Google
 

Trailing-Edge - PDP-10 Archives - BB-J696A-BM_1980 - dngen/netlib.mac
There are 5 other files named netlib.mac in the archive. Click here to see a list.
	.MACRO	ABODF$,L,B
S.COAD='B'0.
S.CSGF='B'2.
S.CBPT='B'4.
S.CIOT='B'6.
S.CILI='B'8.
S.CEMT='B'10.
S.CTRP='B'12.
S.CFLT='B'14.
S.CSST='B'16.
S.CAST='B'18.
S.CABO='B'20.
S.CLRF='B'22.
S.CCRF='B'24.
S.IOMG='B'26.
S.PRTY='B'28.
T.NDNR='B'0
T.NDSE='B'2
T.NCWF='B'4
T.NCRE='B'6
T.NDMO='B'8.
T.NLDN='B'12.
T.NLUP='B'14.
	.MACRO	ABODF$	X,Y
	.ENDM
	.ENDM
	.MACRO	ABTW$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	QDPB$	3,16010,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	ABTW$
	.MACRO	ABTW$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,3,#16010,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	ABTW$E
	.MACRO	ABTW$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	QDPB$S	3,#16010,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	ABTW$S
	.MACRO	ABT$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	QDPB$	1,16010,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	ABT$
	.MACRO	ABT$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,1,#16010,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	ABT$E
	.MACRO	ABT$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	QDPB$S	1,#16010,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	ABT$S
	.MACRO	ACCW$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$
	$CON$	3,15410,LUN,EFN,IOST,AST,98.,PRMLST
	.ENDM	ACCW$
	.MACRO	ACCW$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$E
	$CON$E	LABEL,3,#15410,LUN,EFN,IOST,AST,PRMLST
	.ENDM	ACCW$E
	.MACRO	ACCW$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$S
	$CON$S	3,#15410,LUN,EFN,IOST,AST,#98.,PRMLST
	.ENDM	ACCW$S
	.MACRO	ACC$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$
	$CON$	1,15410,LUN,EFN,IOST,AST,98.,PRMLST
	.ENDM	ACC$
	.MACRO	ACC$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$E
	$CON$E	LABEL,1,#15410,LUN,EFN,IOST,AST,PRMLST
	.ENDM	ACC$E
	.MACRO	ACC$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$S
	$CON$S	1,#15410,LUN,EFN,IOST,AST,#98.,PRMLST
	.ENDM	ACC$S
	.MACRO	ASCII$	TEXT
	.ASCII	/'TEXT'/
	.ENDM
	.MACRO	ASL$	COUNT,REGISTER
	.IF DF	R$$11D ! I$$AS ! R$$EIS
	ASH	#'COUNT',REGISTER
	.IFF
	.REPT	COUNT
	ASL	REGISTER
	.ENDR
	.ENDC
	.ENDM	ASL$
	.MACRO	ASR$	COUNT,REGISTER
	.IF DF	R$$11D ! I$$AS ! R$$EIS
	ASH	#-'COUNT',REGISTER
	.IFF
	.REPT	COUNT
	ASR	REGISTER
	.ENDR
	.ENDC
	.ENDM	ASR$
	.MACRO	A1$	LB
 
	.BYTE	5. , 0		; OPCODE, COUNT
 
 
	.ENDM
	.MACRO	A10$	LB,ROW,COL,VA,STRING
 
	.BYTE	14.		; OPCODE
	.BYTE	LB'C		; COUNT
LB:	.BYTE	ROW,COL		; ROW AND COLLUMN
	.BYTE	LB'C-4		; LENGTH OF TEXT
	.IF	B,VA
	.BYTE	V.N		; DEFAULT
	.IFF
	.BYTE	VA
	.ENDC
	.ASCII	STRING
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	A11$	LB,ROW,COL,VA,STRING
 
	.BYTE	15.		; OPCODE
	.BYTE	LB'C		; COUNT
LB:	.BYTE	ROW,COL		; ROW AND COLLUMN
	.BYTE	LB'C-4		; LENGTH OF TEXT
	.IF	B,VA
	.BYTE	V.N		; DEFAULT
	.IFF
	.BYTE	VA
	.ENDC
	.ASCII	STRING
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	A2$	LB,VA,STRING
 
	.BYTE	6		; OP CODE
	.BYTE	LB'C		; COUNT
LB:
	.IF	B,VA
	.BYTE	V.N			; DEFAULT
	.IFF
	.BYTE	VA
	.ENDC
	.ASCII	STRING
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	A3$	LB,VA,STRING
 
	.BYTE	7.		; OPCODE
	.BYTE	LB'C		; COUNT
LB:
	.IF	B,VA
	.BYTE	V.N		; DEFAULT
	.IFF
	.BYTE	VA
	.ENDC
	.ASCII	STRING		; TEXT TO BE WRITTEN
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	A4$	LB,RW,CL,VA,STRING
 
	.BYTE	8.		; OPCODE
	.BYTE	LB'C		; COUNT
LB:	.BYTE	RW,CL		; ROW AND COLLUMN
	.BYTE	LB'C-4		; LENGTH OF TEXT
	.IF	B,VA
	.BYTE	V.N			; DEFAULT
	.IFF
	.BYTE	VA
	.ENDC
	.ASCII	STRING
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	A5$	LB,ROW,COL,VA,STRING
 
	.BYTE	9.		; OPCODE
	.BYTE	LB'C		; COUNT
LB:	.BYTE	ROW,COL		; ROW, COLLUMN
	.BYTE	LB'C-4		; LENGTH OF TEXT
	.IF	B,VA
	.BYTE	V.N			; DEFAULT
	.IFF
	.BYTE	VA
	.ENDC
	.ASCII	STRING
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	A6$	LB
 
	.BYTE	10., 0		; OP CODE, COUNT
 
 
	.ENDM
	.MACRO	A7$	LB
 
	.BYTE	11. , 0		; OPCODE, COUNT
 
 
	.ENDM
	.MACRO	A8$	LB,VA,STRING
 
	.BYTE	12.		; OPCODE
	.BYTE	LB'C		; COUNT
LB:
	.IF	B,VA
	.BYTE	V.N		; DEFAULT
	.IFF
	.BYTE	VA
	.ENDC
	.ASCII	STRING
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	A9$	LB,VA,STRING
 
	.BYTE	13.		; OPCODE
	.BYTE	LB'C		; COUNT
LB:
	.IF	B,VA
	.BYTE	V.N		; DEFAULT
	.IFF
	.BYTE	VA
	.ENDC
	.ASCII	STRING
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	BITDF$
BIT0	= 1
BIT1	= 2
BIT2	= 4
BIT3 	= 10
BIT4	= 20
BIT5	= 40
BIT6	= 100
BIT7	= 200
BIT8	= 400
BIT9	= 1000
BIT10	= 2000
BIT11	= 4000
BIT12	= 10000
BIT13	= 20000
BIT14	= 40000
BIT15	= 100000
	.MACRO	BITDF$
	.ENDM
	.ENDM
	.MACRO BUF$DF	CCB,SCCB,NRDB,SRDB,NSDB,SSDB,THR,PSH,W,X,Y,Z
	DEF$DF				; DEFINE ALL DEFAULT VALUES
	CCB.NB=CCB	; USER DEFINED NUMBER OF CCBS'S
	CCB.SZ=SCCB	; USER DEFINED SIZE OF CCB'S
	RDB.NB=NRDB	; USER DEFINED NUMBER OF RDB'S
	RDB.SZ=SRDB	; USER DEFINED SIZE OF RDB'S
	SDB.NB=NSDB	; USER DEFINED NUMBER OF SDB'S
	SDB.SZ=SSDB	; USER DEFINED SIZE OF SDB'S
	TR=THR		; FAIL TO ALLOCATE LDB'S HERE
	XM=PSH		; STACK THIS MANY TRANSMIT BUFFERS
	.ENDM	BUF$DF
.MACRO  BYTADF
.MACRO  PSHSTK,SRC
CLR     -(SP)
MOVB    SRC,(SP)
.ENDM   PSHSTK
.MACRO  POPSTK,DST
MOV     (SP)+,DST
.ENDM   POPSTK
.MACRO  ADDSTK
ADD     (SP)+,(SP)
.ENDM   ADDSTK
.MACRO  SUBSTK
SUB     (SP)+,(SP)
.ENDM   SUBSTK
.ENDM   BYTADF
	.MACRO	CALLC	LABEL
	.IF DF	RSX11D
	CALL	LABEL
	.IFF
	.IF DF	M$$MGE
	CALLX	LABEL,PD$NSP
	.IFF
	CALL	LABEL
	.ENDC
	.ENDC
	.ENDM
	.MACRO	CALLX	LABEL,PDV
	.IF DF	M$$MGE!RSX11D
	JSR	R5,$CALLX	; TRANSFER TO INTERMEDIATE ROUTINE
	.WORD	LABEL		; ADDRESS OF SUBROUTINE TO CALL
	.WORD	PDV		; PDV INDEX OF TARGET PROCESS
	.IFF
	CALL	LABEL		; CALL SUBROUTINE DIRECTLY
	.ENDC
	.ENDM	CALLX
	.MACRO  CASE
	.IF GT $$CSTA
	  $$ELSE
	  $$TRNM=$$TRNM-2
	.IFF
$$CSTA=1
	.ENDC
	.ENDM
	.MACRO	CCBDF$,L,B,LST
	.IIF NB,LST,	.LIST
; COMMUNICATIONS CONTROL BLOCK FORMAT
;
;
;	---------------------------------
;	!             C.LNK             !	000
;	!-------------------------------!
;	!     C.BID     !     C.RSV     !	002
;	!-------------------------------!
;	!             C.NSP             !	004
;	!-------------------------------!
;	!     C.STA     !     C.LIN     !    	006
;	!-------------------------------!
;	!     C.MOD     !     C.FNC     !	010
;	!-------------------------------!
;	!             C.STS             !	012
;	!-------------------------------!
;	!                               !	014
;	!-            C.BUF1           -!
;	!                               !	016
;	!-------------------------------!
;	!             C.CNT1	        !	020
;	!-------------------------------!
;	!             C.FLG1            !	022
;	!-------------------------------!
;	!                               !	024
;	!-            C.BUF2           -!
;	!                               !	026
;	!-------------------------------!
;	!             C.CNT2	        !	030
;	!-------------------------------!
;	!             C.FLG2            !	032
;	---------------------------------
 
	.ASECT
.=0
C.LNK:'L'	.BLKW	1	;FORWARD LINK
C.RSV:'L'	.BLKB	1	;RESERVED CELL FOR ALLOCATOR OF CCB
C.BID:'L'	.BLKB	1	;BUFFER ID
C.NSP:'L'	.BLKW	1	;NSP RESERVED CELL
C.LIN:'L'	.BLKB	1	;LINE NUMBER
C.STA:'L'	.BLKB	1	;STATION NUMBER
C.FNC:'L'	.BLKB	1	;FUNCTION CODE
C.MOD:'L'	.BLKB	1	;FUNCTION CODE MODIFIER
C.STS:'L'	.BLKW	1	;STATUS WORD
 
				;FIRST BUFFER DESCRIPTOR
C.BUF1:'L'	
C.BUF:'L'	.BLKW	2	;BUFFER ADDRESS DOUBLEWORD
C.CNT1:'L'	
C.CNT:'L'	.BLKW	1	;BUFFER COUNT
C.FLG1:'L'	
C.FLG:'L'	.BLKW	1	;BUFFER FLAGS
				;SECOND BUFFER DESCRIPTOR
C.BUF2:'L'	.BLKW	2	;BUFFER ADDRESS DOUBLEWORD
C.CNT2:'L'	.BLKW	1	;BUFFER COUNT
C.FLG2:'L'	.BLKW	1	;BUFFER FLAGS
 
	.PSECT
;
; CCB BUFFER ID DEFINITONS
;
CB.CCB='B'	000002		; COMMON POOL CCB
CB.RDB='B'	000004		; LARGE/RECEIVE DATA BUFFER CCB
 
;
; CCB STATUS WORD BIT DEFINITIONS (C.STS) DDM > DLC
;
 
CS.EOF='B'	000001		;END OF FILE
CS.DEV='B'	000002		;HARD DEVICE ERROR (I.E. NXM)
CS.ROV='B'	000004		;RECEIVER OVERRUN
CS.RNG='B'	000010		;RING DETECT
CS.ENB='B'	000020		;CONNECTION ESTABLISHED
CS.DIS='B'	000040		;DISCONNECT DETECTED
CS.ABO='B'	000100		;MESSAGE ABORTED
CS.BUF='B'	000200		;PREVIOUS BUFFER ALLOCATION FAILED & DEVICE RESYNC
CS.DCR='B'	000400		;DATA CRC ERROR
CS.HFE='B'	002000		;HEADER FORMAT ERROR
CS.MTL='B'	004000		;MESSAGE TO LONG
CS.RSN='B'	010000		;RECEIVER RESYNCED BEFORE THIS MESSAGE
CS.TMO='B'	020000		;TIMEOUT ERROR (CLOCK LOSS)
CS.LST='B'	040000		;LAST CCB IN MESSAGE CHAIN (USED BY COMM EXEC)
 
CS.ERR='B'	100000		;INCLUSIVE OR OF ALL ERRORS
;
; CCB STATUS WORD BIT DEFINITIONS (C.STS)
;	DLC  (DDCMP OR DMC11) > LLC  (NSP)
;
CE.RTE='B'	100376		;RECEIVE THRESHOLD EXCEEDED
CE.TMO='B'	100374		;REP THRESHOLD EXCEEDED
CE.MOP='B'	100372		;MOP MESSAGE RECEIVED
CE.ERR='B'	100370		;GENERAL ERROR
CE.DIS='B'	100366		;DISCONNECT
CE.SRC='B'	100364		;START RECEIVED
CE.ABO='B'	100362		;OPERATION ABORTED
CE.NTE='B'	100361		;NAK THRESHOLD EXCEEDED
CS.SUC='B'	000001		;OPERATION SUCCESSFUL
 
;
; BUFFER FLAGS WORD BIT DEFINITIONS (C.FLG)
;
 
CF.EOM='B'	000004		;END OF MESSAGE
CF.SOM='B'	000010		;START OF MESSAGE
CF.HDR='B'	000020		;BUFFER IS A HEADER
CF.SYN='B'	000040		;PRECEED BUFFER BY SYNCS
CF.TRN='B'	000100		;LIST MARKER FOR TURN AROUND
CF.LB='B'	100000		;LAST BUFFER IN THIS LINK
;
; PROCESS OPERATION FUNCTION CODE DEFINITIONS
;
FC.XME='B'	0		;TRANSMIT ENABLE
FC.RCE='B'	2		;RECEIVE ENABLE (BUFFER RETURN)
FC.KIL='B'	4		;KILL I/O
FC.CTL='B'	6		;CONTROL
FC.TIM='B'	10		;TIMEOUT
FC.XCP='B'	12		;TRANSMIT COMPLETE
FC.RCP='B'	14		;RECEIVE COMPLETE
FC.KCP='B'	16		;KILL COMPLETE
FC.CCP='B'	20		;CONTROL COMPLETE
;
; RECEIVE ENABLE SUBFUNCTION CODES
;
FS.RTN='B'	2*400		;BUFFER FROM BUFFER WAIT REQUEST
;
; RECEIVE COMPLETE SUBFUNCTION CODES
;
FS.DVC='B'	2*400		;DEVICE CHECKS CRC (CHECK C.STS FOR ERROR INDICATION)
FS.CIB='B'	4*400		;CRC IS IN RECEIVE BUFFER
;
; KILL SUBFUNCTION CODES
;
FS.KIL='B'	0*400		;RECEIVE & TRANSMIT KILL
FS.CRA='B'	2*400		;RECEIVE KILL
FS.XKL='B'	4*400		;TRANSMIT KILL
;
; CONTROL SUBFUNCTION CODES
;
FS.AST='B'	0*400		;ASYNCHRONOUS EVENT (COMPLETION ONLY)
FS.INI='B'	0*400		;INITIALIZE
FS.STR='B'	2*400		;START
FS.STP='B'	4*400		;STOP
FS.TRM='B'	6*400		;TERMINATE
FS.MNT='B'	10*400		;MAINTAINANCE
FS.SET='B'	12*400		;SET CHARACTERISTICS
FS.GET='B'	14*400		;GET CHARACTERISTICS
FS.XON='B'	16*400		;XON
FS.XOF='B'	20*400		;XOFF
				;MODEM CONTROL: LLC > DLC > MDMCTL > DDM
FS.RNG='B'	22*400		;LOOK FOR RING
				;MODEM CONTROL: DLC > MDMCTL > DDM
FS.ENB='B'	24*400		;ENABLE LINE
FS.DIS='B'	26*400		;DISABLE LINE
				;MODEM CONTROL: MDMCTL > DDM
FS.MSN='B'	30*400		;SENSE MODEM STATUS
;
; TIMEOUT SUBFUNCTION CODES
;
FS.STM='B'	0*400		;SHORT TIMEOUT (50 MSEC)
FS.LTM='B'	2*400		;LONG TIMEOUT (1 SEC)
 
	.IF NB	LST
	.NLIST
	.IFF
	.MACRO	CCBDF$,X,Y
	.ENDM
	.ENDC
	.ENDM
	.MACRO	CHADF$
CH.DUP	=	000001
CH.ECH	=	000002
CH.SYN	=	000004
CH.TYP	=	000010
CH.MDT	=	000020
CH.STA	=	000040
CH.PAR	=	000100
CH.PRM	=	000200
	.ENDM	CHADF$
	.MACRO 	CLKDF$,L,B
C.MRKT='B'0
C.SCHD='B'2
C.SSHT='B'4
C.SYST='B'6
C.SYTK='B'8.
C.CSTP='B'10.
	.ASECT
.=0
C.LNK:'L' .BLKW	1
C.RQT:'L' .BLKB	1
C.EFN:'L' .BLKB	1
C.TCB:'L' .BLKW	1
C.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DF
.PSECT	CMDDAT,RW,D,GBL,REL,OVR
CMIPHD:	.WORD	0
CMIPTL:	.WORD	CMIPHD
DFLCNT:	.WORD	0
DFLNAM:	.WORD	0,0,0
.PSECT
.ENDM
.MACRO	CMIMDF
TERINP	= 1.
.PSECT	CMIDAT,RW,D,GBL,REL,OVR
CMIFLG:	.BYTE	0
.PSECT
.ENDM
.MACRO	CMOMDF
.PSECT	CMODAT,RW,D,GBL,REL,OVR
CMLOCK:	.BYTE	0
.PSECT
.ENDM
	.MACRO	CNBDF$,L,B
 
	.ASECT
 
.=0
N.CTL:'L' .BLKW		1	;TEMPORARY LINK ADDRESS
				;
N.SEGZ:'L'.BLKW		1	;SEGMENT SIZE
N.DFM:'L' .BLKB		1	;DESTINATION DESCRIPTOR FORMAT
N.DOT:'L' .BLKB		1	;     "      OBJECT TYPE
				;FORMAT 0 -
	.BLKB	18.		; [UNUSED]
.=.-18.				;FORMAT 1 -
N.DDEC:'L' .BLKW	1	; DESTINATION PROCESS BYTE COUNT
N.DDE:'L' .BLKB		16.	;      "         "
.=.-18.				;FORMAT 2 -
N.DGP:'L' .BLKW		1	; DESTINATION GROUP
N.DUS:'L' .BLKW		1	;      "      USER
N.DNMC:'L' .BLKW	1	;      "      NAME BYTE COUNT
N.DNM:'L' .BLKB		12.	;      "        "
				;
N.SND:'L' .BLKB		6	;SOURCE NODE NAME
N.SFM:'L' .BLKB		1	;  "    DESCRIPTOR FORMAT
N.SOT:'L' .BLKB		1	;  "    OBJECT TYPE
				;FORMAT 0 -
	.BLKB	18.		; [UNUSED]
.=.-18.				;FORMAT 1 -
N.SDEC:'L' .BLKW	1	; SOURCE PROCESS NAME BYTE COUNT
N.SDE:'L' .BLKB		16.	;    "      "      "
.=.-18.				;FORMAT 2 -
N.SGP:'L' .BLKW		1	; SOURCE GROUP
N.SUS:'L' .BLKW		1	;   "    USER
N.SNMC:'L' .BLKW	1	;   "    NAME BYTE COUNT
N.SNM:'L' .BLKB		12.	;   "      "
				;
N.CIDC:'L' .BLKW	1	;SOURCE TASK ID BYTE COUNT
N.CID:'L' .BLKB		16.	;   "     "   "
N.CPSC:'L' .BLKW	1	;PASSWORD BYTE COUNT
N.CPS:'L' .BLKB		8.	;    "
N.CACC:'L' .BLKW	1	;ACCOUNTING INFORMATION BYTE COUNT
N.CAC:'L' .BLKB		16.	;     "          "
N.CDAC:'L' .BLKW	1	;OPTIONAL DATA BYTE COUNT
N.CDA:'L'			;   "       "  BUFFER
				;
N.CBL='B'.-N.CTL			;LENGTH OF CNB (WITHOUT ANY DATA)
 
	.PSECT
 
	.MACRO	CNBDF$,X,Y
	.ENDM	CNBDF$
 
	.ENDM	CNBDF$
.MACRO	CNFDF
TGNMAD	= 0.
SVNMAD	= 4.
SVLNID	= 8.
LDFLAD	= 12.
LDPRAD	= 16.
BTPSAD	= 20.
DMFLAD	= 24.
ENTLEN	= 28.
.MACRO	CNFDF
.ENDM
.ENDM
.MACRO	CNFMAC
NODLEN	= 6.
BPSLEN	= 8.
FILLEN	= 30.
PARLEN	= 30.
.MACRO	CNFBEG
CNFDB::
.ENDM
.MACRO	CNFEND
CNFDBE::
.EVEN
.ENDM
.MACRO	CNFENT NODE,SERVER,LOAFIL,LOAPAR,BOOPAS,DUMFIL
STRENT	NODE,NODLEN
SERENT	SERVER
STRENT	LOAFIL,FILLEN
PARENT	LOAPAR
STRENT	BOOPAS,BPSLEN
STRENT	DUMFIL,FILLEN
.ENDM
.MACRO	STRENT STRNG,MAXLEN
.PSECT	CNFSTR,RW,D,LCL,REL,OVR
$$ADDR	= .
.ASCII	/'STRNG'/
$$LEN	= .-$$ADDR
.PSECT
.IF	LT MAXLEN-$$LEN
  .ERROR
.ENDC
.WORD	$$ADDR
.WORD	$$LEN
.ENDM
.MACRO	SERENT NAME,DEV,CON,LIN,STA
STRENT	NAME,NODLEN
.BYTE	DEV,CON,LIN,STA
.ENDM
.MACRO	PARENT NAME,NUMBER,HOST
.PSECT	CNFSTR,RW,D,LCL,REL,OVR
$$ADDR	= .
NODPAR	NAME,1
NUMPAR	NUMBER,2
NODPAR	HOST,3
.BYTE	0
$$LEN	= .-$$ADDR
.PSECT
.IF	LT PARLEN-$$LEN
  .ERROR
.ENDC
.WORD	$$ADDR
.WORD	$$LEN
.ENDM
.MACRO	NODPAR NODNAM,CODE
.IF	NB NODNAM
  .BYTE   CODE
  .NCHR   $$LEN,<NODNAM>
  .IF     LT 6-$$LEN
    .ERROR
  .ENDC
  .BYTE   $$LEN
  .ASCII  /'NODNAM'/
.ENDC
.ENDM
.MACRO	NUMPAR NUMBER,CODE
.IF	NB NUMBER
  .BYTE   CODE,2
  .IF     LE NUMBER-377
    .BYTE   NUMBER
    .BYTE   0
  .IFF
    .BYTE   NUMBER&377
    .BYTE   NUMBER/400
  .ENDC
.ENDC
.ENDM
.ENDM
.MACRO	CNT$	LB
LB'C	= .-1$
	.ENDM
	.MACRO CNT$DF A,B,C,D,E,F,G,H,I,J,K,L,M
	.ENDM	CNT$DF
	.MACRO	CONB$$	NODNAM,OBJ,FMT,DSCRIP,RQID,PASS,ACNT
$$$LOC=.
	.IF NB	<NODNAM>
	.NCHR	$$$,<NODNAM>
	.IF GE	6-$$$
	.ASCII	''NODNAM''
	.REPT	6-$$$
	.BYTE	' 
	.ENDR
	.IFF
	.ERROR	NODE	;NODE NAME TOO LONG
	.ENDC
	.IFF
	.BLKB	6
	.ENDC
	.IF NB	<FMT>
$$$FMT=FMT
	.IF LE	$$$FMT-2
	.BYTE	FMT
	.IFF
	.ERROR	FMT	;ILLEGAL FORMAT NUMBER
	.ENDC
	.IFF
$$$FMT=0
	.BLKB	1
	.ENDC
	.IF NB	<OBJ>
	.BYTE	OBJ
	.IFF
	.BLKB	1
	.ENDC
	.IF NB	<DSCRIP>
	.IF EQ	$$$FMT
	.ERROR	DSCRIP	;FORMAT 0 DESCRIPTOR NOT ALLOWED
	.ENDC
	.IF EQ	1-$$$FMT
	.NCHR	$$$,<DSCRIP>
	.IF GE	16.-$$$
	.WORD	$$$
	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= 5.
C$NOPN	= 25.
C$NORD	= 26.
C$ALBF	= 26.
C$ALCB	= 27.
C$OPCO	= 28.
C$RDCM	= 29.
C$WRCM	= 30.
C$STPR	= 31.
C$STPS	= C$STPR
C$RDIN	= 32.
C$RDIS	= C$RDIN
C$OPIN	= 33.
C$OPOT	= 34.
C$RDBK	= 35.
C$WRBK	= 36.
C$OPLN	= 37.
C$TRBK	= 38.
C$RCBK	= 39.
C$RCEV	= 40.
C$OPLK	= 41.
C$CLLK	= 42.
C$TRMS	= 43.
C$RCMS	= 44.
C$STBK	= 45.
C$OPIR	= 46.
C$OPOR	= 47.
C$RDRC	= 48.
C$WRRC	= 49.
C$RCIN	= 50.
C$TRIN	= 51.
C$ZRCN	= 52.
C$WRCL	= 53.
C$OPCL	= 54.
C$CLCL	= 55.
C$ORD	= 101.
C$TRMA	= 101.
C$RCMA	= 102.
C$PROC	= 128.
CS$SUC	= 1.
CS$ACK	= 2.
CS$NCH	= 3.
CS$LKE	= 1.
CS$LNA	= 2.
CS$LOG	= 3.
CE$FUN	= -1.
CE$ADR	= -2.
CE$LEN	= -3.
CE$FAI	= -4.
CE$GEN	= CE$FAI
CE$NWE	= -5.
CE$REJ	= -6.
CE$DIS	= -7.
CE$CON	= -8.
CE$EOF	= -9.
CE$LID	= -10.
CE$NOD	= -11.
CE$OVR	= -12.
CE$PAR	= -13.
CE$TMO	= -14.
CE$OPN	= -15.
CE$IO	= -16.
CE$IND	= -17.
CE$FIL	= -18.
CE$NSD	= -19.
CE$NST	= -20.
CE$ACP	= -21.
CE$LST	= -22.
CE$PRO	= -23.
CE$OBJ	= -24.
C.PTR	= 0.
C.SERV	= 2.
C.CTXT	= 4.
C.FUNC	= 6.
C.PROC	= 7.
C.RET	= 8.
C.LEN	= 10.
C.ADDR	= 12.
C.LINE	= C.ADDR
C.BKNM	= C.ADDR
C.TYPE	= 14.
C.PROM	= C.TYPE
C.TASK	= C.TYPE
C.PRID	= 15.
C.LUN	= 16.
C.LKNM	= C.LUN
C.WAIT	= C.LUN
C.MODE	= 17.
C.SAVE	= 18.
C$LEN	= 22.
RI$LCC	= 1.
RI$LCS	= 2.
RI$RML	= 3.
RI$RMC	= 4.
RI$RMS	= 5.
RI$LNL	= 6.
RI$LNC	= 7.
RI$LNS	= 8.
RI$ZLC	= 9.
RI$ZRM	= 10.
RI$ZLN	= 11.
SP$LST	= 1.
SP$LHO	= 2.
SP$DHO	= 3.
SP$RRP	= 4.
SP$RTP	= 5.
SP$NST	= 6.
SP$DRP	= 7.
SP$DTP	= 8.
SP$LLP	= 9.
SP$LOF	= 10.
SP$NDO	= 11.
SP$NDM	= 12.
SP$LNO	= 13.
SP$LNM	= 14.
.MACRO	CONDF
.ENDM
.ENDM
.MACRO	CONMDF
.MCALL	CONFIG
.PSECT	CONDAT,RW,D,GBL,REL,OVR
CONFIG
CBLEN	= 22.
CBLIST:	.REPT	F$CB-1
	  .WORD	  .+CBLEN
	  .BLKB	  CBLEN-2
	.ENDM
	.WORD	0
	.BLKB	CBLEN-2
FSTCB	= CBLIST
LSTCB	= F$CB-1
LSTCB	= LSTCB*CBLEN+FSTCB
CBHEAD:	.WORD	CBLIST
.PSECT
.ENDM
	.MACRO	CONW$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$
	$CON$	3,15400,LUN,EFN,IOST,AST,72.,PRMLST
	.ENDM	CONW$
	.MACRO	CONW$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$E
	$CON$E	LABEL,3,#15400,LUN,EFN,IOST,AST,PRMLST
	.ENDM	CONW$E
	.MACRO	CONW$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$S
	$CON$S	3,#15400,LUN,EFN,IOST,AST,#72.,PRMLST
	.ENDM	CONW$S
	.MACRO	CON$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$
	$CON$	1,15400,LUN,EFN,IOST,AST,72.,PRMLST
	.ENDM	CON$
	.MACRO	CON$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$E
	$CON$E	LABEL,1,#15400,LUN,EFN,IOST,AST,PRMLST
	.ENDM	CON$E
	.MACRO	CON$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$S
	$CON$S	1,#15400,LUN,EFN,IOST,AST,#72.,PRMLST
	.ENDM	CON$S
.MACRO	CPH$	CODE
	.IF	B,CODE
	.BYTE	0	;DEFAULT CPH CODE TO ZERO
	.IFF
	.BYTE	CODE
	.ENDC
	.ENDM
	.MACRO	CRBDF$,L,B
 
	.ASECT
 
.=0
N.RND:'L' .BLKB		6	;DESTINATION NODE NAME
N.RFM:'L' .BLKB		1	;     "      DESCRIPTOR FORMAT
N.ROT:'L' .BLKB		1	;     "      OBJECT TYPE
				;FORMAT 0 -
	.BLKB	18.		; [UNUSED]
.=.-18.				;FORMAT 1 -
N.RDEC:'L' .BLKW	1	; DESTINATION PROCESS BYTE COUNT
N.RDE:'L' .BLKB		16.	;      "         "
.=.-18.				;FORMAT 2 -
N.RGP:'L' .BLKW		1	; DESTINATION GROUP
N.RUS:'L' .BLKW		1	;      "      USER
N.RNMC:'L' .BLKW	1	;      "      NAME BYTE COUNT
N.RNM:'L' .BLKB		12.	;      "        "
				;
N.RIDC:'L' .BLKW	1	;REQUESTING PROCESS ID BYTE COUNT
N.RID:'L' .BLKB		16.	;     "        "     "
N.RPSC:'L' .BLKW	1	;REQUESTING PASSWORD BYTE COUNT
N.RPS:'L' .BLKB		8.	;    "         "
N.RACC:'L' .BLKW	1	;ACCOUNTING INFORMATION BYTE COUNT
N.RAC:'L' .BLKB		16.	;     "          "
				;
N.RQL='B'.-N.RND		;LENGTH OF RDB
 
	.PSECT
 
	.MACRO	CRBDF$,X,Y
	.ENDM	CRBDF$
 
	.ENDM	CRBDF$
	.MACRO	CRDLT$ L,B
	.MCALL	TMPDF$
	TMPDF$
;
; NURD CR11 DEVICE DRIVER LINE TABLE TEMPLATE
;
	.ASECT
	.=0
C.TIMC:'L	.BLKB	1		;TWO BYTE TIMER ENTRY, CURRENT VALUE
C.TIMI:'L	.BLKB	1		;  AND INITIAL TIMER VALUE
C.CALL:'L	.INT			;INTERRUPT DISPATCH CALL
C.PRI:'L	.PRI			;SCHEDULING PRIORITY
					;DDM LEVEL DATA BASE
					;ORDER FOR THIS SECTION IS CRITICAL
C.CSR:'L	.CSR			;ONE WORD CSR POINTER
C.RST:'L	.BLKW	1		;CR11 STATUS READ AT INTERRUPT
C.COLC:'L	.BLKB	1		;PHYSICAL COLUMN COUNT
C.HUNG:'L	.BLKB	1		;DEVICE HUNG TIMER
C.PUBP:'L	.BLKW	2		;BUFFER PTR DOUBLEWORD
C.SGHD:'L	.BLKW	1		;CURRENT SEGMENT HEADER ADDRESS
C.LDAT:'L	.BLKW	1		;LAST DATA ITEM READ
C.PUBS:'L	.BLKW	1		;BUFFER INPUT COUNTER
C.NRDA:'L	.BLKW	1		;BEG OF NURD MESSAGE(ADDRESS)
C.DDMQ:'L	.LSTHD			;CCB'S QUEUED FOR INPUT
C.ASTS:'L	.BLKW	1		;ACTION STATUS BIT MAP
	CA.CLO	='B	1		;CLOSED
	CA.PAU	='B	2		;PAUSED
	CA.ADN	='B	4		;ABORT WHEN DONE WITH DDM QUEUE
	CA.ABO	='B	10		;ABORTING
	CA.ABE	='B	20		;CLEAR ABORT ON EOF (ELSE ON CLEAR)
	CA.EOF	='B	40		;CURRENT MESSAGE HAS EOF
	CA.HOP	='B	100		;HOPPER CHECK - EMPTY INPUT OR FULL OUTPUT
	CA.MOT	='B	200		;MOTION CHECK - PICK FAIL,STACK FAIL,MOTION ERROR
	CA.TER	='B	400		;TIMING ERROR - DATA OVERRUN CONDITION
	   CA.ERR='B	CA.HOP!CA.MOT!CA.TER	;SUMMARY - HARD ERROR
	CA.OFL	='B	1000		;READER OFFLINE
	CA.IVP	='B	2000		;INVALID PUNCH - MULTIPUNCH
	CA.TMO	='B	4000		;DEVICE TIME OUT
	CA.XOF	='B	100000		;READER XOF'D
C.CDCT:'L	.BLKW	1		;PHYSICAL CARD COUNT
					;MISCELLANEOUS ITEMS
	.EVEN
C.SLN:'L	.SLNW			;DEVICE SYSTEM LINE NUMBER
C.IOCN:'L	.BLKW	1		;OUTSTANDING IO COUNT
C.IOWT:'L	.BLKW	1		;CLOSE WAIT FLAG = CLOSE CCB
					;CONTROL MESSAGE PROCESSING DATA BASE
	.EVEN
C.CMSQ:'L	.LSTHD			;CONTROL MESSAGE QUEUE
C.RECO:'L	.BLKB	1		;CONTROL MESSAGE RESOURCE ERROR FLAG
C.RATT:'L	.BLKB	1		;PENDING ATTENTION MESSAGE FLAG - REASON CODE
C.CAPP:'L	.BLKB	1		;PENDING CAPABILITIES MESSAGE FLAG
C.STRT:'L	.BLKB	1		;PENDING READ START
					;DATA & FEATURES PROCESSING DATA BASE
	.EVEN
C.DLCQ:'L	.LSTHD			;CCB'S QUEUED INTO DLC
C.MFLG:'L	.BLKB	1		;CURRENT NURD MESSAGE FLAGS
C.CAPN:'L	.BLKB	1		;CURRENT INDEX INTO CAPABILITIES LIST
C.NFSP:'L	.BLKB	1		;NO. FEATURE SPECS IN CURRENT MSG
	.EVEN
C.DMAD:'L	.BLKW	2		;DATA MSG ADDRESS DOUBLEWORD (PTR)
C.DMBS:'L	.BLKW	1		;DATA MSG BUFFER SIZE
C.DMSQ:'L	.BLKB	2		;LAST GOOD, CURRENT DATA SEQ NUMBERS
C.PBRC:'L	.BLKB	1		;TEMP BYTE
	.EVEN
C.MSGQ:'L	.LSTHD			;OUTGOING MSG QUEUE
C.MSGA:'L	.BLKW	2		;CURRENT MSG BUFFER ADDRESS DOUBLEWORD
C.MSGS:'L	.BLKW	1		;CURRENT MSG BUFFER SIZE
					;DATA/FEATURES PROCESS HYBER CONTEXT
C.DWAK:'L	.BLKB	1		;WAKE CONDITION
	DWAKS	='B	1		;WAKE WHEN NEW MESSAGE SEGMENT RECEIVED
	DWAKP	='B	2		;WAKE WHEN PHYSICAL BUFFER RETURNED TO QUEUE
	DWAKT	='B	3		;WAKE ON CLOCK TOCK
	DWAKR	='B	4		;WAKE WHEN RESUME CONTROL FCN DONE
C.DTXL:'L	.BLKB	1		;NO. WORDS ON STACK AT SLEEP TIME
	.EVEN
C.DFSP:'L	.BLKW	1		;STACK ORIGIN
DTXTSZ	='B	16.			;DATA/FEATURES PROCESS CONTEXT ALLOCATED
C.DTXT:'L	.BLKW	DTXTSZ		;CONTEXT BLOCK FOR DA/FEATURES PROCESS
					;FEATURE CRUFT
C.CFET:'L				;LP11 COMMON FEATURE LIST
	.BLKB	1			;NUMBER OF COMMON FEATURES
	.BLKB	1			;FEATURE FE.DAT     SUPPORTED
	.BLKB	1			;FEATURE FE.SER NOT SUPPORTED
	.BLKB	1			;FEATURE FE.LCR NOT SUPPORTED
	.BLKB	1			;FEATURE FE.FWD NOT SUPPORTED
	.BLKB	1			;FEATURE FE.EOF     SUPPORTED
	.BLKB	1			;FEATURE FE.DVT NOT SUPPORTED
	.BLKB	1			;FEATURE FE.TRN NOT SUPPORTED
	.BLKB	1			;FEATURE FE.FNM NOT SUPPORTED
	.BLKB	1			;FEATURE FE.DWD     SUPPORTED
CCFETL	='B	.-C.CFET-1
C.DFET:'L	.BLKB	1		;NUMBER OF DEVICE SPECIFIC FEATURES
	.BLKB	1			;FEATURE 129    NOT DEFINED
	.BLKB	1			;FEATURE CD.CWD     SUPPORTED
CDFETL	='B	.-C.DFET-1
					;FEATURE BLOCKS
F.FSB	='B	0			;(BM)FEATURES STATUS BYTE
	FB.CL0	='B 0			;CLASS 0 FEATURE => <BIT> FORM
	FB.CL1	='B 1			;CLASS 1 FEATURE => <CNT><...> FORM
	FB.WRD	='B 2			;FEATURE IS A WORD AND
					; F.FCV IS A DLT OFFSET TO IT
	FB.STR	='B 4			;FEATURE IS A STRING
					;F.FCV IS THE LENGTH
					;CURRENT VALUE BEGINS AT F.FCV+1
					;STANDARD VALUE(IF ANY) BEGINS AT F.FCV+1+(F.FCV)
	FB.STE	='B 10			;STANDARD VALUE EXISTS
	FB.SST	='B 20			;STANDARD IS SET
	FB.CP	='B 40			;CHANGE PENDING
	FB.CA	='B 100			;CHANGE ALLOWED
F.FCV	='B	1			;FEATURE CURRENT VALUE BYTE
F.FSV	='B	2			;FEATURE STANDARD VALUE BYTE
CR.DAT:'L					;DATA MODE
	.BLKB	1
	CRDATS	='B	FB.CL1!FB.CA!FB.SST!FB.STE	;INITIAL STATUS OF LE.DOF LE.DAT
	.BLKB	1				;ASCII
	.BLKB	1				;ASCII IS STD
;CR.SER:'L					;SERIAL NUMBER
;CR.LCR:'L					;LOWER CASE RAISE
;CR.FWD:'L					;FORM WIDTH
CR.EOF:'L						;EOF RECOGNITION
	.BLKB	1
	CREOFS	='B	FB.CL1!FB.CA		;INITIAL STATUS OF CR.EOF
	.BLKB	1
;CR.DVT:'L					;DEVICE TYPE
;CR.TRN:'L					;RECORD TRUNCATION
;CR.FNM:'L					;FORM NAME
CR.DWD:'L					;DEVICE WIDTH
	.BLKB	1
	.BLKB	1				;STD WIDTH
;	DEVICE SPECIFIC FEATURES
CR.CWD:'L					;CARD WIDTH
	.BLKB	1
	CRCWDS	='B	FB.CL1!FB.CA!FB.STE!FB.SST	;INITIAL STATUS OF CR.CWD
	.BLKB	1
	.BLKB	1
	.PSECT
	.ENDM	CRDLT$
	.MACRO	CUCDF$	X,Y
	.ASECT
.=	U.CW2+2
U.ACUR:'X	.BLKW	1
U.NSYN:'X	.BLKB	1
U.NSYC:'X	.BLKB	1
.=	U.VCB+2
U.PHDR:'X	.BLKW	1
U.RCHK:'X	.BLKW	1
U.QSYN:'X
U.RCAC:'X	.BLKW	1
U.RBUF:'X	.BLKW	2
U.RCNT:'X	.BLKW	1
U.SVC:'X	.BLKW	1
U.TXCT:'X
U.INTP:'X	.BLKW	1
U.SYNC:'X	.BLKB	1
U.MPN:'X	.BLKB	1
U.RFRK:'X	.BLKW	1
U.RFPC:'X	.BLKW	1
U.RFR5:'X	.BLKW	1
U.RFR4:'X	.BLKW	1
U.RFCT='Y	U.TXCT+1
	.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
V.COVR:'X	.BLKW	1
V.CRST:'X	.BLKW	1
V.CALF:'X	.BLKW	1
V.CREA:'X	.BLKB	1
	.BLKB	1
	.IF DF	C$$ACU
V.CTPN:'X	.BLKB	12.
	.ENDC
V.CLEN:'X	.BLKW	1
	.PSECT
VS.SEL='Y	100000
VS.FIN='Y	 40000
VS.REP='Y  20000
VS.RTR='Y	 10000
VS.STK='Y	  4000
VS.STR='Y	  2000
VS.ACK='Y	  1000
VS.NAK='Y	   400
VS.MPT='Y	   200
VS.DIS='Y    200
VS.CTL='Y	   100
VS.DAT='Y	    40
VS.SYN='Y	    20
VS.POL='Y	    10
VS.ONL='Y	     4
VS.BOO='Y	     2
VS.TRN='Y	     1
	.MACRO	CVCDF$	A,B
	.ENDM
	.ENDM
.MACRO	CVLMDF
.PSECT	CVLDAT,RW,D,GBL,REL,OVR
CONTAB:
	.REPT	40.
	.WORD	0
	.ENDR
ENDIX	= .-CONTAB
	.MCALL	DVTMDF
	.MACRO	XXX NAM,DSP,NUM,ARG4,ARG5,ARG6,ARG7
	.IIF LE,<40.*2-'NUM'>,.ERROR 'NUM';DEVICE INDEX TOO LARGE
	.IF EQ	$$$PAS
	$$$'NUM'=0
	.IFF
	.IF EQ	$$$'NUM'
	$$$'NUM'=1
	.=CONTAB+'NUM'
	.RAD50	/'NAM'/
	.ENDC
	.ENDC
	.ENDM	XXX
	.IF NDF	$$$PAS
	$$$PAS=0
	.IFF
	$$$PAS=1
	.ENDC
	DVTMDF	XXX
.PSECT
.ENDM
	.MACRO	C1$	LB,TIME
 
LB:	.BYTE	50.,1		; OPCODE, COUNT
	.BYTE	TIME
 
	.ENDM
	.MACRO	C2$	LB,STRNG
 
	; LB - LABEL
	; STRING - UP TO 4 CHAR ID
 
LB:	.BYTE	51.		; OPCODE
	.BYTE	LB'C		; COUNT
1$:	.ASCII	STRNG
 
	LB'C=	.-1$
 
	.ENDM
	.MACRO	C3$	LB
 
LB:	.BYTE	52.,0		; OPCODE, COUNT
 
	.ENDM
	.MACRO	C4$	LB
 
LB:	.BYTE	53.,0		; OPCODE, COUNT 
 
	.ENDM
	.MACRO	DADF$	LST
	.IIF NB,LST,	.LIST
	.MCALL	TMPDF$
	TMPDF$
	.ASECT
	.=0
	.INT
	.=-<.+2>
T.VCT:	.INT			;SPACE FOR $INTSX SAVE'S ETC.
	.PRI			;DEVICE PRIORITY
	T.OFFS==.-T.VCT
T.TIMR:	.BLKB	1		;TIMER CELL
T.TIME:	.BLKB	1		;TIMOUT TIME IN SECONDS
T.DR:	.CSR			;DEVICE REGISTER ADDRESS
T.FL:	.BLKW	1		;FLAGS WORD
T.RA:	.BLKW	1		;RECEIVE BUFFER AVAILABLE
T.RC:	.BLKW	1		;RECEIVE BUFFER WAITING FOR COMPLETION
T.XW:	.LSTHD			;XMIT BUFFERS WAITING QUEUE
T.XC:	.BLKW	1		;XMIT BUFFER WAITING FOR COMPLETION
T.SP:	.BLKW	1		;STOP PENDING CCB
T.LN:	.SLNW			;LINE NUMBER
T.ER:	.BLKW	1		;ASYNC ERROR PENDING
T.XMT:	.BLKW	1		;NUMBER OF BLOCKS TRANSMITTED
T.RCV:	.BLKW	1		;NUMBER OF BLOCKS RECEIVED
T.TLZ:	.BLKW	1		;TIME COUNTS WERE LAST ZEROED
.PSECT
	.IIF NB,LST,	.NLIST
	.ENDM
	.MACRO	DCBDF$,L,B
	.ASECT
.=0
D.LNK:'L' .BLKW	1
D.UCB:'L' .BLKW	1
D.NAM:'L' .BLKW	1
D.UNIT:'L' .BLKB 1
	.BLKB	1
D.UCBL:'L' .BLKW 1
D.DSP:'L' .BLKW	1
D.MSK:'L' .BLKW	1
	.BLKW	1
	.BLKW	1
	.BLKW	1
	.BLKW	1
	.BLKW	1
	.BLKW	1
	.BLKW	1
D.PCB:'L' .BLKW	1
	.PSECT
D.VINI='B'0
D.VCAN='B'2
D.VOUT='B'4
D.VPWF='B'6
	.MACRO	DCBDF$,X,Y
	.ENDM
	.ENDM
	.MACRO	DCLW$S	LUN,EFN,IOST,AST,UAST
	.IF B	LUN
	.ERROR	;DCLW$S - A LOGICAL UNIT # MUST BE SPECIFIED
	.MEXIT
	.ENDC
	.IF B	UAST
	.PRINT	;DCLW$S WARNING - TRAP ADDRESS NOT SPECIFIED 
	.IFTF
	MOV	R0,-(SP)		;GET A REGISTER TO WORK WITH
	.IFF
	MOV	UAST,-(SP)		;GET THE UAST
	.ENDC
	.IF NB	IOST
	MOV	IOST,-(SP)		;AND THE IOST
	.ENDC
	MOV	LUN,-(SP)		;AND FINALLY THE LUN
	MOV	#$ASTBL,R0		;GET THE AST TABLE ADDRESS
	TST	(R0)			;WHAT'S THIS LOCATION'S STATUS?
	.IF B	IOST
	.IF B	UAST
	BMI	.+14			;IF MI, THERE'S NO MORE ROOM
					;IN THE TABLE
	.IFF
	BMI	.+22			;.
	.ENDC
	.IFF
	.IF B	UAST
	BMI	.+24			;.
	.IFF
	BMI	.+32			;.
	.ENDC
	.ENDC
	.IF NB	UAST
	BEQ	.+12			;IF EQ, THIS IS A FREE LOCATION
	.IFTF
	CMP	(SP),(R0)+		;IS THIS THE WANTED LUN?
	.IFF
	BEQ	.+6			;IF EQ, YES
	.IFT
	BEQ	.+10			;.
	.IFTF
	TST	(R0)+			;GET TO THE NEXT TABLE ENTRY
	.IFF
	BR	.-12			;TRY AGAIN
	.IFT
	BR	.-14			;.
	.IFF
	CLR	-(R0)			;DELETE THE TABLE ENTRY
	.IFT
	MOV	(SP),(R0)+		;STORE THE LUN #
	.IF B	IOST
	MOV	2(SP),(R0)		;AND IT'S AST ADDRESS
	.IFF
	MOV	4(SP),(R0)		;.
	.ENDC
	.ENDC
	.IF NB	IOST
	MOV	#1,@2(SP)		;INDICATE SUCCESS
	BR	.+10			;BRANCH AROUND ERROR CODE
	MOV	#-1,@2(SP)		;SET THE ERROR CODE
	CMP	(SP)+,(SP)+		;POP OFF THE LUN AND IOST
					;STORAGE LOCATIONS
	.IFF
	TST	(SP)+			;POP THE LUN STORAGE LOCATION
	.ENDC
	.IF NB	UAST
	TST	(SP)+			;POP OFF THE UAST STORAGE
					;LOCATION
	.ENDC
	MOV	(SP)+,R0		;RESTORE R0
	.ENDM
.MACRO	DDCDF$	L
;
	    .ASECT
;
; DDCMP LINE TABLE OFFSETS
 
.=0
L.CTMO:	.BLKB	1		;CURRENT TIMEOUT VALUE
L.ITMO:	.BLKB	1		;LINK TIMER INITIAL VALUE
L.STS:	.BLKW	1		;LINE STATUS WORD
L.PTXQ:	.BLKW	2		;PRE TRANSMIT MESSAGE QUEUE
L.TDNQ:	.BLKW	2		;TRANSMIT DONE QUEUE
L.FCNL:	.BLKW	2		;CONTROL FUNCTION QUEUE
L.STAL:	.BLKW	2		;STATIONS  LIST
L.CRST:	.BLKW	1		;POINTER TO CURRENT STATION
L.HDR:	.BLKW	1		;LIST OF CCBS FOR HEADERS
	.IF	DF,M$$MGE
L.CRC:	.BLKW	2		;POINTER TO CRC LIBRARY ROUTINE
	.IFF
L.CRC:	.BLKW	1		;POINTER TO CRC LIBRARY ROUTINE
	.ENDC
L.CHAR:	.BLKW	2		;DEVICE CHARTERISTICS
L.ENA:	.BLKB	1		;LINE ENABLE COUNTER (MPT ONLY)
L.STIC:	.BLKB	1		;MPT ONLY
L.STCC:	.BLKB	1		;MPT ONLY
L.NAST:	.BLKB	1		;NUMBER OF ACTIVE STATIONS ON THIS LINE
L.HCCB:	.BLKB	1		;NUMBER OF CCB'S TO ASSIGN AS HEADERS
L.MOTD:	.BLKB	1		;NUMBER OF CCB'S AVAILABLE FOR HEADERS
L.LNUM:	.BLKB	1		;SYSTEM LINE NO. THIS LINE
 
	.EVEN
 
L.STBL:'L'				;START OF STATION TABLES FOR LINE
 
; DEFINITIONS OF BITS IN LINE STATUS WORD
 
LS.LEN=1			;SET IF LINE IS ENABLED
LS.MPM=2			;SET IF MULTIPOINT MASTER
LS.MPS=4			;SET IF MULTIPOINT SLAVE
LS.HDX=10			;SET IF LINK IS HALF DUPLEX
LS.OLD=20			;SET IF LINK COMPATIBLE WITH RELEASE 1
LS.PLW=40			;SET IF POLLING SUSPENDED
LS.TRT=100			;SET IF TURNAROUND TIMER SET
LS.HRC=200			;SET IF DEVICE HAS HARDWARE CRC 
LS.RSN=400			;SET IF LINE IN RESYNC STATE
LS.RSA=1000			;SET IF CCB OUTSTANDING FOR A RESYNC
LS.CTL=2000			;SET IF CONTROL MESSAGE OUTSTANDING
LS.MPT=LS.MPM!LS.MPS		;MASK FOR MULTIPOINT STATION
; DEFINITIONS FOR STATIONS TABLE OFFSETS
 
.=0
 
S.LNK:	.BLKW	1		;STATION TABLE THREAD WORD
S.STS:	.BLKW	1		;STATION STATUS WORD
S.PTXQ:	.BLKW	2		;SLAVE-ONLY PRETRANSMIT QUEUE
S.MOPQ:				;MOP MESSAGE QUEUE
S.TAKQ:	.BLKW	2		;WAITING FOR ACKNOWLEDGE QUEUE
S.FCNL:	.BLKW	1		;FUNCTION PENDING LIST
S.SLAN:	.BLKB	1		;STATION LOGICAL ADDRESS NUMBER
S.SPAN:	.BLKB	1		;STATION PHYSICAL ADDRESS NUMBER
S.STE:	.BLKB	1		;STATUS EXTENSION BYTE
S.RXEN:	.BLKB	1		;RECEIVE ENABLE COUNTER
S.MOTD:	.BLKB	1		;NO. OF MESSAGES OUTSTANDING TO DRIVER
S.LTM:	.BLKB	1		;NO. OF LAST TRANSMITTED MESSAGE
S.LTMR:	.BLKB	1		;NO. OF LAST TX MESSAGE RETURNED
S.LTMA:	.BLKB	1		;NO. OF LAST TX MESSAGE ACKNOWLEDGED
S.HTNA:	.BLKB	1		;HIGHEST TRANSMIT NUMBER ASSIGNED
S.TNRP:	.BLKB	1		;TX NO. FOR REP RESPONSE
S.LRM:	.BLKB	1		;NO. OF LAST RECEIVED MESSAGE
S.RMA:	.BLKB	1		;NO. OF LAST RECEIVED MESSAGE ACKED
S.SIPC:	.BLKB	1		;STATION'S INITIAL PRIORITY VALUE
S.SCPC:	.BLKB	1		;STATION'S CURRENT PRIORITY COUNTER
S.NKRE:	.BLKB	1		;NAK REASON TO BE SENT IN NAK MESSAGE
 
; COUNTERS FOR VARIOUS STATISTICS
 
S.RCVE:	.BLKB	1		;RECEIVE ERRORS
S.TMOE:	.BLKB	1		;RECEIVE TIMEOUTS AND SELECTION ERRORS
S.RSTE:	.BLKB	1		;RECEIVE SYSTEM RESOURCE ERRORS
S.XMTE:	.BLKB	1		;TRANSMITTER ERRORS (FROM NAKS)
S.DSTE:	.BLKB	1		;DESTINATION SYSTEM ERRORS (FROM NAKS)
; THRESHOLD COUNTERS
S.STRC:	.BLKB	1		;START AND RESTART COUNTER
S.REPS:	.BLKB	1		;NO. OF REP MESSAGES SENT TO STATION
S.RETH:	.BLKB	1		;RECEIVER ERROR THRESHOLD COUNTER
S.RPTH:	.BLKB	1		;REPS SENT THRESHOLD ERROR COUNTER
S.NAKT:	.BLKB	1		;NAKS RECEIVED THRESHOLD COUNTER
 
;WORD COUNTERS FOR VARIOUS STATISTICS
	.EVEN
S.TIM:	.BLKW	1		;TIME WHEN STATISTICS ZEROED
S.RCV:	.BLKW	1		;NUMBER OF MESSAGES RECEIVED
S.XMT:	.BLKW	1		;NUMBER OF MESSAGES TRANSMITTED
 
S.STLG:'L'				;LENGTH OF STATION TABLE
; VALUES OF BITS IN STATION STATUS WORD
 
SS.STR=1			;STATION IN START MODE
SS.STK=2			;STATION IN STACK MODE
SS.ONL=4			;STATION IS ONLINE
SS.MOP=10			;STATION IN MOP MODE
SS.HLT=20			;STATION IS BEING HALTED
SS.RTX=40			;RETRANSMISSION IS REQUESTED
SS.SHU=100			;SET IF STATION BEING SHUT DOWN
SS.SEL=200			;SET IF THIS STATION SELECTED
SS.REP=400			;SET IF STATION IN REP MODE
SS.FLO=1000			;SET IF STATION IS FLOW CONTROLLED
SS.MDC=^C<SS.FLO>		;OR OF STATUS STATE BITS
 
; VALUES OF BITS IN STATION STATUS EXTENSION BYTE
 
SE.SSK=1			;SET IF SEND STACK MESSAGE
SE.SST=2			;SET IF SEND START MESSAGE
SE.SNK=4			;SET IF SEND NAK MESSAGE
SE.SRP=10			;SET IF SEND REP MESSAGE
SE.SAK=20			;SET IF SEND ACK MESSAGE
SE.SSL=40			;SET IF SEND SELECT ON THIS MESSAGE
SE.CMS=^C<SE.SAK!SE.SSL>	;MASK FOR DDCMP CONTROL MESSAGES
; OFFSETS FOR RECEIVE MESSAGE PROCESSING
 
.=0
R.HDR1:	.BLKB	1		;FIRST BYTE OF DDCMP HEADER
R.HDR2:	.BLKB	1		;SECOND BYTE OF DDCMP HEADER
R.HDR3:	.BLKB	1		;THIRD BYTE OF DDCMP HDR
R.HDR4:	.BLKB	1		;FOURTH BYTE OF HEADER
R.HDR5:	.BLKB	1		;FIFTH BYTE OF HEADER
R.HDR6:	.BLKB	1		;SIXTH BYTE OF HEADER
R.HDR7:	.BLKB	1		;SEVENTH BYTE OF HEADER
R.HDR8:	.BLKB	1		;EIGTH BYTE OF HEADER
 
; ASCII COMMUNICATION CHARACTERS
CM.ENQ=005			;ENQUIRE (CONTROL MESSAGE)
CM.SOH=201			;START OF HEADER (DATA MESSAGE)
CM.DLE=220			;DATA LINK ESCAPE (BOOT MESSAGE)
CM.SYN=226			;SYN CHARACTER
; CONTROL MESSAGE TYPES
MT.ACK=001			;ACKNOWLEDGE
MT.NAK=002			;NEGATIVE ACKNOWLEDGE
MT.REP=003			;REPLY
MT.RES=004			;RESET
MT.RSK=005			;RESET ACKNOWLEDGE
MT.STR=006			;START
MT.STK=007			;START ACKNOWLEDGE
 
 
; DDCMP DEFINED NAK REASON ERROR CODES
 
RN.HBC=1			;HEADER BLOCK CHECK ERROR
RN.DBC=2			;DATA BLOCK CHECK ERROR
RN.REP=3			;REP RESPONSE
RN.BUF=10			;RECEIVER BUFFER ALLOCATION FAILRE
RN.ROV=11			;RECEIVER OVERRUN FLIALURE
RN.MTL=20			;RECEIVED MESSAGE TOO LONG
RN.HFE=21			;RECEIVED HEADER FORMAT ERROR
 
; SPECIAL HEADER BITS
 
DD.QSN=100			;DDCMP FINAL OR QSYNC BIT
DD.SEL=200			;DDCMP SELECT BIT
 
 
	.PSECT
	.ENDM
	.MACRO DDM$DF	NAM,FLG,PRI
	NAM'PR=PRI
	NAM'FL=FLG
	.ENDM	DDM$DF
	.MACRO DEF$DF
	SLN=-1			; INTERNAL COUNTER
	STATBL=0		; TOTAL NUMBER OF STATIONS
;
;	DEFINE SYMBOLS NEEDED DURING PART 1
;
	SLTDF$
	PDVDF$
;
;	PROCESSOR PRIORITIES
;
	PR0=0
	PR1=40
	PR2=100
	PR3=140
	PR4=200
	PR5=240
	PR6=300
	PR7=340	
 
	.ENDM	DEF$DF
.MACRO	DEVDF
	.MCALL	DVTMDF
	.MACRO	XXX NAM,DSP,NUM,ARG4,ARG5,ARG6,ARG7
	'NAM'='NUM'
	.ENDM	XXX
	DVTMDF	XXX
.MACRO	DEVDF
.ENDM
.ENDM
	.MACRO	DEVDF$,L,B
	.MCALL	DCBDF$
	DCBDF$	<L>,<B>
	.MCALL	UCBDF$
	UCBDF$	<L>,<B>
	.MCALL	SCBDF$
	SCBDF$	<L>,<B>
	.MCALL	LCBDF$
	LCBDF$	<L>,<B>
	.MACRO	DEVDF$,X,Y
	.ENDM
	.ENDM
.MACRO	DHTDF$	PS
	.ASECT
.=	0
DHDLT:			; DH11 DEVICE LINE TABLE OFFSETS
DRCV:	.BLKW	7	; RECIEVE INTERRUPT ENTRY
DRPRI:	.BLKW	1	; RCV PRIORITY
DRNCR:	.BLKW	1	; ADDR OF DH11 NCR
DTRN:	.BLKW	7	; TRANSMIT INTERRUPT ENTRY
DTPRI:	.BLKW	1	; TRN PRIORITY
DTBAR:	.BLKW	1	; ADDR OF DH11 BUFFER ACTIVE REG
DTCTR:	.BLKW	1	; CURRENT TRN ACTIVE BITS (C0=B0)
DMDM:	.BLKW	7	; NO MODEM INTERRUPT ENTRY
DMPRI:	.BLKW	1	; MODEM INTERUPT PRIORITY
DMCSR:	.BLKW	1	; DM11-BB CSR ADDRESS
DHSCR:	.BLKW	1	; ADDR OF DH11 SCR
DHHDR:	.BLKW	2	; HEADER LIBRARY POINTER
DHCRC:	.BLKW	2	; CRC LIBRARY POINTER
DHACT:	.BLKB	0	; ACTIVE LINE COUNT
DHFLG:	.BLKW	1	; DH FLAGS
DHTIM:	.BLKW	2	; SHORT TIMER CONTROL
;
; TABLE OF 16 ENTRIES, ONE ENTRY PER DH LINE (CHANNEL)
;
DHCTB:
.=	0
DCLTW:	.BLKW	1	; LONG TIMER WORD
DCTCR:	.BLKW	1	; CURRENT TRN CCB ENTRY
DCTQH:	.BLKW	1	; CURRENT TRN CCB QUEUE
DCRAD:	.BLKW	1	; RCV BUFFER MAPPING BIAS
DCRPT:	.BLKW	1	; RCV BUFFER BYTE POINTER
DCRCT:	.BLKW	1	; RCV BUFFER BYTE COUNTER
DCRQH:	.BLKW	1	; RCV BUFFER QUEUE
DCLPR:	.BLKW	1	; DH11 DEV LINE PARAM VALUE
DCDLP:	.BLKW	1	; STANDARD DEV LINE PARAM VALUE
DCDFL:	.BLKW	1	; DEFAULT DEV LINE PARAM VALUE
DCSWT:	.BLKW	1	; LINE SWITCHES
DCPST:	.BLKW	1	; PROTOCOL STATUS BITS
DCCHN:	.BLKB	1	; CHANNEL NUMBER
DCSLN:	.BLKB	1	; SYSTEM LINE NUMBER
	.EVEN
DHCTS=	.		;SIZE OF ENTRY
	.PSECT
.ENDM	DHTDF$
	.MACRO DLC$DF	NAM,FLG,PRI
	NAM'PR=PRI
	NAM'FL=FLG
	.ENDM	DLC$DF
.MACRO	DLPDF$	L,X
	.IIF	B,L,	.NLIST
	LP....=	0
	.IF	NB,X
	.IIF	EQ,''X-'M,	LP....=	1
	.IIF	EQ,''X-'B,	LP....=	-1
	.ENDC
	.IF	GE,LP....
	.LIST
 
;
; MASK DEFINITIONS FOR STANDARD DEVICE LINE PARAMETER WORD
;
LP.DUP=	000001		;DUPLEX MODE (0=FULL, 1=HALF)
LP.ECO=	000002		;HARDWARE AUTO-ECHO SWITCH (1=ENABLE)
LP.SAD=	000004		;SECONDARY ADDRESS PRESENT FOR SET CHARACTERISTICS
LP.CLN=	000030		;CHARACTER LENGTH (SEE BELOW)
LP.STP=	000040		;STOP CODE (0=1 BIT, 1=1.5 OR 2 BITS)
LP.PAR=	000300		;PARITY MODE (SEE BELOW)
LP.TRN=	007400		;TRANSMIT SPEED (OR TRN+RCV SPEED FOR SINGLE
			;  SPEED DEVICES) (SEE BELOW)
LP.RCV=	170000		;RECEIVE SPEED (SEE BELOW)
	.NLIST
	.ENDC
	.IF	LE,LP....
	.LIST
 
;
; BIT DEFINITIONS FOR MULTI-BIT MASKS
;
LB.CL5=	000000		;CHARACTER LENGTH = 5 BITS
LB.CL6=	000010		;CHARACTER LENGTH = 6 BITS
LB.CL7=	000020		;CHARACTER LENGTH = 7 BITS
LB.CL8=	000030		;CHARACTER LENGTH = 8 BITS
 
LB.PRN=	000000		;PARITY = NONE
LB.PRE=	000100		;PARITY = EVEN
LB.PRO=	000300		;PARITY = ODD
 
LB.T00=	000000		;TRN SPEED =   50   BAUD
LB.T01=	000400		;TRN SPEED =   75   BAUD
LB.T02=	001000		;TRN SPEED =  110   BAUD
LB.T03=	001400		;TRN SPEED =  134.5 BAUD
LB.T04=	002000		;TRN SPEED =  150   BAUD
LB.T05=	002400		;TRN SPEED =  300   BAUD
LB.T06=	003000		;TRN SPEED =  600   BAUD
LB.T07=	003400		;TRN SPEED = 1200   BAUD
LB.T08=	004000		;TRN SPEED = 1800   BAUD
LB.T09=	004400		;TRN SPEED = 2000   BAUD
LB.T10=	005000		;TRN SPEED = 2400   BAUD
LB.T11=	005400		;TRN SPEED = 3600   BAUD
LB.T12=	006000		;TRN SPEED = 4800   BAUD
LB.T13=	006400		;TRN SPEED = 7200   BAUD
LB.T14=	007000		;TRN SPEED = 9600   BAUD
LB.T15=	007400		;TRN SPEED = EXTERNAL INPUT
 
LB.R00=	000000		;RCV SPEED =   50   BAUD
LB.R01=	010000		;RCV SPEED =   75   BAUD
LB.R02=	020000		;RCV SPEED =  110   BAUD
LB.R03=	030000		;RCV SPEED =  134.5 BAUD
LB.R04=	040000		;RCV SPEED =  150   BAUD
LB.R05=	050000		;RCV SPEED =  300   BAUD
LB.R06=	060000		;RCV SPEED =  600   BAUD
LB.R07=	070000		;RCV SPEED = 1200   BAUD
LB.R08=	100000		;RCV SPEED = 1800   BAUD
LB.R09=	110000		;RCV SPEED = 2000   BAUD
LB.R10=	120000		;RCV SPEED = 2400   BAUD
LB.R11=	130000		;RCV SPEED = 3600   BAUD
LB.R12=	140000		;RCV SPEED = 4800   BAUD
LB.R13=	150000		;RCV SPEED = 7200   BAUD
LB.R14=	160000		;RCV SPEED = 9600   BAUD
LB.R15=	170000		;RCV SPEED = EXTERNAL INPUT
	.NLIST
	.ENDC
 
	.IIF	B,L,	.LIST
	.ENDM	DLPDF$
.MACRO	DLTDF$	PS
	.NLIST
	....PS=	0
	.IF	NB,PS
	.IIF	NE,PS,	....PS=	1
	.ENDC
	.LIST
	.ASECT
.=	0
 
DLDLT:					;DL11 DEVICE LINE TABLE OFFSETS
DLLTM:	.BLKW	1			;LONG TIMEOUT CONTROL
 
DRCV:	.INT				;RCV INTERRUPT RE-VECTORING
	.PRI				;RCV PRIORITY
DRBUF:	.BLKW	1			;RCV RBUF REGISTER ADDRESS
	.IF	NE,....PS
DPSTS:	.BLKW	1			;PROTOCOL STATUS HOLDER
DRBAD:	.IF	DF,M$$MGE
	.BLKW	1			;RCV BUFFER MAPPING BIAS
	.IFTF
DRPNT:	.BLKW	1			;RCV BUFFER BYTE POINTER
DRCNT:	.BLKW	1			;RCV BUFFER BYTE COUNTER
DRQHD:	.BLKW	1			;RCV CCB QUEUE HEAD
	.ENDC
	.ENDC
 
DTRN:	.INT				;TRN INTERRUPT RE-VECTORING
	.PRI				;TRN PRIORITY
DTBAD:	.IF	DF,M$$MGE
	.BLKW	1			;TRN BUFFER MAPPING BIAS
	.ENDC
DTPNT:	.BLKW	1			;TRN BUFFER BYTE POINTER
DTBUF:	.BLKW	1			;TRN TBUF REGISTER ADDRESS
DTCNT:	.BLKW	1			;TRN BUFFER BYTE COUNTER
DTCCE:	.BLKW	1			;TRN CURRENT CCB ENTRY
DTQHD:	.BLKW	1			;TRN CCB QUEUE HEAD
 
DLTCR:	.BLKW	1			;TRN CONTROL REGISTER ADDRESS
TCRC:	.LIBR				;STCRC POINTER
DLSLN:	.BLKW	1			;SYSTEM LINE NUMBER
DLSWT:	.BLKW	1			;SWITCHES
DLDLP:	.BLKW	2			;DEVICE LINE PARAMETERS
	DLTLN==.
	.PSECT
.ENDM	DLTDF$
	.MACRO	DLXDF
;+
; NICE FUNCTIONS IN DLX
;
NX.NIC	=36*400+50		; NICE QIO FUNCTION CODE
;
; SUB-FUNCTIONS IN PARAM(3)
;
NX$RNN	=0			; READ NODE NAMES
NX$RNS	=2			; READ NODE STATUS
NX$RNC	=4			; READ NODE COUNTERS
NX$ZNC	=6			; ZERO NODE COUNTERS
NX$SNS	=10			; SET NODE STATUS
NX$RLN	=12			; READ LINE IDENTIFIERS
NX$RLS	=14			; READ LINE STATUS
NX$RLC	=16			; READ LINE COUNTERS
NX$ZLC	=20			; ZERO LINE COUNTERS
NX$SLS	=22			; SET LINE STATE
NX$SNH	=24			; SET HOST NODE
NX$SLH	=26			; SET HOST FOR LINE
NX$XMT	=30			; SET XMT PASSWORD FOR NODE
NX$RCV	=32			; SET RCV PASSWORD FOR NODE
NX$SNO	=34			; SET OPERATOR STATE FOR LOCAL NODE
NX$SNM	=36			; SET MAINTENANCE STATE FOR LOCAL NODE
NX$SLO	=40			; SET OPERATOR STATE FOR LINE
NX$SLM	=42			; SET MAINTENANCE STATE FOR LINE
;	=44			; (UNUSED)
NX$DEP	=46			; DEPOSIT MEMORY
NX$EXM	=50			; EXAMINE MEMORY
;
; NODE TYPE CODES
;
N$XLCL	=1			; LOCAL NODE
N$XADJ	=2			; ADJACENT NODE
N$XINT	=3			; INTERCEPT NODE
N$XRMT	=4			; REMOTE NODE
;
;-
	.MACRO	DLXDF
	.ENDM	DLXDF
	.ENDM	DLXDF
	.MACRO	DLXDF$
;
; LINE PARAMETER BLOCK OFFSET DEFINITIONS:
;
	.ASECT
	.=0
TNAM:	.BLKW	1		; RAD50 PROCESS NAME
TCTL:	.BLKB	1		; CONTROLLER NUMBER
TLIN:	.BLKB	1		; LINE NUMBER ON CONTROLLER
TSTA:	.BLKB	1		; MULTIPOINT STATION ADDRESS
	.BLKB	1		; RESERVED
TFLG:	.BLKB	1		; PROCESS FLAGS
TPDV:	.BLKB	1		; PROCESS INDEX
TSLN:	.BLKW	1		; SYSTEM LINE NUMBER AND LOGICAL STATION
TSLF:	.BLKW	1		; SYSTEM LINE TABLE FLAGS
TDDM:	.BLKB	1		; DDM PROCESS INDEX
TDLC:	.BLKB	1		; DLC PROCESS INDEX
TASN:	.BLKW	1		; CURRENT ASSIGNMENT (PDV & CHAN)
;
; NODE PARAMETER BLOCK OFFSET DEFINITIONS:
;
	.=0
NNOD:	.BLKW	1		; NODE NAME DESCRIPTOR ADDRESS
NNUM:	.BLKW	1		; NODE NUMBER
NPWD:	.BLKW	1		; PASSWORD BLOCK ADDRESS
NSTA:	.BLKW	1		; STATISTICS PARAMETER BLOCK ADDRESS
;
; DEVICE SERVICES DISPATCH TABLE
;
	.=0
S.SLG:	.BLKW	1		; SET LOGGING STATE
S.RLG:	.BLKW	1		; READ LOGGING STATE
S.RCN:	.BLKW	1		; READ LINE COUNTERS
S.ZCN:	.BLKW	1		; ZERO LINE COUNTERS
	.PSECT
	.MACRO	PROCESS .NM,SLG,RCN,ZCN,RLG
	.PSECT
$$$	=.
	.IRP	.AD,<SLG,RLG,RCN,ZCN>
	.IF NB	.AD
	.WORD	.AD
	.IFF
	.WORD	$NXNOP
	.ENDC
	.ENDR
	.PSECT	$$DSP1,D,GBL
	.WORD	$$$
	.PSECT	$$NAM1,D,GBL
	.RAD50	\.NM\
	.PSECT
	.ENDM	PROCESS
	.ENDM	DLXDF$
.MACRO	DMCDF$	L,B,LST
	.IIF NB	<LST>,	.LIST
	.MCALL	TMPDF$
	TMPDF$
	.ASECT
	.=0
	.INT
	..OFF.=-<<.*2>+20>
	.=..OFF.
D.IVCT:'L'				; INPUT INTERRUPT TRANSFER VECTOR
	.INT			; INPUT INTERRUPT TRANSFER VECTOR
	.PRI			; ^C< DEVICE PRIORITY >
D.SEL0:'L'	.CSR			; ADDRESS OF DMC SEL0 REGISTER
	.BLKW	1		; OFFSET TO INTERRUPT SERVICE DISPATCH TABLE
D.OFFI='B' -.
	.BLKW	1		; OFFSET TO START OF LINE TABLE
D.OVCT:'L'				; OUTPUT INTERRUPT TRANSFER VECTOR
	.INT			; OUTPUT INTERRUPT TRANSFER VECTOR
	.PRI			; ^C< DEVICE PRIORITY >
D.SEL2:'L'	.CSR			; ADDRESS OF DMC SEL2 REGISTER
	.BLKW	1		; OFFSET TO INTERRUPT SERVICE DISPATCH TABLE
D.OFFO='B' -.
	.BLKW	1		; OFFSET TO START OF LINE TABLE
D.OFFS='B' .-D.IVCT
D.TIMR:'L'	.BLKB	1		; LINE TABLE TIMER CELL
D.TIME:'L'	.BLKB	1		; TIMER RESET VALUE CELL
D.RAQC:'L'	.BLKB	1		; MINUS THE CURRENT NUMBER OF RECV BUFFERS ASSIG
D.RBFC:'L'	.BLKB	1		; MINUS THE MAXIMUM NUMBER OF RECV BUFFERS ASSIG
D.RAWQ:'L'	.LSTHD			; RECV BUFFERS AWAITING ASSIGNMENT QUEUE
D.RASQ:'L'	.LSTHD			; RECV BUFFERS ASSIGNED TO DMC QUEUE
D.XAQC:'L'	.BLKB	1		; MINUS THE CURRENT NUMBER OF XMIT BUFFERS ASSIG
D.XBFC:'L'	.BLKB	1		; MINUS THE MAXIMUM NUMBER OF XMIT BUFFERS ASSIG
D.XAWQ:'L'	.LSTHD			; XMIT BUFFERS AWAITING ASSIGNMENT QUEUE
D.XASQ:'L'	.LSTHD			; XMIT BUFFERS ASSIGNED TO DMC QUEUE
D.LINE:'L'	.BLKW	1		; SYSTEM LINE NUMBER
D.LBIA:'L'	.IF DF	M$$MGE
	.BLKW	1		;DMC LINE TABLE BIAS ADDRESS
	.ENDC
D.LVA:'L'	.BLKW	1		; DMC LINE TABLE VIRTUAL ADDRESS
D.ERRS:'L'	.BLKW	1		; PENDING STATUS WORD
D.CFNC:'L'	.BLKW	1		; CONTROL FUNCTION IN PROGRESS
D.PFNC:'L'	.LSTHD			; PENDING CONTROL FUNCTION QUEUE
D.STAT:'L'	.BLKW	1		; STATE FLAGS
D.PLEX:'L'	.DVCHA			; DEVICE CHARACTERISTICS
D.TLZ:'L'	.BLKW	1		; THE TIME COUNTERS WHERE LAST ZEROED
D.XMT:'L'	.BLKW	1		; NUMBER OF BLOCKS TRANSMITTED
D.RCV:'L'	.BLKW	1		; NUMBER OF BLOCKS RECEIVED
D.LREC:'L'	.BLKB	6.		; ERROR COUNTER VALUES FROM LAST READ OF BASE TA
D.LOGG:'L'	.BLKW	1		; EVENT LOGGING DESTINATION
D.LEN='B'.-..OFF.
	.PSECT
	.IIF NB <LST>,	.NLIST
.ENDM	DMCDF$
.MACRO DMEMDF
.MCALL	CONFIG
CONFIG
.PSECT	DYNMEM,RW,D,GBL,REL,OVR
.MACRO	$$DFBF BEGLAB,LEN,CNT
BEGLAB':
.IF	GT	CNT
  .REPT	  CNT-1
	.WORD	  .+LEN
	.BLKB	  LEN-2
  .ENDM
	.WORD	0
	.BLKB	LEN-2
.ENDC
.ENDM
$$DFBF	BG550,550.,F$550
$$DFBF	BG300,300.,F$300
$$DFBF	BG150,150.,F$150
$$DFBF  BG50,50.,F$50
BFMAX	=.-2
BFHEAD:
	.WORD	BG50
	.WORD	BG150
	.WORD	BG300
	.WORD	BG550
BFLEN:
	.WORD	50.
	.WORD	150.
	.WORD	300.
	.WORD	550.
BFBEG:
	.WORD	BG50
	.WORD	BG150
	.WORD	BG300
	.WORD	BG550
BFPCNT	= 4.
.PSECT
.ENDM
.MACRO  DMXB
LINLEN	= 5.
NODLEN	= 6.
ADCINC	= 010
BADBIT	= 360
FILINC	= 004
IDTYPE	= 003
RESBIT  = 001
SRVINC	= 002
X.CB	= 0.
X.CB2	= 2.
X.ADDR	= 4.
X.CNT	= 8.
X.DBUF	= 12.
X.DLEN	= 14.
X.DFIL	= 16.
X.LLBF	= 18.
X.LLEN	= 20.
X.LLPR	= 22.
X.CPU	= 24.
X.FLGS	= 25.
X.SLIN	= 26.
X.SIMG	= 31.
X.SNOD	= 32.
X.STAT	= 38.
X.LKNM	= 40.
X.LLUN	= 42.
X.DLUN	= 44.
X.OSTE	= 46.
X.ERR	= 48.
	.ASECT
.=50.
X.TNOD: .BLKB	NODLEN+1
	.EVEN
X.DSD:	.BLKW	6
X.DFNB:	.BLKW	15.
X.SPEC:	.BLKB	32.
X$LEN	= .
	.PSECT
XF$DSA	= 1
XF$DSC	= 2
XF$LRA	= 4
XF$LRC	= 10
XF$LWA	= 20
XF$LWC	= 40
XF$EOD	= 100
XF$SAD	= 200
GTNXCB	= 1.
ODFSLL	= 2.
WDUMLB	= 3.
XMSPRD	= 4.	;SEND MESSAGE
ABORT	= 6.
FINISH	= 97.
GTDKBF	= 98.
BUFSZ4	= 512.
	.MACRO	DMXB
	.ENDM
	.ENDM
	.MACRO	DO
	THEN
	.ENDM
	.MACRO	DQDF$	LST
	.IIF NB,LST,	.LIST
	.MCALL	TMPDF$
	TMPDF$
	.ASECT
	.=0
TIME:	.BLKB	1		;TIMER BYTE
TIMS:	.BLKB	1		;TIME OUT TIME IN SECONDS
DQREG:	.CSR			;CSR VALUE (CSR + 5 IN TEMPLATE)
RTINS:	.INT			;RECEIVE INTERRUPT ENTRY POINT
RPRI:	.PRI			;RECEIVE PRIORITY
RINS:	.BLKW	1		;ROUTINE TO CALL ON NEXT REC INTERRUPT
RFLAG:	.BLKW	1		;RECEIVER FLAGS
RSTAT:	.BLKW	1		;RECEIVER STATUS
	.IF DF	M$$MGE
RBIAS:	.BLKW	1		;RELOCATION BIAS
	.ENDC
RADD:	.BLKW	1		;VIRTUAL ADDRESS OF REC BUFFER
RBUF1:	.BLKW	1		;BUFFER TO RETURN RECEIVE COMPLETE ON
RBUF2:	.BLKW	1		;BUFFER THAT IS BEING SET UP
TTINS:	.INT			;TRANSMIT INTERRUPT ENTRY POINT
TPRI:	.PRI			;TRANSMITTER PRIORITY
TFLAG:	.BLKW	1		;FLAGS FROM BUFFER DESCRIPTOR
TBUFP:	.BLKW	1		;BUFFER IN PRIMARY XMIT REGISTER
TBUFS:	.BLKW	1		;BUFFER IN SECONDARY XMIT REGISTER
TQUE:	.LSTHD			;QUEUE OF BUFFERS TO TRANSMIT
KICCB:	.BLKW	1		;CCB ADDRESS FOR A KILL
LINE:	.SLNW			;SYSTEM LINE NUMBER
DQCHA:	.DVCHA			;DEVICE CHARACTERISTICS
DDHAR:	.LIBR			;DDHAR LIBRARY CALL
CLCRC:	.LIBR			;STCRC LIBRARY CALL
.PSECT
	.IIF NB,LST,	.NLIST
	.ENDM
	.MACRO	DSCW$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	QDPB$	3,16000,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	DSCW$
	.MACRO	DSCW$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,3,#16000,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	DSCW$E
	.MACRO	DSCW$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	QDPB$S	3,#16000,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	DSCW$S
	.MACRO	DSC$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	QDPB$	1,16000,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	DSC$
	.MACRO	DSC$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,1,#16000,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	DSC$E
	.MACRO	DSC$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	QDPB$S	1,#16000,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	DSC$S
.MACRO	DTEDF$	LST
	.IIF NB	<LST>,	.LIST
	.MCALL	TMPDF$
	TMPDF$
	.ASECT
.=0
L.TIM:	.BLKB	1	;COMM/EXEC TIMER
L.UNT:	.BLKB	1	;DTE20 NUMBER
	.EVEN
;
; *** DO NOT CHANGE ORDER OF L.IVC THROUGH L.ICB ***
;      (USED BY INTERRUPT SERVICE)
;
L.IVC:	.INT	$DTEIS	;INTERRUPT VECTOR CONTROL BLOCK
L.ICB:	.BLKW	1	;INTERRUPT CCB FOR DDM ==> DLC
L.CST:	.BLKW	1	;EXTERNAL PAGE ADDRESS OF CSTAT REGISTER
L.STS:	.BLKW	1	;LINE STATUS:
	LS.RUN=^O100000	; LINE IS RUNNING NORMAL PROTOCOL *** MUST BE SIGN BIT ***
	LS.INI=^O040000	; LINE IS DOING AN INITIALIZE SEQUENCE
	LS.ICB=^O020000	; LINE HAS AN INTERRUPT CCB
L.SLN:	.BLKW	1	;SYSTEM LINE NUMBER
L.PSW:	.BLKW	1	;PENDING STATUS WORD (FOR $ASCMP) OR ZERO
L.LOG:	.BLKW	1	;EVENT LOGGING DESTINATION
L.PCQ:	.LSTHD		;PENDING CONTROL FUNCTION QUEUE
L.MPN:	.BLKB	1	;MY PROTOCOL PROCESSOR #
L.HPN:	.BLKB	1	;HIS PROTOCOL PROCESSOR #
	.EVEN
L.EHG:	.BLKW	1	;EXAMINE HIS GENERAL OFFSET
L.EHM:	.BLKW	1	;EXAMINE HIS TO-ME
L.EMG:	.BLKW	1	;EXAMINE MY GENERAL
			;EXAMINE MY TO-HIM  IS (L.EMG)+(L.DMH)
			;DEPOSIT MY GENERAL  IS ALWAYS 0
L.DMH:	.BLKW	1	;DEPOSIT MY TO-HIM
;
L.HKA:	.BLKW	1	;HIS KEEP-ALIVE
L.MKA:	.BLKW	1	;MY KEEP-ALIVE
;
; RECEIVE CONTROL BLOCK     ** DO NOT CHANGE ORDER OF  L.RST  THRU  L.RTM **
;
L.RST:	.BLKW	3	;TO-ME STATUS WORD
L.RFQ:	.LSTHD		;FREE RECEIVE BUFFER QUEUE
L.RCB:	.BLKW	1	;CCB ADDRESS OF CURRENT BUFFER
L.RBA:			;RECEIVE BUSS ADDRESS:
	.BLKW	1	; BITS 17-16, STORED IN BITS 15-14
L.RLA:	.BLKW	1	; BITS 15-0
L.RCT:	.BLKW	1	;RECEIVE BYTE COUNT
L.RBZ:	.BLKW	1	;RECEIVE BUFFER SIZE
L.RQZ:			;TO-ME QSIZE WORD:
L.RCZ:	.BLKW	1	; SIZE OF THIS TRANSFER
L.RPZ:	.BLKW	1	; SIZE OF THIS MESSAGE
L.RTM:	.BLKW	1	; TRNASFER MODE
;
; TRANSMIT CONTROL BLOCK     ** DO NOT CHANGE THE ORDER OF  L.XST  THRU  L.XTM **
;
L.XST:	.BLKW	3	;TO-HIM STATUS WORD
L.XMQ:	.LSTHD		;TRANSMIT QUEUE
L.XCB:	.BLKW	1	;CCB ADDRESS OF CURRENT TRANSMIT
L.XBA:			;TRANSMIT BUSS ADDRESS
	.BLKW	1	; BITS 17-16, STORED IN BITS 15-14
L.XLA:	.BLKW	1	; BITS 15-0
L.XQZ:			;TO-HIM QSIZE WORD:
L.XCT:	.BLKW	1	; TRANSMIT BYTE COUNT
L.XBZ:	.BLKW	1	; TRANSMIT BUFFER SIZE
L.XTM:	.BLKW	1	; TRANSFER MODE
; LINE COUNTERS
L.TLZ:	.BLKW	1		; SECONDS SINCE LINE COUNTERS ZEROED
L.RCV:	.BLKW	1		; BLOCKS SUCCESSFULLY RECEIVED
L.XMT:	.BLKW	1		;    "        "       TRANSMITTED
L.TMO:	.BLKB	1		; RECEIVE TIMEOUTS
L.RES:	.BLKB	1		; RESOURCE ALLOC ERRORS
;
$DTELZ==.		;SIZE OF DTE20 LINE TABLE
	.PSECT
	.IIF NB	<LST>,	.NLIST
.ENDM	DTEDF$
.MACRO	DUPDF$	LST
	.IIF NB	<LST>,	.LIST
	.MCALL	TMPDF$
	TMPDF$
;
; DEVICE LINE TABLE OFFSET DEFINITIONS
;
	.ASECT
.=0
TIME:	.BLKB	1	; DEVICE DRIVER TIMER CELL
TIMS:	.BLKB	1	; DEVICE DRIVER INITIAL TIMEOUT
RINS:	.INT		; RECEIVE TRANSFER INSTRUCTION
RDBF:	.BLKW	1	;         RECEIVE DATA ADDRESS
	.IF DF	M$$MGE
RBIAS:	.BLKW	1	;         RELOCATION BIAS
	.IFTF
RADD:	.BLKW	1	;         VIRTUAL ADDRESS
RCNT:	.BLKW	1	;         REMAINING COUNT
RPRI:	.PRI		;         PRIORITY
RTHRD:	.BLKW	1	;         POINTER TO CURRENT BUFFER IN CCB
RFLAG:	.BLKW	1	;         FLAGS WORD
RPRIM:	.BLKW	1	;         PRIMARY CCB (CURRENT)
RSTAT:	.BLKW	1	;         DEVICE STATUS
RPCNT:	.BLKW	1	;	SIZE OF DATA IN NUMBERED MESSAGE
TINS:	.INT		; TRANSMIT TRANSFER INSTRUCTION
TCSR:	.BLKW	1	;          CSR ADDRESS
	.IFT
TBIAS:	.BLKW	1	;          RELOCATION BIAS
	.IFTF
TADD:	.BLKW	1	;          VIRTUAL ADDRESS
TCNT:	.BLKW	1	;          REMAINING COUNT
TPRI:	.PRI		;          PRIORITY
TSTAT:	.BLKW	1	;	   NEXT STATE
TTHRD:	.BLKW	1	;          POINTER TO CURRENT BUFFER IN CCB
TPRIM:	.BLKW	1	;          PRIMARY CCB (CURRENT)
TSEC:	.BLKW	1	;          SECONDARY CCB CHAIN
KICCB:	.BLKW	1	; ADDRESS OF CCB USED IN KILL
LINE:	.BLKW	1	; DEVICE SYSTEM LINE NUMBER
DUPCH:	.DVCHA		; DEVICE CHA. (LOADED BY .DVCHA) ONLY THE
			;  FULL/HALF DUPLEX INDICATOR IS USED
DUPLG:	.BLKW	1	; EVENT LOGGING DESTINATION
HDRA:	.LIBR
	.ENDC
	DUPLN==.
	.PSECT
	.IIF NB	<LST>,	.NLIST
.ENDM	DUPDF$
	.MACRO	DVBDF$,L,B
 
	.ASECT
 
.=0
V.TRCT:'L' .BLKW	1	;VOLUME TRANSACTION COUNT (RESERVED FOR RSX)
V.TIMR:'L' .BLKB	1	;CURRENT TIMER VALUE
V.TIME:'L' .BLKB	1	;RESET TIME VALUE
V.CULT:'L' .BLKW	1	;CURRENT USER LINK TABLE ADDRESS
V.ULT:'L' .BLKW		1	;POINTER TO START OF USER LINK TABLE
V.ULTE:'L' .BLKW 	1	;POINTER TO END OF USER LINK TABLE
V.MBXQ:'L' .BLKW	2	;USER TASK MAILBOX LISTHEAD
V.GENQ:'L' .BLKW	2	;GENERAL DELIVERY CCB QUEUE LISTHEAD
V.1CPQ:'L' .BLKW	2	;VERSION 1 CONNECT PENDING QUEUE LISTHEAD
				;
V.VBL='B'.-V.TRCT		;LENGTH OF DECNET (V2) VOLUME CONTROL BLOCK
 
	.PSECT
 
	.MACRO	DVBDF$,X,Y
	.ENDM	DVBDF$
 
	.ENDM	DVBDF$
.MACRO	DVTMDF	MCRO
	'MCRO'	DP,DP,0,<DV$NET!DV$LOD>,15.,0,255.	;** MOP
	'MCRO'	DU,DU,2,<DV$NET!DV$LOD>,15.,0,255.	;** MOP
	'MCRO'	DUV,DUV,2,<DV$NET!DV$LOD>,15.,0,255.	;** MOP
	'MCRO'	DL,DL,4,<DV$NET!DV$LOD>,15.,0,255.	;** MOP
	'MCRO'	DLV,DLV,4,<DV$NET!DV$LOD>,0.,0,255.	;** MOP
	'MCRO'	DQ,DQ,6,<DV$NET!DV$LOD>,15.,0,255.	;** MOP
	'MCRO'	DA,DA,10,<DV$NET!DV$LOD>,1.,0,0.	;** MOP
	'MCRO'	DUP,DUP,12,<DV$NET!DV$LOD>,15.,0,255.	;** MOP
	'MCRO'	DMC,DMC,14,<DV$NET!DV$LOD>,7.,0,0.	;** MOP
	'MCRO'	DLA,DLA,20,,0.,0.,0.			;OUR DEFINITION
	'MCRO'	DTE,DTE,24,<DV$NET>,0.,0,0.		;** MOP
	'MCRO'	DV,DV,26,<DV$NET!DV$LOD>,3.,15.,255.	;MAYNARD DEFINITION
	'MCRO'	DZ,DZ,30,<DV$NET!DV$LOD>,7.,7.,255.	;MAYNARD DEFINITION
	'MCRO'	KDP,KDP,34,<DV$NET!DV$LOD>,0.,15.,255.	;MAYNARD DEFINITION
	'MCRO'	KDZ,KDZ,36,<DV$NET!DV$LOD>,2.,47.,255.	;MAYNARD DEFINITION
	'MCRO'	KL,KL,40,<DV$NET>,15.,0,255.		;** MOP
	'MCRO'	DH,DH,42,<DV$NET!DV$LOD>,7.,15.,255.	;OUR DEFINITION
	'MCRO'	CR,CR,44,,0.,0.,0.			;OUR DEFINITION
	'MCRO'	LE,LE,46,,0.,0.,0.			;OUR DEFINITION
.ENDM	DVTMDF
.MACRO	DZTDF$	PS
	.MCALL	TMPDF$
	TMPDF$
	.NLIST
	....PS=	0
	.IF	NB,PS
	.IIF	NE,PS,	....PS=	1
	.ENDC
	.LIST
	.ASECT
	.=	0
DZDLT:					;DZ11 DEVICE LINE TABLE OFFSETS
DRCV:	.INT				;NTL .INT & .PRI OPERATOR
	.PRI
DRDBR:	.BLKW	1			;RCV DATA BUF REG ADDR
DTRN:	.INT			;NTL .INT & .PRI OPERATOR
	.PRI
DTDBR:	.BLKW	1			;XMT DATA BUF REG ADDR
DZCSR:	.BLKW	1			;DZ11 CSR ADDRESS
DTIM:	.BLKW	2			;2 WORD ENTRY FOR TIMER QUEUE
DFLG:	.BLKB	1			;REMOVED: FREE TO ALL TAKERS
DCNT:	.BLKB	1			;ACTIVE CHANNEL COUNT
DCRC:	.LIBR				;CRC ROUTINE POINTER
DTMSTP:	.BLKW	1			;STORAGE FOR STOP CCB WHILE
					;TIMER STOPS
DTTAB::					;TABLE OF 8 CHN ENTRIES
.=	0				;OFFSETS INTO TABLE ENTRIES
DTTLT:	.BLKW	1			;TIMEOUT COUNT, MUST BE FIRST
DTTAD:	.IF	DF,M$$MGE
	.BLKW	1			;TRN CHAR BUFFER RELOC BIAS
	.ENDC
DTTPT:	.BLKW	1			;TRN CHAR BUFF POINTER
DTTCT:	.BLKW	1			;TRN CHARACTER COUNT
DTTCE:	.BLKW	1			;TRN CCB BUFFER ENTRY POINTER
DTTQH:	.BLKW	1			;TRN CCB Q HEAD AND CURRENT CCB
DTLOG:	.BLKW	1			;EVENT LOGGING DESTINATION
	.IF	NE,....PS
DTPST:	.BLKW	1			;PROTOCOL I/O STATUS BITS
DTRAD:	.IF	DF,M$$MGE
	.BLKW	1			;RCV CHAR BUFFER RELOC BIAS
	.ENDC
DTRPT:	.BLKW	1			;RCV CHAR BUFFER POINTER
DTRCT:	.BLKW	1			;RCV CHARACTER COUNT
DTRQH:	.BLKW	1			;RCV CURRENT CCB
	.ENDC
DTFLG:	.BLKB	1			;DZ11 CHANNEL'S FLAGS
DTSLN:	.BLKB	1			;SYSTEM LINE NUMBER
DTTLS:	.DVCHA				;LPR (LINE PARAM REG) INIT VALUE
DTLIN:	.BLKB	1			;SPACE FOR LINE NO (0-7)
					;USED ONLY BY START CODE TO INIT
					;3 LSB IN LINE CHA. WORDS
	.EVEN
DTTLN==	.				;LEN OF TABLE ENTRY
	.PSECT
.ENDM	DZTDF$
	.MACRO	D1$	LB,D
 
	; L - LABEL
	; D - DISPLAY END
 
	.BYTE	1.,1		; OPCODE, COUNT
	.BYTE	D		; LINE AT WHICH DISPLAY AREA ENDS
 
	.ENDM
	.MACRO	D2F$	ROW,COL,LEN,VA,IC,FA
 
	;  FIELD DEFINATIONS
 
	.BYTE	ROW,COL,LEN
	.IF	B,VA
	.BYTE	V.N		; DEFAULT TO NORMAL VIDEO
	.IFF
	.BYTE	VA
	.ENDC
	.IF	B,IC
	.BYTE	I.S		; DEFAULT TO SPACES
	.IFF
	.BYTE	IC
	.ENDC
	.BYTE	FA & 377	; 1ST BYTE
				; LOW BYTE - DATA TYPE, EMPTY-FULL BITS
	.BYTE	FA/400 & 377	; 2ND BYTE
				; HIGH BYTE - RJ, MODIFIER BITS
 
	.ENDM
	.MACRO	D2H$	LB
 
	; SET OPCODE, RESERVE BYTE FOR COUNT
 
	.BYTE	2		; OPCODE
	.BYTE	LB'C & 177 ! 200 ; 1ST BYTE OF BYTE COUNT
	.BYTE	LB'C / 200	 ; 2ND BYTE
LB:				; LABEL USED TO COMPUTE COUNT
 
	.ENDM
	.MACRO	D2T$	LB
 
	; COMPUTE COUNT AND LENGTH
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	D2$	LB,R,COL,LEN,V,IC,F
 
	; *** THIS MACRO USED FOR DEFINE ONE AND ONLY ONE FIELD ***
	;      FOR MULTIPLE FIELDS USE D2H$, D2F$, D2T$
 
	; LB - LABEL
	; FIELD DEFINITIONS
	;     <ROW>
	;     <COLUMN>
	;     <LENGTH>
	;     <VIDEO ATTRIBUTES>
	;     <INITIALIZATION CHAR>
	;     <FIELD ATTRIBUTES>
 
	.BYTE	2.		; OPCODE
	.BYTE	LB'C		; COUNT
LB:	.BYTE	R,COL,LEN	; ROW, COLUMN, LENGHT
	.BYTE	V 		; VIDEO ATTRIBUTES
	.BYTE	IC		; INIT CHAR
	.BYTE	F & 377		; 1ST BYTE
				; LOW BYTE - CONTAINS DATA TYPE, EMPTY-FULL BITS
	.BYTE	F/400&377	; 2ND BYTE OF ATTRIBUTES
				; HIGH BYTE - CONTAINS RJ, MODIFIER BITS
 
	LB'C=	.-LB
     
	.ENDM
	.MACRO	D3F$	ROW,COL,LEN,VA
 
	; SET FIELD DEFINATIONS
 
	.BYTE	ROW,COL,LEN
	.IF	B,VA
	.BYTE	V.N			; DEFAULT
	.IFF
	.BYTE	VA
	.ENDC
 
	.ENDM
	.MACRO	D3H$	LB
 
	; SET OPCODE, RESERVE BYTE FOR COUNT
 
	.BYTE	3		; OPCODE
	.BYTE	LB'C&177!200	;COUNT LOW BYTE
	.BYTE	LB'C/200	;HIGH BYTE
LB:				; LABEL USED TO COMPUTE COUNT
 
	.ENDM
	.MACRO	D3T$	LB
 
	; COMPUTE COUNT
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	D3$	LB,ROW,COL,LEN,VA
 
	; *** THIS MACRO USED FOR DEFINING ONE AND ONLY ONE FIELD ***
	;	FOR MULTIPLE FIELDS USE D3H$, D3F$, D3T$
 
 
	; LB - LABEL
	; VA - VIDEO ATTRIBUTES
 
 
	.BYTE	3		; OP CODE
	.BYTE	LB'C		; COUNT
LB:	.BYTE	ROW, COL, LEN
	.BYTE	VA
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	D4$	LB,MSG,VA,STRING
 
	; LB - LABEL
	; MSG - MESSAGE NUMBER (1-32)
 
	.BYTE	4		; OP CODE
	.BYTE	LB'C		; COUNT
LB:	.BYTE	MSG
	.IF	B,VA
	.BYTE	V.N			; DEFAULT
	.IFF
	.BYTE	VA
	.ENDC
	.ASCII	STRING
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	ELSE
	$$ELSE
$$TRNM=11
	.ENDM
	.MACRO	EMBDF$,L,B
EC.INI='B'40
EC.DVC='B'1
EC.DTO='B'140
EC.NSI='B'141
EC.LOA='B'4
EC.UNL='B'10
	.ASECT
.=0
E.SIZE:'L' .BLKW 1
E.CODE:'L' .BLKB 1
	 .BLKB 1
E.TIME:'L' .BLKB 6
E.SEQ:'L'.BLKW 1
E.ABM:'L'.BLKW 1
.=E.ABM+2
E.VCTR:'L' .BLKB 1
E.LOST:'L' .BLKB 1
E.OPS:'L'.BLKW 1
E.OPC:'L'  .BLKW 1
.=E.ABM+2
E.RTRY:'L' .BLKB 2
	 .BLKB 1
E.IOC:'L'.BLKB 1
E.TASK:'L' .BLKW 2
E.PAR:'L'.BLKW 1
E.UIC:'L'.BLKW 1
E.UCB:'L'.BLKW 1
E.FCN:'L'.BLKB 2
E.PRM:'L'.BLKW 1
	 .BLKW 6
E.RCNT:'L' .BLKB 1
	 .BLKB 1
E.REGS='B'.
E.LGTH='B'.
.=E.TIME+<9.*2>
E.WHY:'L'.BLKW	1
.=.+2
E.NAME:'L'.BLKW	1
	.PSECT
	.MACRO	EMBDF$	X,Y
	.ENDM
	.ENDM
	.MACRO	EMSG$	NUMBER,REG
	.IF NB	REG
	MOV	#$ERR'NUMBER',REG
	CALL	@(REG)+
	.IFF
	MOV	#$ERR'NUMBER',R0
	CALL	@(R0)+
	.ENDC
	.ENDM	EMSG$
	.MACRO	EMSG$R	NUMBER,REG
	.IF NB	REG
	MOV	#$ERR'NUMBER',REG
	JMP	@(REG)+
	.IFF
	MOV	#$ERR'NUMBER',R0
	JMP	@(R0)+
	.ENDC
	.ENDM	EMSG$R
	.MACRO	ENABL$
 
	.IF DF	L$$SI1
 
	MTPS	(SP)+		;;; RESTORE PREVIOUS PRIORITY
 
	.IFF
 
	MOVB	(SP)+,@#PS	;;; RESTORE PREVIOUS PRIORITY
 
	.ENDC
 
	.ENDM
	.MACRO  ENDCASE
	$$POP	$$CSTA
	.IF NE $$TRNM-11
	  $$LAB	  \$$STNM,10
	.ENDC
	ENDIF
	.ENDM
	.MACRO	ENDIF
	$$LAB	\$$STNM,\$$TRNM-1
	$$POP	$$TRNM
	$$POP	$$STNM
	.ENDM
	.MACRO	ENDPROC
	.IF	EQ $$SUB
	$$GEN1	,RTS,PC
	.ENDC
	.ENDM
	.MACRO	ENDSYSTATE
	.IF	DF,R$$11D!I$$AS
	  .ENB0
	.ENDC
	.IF	NDF,R$$11M
	  MOV     (SP)+,R5
	  MOV     (SP)+,R4
	  MOV     (SP)+,R3
	  MOV     (SP)+,R2
	  MOV     (SP)+,R1
	  MOV     (SP)+,R0
	.IFF
	  $$GEN1	,RTS,PC
	  $$LAB	\$$STNM,10
	  ENDIF
	.ENDC
	.ENDM
	.MACRO	ENDWHILE
	$$BGNN	R,\$$STNM,10
	ENDIF
	.ENDM
	.MACRO END$DF
	SLTTOT=SLN+1
	PDVTOT=PDN+1
	.ENDM	END$DF
	.MACRO	ERBLK$	AA,BB
	.BYTE	0		; TERMINATE STRING
	$$=-1			; FORCE NEW ADDRESS TO BE SAVED IN ERMSG$
	.EVEN
	$$$$=.
	.IF NB AA
AA':
	.ENDC
	.WORD	$$$		; ADDRESS OF INPUT ASCIZ STRING
	.IF NB <BB>
	.IRP	CC,<BB>
	.WORD	CC
	.ENDR
	.ENDC
	.ENDM	ERBLK$
	.MACRO	ERMSG$	AA
	.IF NDF $$
	$$=-1
	.ENDC
	.IIF EQ,$$+1, $$$=.
	$$=+1
	.ASCII	^AA^
	.ENDM	ERMSG$
	.MACRO	ERRPT$	AA,BB,CC
	.IF B AA
	MOV	#$$$$,R2	; ADDRESS ARGUMENT BLOCK
	.IFF
	MOV	#'AA,R2		; ADDRESS OF ARGUMENT BLOCK
	.ENDC
	.IF NB BB
	.IF NB CC
	MOV	#'CC,R1		; PASS OPTIONAL WORD
	.ENDC
	CALL	BB		; CALL USER SUBROUTINE
	.IFF
	.ERROR	ERRPT$ MACRO MUST BE SUPPLIED WITH USER SUBROUTINE
	.ENDC
	.ENDM	ERRPT$
.MACRO	EVDF
SIDLEN	= 16.
NODLEN	= 6.
.ASECT
.=0
CMLKNM:	.BLKW	1
MESBUF:	.BLKW	1
MEMLEN:	.BLKW	2
ORIGCB:	.BLKW	1
EXTCB:	.BLKW	1
STATE:	.BLKB	1
FLAGS:	.BLKB	1
LINE:	.BLKB	4
MODE:	.BLKB	1
BOODEV:	.BLKB	1
REQPRO:	.BLKB	1
SOFTID:	.BLKB	SIDLEN+1
REQTYP:	.BLKB	1
ERRFUN:	.BLKB	1
ERRCOD:	.BLKB	1
CTXTLN	= .
.PSECT
LOGPRO	= 1.
LINPRO	= 2.
LNKPRO	= 3.
FINISH	= 4.
LINSWI	= 001
FINMES	= 002
OPTSPE	= 004
TRAPEN	= 010
RECPEN	= 020
MAINT	= 0.
LOAD	= 1.
DUMP	= 2.
.MACRO	EVDF
.ENDM
.ENDM
	.MACRO EXPALL NAM,CNT,UNT,SLN,DLCLST
	EXPFLG	\S'SLN'SF,NAM,\S'SLN'CN,\SLN ; EXPAND FLAG LINE
	.RADIX 10
	EXPDDM \PD$'NAM,NAM
	.RADIX 8
;
;	SPECIAL CASE OF DDM=DLC ( SUCH AS DMC )
;
	.IF EQ S'SLN'DD-S'SLN'DL
	.RADIX 10
	EXPDLC \PD$'NAM,NAM
	.RADIX 8
	EXPWRD NAM,NAM,\S'SLN'CN,\S'SLN'UN
	.IFF
;
;	NORMAL DLC PROCESSES
;
	.IRP NAMDL,<DLCLST>
	.IF EQ NAMDL-S'SLN'DL
	.RADIX 10
	EXPDLC \PD$'NAMDL,NAMDL
	.RADIX 8
	EXPWRD NAM,NAMDL,\S'SLN'CN,\S'SLN'UN
	.MEXIT
	.ENDC
	.ENDM
	.ENDC
	.ENDM	EXPALL
	.MACRO EXPATS	AT,PD,ST,SL
	ATLL'AT=PD	; CHANNEL AT LLC PDI
	ATSL'AT=SL	; CHANNEL AT SLN
	ATST'AT=ST	; CHANNEL AT STATION NUMBER
	.ENDM EXPATS
	.MACRO EXPATT AT,NAM
	EXPATU	\ATLL'AT,\ATSL'AT,\ATST'AT,NAM,\AT
	.ENDM EXPATT
	.MACRO EXPATU LL,SL,ST,NAM,AT
	.IF LE AT-ATS		; IF NOT INTO EXENDED TABLE SPACE
	.IF EQ LL-PD$'NAM	; AND THIS CHANNEL BELONGS TO THIS LLC
	.LIST
	.BYTE	SL,ST		; (A) ;	CHANNEL AT': SLN'SL,STATION ST
	.NLIST
	.IFF			; IF IT BELONGS TO SOME OTHER LLC
	.LIST
	.BYTE	0,200		; (A) ;	CHANNEL AT': NOT ASSIGNED TO THIS LLC
	.NLIST
	.ENDC
	.IFF			; IF INTO EXTENDED SPACE
	.LIST
	.BYTE	0,200		; (A) ;	CHANNEL AT': UNASSIGNED CHANNEL
	.NLIST
	.ENDC
	.ENDM EXPATU
	.MACRO EXPBFT
	.LIST
;
;		COMMUNICATION SYSTEM COMMON DATA BASE
;			( ORDERING IMPACTS VNP )
;
;
;
;
;
	.NLIST
 
	.RADIX 10
	EXPTAB	\SLTTOT,\PDVTOT
	EXPBUF	\CCB.NB,\CCB.SZ,\RDB.NB,\RDB.SZ,\SDB.NB,\SDB.SZ,\TR,\XM
	.RADIX 8
	.LIST
$CMPDV::.WORD	0		; (R) ; PDV INDEX OF CURRENT DISPATCHED PROCESS
	.IF DF R$$11D!I$$AS
$PRQUE::.WORD	0		; (R) ; QUEUE LISTHEAD
	.WORD	.-2		; (R) ; POINTER TO LAST CCB IN QUEUE
	.ENDC
	.IF DF R$$11M!X$$MCB
$CMFRK::.WORD	$SQSRV		; (R) ;	INITIAL LINK MARKS FORK BLOCK FREE
	.WORD	$SQSRV		; (R) ;	ADDRESS OF FORK PROCESS
	.WORD	0		; (R) ;	FORK PROCESS QUEUE
	.WORD	.-2		; (R) ;	 IS INITIALLY EMPTY
	.ENDC
$CCBLH::.WORD	0		; (D) ; POINTER TO FIRST FREE CCB
$SDBLH::.WORD	0		; (D) ; POINTER TO FIRST FREE SMALL DATA BUFFER
	.WORD	0		; (D) ; SECOND HALF OF ADDRESS DOUBLEWORD
$RDBLH::.WORD	0		; (D) ; POINTER TO FIRST FREE RECEIVE BUFFER
$RDQSL::.WORD	0		; (R) ; SYSTEM LINE NUMBER TO CHECK ON NEXT BUFFER RETURN
$RDQCT::.WORD	0		; (R) ; NUMBER OF BUFFER WAIT REQUESTS AND FLAG
$NTLPT::.WORD	0		; (D) ; NTL POINTER TO IMPURE AREA IN NTPOOL
	.IF DF R$$11D!I$$AS
$EVFLG::.WORD	0		; (D) ; POINTER TO FIRST 16 LOCAL EVENT FLAGS
	.ENDC
	.IF NDF M$$MGE
	.WORD	77		; (A) ;	GLITCH FOR ALLOCATION ROUTINES
$QBIAS::.WORD	0		; (R) ; START OF COMMUNICATION BUFFER POOL
	.WORD	0		; (R) ;	SECOND WORD OF $QBIAS LISTHEAD
$PUMA::	.WORD	0		; (R) ; FREE WORD ON UNMAPPED SYSTEMS
	.IFF
$NBIAS::.WORD	0		; (R) ; POINTER TO NON-UMR MAPPED PORTION OF POOL
$QBIAS::.WORD	0		; (R) ; POINTER TO UMR-MAPPED PORTION OF POOL
$QSTRT::.WORD	0		; (R) ; ORIGINAL BIAS OF UMR-MAPPED PORTION OF POOL
$PUMR::	.WORD	0		; (D) ; STARTING UMR BIAS
	.ENDC
	.IF	DF,R$$11D!I$$AS
$XUMR::	.WORD	0		; (D) ; STARTING UMR BIAS OF SCOM AREA
$POOLB::.WORD	0		; (D) ; BASE ADDRESS OF NETWORK POOL
$POOLS::.WORD	0		; (D) ; SIZE OF NETWORK POOL
	.ENDC
	.NLIST
	.ENDM	EXPBFT
	.MACRO EXPBUF NCCB,SCCB,NRDB,SRDB,NSDB,SSDB,THRESH,XMIT
	.LIST
$CCBNM::.WORD	NCCB'.		; (D) ; # OF CCB'S ALLOCATED
$CCBSZ::.WORD	SCCB'.		; (A) ; # BYTES / CCB
$RDBNM::.WORD	NRDB'.		; (D) ; # OF RDB'S ALLOCATED
$RDBSZ::.WORD	SRDB'.		; (D) ; # BYTES / RDB
$SDBNM::.WORD	NSDB'.		; (D) ; # OF SDB'S ALLOCATED
$SDBSZ::.WORD	SSDB'.		; (D) ; # BYTES / SDB
$CCBCT::.WORD	NCCB'.		; (D) ; COUNTER OF CURRENT # OF CCBS IN POOL
$RDBCT::.WORD	NRDB'.		; (D) ; COUNTER OF CURRENT # OF RDBS IN POOL
$SDBCT::.WORD	NSDB'.		; (D) ; COUNTER OF CURRENT # OF SDBS IN POOL
$CCBAF::.WORD	0		; (D) ; COUNTER OF # OF CCB ALLOCATION FAILURES
$RDBAF::.WORD	0		; (D) ; COUNTER OF # OF RDB ALLOCATION FAILURES
$LDBAF::.WORD	0		; (D) ; COUNTER OF # OF LDB ALLOCATION FAILURES
$SDBAF::.WORD	0		; (D) ; COUNTER OF # OF SDB ALLOCATION FAILURES
$RDBTH::.WORD	THRESH'.		; (D) ; POOL THRESHOLD FOR LARGE DATA BUFFER ALLOCATON FAILURE
$XMTBF::.WORD	XMIT'.		; (D) ; # OF XMITS/LINK TO STACK
	.NLIST
	.ENDM	EXPBUF
	.MACRO EXPCHN NCHAN,NAM
	.LIST
	.BYTE	NCHAN'.		; (A) ; NUMBER OF CHANNELS ALLOCATED FOR NAM
	.NLIST
	.ENDM	EXPCHN
	.MACRO EXPDDM	DDMIND,NAM
	.LIST
	.BYTE	DDMIND'.	; (D) ; NAM OFFSET IN PDVTB::
	.NLIST
	.ENDM	EXPDDM
	.MACRO EXPDLC	DLCIND,NAM
	.LIST
	.BYTE	DLCIND'.	; (D) ; NAM OFFSET IN PDVTB::
	.NLIST
	.ENDM	EXPDLC
	.MACRO EXPFLG	FLG,NAM,NUM,SLNN
	.LIST
	.IF EQ SSL'SLNN
;   SLN'SLNN NAM'NUM
	.IFF
;   SLN'SLNN NAM'NUM  ***  MULTIDROP ***
	.ENDC
	.WORD	FLG	; (D) ; FLAG FOR NAM'NUM
	.NLIST
	.ENDM	EXPFLG
	.MACRO EXPLLL CHAN,PDI,SL,NAM,AT
 
	.IF LE SSL'SL-1
	.IF NDF X$$ATS
	.LIST
	.BYTE	CHAN,PDI		; (A) ; SLN'SL': CHANNEL CHAN-NAM
	.NLIST
	NAM'CHAN=SL		; GENERATE SYMBOL FOR LLC CHANNEL TABLE
	.IFF
	.LIST
	.BYTE	AT,PDI			; (A) ; SLN'SL': CHANNEL AT-NAM
	.NLIST
	ATLL'AT=PDI		; CHANNEL AT LLC PDI
	ATSL'AT=SL		; CHANNEL AT SLN
	ATST'AT=0		; CHANNEL AT STATION NUMBER
	ATS=ATS+1		; ONE MORE ATS CHANNEL ( GLOBAL TOTAL )
	.ENDC
	.IFF
	.LIST
	.WORD	<ST'SL-.>/2!100000	; (A) ;	SLN'SL: MULTIDROP
	.NLIST
	M'NAM'CHAN=SL		; GENERATE SYMBOL FOR LLC  MULTIDROP ENTRY
	NAM'CNT=NAM'CNT+SSL'SL-1	; # CHANNELS/LLC
	SSN'SL=CHAN			; STARTING CHANNEL # BY SLN
	.IF DF X$$ATS
	STA=0				; START WITH STATION ZERO
	SSN'SL=ATS			; STARTING CHANEL NUMBER / SLN
	.REPT	SSL'SL			; GENERATE SYMBOLS FOR EACH CHANNEL
	EXPATS	\ATS,\PDI,\STA,\SL	; GERNERATE SYMBOLS
	STA=STA+1
	ATS=ATS+1			; NUMBER ATS CHANNELS CONSECUTIVELY
	.ENDR
	.ENDC
	.ENDC
	.ENDM	EXPLLL
	.MACRO EXPLLN SLN,LST
	.IRP	NAM,<LST>
 
	.IF EQ	NAM-S'SLN'LL
	NAM'CNT=NAM'CNT+1		; INCREMENT REFERENCE COUNTER
	EXPLLL	\NAM'CNT,\PD$'NAM,\SLN,NAM,\ATS
	.MEXIT
	.ENDC
	.ENDR
	.ENDM	EXPLLN
	.MACRO EXPLLR SL,CHAN,STA
	.IF B STA
	.LIST
	.BYTE	0,200		; (A) ;	CHANNEL CHAN': UNASSIGNED
	.NLIST
	.IFF
	.LIST
	.BYTE	SL',STA 		; (A) ; CHANNEL CHAN': SLN'SL,STATION STA
	.NLIST
	.ENDC
	.ENDM	EXPLLR
	.MACRO EXPLLS SL,NAM,CHA
	.IF GE NAM'CNT-CHA
	.IF DF NAM'CHA
	STA=0
	EXPLLR	\NAM'CHA,\CHA,\STA
	.ENDC
	.IF DF M'NAM'CHA
	CHAN=CHA-1
	STA=-1
	.REPT SSL'SL
	STA=STA+1
	CHAN=CHAN+1
	EXPLLR SL,\CHAN,\STA
	.ENDR
	.ENDC
	.IFF
	STA=0
	EXPLLR	0,CHA
	.ENDC
	.ENDM	EXPLLS
	.MACRO EXPLLT	LST
	.PAGE
	.LIST
	.IF NE STATBL
;
;	SYSTEM LINE TABLE ( EXTENSION )
;
;	THIS TABLE IS INDEXED BY SYSTEM LINE NUMBER AND
;	   ASSOCIATES EACH SYSTEM LINE WITH AN:
;
;		1 - LLC PROCESS AND A CHANNEL NUMBER WITHIN THAT PROCESS
;	OR	2 - ADDRESS OF A STATION TABLE FOR A MULTIDROP LINE
 
	.IFF
;
;	SYSTEM LINE TABLE ( EXTENSION )
;
;	THIS TABLE IS INDEXED BY SYSTEM LINE NUMBER AND
;	   ASSOCIATES EACH SYSTEM LINE WITH AN LLC PROCESS
;	   AND A CHANNEL NUMBER WITHIN THAT PROCESS.
 
	.ENDC
$LLCTB::
	.NLIST
 
	SLN=-1
	ATS=0			; COUNT TOTAL NUMBER OF CHANNELS
	.REPT	SLTTOT
	SLN=SLN+1
	EXPLLN	\SLN,<LST>
	.ENDR
	ATS=ATS-1		; DECREMENT TO TRUE COUNT
	.ENDM	EXPLLT
	.MACRO	EXPNOD	ARG1,ARG2,ARG3,ARG4=1
	.NLIST	BEX
	.LIST
$NSPNM::.WORD	'ARG4'		; (X) ; LOCAL NODE NUMBER
$NTNAM::.ASCII	/'ARG1'/	; (D) ; LOCAL NODE NAME
$HOST::	.ASCII	/      /	; (D) ; HOST SYSTEM ID ( SET WITH VNP )
	.NLIST
	.NCHR	$$TMP,<ARG2>
	.LIST
$NODID::.WORD	$$TMP		; (D) ; LOCAL NODE IDENTIFICATION
	.ASCII	@'ARG2'@
	.NLIST
	.LIST	BEX
	.BLKB	32.-$$TMP
	.ENDM
	.MACRO EXPPDL	NAM,NUM,LDRFLG,XXX
	.IF EQ	LDRFLG&ZF.MFL	; DON'T LOAD PROCESS
	.LIST
.WORD	NAM'PDV	; NAM	  XXX	   NUM'.	   NO	; (A) ;
	.NLIST
	.IFF			; LOAD PROCESS
	.LIST
.WORD	NAM'PDV	; NAM	  XXX	   NUM'.	  YES	; (A) ;
	.NLIST
	.ENDC
 
	.ENDM	EXPPDL
	.MACRO EXPPDN	LST,XXX
 
	.IRP	NAM,<LST>
	PDN=PDN+1
	.RADIX 10
	EXPPDL	NAM,\PDN*2,NAM'FL,XXX
	.RADIX 8
	.ENDM
 
	.ENDM	EXPPDN
	.MACRO EXPPDT	LLCLST,DLCLST,DDMLST
	.LIST
 
;
;	PROCESS DESCRIPTOR ADDRESS TABLE
;
;	EACH ENTRY IS THE ADDRESS OF THE CORRESPONDING
;	PROCESS DESCRIPTOR VECTOR ( BELOW ).
;
;		PROCESS	PROCESS	PROCESS	PROCESS
;		 NAME	 LEVEL	 INDEX	  MFL
$PDVTB::
	.NLIST
 
	PDN=-1
	EXPPDN <LLCLST>,LLC
	EXPPDN <DLCLST>,DLC
	EXPPDN <DDMLST>,DDM
	.LIST
$PDVND::
	.NLIST
	.ENDM	EXPPDT
	.MACRO EXPPVL NAM,FLG,PRI,PDN,XXX
	.LIST
;
;	NAM - PROCESS DESCRIPTOR VECTOR # 'PDN'
	.IF DIF XXX,LLC
;		THIS IS A XXX PROCESS
	.IFF
;
;		THIS IS AN XXX PROCESS
	.ENDC
;
	.NLIST
	.LIST
NAM'PDV::
	.IF DF M$$MGE
	.WORD	0		; (I) ; RELOCATION BIAS
	.IFF
	.WORD	0		; (I) ; UNUSED WORD ON UNMAPPED SYSTEMS
	.ENDC
	.WORD	0		; (I) ; DISPATCH TABLE ADDRESS
	.IF DF X$$MCB
	.WORD	0		; (R) ; RESERVED WORD
	.ENDC
	.WORD	^C<PR'PRI'>&PR7 	; (D) ; PRIORITY PRI
	.RAD50	/'NAM'/		; (D) ; PROCESS NAME
	.IF DF NAM'CHN
	.IF NE NAM'CHN
	.IF NDF X$$ATS
	.NLIST
	.IIF GT,NAM'CNT-NAM'CHN, NAM'CHN=NAM'CNT
	.LIST
	.IFF
	.NLIST
	.IIF GT,ATS-NAM'CHN, NAM'CHN=ATS
	.LIST
	.ENDC
	.ENDC
	.IFT
	.IF NE NAM'CHN
	.NLIST
	.RADIX 10
	.IF NDF X$$ATS
	EXPCHN	\NAM'CHN+1,NAM	; NUMBER OF CHANNELS ( EXCLUDING CHANNEL 0 )
	.IFF
	EXPCHN	\NAM'CHN,NAM
	.ENDC
	.RADIX 8
	.LIST
	.IFF
	.BYTE	0		; (R) ; AVAILABLE BYTE
	.ENDC
	.IFF
	.BYTE	0		; (R) ; AVAILABLE BYTE
	.ENDC
	.BYTE	FLG		; (D) ; FLAG BYTE
	.IF DF R$$11M
	.WORD	0		; (I) ; LOADED PROCESS PCB POINTER
	.ENDC
	.IF DF R$$11D!I$$AS
	.WORD	0		; (I) ; GCD POINTER
	.ENDC
	.NLIST
	.IF DF NAM'CHN
	.LIST
	.WORD	0		; (I) ;	VIRTUAL ADDRESS OF LLC DATA BASE
	.NLIST
	.IF NE NAM'CHN
	.IF NDF X$$ATS
	.LIST
	.BYTE	0,300		; (A) ; CHANNEL 0: RESERVED FOR LOOPBACK
	.NLIST
	CHAN=0
	SLN=-1
	.REPT NAM'CHN
	SLN=SLN+1
	CHAN=CHAN+1
	EXPLLS	\SLN,NAM,\CHAN
	.IIF EQ,NAM'CHN-CHAN, .MEXIT	; EXIT NOW IF ENOUGH CHANNELS ARE ALLOCATED
	.ENDR
	.IFF
	AT=-1		; START WITH CHANNEL 0
	.REPT NAM'CHN
	AT=AT+1
	EXPATT	\AT,NAM
	.ENDR
	.ENDC
	.ENDC
	.ENDC
	.ENDM	EXPPVL
	.MACRO EXPPVN	LST,XXX
	.IRP	NAM,<LST>
	PDN=PDN+1
	EXPPVL	NAM,\NAM'FL,\NAM'PR,\PDN,XXX
	.ENDR
	.ENDM	EXPPVN
	.MACRO EXPPVT	LLCLST,DLCLST,DDMLST
	PDVDF$	,,LST		; LIST PDV OFFSETS AND FLAG VALUES
	.RADIX	8
	PDN=-1
	EXPPVN <LLCLST>,LLC
	EXPPVN <DLCLST>,DLC
	EXPPVN <DDMLST>,DDM
	.ENDM	EXPPVT
	.MACRO EXPSLN NAM,CNT,UNT,DLCLST
 
	.IF DF NAM'CNT'UNT
	SLN=SLN+1
	EXPALL NAM,\CNT,\UNT,\SLN,<DLCLST>
	.IFF
	EXITUN=1
	.ENDC
 
	.ENDM	EXPSLN
	.MACRO EXPSLT	DLCLST,DDMLST
	SLTDF$	,,LST		; LIST SLT OFFSETS AND FLAG WORD BIT VALUES
	.LIST
 
;
;	SYSTEM LINE TABLE
;
$SLTTB::
	.NLIST
	SLN=-1
	.IRP NAM,<DDMLST>
	CNT=-1
	.REPT 8.
	CNT=CNT+1
	EXITUN=0
	UNT=-1
	.REPT	48.
	UNT=UNT+1
	EXPSLN NAM,\CNT,\UNT,<DLCLST>
	.IIF EQ,EXITUN-1,	.MEXIT
	.ENDR
	.ENDR
	.ENDM
	.LIST
$SLTND::
	.NLIST
	.ENDM	EXPSLT
	.MACRO EXPSTA SL,CHAN,CHANN
	EXPSTS	\SL,\CHAN,\S'SL'C'CHANN
	.ENDM EXPSTA
	.MACRO EXPSTN SLN
	.IF GT SSL'SLN-1
	.LIST
ST'SLN:
	.NLIST
	CHANN=-1
	.REPT	SSL'SLN
	CHANN=CHANN+1
	EXPSTA	\SLN,\SSN'SLN,\CHANN
	SSN'SLN=SSN'SLN+1
	.ENDR
	.LIST
	.WORD	-1		; (D) ; END OF TABLE
	.NLIST
	.ENDC
	.ENDM EXPSTN
	.MACRO EXPSTS SL,CHAN,PDI
	.LIST
	.BYTE	CHAN,PDI		; (D) ;	SLN'SL: CHANNEL,LLC
	.NLIST
	.ENDM EXPSTS
	.MACRO EXPSTT
	.LIST
	.IF NE STATBL
;
;	STATION TABLE ORDERED BY SYSTEM LINE NUMBER
;		( INDEXED THROUGH $LLCTB )
;
	.IFF
;
;	NO STATIONS IN THIS CONFIGURATION
;
	.ENDC
	.NLIST
	SLN=-1
	.REPT	SLTTOT
	SLN=SLN+1
	EXPSTN	\SLN
	.ENDR
	.ENDM	EXPSTT
	.MACRO EXPTAB	SLTN,PDVN
 
	.LIST
$PDVTA::.WORD	$PDVTB		; (A) ; ADDRESS OF PDV ADDRESS TABLE
$SLTTA::.WORD	$SLTTB		; (A) ; ADDRESS OF SYSTEM LINE TABLE
$LLCTA::.WORD	$LLCTB		; (A) ; ADDRESSS OF LLC REVERSE MAPPING TABLE
$PDVNM::.WORD	PDVN'.		; (A) ; NUMBER OF PDV ENTRIES
$SLTNM::.WORD	SLTN'.		; (A) ; NUMBER OF SYSTEM LINES
	.NLIST
	.ENDM	EXPTAB
	.MACRO EXPWRD NAMPL,NAMDL,CNTN,UNTN
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; F - FIELD NUMBER  (ONLY 1 ACCEPTED)
	; STRING - TEXT TO BE WRITTEN IN FIELD
 
	.ENABL	LSB
 
	.BYTE	20.		; OPCODE
	.BYTE	LB'C		; COUNT
LB:	.BYTE	F		; FIELD NUMBER
	.BYTE	LB'C-2		; SIZE OF TEXT
	.ASCII	STRNG
 
	LB'C=	.-LB
 
	.DSABL	LSB
 
	.ENDM
	.MACRO	F3$	LB,STRING
 
	.BYTE	21.		; OPCODE
	.BYTE	LB'C		; COUNT
LB:	.ASCII	STRING
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	F4$	LB,FIELDS
 
	; IF MORE THAN 1 FIELD IS USED, THEY MUST BE ENCLOSED IN <>'S
 
	.BYTE	22.		; OPCODE
	.BYTE	LB'C		; COUNT
LB:	.BYTE	FIELDS
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	F5$	LB,FIELDS
 
	; IF MORE THAN 1 FIELD IS USED, THEY MUST BE ENCLOSED IN <>'S
 
	.BYTE	23.		; OPCODE
	.BYTE	LB'C		; COUNT
LB:	.BYTE	FIELDS
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	F6$	LB,A,F
 
	; LB - LABEL
	; A - AREA
	; F - FIELD
 
	.BYTE	24.,2		; OPCODE, COUNT
	.BYTE	A		; AREA
	.BYTE	F		; FIELD NUMBER
 
	.ENDM
.MACRO	GCDF
IS$INZ	= 1.
IS$INP 	= 2.
IS$SEL	= 3.
IS$ABO	= 4.
IS$FIN	= 5.
.MACRO	GCDF
.ENDM
.ENDM
	.MACRO GCLDF$	AA,AF,BB,CC,DD,EE,FF,GG,HH
 
 
; MACRO CALLS
 
	.IF NB AA		; ASSEMBLE FOR ROOT SECTION ONLY
 
	.IF NB AF
	EF=AF			; USE SPECIFIED EVENT FLAG
	.IFF
	EF=AA			; OR DEFAULT TO LUN
	.ENDC
 
	.PSECT	$$$GCL		; NAME PSECT ( GENERATE DATA OUT OF LINE )
 
	.MCALL	GMCR$,WTSE$,QIO$,ALUN$,FDBDF$,FDOP$A,FDRC$A,NMBLK$,CSI$,SETF$
	.GLOBL G.MCRB,Q.IOAE,Q.IOFN,Q.IOPL,Q.IOSB
 
$CLMCR::GMCR$			; GET MCR COMMAND LINE DPB
$CLQIO::QIO$	0,AA,EF,,$CLMCR+G.MCRB+72.,,<0,0> ; QIO DPB
$CLWEF::WTSE$	EF		; WAIT FOR FLAG DPB ( I/O COMPLETION )
$CLSEF::SETF$	EF		; SET FLAG DPB ( AFTER GET$ )
$CLASN::ALUN$	AA,TI,0		; REASSIGN LUN DPB
$CLAST::.WORD	0		; AST SERVICE ROUTINE POINTER
$PSHPT::.WORD	$CLMCR+G.MCRB	; POINTER TO TOP OF STACK OF FILES
$CLEVL::.BYTE	0		; START AT TI:/MCR LEVEL
	.BYTE	0		; FLAG FOR QUEUED FILES
$ASTLV::.BYTE	0		; AST LEVEL ( 0 = NO ASTS PENDING )
	.EVEN
	CSI$			; DEFINE C.SIZE
$CLCSI::.BLKB	C.SIZE		; CSI CONTROL BLOCK
$CLFDB::FDBDF$			; INPUT FILE FDB
	FDOP$A	AA,$CLCSI+C.DSDS,DFLTNB ; ASSIGN LUN
DFLTNB:	NMBLK$	BB,CMD,,SY,0	; DEFAULT VALUES
	.IF NB CC
	.IF NB DD
	FDRC$A	,CC,DD-1	; USER SPECIFIED BUFFER AND SIZE
	.IFF
	.ERROR	IF USER SPECIFIES BUFFER, THEN SIZE MUST ALSO BE SPEC'ED
	.ENDC
	.IFF
	.IF NB DD
	FDRC$A	,BUFFER,DD-1	; USER SPECIFIED SIZE OF INTERNAL BUFFER
	.IFF
	FDRC$A	,BUFFER,80.	; DEFAULT BUFFER AND SIZE
	.ENDC
	.ENDC
$CLBUF	==$CLFDB+F.URBD+2	; POINTER TO DATA BUFFER
$CLSIZ	==$CLFDB+F.URBD		; BUFFER SIZE IN BYTES
$CLIOS	==$CLQIO+Q.IOSB		; GCL I/O STATUS BLOCK ( IOS/LENGTH )
	DEFFLG=CL.CMT!CL.IND!CL.EXT!CL.ATT!CL.LCC ; DEFAULT FLAG VLAUES
	.IF NB EE
	.IF NB FF
$CLFLG::.WORD	DEFFLG!EE&^C<FF>; USER DEFINED OPTIONS
	.IFF
$CLFLG::.WORD	DEFFLG!EE	; USE DESIRED EXTRAS
	.ENDC
	.IFF
	.IF NB FF
$CLFLG::.WORD	DEFFLG&^C<FF>	; USER DOESN'T WANT THESE OPTIONS
	.IFF
$CLFLG::.WORD	DEFFLG		; DEFAULT ALL THE WAY
	.ENDC
	.ENDC
	.IF NB BB
$CLPMT::.WORD	$CLPRM		; POINTER TO USER SPECIFIED DEFAULT PROMPT
	.IFF
$CLPMT::.WORD	0		; POINTER TO PROMPT STRING
	.ENDC
	.IF NB GG
$CLSRV::.WORD	GG		; AST SERVICE SUBROUTINE
	.IFF
$CLSRV::.WORD	$CLRTN		; POINT AT A FAKE AST SERVICE ROUTINE
	.ENDC
	.IF B CC
	.IF B DD
BUFFER:	.BLKB	80.		; INTERNALLY GENERATED BUFFER
	BUFLEN=79.
	.IFF
BUFFER:	.BLKB	DD		; USER SPECIFIED BUFFER SIZE
	BUFLEN=.-BUFFER-1
	.ENDC
	.ENDC
	.EVEN
	.IF NB BB
$CLPRM:	.BYTE	12,15		; LINE FEED, CARRIAGE RETURN
	.ASCII	"BB"		; USER DEFINED DEFAULT PROMPT STRING
	.ASCIZ	">"
	DFTLEN=.-$CLPRM
	.ENDC
	.EVEN
 
	.PSECT	HH		; BACK TO USER PSECT
 
	.ENDC			; END OF ROOT SEGMENT DATA
 
	.MCALL	DIR$,GCL$	; ALWAYS .MCALL THESE
 
; FLAG WORD BIT DEFINITIONS ( COMMAND LINE RETURNED W/O MODS UNLESS
;		A MODIFIER BIT IS SET )
 
CL.CMT=1	; ENABLE COMMENT LINES
CL.IND=2	; ENABLE INDIRECTION INDICATOR "@"
CL.RNE=4	; READ WITHOUT ECHOING
CL.EXT=10	; ENABLE EXTENDED COMMAND LINE SUPPORT
CL.LCC=20	; CONVERT TO UPPER CASE
CL.EIF=40	; ECHO INDIRECT PROMPTS AND RESPONSES (IF CL.RNE CLEAR)
CL.OPN=100	; LEAVE INDIRECT FILES OPEN
CL.ATT=200	; ATTACH TI: WHENEVER POSSIBLE USING LUN ASSIGNED TO GCL
 
CL.AST=4000	; ENABLE ASYCHRONOUS COMPLETION
CL.CAS=20000	; INTERNAL STATE ( MULTIPLE ASTS IN PROGRESS )
CL.EXN=40000	; INTERNAL STATE ( EXTENDED COMMAND LINE MODE )
CL.XIT=100000	; INTERNAL STATE ( EXIT NEXT TIME WE GET TO LEVEL 0 )
 
	.ENDM	GCLDF$
	.MACRO GCL$ AA,BB,CC,DD
	.IF NB AA
	MOV	AA,$CLPMT	; USER SPECIFIED NEW PROMPT STRING
	.ENDC
	.IF NB BB
	MOV	BB,$CLBUF	; USER SPECIFIED DESTINATION
	.IF B CC
	.ERROR GCL$ MACRO "BUFFER SIZE" ARGUMENT MUST BE INCLUDED
	.IFF
	MOV	CC,$CLSIZ	; SIZE OF USER SPECIFIED BUFFER
	.ENDC
	.ENDC
	.IF NB DD
	MOV	DD,$CLIOS
	.ENDC
	CALL	$GCLEP			; CALL SUBROUTINE
	.ENDM GCL$
.MACRO	GCMDF
.MCALL	CONFIG
.PSECT	GCDAT,RW,D,GBL,REL,OVR
MODULE	= 0.
STATE	= 2.
CONFIG
CBADDR:	.WORD	0
CMDSOR: .WORD	0
WINDUP: .WORD	0
CTEXT:
NCLKIX	= .-CTEXT
.IF	NE FS$NET
	.WORD	CTNTCM
.ENDC
INCMIX	= .-CTEXT
.IF	NE FS$INT
	.WORD	CTINCM
.ENDC
CTEXTE	= .-CTEXT
.IF	NE FS$INT
CTINCM:	.WORD	GCINCM
ISTATE:	.WORD	0
IBUFAD: .WORD	0
IBUFLN: .WORD	300.
ICMDNM: .WORD	1.
.ENDC
.IF	NE FS$NET
CTNTCM: .WORD	GCNTCM
NSTATE:	.WORD	0
.ENDC
.PSECT
.ENDM
	.MACRO	GETAD ADDR,SIZE,BLOCK
	.MCALL RAND
	.IF NB	BLOCK
	MOV	BLOCK,$RBLCK
	.ENDC
	RAND	$GETAD,ADDR,SIZE
	.ENDM
	.MACRO	GETRC ADDR,SIZE
	.MCALL	RAND
	RAND	$GETRC,ADDR,SIZE
	.ENDM
	.MACRO	GETRV ADDR,SIZE
	.MCALL RAND
	RAND	$GETRV,ADDR,SIZE
	.ENDM
	.MACRO	GLNW$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	.IF B	<LUN>
	QDPB$	3,16670,<.MBXLU>,EFN,,IOST,AST,<PRMLST>
	.IFF
	QDPB$	3,16670,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDC
	.ENDM	GLNW$
	.MACRO	GLNW$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,3,#16670,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	GLNW$E
	.MACRO	GLNW$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	.IF B	<LUN>
	QDPB$S	3,#16670,<#.MBXLU>,EFN,,IOST,AST,<PRMLST>
	.IFF
	QDPB$S	3,#16670,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDC
	.ENDM	GLNW$S
	.MACRO	GLN$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	.IF B	<LUN>
	QDPB$	1,16670,<.MBXLU>,EFN,,IOST,AST,<PRMLST>
	.IFF
	QDPB$	1,16670,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDC
	.ENDM	GLN$
	.MACRO	GLN$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,1,#16670,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	GLN$E
	.MACRO	GLN$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	.IF B	<LUN>
	QDPB$S	1,#16670,<#.MBXLU>,EFN,,IOST,AST,<PRMLST>
	.IFF
	QD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	1
H.LUN:'L'.BLKW	2
.=0
W.BPCB:'L'.BLKW	1
W.BLVR:'L'.BLKW	1
W.BHVR:'L'.BLKW	1
W.BATT:'L'.BLKW	1
W.BSIZ:'L'.BLKW	1
W.BOFF:'L'.BLKW	1
W.BFPD:'L'.BLKB	1
W.BNPD:'L'.BLKB	1
W.BLPD:'L'.BLKW	1
W.BLGH:'L'
	.PSECT
	.MACRO	HDRDF$	X,Y
	.ENDM
	.ENDM
	.MACRO	HLDDF$
	.ASECT
	.=0
	.BLKW	1		; LINK WORD
H$OVR:	.BLKW	1		; OVERLAY ENTRY POINT ADDRESS
H$ERX:	.BLKB	1		; ERROR INDEX
H$ERC:	.BLKB	1		; ERROR CODE
H$NODE:	.BLKW	3		; NODE NAME IN ASCII
				; CONNECT PARAMETERS
H$TASK:	.BLKW	2		; TASK NAME
  EB$LEN = .+2
H$PBAS:	.BLKW	1		; PARTITION BASE ADDRESS (0=MAPPED)
H$PSIZ:	.BLKW	1		; PARTITION SIZE (BLOCKS MAPPED, BYTES UNMAPPED)
H$GP:	.BLKB	1		; SLD2 G/P SUPPORT (0=NO)
H$TYP:	.BLKB	1		; TRANSFER TYPE (0=LOAD, 1=CKP READ, 2=CKP)
				; WORD FIELDS
H$ACSB:	.BLKW	2		; CONNECT ACCEPT IOSB
H$DISK:	.BLKW	1		; DISK BLOCKS REMAINING TO BE TRANSFERRED
H$LBN:	.BLKW	2		; LOGICAL BLOCK NUMBER
H$LUN:	.BLKW	1		; FIRST LUN BLOCK LBN
H$MBX:	.BLKW	1		; COPY OF FIRST WORD OF MAILBOX
H$NET:	.BLKW	1		; NETWORK BLOCKS REMAINING TO BE TRANSFERRED
H$STAT:	.BLKW	1		; STATUS
  HS$ACC = 1		; CONNECTION HAS BEEN ACCEPTED
  HS$DIO = 2		; DISK I/O'S STILL PENDING
  HS$DR1 = 4		; FIRST DISK READ HAS BEEN DONE
  HS$DSC = 10		; LINK HAS BEEN DISCONNECTED
  HS$ERR = 20		; ERROR OF SOME SORT HAS OCCURRED
  HS$FIL = 40		; "HTASK$" CAME FROM MAPPING FILE, NOT TASK
  HS$GP  = 100		; "HTASK$" CAME FROM GENERAL-PURPOSE LIST
  HS$LB1 = 200		; DISK LUN BLOCK 1 TRANSFER STILL PENDING
  HS$LB2 = 400		; DISK LUN BLOCK 2 TRANSFER STILL PENDING
  HS$LFX = 1000		; LUN FIXING NEEDED
  HS$NIO = 2000		; NETWORK I/O'S STILL PENDING
  HS$NL1 = 4000		; NETWORK LUN BLOCK 1 TRANSFER STILL PENDING
  HS$NL2 = 10000	; NETWORK LUN BLOCK 2 TRANSFER STILL PENDING
  HS$TRM = 20000	; LINK HAS BEEN TERMINATED
    HS$ACT = HS$DIO ! HS$LB1 ! HS$LB2 ! HS$NIO ! HS$NL1 ! HS$NL2
				; BYTE FIELDS
H$DLU:	.BLKB	1		; DISK LUN NUMBER
H$IOC:	.BLKB	1		; ACTIVE I/O COUNT
H$NBF:	.BLKB	1		; BUFFERING LEVEL
H$NLU:	.BLKB	1		; NETWORK LUN NUMBER
	.EVEN
H$EMB:	.BLKB	EB$LEN		; ERROR MESSAGE BLOCK
H$LEN:	.BLKW	1		; CONTROL BLOCK ADDRESS (LENGTH OF FIXED PART)
H$BUF:	.BLKW	1		; BUFFER ADDRESS
H$IOSB:	.BLKW	2		; IOSB
	.PSECT
	.ENDM	HLDDF$
	.MACRO	HLDTB$	TYPE
	.MCALL	HNODE$,HTASK$
	.MACRO	LABEL$	A,B
A'B:
	.ENDM	LABEL$
	.MACRO	THRED$	A,B
	.IF DF	A'B
	.WORD	A'B
	.IFF
	.WORD	0
	.ENDC
	.ENDM	THRED$
.NODES=0
.TASKS=0
.IIF NDF,.GPTSK, .GPTSK=0
	.IF NB	TYPE
	.IF IDN	TYPE,<TASK>
	.PSECT	.HTSK
$HTSK::	CLR	R4
	JMP	$FFS
	.IFF
	.ERROR			; ILLEGAL ARGUMENT
	.ENDC
	.ENDC
	.PSECT	.HTAB
.HLDTB::.RAD50	"HLD"
	.WORD	.GPTSK
	THRED$	ND,\.NODES
	.ENDM	HLDTB$
	.MACRO	HNODE$	NODNAM
	LABEL$	ND,\.NODES
.NODES=.NODES+1
.TASKS=.TASKS+1
	THRED$	ND,\.NODES
	THRED$	TK,\.TASKS
	.ASCII	"NODNAM"
	.NCHR	.SIZE,NODNAM
	.IF GT	.SIZE-6
	.ERROR			; NODE NAME TOO LONG
	.ENDC
	.REPT	6-.SIZE
	.ASCII	" "
	.ENDR
	.ENDM	HNODE$
.MACRO	HOSDF
ENTLEN	= 11.
TABBEG	= 7.
.ENDM
.MACRO	HOSMAC
.MCALL	CONFIG
CONFIG
NODLEN	= 6.
.MACRO	HOSBEG DEFHOS
HOSDB::
NODENT	DEFHOS
.ENDM
.MACRO	HOSEND
.REPT	F$EXHO
  HOSENT
.ENDR
HOSDBE::
.EVEN
.ENDM
.MACRO	HOSENT DEVICE,CONT,LINE,STAT,HOST
.IF     NB DEVICE
  .BYTE   DEVICE,CONT,LINE,STAT
  NODENT  <HOST>
.IFF
  .BYTE   -1,0,0,0
  NODENT
.ENDC
.ENDM
.MACRO	NODENT NAME
.NCHR   $$TEMP,<NAME>
.BYTE   $$TEMP
.ASCII  /'NAME'/
$$TEMP  = NODLEN-$$TEMP
.IF     LT $$TEMP
  .ERROR
.IFF
  .REPT   $$TEMP
    .BYTE   0
  .ENDR
.ENDC
.ENDM
.ENDM
	.MACRO	HTASK$	TSKNAM,FILNAM,TYPE
	.IIF EQ,.NODES, .GPTSK=.GPTSK+1
	LABEL$	TK,\.TASKS
.TASKS=.TASKS+1
	THRED$	TK,\.TASKS
	.RAD50	"TSKNAM"
	.NCHR	.SIZE,TSKNAM
	.IF GT	.SIZE-6
	.ERROR			; TASK NAME TOO LONG
	.ENDC
	.IF LE	.SIZE-3
	.WORD	0
	.ENDC
	.IF B	TYPE
	.BYTE	0
	.IFF
	.IF EQ	.NODES
	.IF IDN	TYPE,<MAP>
	.BYTE	0
	.IFF
	.IF IDN	TYPE,<UNM>
	.BYTE	1
	.IFF
	.ERROR			; ILLEGAL THIRD ARGUMENT
	.ENDC
	.ENDC
	.IFF
	.IF IDN	TYPE,<LUN>
	.BYTE	1
	.IFF
	.ERROR			; ILLEGAL THIRD ARGUMENT
	.ENDC
	.ENDC
	.ENDC
	.ASCIZ	"FILNAM"
	.EVEN
	.ENDM	HTASK$
	.MACRO HWDDF$,L,B
MPCSR='B'177746
MPAR='B'172100
PIRQ='B'177772
PR0='B'0
PR1='B'40
PR4='B'200
PR5='B'240
PR6='B'300
PR7='B'340
PS='B'177776
SWR='B'177570
TPS='B'177564
	.IF DF	E$$EAE
AC='B'177302
MQ='B'177304
SC='B'177310
	.ENDC
	.IF DF	M$$MGE
KDSAR0='B'172360
KDSDR0='B'172320
KISAR0='B'172340
KISAR5='B'172352
KISAR6='B'172354
KISAR7='B'172356
KISDR0='B'172300
KISDR6='B'172314
KISDR7='B'172316
SISDR0='B'172200
UDSAR0='B'177660
UDSDR0='B'177620
UISAR0='B'177640
UISAR4='B'177650
UISAR5='B'177652
UISAR6='B'177654
UISAR7='B'177656
UISDR0='B'177600
UISDR4='B'177610
UISDR5='B'177612
UISDR6='B'177614
UISDR7='B'177616
UBMPR='B'170200
CMODE='B'140000
PMODE='B'30000
SR0='B'177572
SR3='B'172516
	.ENDC
FE.EXT='B'1
FE.MUP='B'2
FE.EXV='B'4
FE.DRV='B'10
FE.PLA='B'20
FE.CAL='B'40
FE.PKT='B'100
FE.EXP='B'200
FE.LSI='B'400
FE.MXT='B'40000
FE.NLG='B'100000
	.MACRO	HWDDF$	X,Y
	.ENDM
	.ENDM
.MACRO	IBUFDF
B$TLEN	= 8.
B$NLEN	= 6.
B$CLEN	= 82.
B$PLEN	= 128.
B$PNTR	= 0.
B$CPTR	= B$PNTR+2
B$CLLN	= B$CPTR+2
B$CRNM	= B$CLLN+2
B$PPTR	= B$CRNM+2
B$PCNT	= B$PPTR+2
B$TYPE	= B$PCNT+2
B$TCNT	= B$TYPE+2
B$TNAM	= B$TCNT+2
B$ECNT	= B$TNAM+B$TLEN
B$ENAM	= B$ECNT+2
B$CBUF	= B$ENAM+B$NLEN
B$PBUF	= B$CBUF+B$CLEN
B$STA	= B$PBUF+B$PLEN
B$NPTR	= B$STA+2
B$LINK	= B$NPTR+2
B$BCNT	= B$LINK+2
B$BTYP	= B$BCNT+2
B$BSTA	= B$BTYP+2
B$BADR	= B$BSTA+2
B$BLEN	= B$BADR+2
B$TBUF	= B$BLEN+2
.ENDM
	.MACRO	IF
	$$PUSH	$$STNM
$$STNM=$$PRST+1
$$PRST=$$STNM
	$$PUSH	$$TRNM
$$TRNM=77
	.ENDM
	.MACRO	INHIB$
 
	.IF DF	L$$SI1
 
	MFPS	-(SP)		; SAVE CURRENT PRIORITY
	MTPS	#PR7		;;; DISABLE INTERRUPTS
 
	.IFF
 
	MOV	@#PS,-(SP)	; SAVE CURRENT PRIORITY
	MOVB	#PR7,@#PS	;;; DISABLE INTERRUPTS
 
	.ENDC
 
	.ENDM
.MACRO	INTCFG
YES	= 1
NO	= 0
O$TELL	= YES					;AP0001
O$TRNS	= YES					;AP0001
O$DROP	= YES					;AP0001
O$LPAR	= YES					;AP0001
O$LBCK	= YES					;AP0001
O$NOFF	= YES					;AP0001
I$HELP	= YES
I$STEX	= O$TELL
I$STST	= YES
I$STLG	= YES					;AP0001
I$STHS	= YES
I$STPW	= YES
I$STLN	= YES
I$STPC	= YES
I$STLL	= YES
.IF	DF	R$$11D!I$$AS
I$STCX	= NO
.IFF
I$STCX	= YES
.ENDC
I$CLHS	= YES
I$CLPW	= YES
I$CLLN	= YES
I$CLPC	= YES
.IF	DF	R$$11D!I$$AS
I$CLCX	= NO
.IFF
I$CLCX	= YES
.ENDC
I$LDRM	= YES
I$LDVI	= YES
I$LDKN	= NO
I$LPRM	= YES
I$LPLN	= YES
I$SHCT	= YES
I$SHST	= YES
I$SHEX	= YES					;AP0001
I$SHQU	= NO
I$SHLK	= NO
I$ZERO	= YES
I$EXIT	= YES
I$SET	= I$STEX+I$STST+I$STLG+I$STHS+I$STPW+I$STLN+I$STPW+I$STLL+I$STCX
I$CLR	= I$CLHS+I$CLPW+I$CLLN+I$CLPC+I$CLCX
I$LOAD	= I$LDRM+I$LDVI+I$LDKN
I$LOOP	= I$LPRM+I$LPLN
I$SHOW	= I$SHCT+I$SHST+I$SHEX+I$SHQU+I$SHLK
K$CEX	= NO
K$CLR	= NO
K$CNT	= NO
K$CNTS	= NO
K$CSR	= NO
K$DSAB	= NO
K$ECHO	= NO
K$ENAB	= NO
K$EXEC	= NO
K$EXIT	= NO
K$FDX	= NO
K$FOR	= NO
K$FROM	= NO
K$HDX	= NO
K$HELP	= NO
K$HOST	= NO
K$INCR	= NO
K$KNOW	= NO
K$LENG	= NO
K$LINE	= NO
K$LINS	= NO
K$LNKS	= NO
K$LOAD	= NO
K$LOCL	= NO
K$LOGG	= NO
K$LOOP	= NO
K$LBCK	= NO
K$MAIN	= NO
K$MIXD	= NO
K$NAME	= NO
K$NONE	= NO
K$NMBR	= NO
K$OBJ	= NO
K$OFF	= NO
K$ON	= NO
K$ONES	= NO
K$OPER	= NO
K$PAR	= NO
K$PART	= NO
K$PASS	= NO
K$PRI	= NO
K$PROC	= NO
K$QUE	= NO
K$RCEV	= NO
K$REMT	= NO
K$REMS	= NO
K$SET	= NO
K$SHOW	= NO
K$SHUT	= NO
K$STA	= NO
K$STAT	= NO
K$TELL	= O$TELL
K$TO	= NO
K$TOP	= NO
K$XMIT	= NO
K$VECT	= NO
K$VIA	= NO
K$WITH	= NO
K$ZERO	= NO
K$ZROS	= NO
.MACRO	CMDFLG FLAG,KYFLGS
.IF	NE FLAG
  .IRP	  KEYFLG,<KYFLGS>
    K$'KEYFLG=K$'KEYFLG+1
  .ENDM
.ENDC
.ENDM
CMDFLG	I$HELP,<HELP>
CMDFLG	I$STEX,<EXEC,SET>
CMDFLG	I$STST,<KNOW,LINE,LINS,LOCL,LBCK,MAIN,OFF,ON,SET,SHUT,STA>
CMDFLG	I$STLG,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SW:'L' .BLKB	1
	.BLKB	1
X.ISR:'L' .BLKW	1
X.FORK:'L'
	.BLKW	1
	.BLKW	1
	.BLKW	1
	.BLKW	1
	.IF DF	M$$MGE
X.REL:'L' .BLKW	1
	.ENDC
X.DSI:'L' .BLKW	1
X.TCB:'L' .BLKW	1
	.IF NB	SYSDEF
	.IF DF	A$$TRP
	.BLKW	1
X.AST:'L' .BLKB	A.PRM
	.ENDC
X.VEC:'L' .BLKW	1
X.VPC:'L' .BLKW	1
X.LEN:'L'
	.ENDC
	.PSECT
.MACRO	ITBDF$	X,Y,Z
.ENDM	ITBDF$
.ENDM	ITBDF$
	.MACRO	I1$	LB,FLAGS,FNKYS
 
	.BYTE	25.		; OPCODE
	.BYTE	LB'C		; COUNT
LB:	.BYTE	FLAGS
 
	.IF	B,<FNKYS>
	.IFF
 
	.BYTE	FNKYS		; FUNCTION KEYS ENABLED
 
	.ENDC
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	I2$	LB
 
	.BYTE	26. , 0		; OPCODE, COUNT
 
	.ENDM
	.MACRO	I3$	LB
 
	.BYTE	27. , 0		; OPCODE, COUNT
 
	.ENDM
	.MACRO	I4$	LB
 
	.BYTE	28. , 0		; OPCODE, COUNT
 
	.ENDM
	.MACRO	I5$	LB,KEY,FIELDS
 
	; IF MORE THAN 1 FIELD IS TO BE MODIFIED, THEY MUST BE ENCLOSED IN <>'S
 
	.BYTE	29.		; OP CODE
	.BYTE	LB'C		; COUNT
LB:	.BYTE	KEY		; FUNCTION-KEY
	.BYTE	FIELDS
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	I6$	LB,KEY,FIELDS
 
	; IF MORE THAN 1 FIELD IS TO BE MODIFIED, THEY MUST BE ENCLOSED IN <>'S
 
LB:	.BYTE	30.		; OPCODE
	.BYTE	LB'C		; COUNT
1$:	.BYTE	KEY		; FUNCTION-KEY
	.BYTE	FIELDS
 
	LB'C=	.-1$
 
	.ENDM
	.MACRO	JMPPROC NAME
	$$GEN1	,JMP,NAME
	.ENDM
.MACRO	KDPDF$	LST
	.IIF NB	<LST>,	.LIST
	.MCALL	TMPDF$
	TMPDF$
	.ASECT
;---------------------------------------------------------------;
;	K M C - 1 1    D E V I C E    L I N E    T A B L E	;
;---------------------------------------------------------------;
.=0
CMIRI:	.INT1	$CDIRI	; INPUT  INTERRUPT CALL SEQUENCE
CMIPR:	.PRI		; INPUT  DEVICE PRIORITY FOR $INTSX
CMORI:	.INT2	$CDORI	; OUTPUT INTERRUPT CALL SEQUENCE
CMOPR:	.PRI		; OUTPUT DEVICE PRIORITY FOR $INTSX
CMCSR:	.CSR		; KMC-11 CSR ADDRESS [SEL 0]
CMSWT:	.BLKW	1	; KMC-11 CONTROL SWITCHES
CMIQH:	.LSTHD		; KMC-11 INPUT INTERRUPT REQUEST QUEUE
CMKQH:	.LSTHD		; KMC-11 KILL I/O IN PROGRESS QUEUE
CMLEN::			; KMC-11 DEVICE TABLE LENGTH
;---------------------------------------------------------------;
;	D U P - 1 1    D E V I C E    L I N E    T A B L E	;
;---------------------------------------------------------------;
.=0
CTLTW:	.BLKW	1	; LONG TIMER WORD
CTCSR:	.SECSR		; DUP-11 CSR ADDRESS [SEL 0]
CTFLG:	.BLKW	1	; DUP-11 CONTROL FLAGS
CTDUP:	.UNB		; DUP-11 NUMBER (0-17 OCTAL)
CTSLN:	.SLNB		; DUP-11 SYSTEM LINE NUMBER
CTCHR:	.DVCHA		; DUP-11 LINE CHARACTERISTICS (TWO WORDS)
CTLOG:	.BLKW	1	; EVENT LOGGING DESTINATION
CTCTL:	.BLKW	1	; STATION ADDRESS + CONTROL-IN FLAGS
CTITQ:	.LSTHD		; INACTIVE TRANSMIT CCB QUEUE
CTTA1:	.BLKW	1	; TRANSMIT CCB ACTIVE ON DESCRIPTOR #1
CTTD1:	.BLKW	3	; TRANSMIT BUFFER DESCRIPTOR #1
CTTA2:	.BLKW	1	; TRANSMIT CCB ACTIVE ON DESCRIPTOR #2
CTTD2:	.BLKW	3	; TRANSMIT BUFFER DESCRIPTOR #2
CTRA1:	.BLKW	1	; RECEIVE CCB ACTIVE ON DESCRIPTOR #1
CTRD1:	.BLKW	3	; RECEIVE BUFFER DESCRIPTOR #1
CTRA2:	.BLKW	1	; RECEIVE CCB ACTIVE ON DESCRIPTOR #2
CTRD2:	.BLKW	3	; RECEIVE BUFFER DESCRIPTOR #2
	.IF DF	X$$ITO
CTITM:	.BLKB	1	; TEMP STORAGE TIMER MUX.
	.ENDC
	.EVEN
CTLEN::			; DUP-11 DEVICE LINE TABLE LENGTH
	.PSECT
	.IIF NB	<LST>,	.NLIST
.ENDM	KDPDF$
.MACRO	KZTDF$
	.MCALL	TMPDF$
	TMPDF$
	.ASECT
	.=0
;
; COMIOP MAIN LINE TABLE, FOR COMIOP KMC/DZ
;
CZDLT:					;COMIOP LINE TABLE
CMIRI:	.INT1				;INPUT RELATED INTERUPT RE-VECTOR
	.PRI				;INPUT INTERUPT PRIORITY
CMORI:	.INT2				;OUTPUT RELATED INTERUPT RE-VECTOR
	.PRI				;OUTPUT INTERUPT PRIORITY
CMCSR:	.CSR				;ADDRESS OF COMIOP SEL 0
CMSWT:	.BLKB	1			;COMIOP CONTROL SWITCHES
CMARB:	.BLKB	1			;ASSIGN DUMMY RECEIVE BUFFER COUNT
CMIQH:	.LSTHD				;COMIOP INPUT INTERUPT REQUEST QUEUE
CMKQH:	.LSTHD				;COMIOP KILL I/O IN PROGRESS QUEUE
CMDRB:	.BLKW	3			;DUMMY RECEIVE BUFFER DESCRIPTOR
;
; LIST OF ADDRESSES OF EXTERNAL TABLES, FORM = "MAPPING,DISPLACEMENT"
;
CMETA:					;BASE FOR EXTERNAL TABLE ADDRESS LIST
CMCWT:	.CORE				;COMIOP CORE WORK TABLE ADDRESS
CMPMT:	.BIN				;DDCMP MODE TABLE ADDRESS
	.IF NE	P$$V52
CMVMT:	.BIN				;VT52 CONTROL MODE TABLE ADDRESS
	.ENDC
CMNET=	<.-CMETA>/4			;NUMBER OF EXTERNAL TABLES IN LIST
;
; LIBRARY CALLS
;
CMCRC:	.LIBR				;STCRC ROUTINE
CMLEN=	.
CTCLT:					;START OF DZ TABLES (48 ALLOWED)
;
; DZ CHANNEL SPECIFIC LINE TABLE OFFSETS, FOR COMIOP/DZ
;
	.=0
CTLTW:	.BLKW	1			;LONG TIMER WORD
CTCSR:	.SECSR				;ADDRESS OF DZ11 CSR
CTLIN:	.UNB				;LINE NUMBER (0-57 OCTAL)
CTSLN:	.SLNB				;SYSTEM LINE NUMBER
CTTFL:	.BLKW	1			;TRANSMIT AND CONTROL FLAGS
CTITQ:	.BLKW	1			;QUEUE OF INACTIVE TRN CCB'S
CTATQ:	.BLKW	1			;QUEUE OF ACTIVE TRN CCB'S
CTTD1:	.BLKW	6			;TRN BUFFER DESCRIPTOR 1
CTTD2:	.BLKW	6			;TRN BUFFER DESCRIPTOR 2
CTRFL:	.BLKB	1			;RECEIVE FLAGS
CTHDR:	.BLKB	1			;DDCMP HEADER CHARACTER
CTARQ:	.BLKW	1			;QUEUE OF ACTIVE RCV CCB'S
CTRD1:	.BLKW	3			;RCV BUFFER DESCRIPTOR 1
CTRD2:	.BLKW	3			;RCV BUFFER DESCRIPTOR 2
CTDLP:	.DVCHA				;CURRENT DEVICE LINE PARAMETERS
CTDFP:	.DVCHA				;DEFAULT DEVICE LINE PARAMETERS
CTLOG:	.BLKW	1			;EVENT LOGGING DESTINATION
CTLEN=	.
	.PSECT
.ENDM	KZTDF$
	.MACRO	LBLDF$	L,B
	.ASECT
.=0
R$LNAM:'L'.BLKW	2
R$LSA:'L' .BLKW	1
R$LHGV:'L'.BLKW	1
R$LMXV:'L'.BLKW	1
R$LLDZ:'L'.BLKW	1
R$LMXZ:'L'.BLKW	1
R$LOFF:'L'.BLKW	1
R$LWND:'L'.BLKW	1
R$LSEG:'L'.BLKW	1
R$LFLG:'L'.BLKW	1
R$LDAT:'L'.BLKW	3
R$LSIZ:'L'.BLKW	0
LD$ACC='B'100000
LD$RSV='B'040000
LD$REL='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CII	/NAMSTR/
.PSECT
.WORD	$$TEMP
.ENDM
.ENDM
	.MACRO	LEDLT$ L,B
	.MCALL	TMPDF$
	TMPDF$
;
; NURD LP11 DEVICE DRIVER LINE TABLE TEMPLATE
;
	.ASECT
	.=0
L.TIMC:'L	.BLKB	1		;TWO BYTE TIMER ENTRY, CURRENT VALUE
L.TIMI:'L	.BLKB	1		;  AND INITIAL TIMER VALUE
L.CALL:'L	.INT			;INTERRUPT DISPATCH CALL
L.PRI:'L	.PRI			;SCHEDULING PRIORITY
					;DDM LEVEL DATA BASE
					;ORDER FOR THIS SECTION IS CRITICAL
L.CSR:'L	.CSR			;ONE WORD CSR POINTER
L.ASTS:'L	.BLKW	1		;ACTION STATUS BIT MAP
	LA.CLO	='B	1		;CLOSED
	LA.PAU	='B	2		;PAUSED
	LA.ADN	='B	4		;ABORT WHEN DONE WITH DDM QUEUE
	LA.ABO	='B	10		;ABORTING
	LA.ABE	='B	20		;CLEAR ABORT ON EOF (ELSE ON CLEAR)
	LA.CPC	='B	40		;CLEAR PAGE COUNTER ENABLE
	LA.AKR	='B	100		;ACKNOWLEDGE REQUESTED
	LA.ERR	='B	200		;AN ERROR HAS BEEN NOTED
	LA.EOF	='B	400		;CURRENT MESSAGE HAS EOF
	LA.EOR	='B	1000		;END OF RECORD ENCOUNTERED
	LA.CTL	='B	2000		;CONTROL MESSAGE TO RETURN
	LA.TMO	='B	4000		;DEVICE TIME OUT
	LA.PLE	='B	10000		;PAGE LIMIT ERROR OCCURRED
L.PUBP:'L	.BLKW	2		;BUFFER PTR DOUBLEWORD
L.PUBS:'L	.BLKW	1		;BUFFER SIZE DOWN COUNTER
L.DDMQ:'L	.LSTHD			;CCB'S QUEUED FOR OUTPUT
L.PGCT:'L	.BLKW	1		;PHYSICAL PAGE COUNT
L.PGLM:'L	.BLKW	1		;PAGE LIMIT REGISTER
L.PLNC:'L	.BLKB	1		;PHYSICAL LINE COUNT
L.HUNG:'L	.BLKB	1		;DEVICE HUNG TIMER
					;MISCELLANEOUS ITEMS
	.EVEN
L.SLN:'L	.SLNW			;DEVICE SYSTEM LINE NUMBER
L.IOCN:'L	.BLKW	1		;OUTSTANDING IO COUNT
L.IOWT:'L	.BLKW	1		;CLOSE WAIT FLAG = CLOSE CCB
					;CONTROL MESSAGE PROCESSING DATA BASE
	.EVEN
L.CMSQ:'L	.LSTHD			;CONTROL MESSAGE QUEUE
L.RECO:'L	.BLKB	1		;CONTROL MESSAGE RESOURCE ERROR FLAG
L.RATT:'L	.BLKB	1		;PENDING ATTENTION MESSAGE FLAG - REASON CODE
L.CAPP:'L	.BLKB	1		;PENDING CAPABILITIES MESSAGE FLAG
					;DATA & FEATURES PROCESSING DATA BASE
	.EVEN
L.CSMP:'L	.BLKW	1		;CHARACTER SET MAP ADDRESS
L.LNCT:'L	.BLKB	1		;LINE COUNTER
L.COCT:'L	.BLKB	1		;COLUMN COUNTER
	.EVEN
L.VFUA:'L	.BLKW	1		;ADDRESS OF VFU MAP IN USE
L.DLCQ:'L	.LSTHD			;CCB'S QUEUED INTO DLC
L.MFLG:'L	.BLKB	1		;CURRENT NURD MESSAGE FLAGS
L.DMSQ:'L	.BLKB	1		;LAST GOOD/CURRENT DATA SEQ NUMBERS
L.DMSG:'L	.BLKB	1		;DATA MESSAGE SEGMENT COUNT BYTE
L.DMSS:'L	.BLKB	1		;DATA MSG CURRENTSEGMENT SIZE
L.CAPN:'L	.BLKB	1		;CURRENT INDEX INTO CAPABILITIES LIST
L.NFSP:'L	.BLKB	1		;NO. FEATURE SPECS IN CURRENT MSG
	.EVEN
L.DMCR:'L	.BLKW	1		;CHAR REPEAT COUNT, 2 BYTES USED AS WORD
L.DMAD:'L	.BLKW	2		;DATA MSG ADDRESS DOUBLEWORD (PTR)
L.DMBS:'L	.BLKW	1		;DATA MSG BUFFER SIZE
L.PLBQ:'L	.LSTHD			;FREE PHYSICAL BUFFER QUEUE
L.PLBP:'L	.BLKW	2		;CHARACTER POINTER DOUBLEWORD
L.PLBS:'L	.BLKW	1		;BUFFER SIZE DOWN COUNTER
L.PBRC:'L	.BLKB	1		;TEMP BYTE
	.EVEN
L.MSGQ:'L	.LSTHD			;OUTGOING MSG QUEUE
L.MSGA:'L	.BLKW	2		;CURRENT MSG BUFFER ADDRESS DOUBLEWORD
L.MSGS:'L	.BLKW	1		;CURRENT MSG BUFFER SIZE
					;DATA/FEATURES PROCESS HYBER CONTEXT
L.DWAK:'L	.BLKB	1		;WAKE CONDITION
	DWAKS	='B	1		;WAKE WHEN NEW MESSAGE SEGMENT RECEIVED
	DWAKP	='B	2		;WAKE WHEN PHYSICAL BUFFER RETURNED TO QUEUE
	DWAKT	='B	3		;WAKE ON CLOCK TOCK
	DWAKR	='B	4		;WAKE WHEN RESUME CONTROL FCN DONE
L.DTXL:'L	.BLKB	1		;NO. WORDS ON STACK AT SLEEP TIME
	.EVEN
L.DFSP:'L	.BLKW	1		;STACK ORIGIN
DTXTSZ	='B	16.			;DATA/FEATURES PROCESS CONTEXT ALLOCATED
L.DTXT:'L	.BLKW	DTXTSZ		;CONTEXT BLOCK FOR DA/FEATURES PROCESS
					;FEATURE CRUFT
L.CFET:'L				;LP11 COMMON FEATURE LIST
	.BLKB	1			;NUMBER OF COMMON FEATURES
	.BLKB	1			;FEATURE FE.DAT     SUPPORTED
	.BLKB	1			;FEATURE FE.SER NOT SUPPORTED
	.BLKB	1			;FEATURE FE.LCR     SUPPORTED
	.BLKB	1			;FEATURE FE.FWD     SUPPORTED
	.BLKB	1			;FEATURE FE.EOF NOT SUPPORTED
	.BLKB	1			;FEATURE FE.DVT NOT SUPPORTED
	.BLKB	1			;FEATURE FE.TRN     SUPPORTED
	.BLKB	1			;FEATURE FE.FNM NOT SUPPORTED
	.BLKB	1			;FEATURE FE.DWD     SUPPORTED
LCFETL	='B	.-L.CFET-1
L.DFET:'L	.BLKB	1		;NUMBER OF DEVICE SPECIFIC FEATURES
	.BLKB	1			;FEATURE 129    NOT DEFINED
	.BLKB	1			;FEATURE LP.HT      SUPPORTED
	.BLKB	1			;FEATURE LP.SFC     SUPPORTED
	.BLKB	1			;FEATURE LP.OVP NOT SUPPORTED
	.BLKB	1			;FEATURE LP.CVF NOT SUPPORTED
	.BLKB	1			;FEATURE LP.FCC     SUPPORTED
	.BLKB	1			;FEATURE LP.VFR NOT SUPPORTED
	.BLKB	1			;FEATURE LP.CHS     SUPPORTED
	.BLKB	1			;FEATURE LP.PLE     SUPPORTED
	.BLKB	1			;FEATURE LP.OPV NOT SUPPORTED
LDFETL	='B	.-L.DFET-1
					;FEATURE BLOCKS
F.FSB	='B	0			;(BM)FEATURES STATUS BYTE
	FB.CL0	='B 0			;CLASS 0 FEATURE => <BIT> FORM
	FB.CL1	='B 1			;CLASS 1 FEATURE => <CNT><...> FORM
	FB.WRD	='B 2			;FEATURE IS A WORD AND
					; F.FCV IS A DLT OFFSET TO IT
	FB.STR	='B 4			;FEATURE IS A STRING
					;F.FCV IS THE LENGTH
					;CURRENT VALUE BEGINS AT F.FCV+1
					;STANDARD VALUE(IF ANY) BEGINS AT F.FCV+1+(F.FCV)
	FB.STE	='B 10			;STANDARD VALUE EXISTS
	FB.SST	='B 20			;STANDARD IS SET
	FB.CP	='B 40			;CHANGE PENDING
	FB.CA	='B 100			;CHANGE ALLOWED
F.FCV	='B	1			;FEATURE CURRENT VALUE BYTE
F.FSV	='B	2			;FEATURE STANDARD VALUE BYTE
LE.DAT:'L					;DATA MODE
	.BLKB	1
	LEDATS	='B	FB.CL1!FB.SST!FB.STE	;INITIAL STATUS OF LE.DOF LE.DAT
	.BLKB	1				;ASCII
	.BLKB	1				;ASCII IS STD
;LE.SER:'L					;SERIAL NUMBER
LE.LCR:'L					;LOWER CASE RAISE
	.BLKB	1
	LELCRS	='B	FB.CL0!FB.CA		;INITIAL STATUS OF LE.LCR
	.BLKB	1				;OFF
LE.FWD:'L					;FORM WIDTH
	.BLKB	1
	.BLKB	1
;LE.EOF:					;EOF RECOGNITION
;LE.DVT:'L					;DEVICE TYPE
LE.TRN:'L					;RECORD TRUNCATION
	.BLKB	1
	LETRNS	='B	FB.CL0!FB.CA!FB.SST!FB.STE	;INITIAL STATUS OF LE.TRN
	.BLKB	1				;OFF
	.BLKB	1				;OFF IS STD
;LE.FNM:'L					;FORM NAME
LE.DWD:'L					;DEVICE WIDTH
	.BLKB	1
	.BLKB	1				;STD WIDTH
;	DEVICE SPECIFIC FEATURES
LE.HT:'L					;HORIZONTAL TAB
	.BLKB	1
	LEHTS	='B	FB.CL1!FB.SST!FB.STE	;INITIAL STATUS OF LE.HT
	.BLKB	1				;STD TABS ON
	.BLKB	1
LE.SFC:'L					;STD VFU
	.BLKB	1
	LESFCS	='B	FB.CL0!FB.SST!FB.STE	;INITIAL STATUS OF LE.SFC
	.BLKB	1				;ON
	.BLKB	1
;LE.OVP:'L					;OVERPRINT LIMIT
;LE.CVF:'L					;CUSTOM VFU
LE.FCC:'L					;FORTRAN CARRIAGE CONTROL
	.BLKB	1
	LEFCCS	='B	FB.CL0!FB.CA!FB.SST!FB.STE	;INITIAL STATUS OF LE.FCC
	.BLKB	1				;OFF
	.BLKB	1
;LE.VFR:'L					;VARIABLE FORMS RATIO
LE.CHS:'L					;CHARACTER SET
	.BLKB	1
	.BLKB	1				;96 CHAR ASCII
LE.PLE:'L					;PAGE LIMIT ENFORCEMENT
	.BLKB	1
	LEPLES	='B	FB.CL1!FB.WRD!FB.CA!FB.SST!FB.STE	;INITIAL STATUS OF LE.PLE
	.BLKB	1				;PAGE COUNTER
	.BLKB	2				;STD = 0 => OFF
;LE.OPV:'L					;OPTICAL VFU
	.PSECT
	.ENDM	LEDLT$
.MACRO	LFDF
LF.OPN	= 33*400
LF.CLS	= 34*400+210
LF.RD	= 32*400
LF.WRT	= 31*400
LF.OFF	= 36*400+10
LF.ON	= 36*400+0
LF.RAS	= 36*400+20
.MACRO	LFDF
.ENDM
.ENDM
.MACRO	LGDF
.ASECT
.=0
MESBUF:	.BLKW	1		;MESSAGE BUFFER
NODE:	.BLKW	1		;ADDRESS OF NODE NAME
COMP:	.BLKW	1		;ADDRESS OF COMPONENT NAME
EVNT:	.BLKW	1		;EVENT NUMBER
DTBEG:	.BLKW	1		;BEGIN ADDRESS OF LOG DATA
DTEND:	.BLKW	1		;END ADDRESS OF LOG DATA
LOGD:	.BLKW	1		;LOG DATA BASE ENTRY ADDRESS
FLAGS:	.BLKW	1		;TARGET FLAGS
SEQN:	.BLKB	1		;SEQUENCE NUMBER
STATE:	.BLKB	1		;LOG DATA PROCESSOR STATE
OLDLUN:	.BLKB	1		;LUN FROM LOGICAL LINK
.EVEN
CTXTLN:	.BLKW	0		;LENGTH OF CONTEXT BLOCK
.PSECT
				;LOG PROCESSOR STATES:
START	= 0			; INITIALIZE
PROC	= 1			; PROCESS REQUESTS
FINISH	= 2			; CLEAN UP
.MACRO	LGDF
.ENDM
.ENDM
.MACRO	LIDMDF
.PSECT	LIDDAT,RW,D,GBL,REL,OVR
.MCALL	DEVDF
DEVDF
L.DNAD	= 0.
L.DNLN	= 2.
L.DLGL	= 3.
L.DTYP	= 4.
L.MCTL	= 5.
L.MLIN	= 6.
L.MSTA	= 7.
L.ELEN	= 8.
DV$NET	= 1.
DV$LOD	= 2.
	.MCALL	DVTMDF
	.MACRO	XXX NAM,DSP,ARG3,ARG4,ARG5,ARG6,ARG7
A'NAM':	.ASCII	/'DSP'/
L'NAM'	= .-A'NAM'
	.ENDM	XXX
	DVTMDF	XXX
.EVEN
LIDBLK:
	.MACRO	XXX NAM,DSP,NUM,FLG,CTL,UNT,STA
	.WORD	A'NAM'
	.BYTE	L'NAM','FLG','NAM','CTL','UNT','STA'
	.ENDM	XXX
	DVTMDF	XXX
LIDEND:
.PSECT
.ENDM
.MACRO	LIMDF
.ASECT
.=0
STATE:	.BLKW	1
LOCK:	.BLKB	1
LENGTH:	.BLKB	1
LINEID:	.BLKB	16.
.PSECT
.ENDM
.MACRO	LIMMDF
.PSECT	LIMDAT,RW,D,GBL,REL,OVR
LIMBLK:
	.WORD	0
LOCK:	.BYTE	0
LENGTH:	.BYTE	0
LINEID:	.BLKB	16.
.PSECT
.ENDM
.MACRO	LKUDF
INUSE	= 0.
LUN	= 1.
ENTLEN	= 2.
MASTER	= 1.
SLAVE	= 2.
.ENDM
.MACRO	LKUMDF
.MCALL	CONFIG,SRDF
CONFIG
SRDF
.PSECT	LKUDAT,RW,D,GBL,REL,OVR
RCEVCB:	.WORD	0
LKUTAB:
$$LUN	= LNKLUN
.REPT	F$LKLU
.BYTE	0
.BYTE	$$LUN
$$LUN	= $$LUN+1
.ENDR
LKUEND:
.PSECT
.ENDM
	.MACRO LLC$DF	NAM,FLG,PRI,NLL,AA,BB
	NAM'PR=PRI	; PRIORITY
	NAM'FL=FLG	; FLAG
	NAM'CHN=NLL	; NUMBER OF CHANNELS TO ALLOCATE
	NAM'CNT=0	; DYNAMIC REFERENCE COUNT ( CROSS-CHECK )
	.ENDM	LLC$DF
	.MACRO	LLWDF$,L,B
 
	.ASECT
 
.=0
W.CTL:'L' .BLKW		1	;(RESERVED FOR RSX)
W.TASK:'L' .BLKW	1	;POINTER TO TASK (TCB/ATL ADDRESS)
W.STAT:'L' .BLKB	1	;STATUS
W.MODC:'L' .BLKB	1	;MODIFY FLOW CONTROL COUNT
W.CCBU:'L' .BLKB	1	;NUMBER OF TRANSMIT CCB'S IN USE
W.LUN:'L' .BLKB		1	;TASK LUN # 
W.LLA:'L' .BLKB		1	;NSP'S LOGICAL LINK ADDRESS (INDEX)
W.ULA:'L' .BLKB		1	;INTERFACE'S USER LINK ADDRESS (INDEX)
W.SEGZ:'L' .BLKW	1	;TRANSMIT SEGMENT SIZE
W.PIO:'L' .BLKW		1	;PENDING I/O PACKET ADDRESS
W.MBOX:'L' .BLKW	1	;POINTER TO TASK MAILBOX
W.CSND:'L' .BLKW	1	;POINTER TO CURRENT TRANSMIT I/O PACKET
W.SNDQ:'L' .BLKW	2	;TRANSMIT QUEUE LISTHEAD
W.RCVQ:'L' .BLKW	2	;RECEIVE QUEUE LISTHEAD
W.CINT:'L' .BLKW	1	;POINTER TO CURRENT INTERRUPT I/O PACKET
W.INTQ:'L' .BLKW	2	;INTERRUPT QUEUE LISTHEAD
				;
W.WBL='B'.-W.CTL		;LENGTH OF LOGICAL LINK WINDOW BLOCK
 
	.PSECT
 
;+
; WINDOW BLOCK STATUS WORD
;-
 
WS.VE1='B'1			;VERSION 1 INTERFACE (0-VERSION 2)
WS.EST='B'2			;LINK IS ESTABLISHED
WS.DIC='B'4			;DISCONNECT ALREADY CLEANED UP FOR TASK
WS.MOD='B'10			;NEEDS FLOW CONTROL MODIFICATION
WS.STA='B'20			;NEEDS CCB FOR TRANSMIT
WS.INT='B'40			;NEEDS CCB FOR INTERRUPT
WS.DIP='B'100			;DISCONNECT IN PROGRESS
WS.KIP='B'200			;KILL (I/O RUNDOWN) IN PROGRESS
 
	.MACRO	LLWDF$,X,Y
	.ENDM	LLWDF$
 
	.ENDM	LLWDF$
.MACRO	LNDMDF
.PSECT	LNDDAT,RW,D,GBL,REL,OVR
NODNUM:	.WORD	0
NAMLEN:	.WORD	6
NODNAM:	.ASCII	/MANILA/
.PSECT
.ENDM
.MACRO	LNUDF
INUSE	= 0.
LUN	= 1.
ENTLEN	= 2.
.ENDM
.MACRO	LNUMDF
.MCALL	CONFIG,SRDF
CONFIG
SRDF
.PSECT	LNUDAT,RW,D,GBL,REL,OVR
LNUTAB:
$$LUN	= LINLUN
.REPT	F$LNLU
.BYTE	0
.BYTE	$$LUN
$$LUN	= $$LUN+1
.ENDR
LNUEND:
.PSECT
.ENDM
.MACRO	LOGDF
.ASECT
.=0
L.GTYP:	.BLKB	0		; LOGGING TYPE:
 LG.OPR	=	0		;  OPERATOR
 LG.MNT	=	1		;  MAINTENANCE
L.GSW:	.BLKW	1		; SWITCHES:
 LG.ON	=	100000		;  LOGGING IS ON.
 LG.CNS	=	001000		;  CONSOLE TARGET SPECIFIED.
 LG.MND	=	000400		;  MASTER NODE TARGET SPECIFIED.
;		000377		; (LOGGING TYPE)
L.GCNS:	.BLKW	2		; CONSOLE DEVICE.
L.GSEQ:	.BLKB	1		; NEXT SEQUENCE NUMBER TO ASSIGN.
L.GMND:	.BLKB	7.		; MASTER NODE NAME
	.EVEN
L.GLEN:	.BLKW	0		; LENGTH OF LOG TARGET ENTRY.
.PSECT
.MACRO	LOGDF
.ENDM
.ENDM
.MACRO	LOGMAC
.MCALL	CONFIG,LOGDF
CONFIG
LOGDF
.MACRO	LOGBEG
LOGDB::
.ENDM
.MACRO	LOGEND
LOGDBE::
.ENDM
.MACRO	LOGENT TYPE,ON,MASTER,CONSOL
$$TEMP=0
.IIF NB	<ON>,$$TEMP=$$TEMP+LG.ON
.IIF NB	<MASTER>,$$TEMP=$$TEMP+LG.MND
.IIF NB	<CONSOL>,$$TEMP=$$TEMP+LG.CNS
.WORD	'TYPE'+$$TEMP
DVCNAM	CONSOL
.BYTE	0
NODNAM	MASTER
.EVEN
.ENDM
.MACRO	NODNAM NAME
STRENT	6.,NAME
.ENDM
.MACRO	STRENT MAX,TEXT
.NCHR   $$TEMP,<TEXT>
.BYTE   $$TEMP
.ASCII  /'TEXT'/
$$TEMP  = MAX-$$TEMP
.IF     LT $$TEMP
  .ERROR
.IFF
  .REPT   $$TEMP
    .BYTE   0
  .ENDR
.ENDC
.ENDM
.MACRO	DVCNAM NAME
.IF NB	<NAME>
$$CNT=0
$$TEMP=0
.IRPC	..C,<NAME>
$$CNT=$$CNT+1
.IF LE	<$$CNT-2>
.ASCII	\'..C'\
.IFF
$$TEMP=$$TEMP*8.+'..C'
.ENDC
.ENDR
.WORD	$$TEMP
.IFF
.WORD	0,0
.ENDC
.ENDM
.ENDM
.MACRO	LSDF
BPSLEN	= 8.
SIDLEN	= 16.
.ASECT
.=0
CMLKNM:	.BLKW	1
CMBFAD:	.BLKW	1
COUNT:	.BLKW	2
MEMADR:	.BLKW	2
LNBFAD:	.BLKW	1
LNBFLN:	.BLKW	1
LNBFMX:	.BLKW	1
DATADR:	.BLKW	1
DATLEN:	.BLKW	1
RESADR:	.BLKW	2
REQLEN:	.BLKW	1
TRACB:	.BLKW	1
ORIGCB	= TRACB
RECCB:	.BLKW	1
EXTCB	= RECCB
STATE:	.BLKB	1
RETCOD:	.BLKB	1
OPTION:	.BLKB	1
FLAGS:	.BLKB	1
LINE:	.BLKB	4
LUN:	.BLKB	1
PROTYP:	.BLKB	1
LOANUM:	.BLKB	1
BOOPAS:	.BLKB	BPSLEN+1
RETRYS:	.BLKB	1
CPUTYP:	.BLKB	1
BOODEV:	.BLKB	1
REQPRO:	.BLKB	1
REQLOA	= REQPRO
SOFTID:	.BLKB	SIDLEN+1
CTXTLN	= .
.PSECT
START	= 1.
LOAD	= 2.
DUMP	= 3.
LOOP	= 4.
BOOT	= 5.
FINISH	= 6.
DIALOG	= 001
XFRSNT	= 002
EODREC	= 004
RCMSPN	= 010
TRMSPN	= 020
RCBKPN	= 040
TRBKPN	= 100
MXRTRY	= 5.
MXWAIT	= 30.
SCBFLN	= 550.
RGBFLN	= 300.
DUMSEG	= 256.
.MACRO	LSDF
.ENDM
.ENDM
	.MACRO	L1$	LB
 
	.BYTE	16.,0		; OP CODE, COUNT
 
 
	.ENDM
	.MACRO	L2$	LB,VA,STRING
 
	.BYTE	17.		; OP CODE
	.BYTE	LB'C		; COUNT
LB:
	.IF	B,VA
	.BYTE	V.N		; DEFAULT
	.IFF
	.BYTE	VA
	.ENDC
	.ASCII	STRING
 
	LB'C=	.-LB
 
	.ENDM
	.MACRO	L3$	LB,MSG
 
	.BYTE	18.		; OP CODE
	.BYTE	1		; COUNT  (TO WRITE MESSAGE)
	.BYTE	MSG		; MESSAGE NUMBER
 
 
	.ENDM
	.MACRO	L4$	LB
 
	.BYTE	18.		; OP CODE  (SAME AS L3$)
	.BYTE	0		; COUNT  (ENTER ERROR MODE ONLY)
 
 
	.ENDM
	.MACRO	MAP BIAS
	.IF DF	M$$MGE
	.MCALL	HWDDF$
	HWDDF$
	MOV	  BIAS,KISAR6
	.ENDC
	.ENDM
.MACRO  MAPXDF
.MACRO  ADDBIA ADDR
.IF     DF R$$11D!I$$AS
IF
FALSE   LE ADDR
THEN
  ADD     #AB,ADDR
ENDIF
.ENDC
.ENDM   ADDBIA
.MACRO  MAPEXM BIAS,VADDR,APRADR,APRCON
.IF     DF R$$11M
.IF     DF M$$MGE
.IF     NB APRCON
IF ; TASK'S FIRST APR NOT ALREADY SAVED
FALSE   SET APRADR
THEN
  SAVSTK  <R0>
  MOV     $HEADR,R0
  MOV     H.ISP(R0),R0
  BIC     #017777,R0
  IF ; KISAR5 IS THE TASK'S FIRST APR
  FALSE   NE R0,#5*20000
  THEN
    MOV     #KISAR5,APRADR
    RESSTK  <R0>
  ELSE
    MOV     #KISAR5-2,APRADR
    RESSTK  <R0>
  ENDIF
  MOV     @APRADR,APRCON
ENDIF
.ENDC
MOV     BIAS,@APRADR
MOV     VADDR,R0
BIC     #7*20000,R0
IF ; KISAR5 IS THE TASK'S FIRST APR
FALSE   NE APRADR,#KISAR5
THEN
  BIS     #5*20000,R0
ELSE
  BIS     #4*20000,R0
ENDIF
.IFF
MOV     VADDR,R0
.ENDC
.ENDC
.IF     DF R$$11D!I$$AS
IF
FALSE   SET APRCON
THEN
  MOV     #77406,-(SP)
  MOV     BIAS,-(SP)
  CALL    ..SPD3
  MOV     (SP)+,APRCON
  MOV     (SP)+,APRADR
ENDIF
MOV	VADDR,R0
BIC     #7*20000,R0
BIS     #3*20000,R0
.ENDC
.ENDM   MAPEXM
.MACRO  MAPBAK APRADR,APRCON
.IF     DF M$$MGE
IF ; TASK'S FIRST APR WAS SAVED
FALSE   CLEAR APRADR
THEN
  ;MAPPED RSX-11M
  .IF     DF R$$11M
  MOV     APRCON,@APRADR
  .ENDC
  .IF     DF R$$11D!I$$AS
  MOV     APRADR,-(SP)
  MOV     APRCON,-(SP)
  CALL    ..SPD3
  CMP     (SP)+,(SP)+
  .ENDC
  CLR     APRADR
  CLR     APRCON
ENDIF
.ENDC
.ENDM   MAPBAK
.ENDM   MAPXDF
	.MACRO	MBXDF$,L,B
 
	.ASECT
 
.=0
M.NEXT:'L' .BLKW	1	;POINTER TO NEXT MAILBOX
M.TASK:'L' .BLKW	1	;POINTER TO TASK (TCB/ATL ADDRESS)
M.STAT:'L' .BLKB	1	;STATUS
M.NAST:'L' .BLKB	1	;NUMBER OF AST'S NEEDED
M.USE:'L' .BLKB		1	;COUNT OF ACTIVE LOGICAL LINKS
M.MAX:'L' .BLKB		1	;MAXIMUM # OF LOGICAL LINKS ALLOWED
M.SPA:'L' .BLKW		1	;USER NETWORK DATA AST ADDRESS
M.MAIL:'L' .BLKW	2	;NETWORK DATA (MAIL) QUEUE LISTHEAD
				;
M.MBL='B'.-M.NEXT			;MAILBOX BLOCK LENGTH
 
	.PSECT
 
;+
; MAILBOX BLOCK STATUS WORD
;-
 
MS.AST='B'10			;NEEDS NETWORK DATA AST
MS.CIP='B'200			;KILL (CLOSE) IN PROGRESS
 
;+
; PENDING CONNECT AND MOP EVENT CCB FUNCTION CODE MODIFIER BYTE
;-
 
CX.GDQ='B'1			;CCB HAS BEEN IN GENERAL DELIVERY QUEUE
CX.REQ='B'2			;TASK ASSOCIATED WITH CCB NEEDS REQUESTING
CX.UNL='B'4			;CCB MARKED AS DEQUEUED
 
	.MACRO	MBXDF$,X,Y
	.ENDM	MBXDF$
 
	.ENDM	MBXDF$
	.MACRO	MDCDF$,L,B,LST
	.IIF NB,LST,	.LIST
	.PSECT
	; MODEM CONTROL SERVICE BITS
	MC.CAR='B'	1	; CARRIER DETECT
	MC.DSR='B'	2	; DATA SET READY DETECT
	MC.RNG='B'	4	; RING DETECT
	MC.CCBNA='B'	200	; CCB NOT ALLOCATED ON PREV SCAN
	; STATUS BITS (BYTE 0 IN LINE TABLE)
	MS.SYNC='B'	1	; SYNCHRONOUS DEVICE
	MS.SCAN='B'	2	; DEV W/DISABLED MODEM INTERRUPTS
	.IF NB LST
	.NLIST
	.IFF
	.MACRO	MDCDF$,X,Y
	.ENDM	MDCDF$
	.ENDC
	.ENDM	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NSSYM$	B		;RETURN SYMBOLS
 
	.MACRO	NETDF$,X,Y
	.ENDM	NETDF$
 
	.ENDM	NETDF$
	.MACRO NHWDF$	L,B
PR0='B'0		; PROCESSOR PRIORITY 0
PR1='B'40		; PROCESSOR PRIORITY 1
PR2='B'100		; PROCESSOR PRIORITY 2
PR3='B'140		; PROCESSOR PRIORITY 3
PR4='B'200		; PROCESSOR PRIORITY 4
PR5='B'240		; PROCESSOR PRIORITY 5
PR6='B'300		; PROCESSOR PRIORITY 6
PR7='B'340		; PROCESSOR PRIORITY 7
PS='B'177776		; PROCESSOR STATUS WORD
SWR='B'177570		; CONSOLE SWITCH AND DISPLAY REGISTER
TPS='B'177564		; CONSOLE TERMINAL PRINTER STATUS REGISTER
;+
; MEMORY MANAGEMENT HARDWARE REGISTERS AND STATUS CODES
;-
	.IF DF	M$$MGE
	.IF DF R$$11D!I$$AS
BUFKMP='B'172344	; BUFFER MAPPING IN KERNEL MODE
PRCKMP='B'172346	; PROCESS MAPPING IN KERNEL MODE
CEXUMP='B'177640	; COMEXEC MAPPING USER MODE
BUFUMP='B'177644	; BUFFER MAPPING IN USER MODE
.BASEB='B'040000	; BUFFER PAR BIAS
PRCUMP='B'177646	; PROCESS MAPPING IN USER MODE
.BASEP='B'060000	; PROCESS PAR BIAS
	.IFF
BUFUMP='B'172354	; BUFFER MAPPING IN SYSTEM STATE
.BASEB='B'140000	; BUFFER PAR BIAS
KISAR6='B'172354	; KERNEL MODE APR 6
UISAR1='B'177642	; USER MODE APR 1
	.ENDC
MPCSR='B'177746		; ADDRESS OF PDP-11/70 MEMORY PARITY REGISTER
MPAR='B'172100		; ADDRESS OF FIRST MEMORY PARITY REGISTER
PIRQ='B'177772		; PROGRAMMED INTERRUPT REQUEST REGISTER
UBMPR='B'170200		; UNIBUS MAPPING REGISTER 0
CMODE='B'140000		; CURRENT MODE FIELD OF PS WORD
PMODE='B'30000		; PREVIOUS MODE FIELD OF PS WORD
KISAR0='B'172340	; KERNEL MODE APR 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$NCO	= -19.
NE$NOR	= -20.
NE$NIC	= -21.
.MACRO	NICDF
.ENDM
.ENDM
	.MACRO	NINT$ LLA,DATA
	.MCALL	$$MOVB,$$BUFD,$$QUE,$$MOV
	$$MOVB	LLA,C.LIN
	$$BUFD	1,DATA
	$$QUE	NT$INT,FC.XME
	.ENDM
	.MACRO	NMOD$ LLA,RQCNT
	.MCALL	$$MOVB,$$QUE
	$$MOVB	LLA,C.LIN
	$$MOVB	RQCNT,C.NSP
	$$QUE	NT$MOD,FC.XME
	.ENDM
	.MACRO NOD$DF A,B,C
	.ENDM
	.MACRO	NQRY$ LLA
	.MCALL	$$MOVB,$$QUE
	$$MOVB	LLA,C.LIN
	$$QUE	NT$QRY,FC.XME
	.ENDM
	.MACRO	NRDIN$
;	CCB STATUS CODES : DLC ->NRD
LS.ABO	=	100201		;ABORTING(COMPLIANCE WITH HIGHER (POWERS)
LS.REJ	=	100202		;REJECTING MSG
LS.CLO	=	100203		;DEVICE IS CLOSED,REJECTING
LS.ILM	=	100204		;ILLEGAL NURD MSG
LS.BOM	=	100205		;DLC IS ABORTING THE LINK DUE TO USER ERROR
;	CCB STATUS CODES : NRD -> NRM
NR.NDV	=	100377		;NOT A NURD DEVICE
	.ENDM	NRDIN$
	.MACRO	NREJ$ SNDCNT
	.MCALL	$$BUFD,$$QUE,$$MOV
	MOV	C.NSP(R4),-(SP)
	MOV	C.LIN(R4),C.NSP(R4)
	MOV	(SP)+,C.LIN(R4)
	$$MOV	SNDCNT,C.CNT1
	$$QUE	NT$REJ,FC.RCE
	.ENDM
	.MACRO	NRTI$ LLA
	.MCALL	$$MOVB,$$QUE
	$$MOVB	LLA,C.LIN
	$$QUE	NT$RTI,FC.RCE
	.ENDM
	.MACRO	NRTN$ LLA,FLAGS
	.MCALL	$$MOV,$$MOVB,$$QUE
	$$MOVB	LLA,C.LIN
	$$MOV	FLAGS,C.STS
	$$QUE	NT$RTN,FC.RCE
	.ENDM
	.MACRO	NSDDB$
 
;
; DATA DESCRIPTOR BLOCK DEFINITIONS:
;
	.ASECT
.=0
N$ACQ:	.BLKW	2	; ACP QUEUE LISTHEAD
N$TCB:	.BLKW	1	; ACP TCB ADDRESS
N$ICF:	.BLKW	1	; INTERCEPT SWITCH  (ADDRESS OF PHYSICAL LINK BLOCK)
N$LNI:	.BLKW	1	; LOOPBACK SWITCH   (ADDRESS OF PHYSICAL LINK BLOCK)
N$TMP:	.BLKW	4	; SCRATCH STORAGE AREA
N$LVC:	.BLKW	2	; LOGICAL LINK ADDRESS TABLE (LENGTH & ADDRESS)
N$PLD:	.BLKW	2	; PHYSICAL LINK DESCRIPTOR (NUMBER & ADDRESS)
N$NOD:	.BLKW	2	; NODE NAME DESCRIPTOR  (NUMBER & ADDRESS)
N$VER:	.BLKW	2	; PASSWORD DESCRIPTOR   (NUMBER & ADDRESS)
N$STS:	.BLKW	2	; STATISTICS DESCRIPTOR (LENGTH & ADDRESS)
	.PSECT
 
;
; PHYSICAL LINK BLOCK DEFINITIONS
;
	.ASECT
.=0
P$LST:	.BLKW	1	; STATE AND FLAGS
P$LCD:	.BLKB	1	; RECOVERY FLAGS
P$TIM:	.BLKB	1	; RECOVERY TIMER
P$CHN:	.BLKB	1	; LOGICAL LINE NUMBER
P$CNT:	.BLKB	1	; NUMBER OF MESSAGES QUEUED
P$PFQ:	.BLKW	1	; PENDING CONTROL FUCTION QUEUE
P$NOD:	.BLKW	1	; POINTER TO ADJACENT NODE
P$FRQ:	.BLKB	1	; FUNCTIONS REQUESTED
P$FSP:	.BLKB	1	; FUNCTIONS REQUESTED
P$LEN:	.BLKW	0	; LENGTH OF PHYSICAL LINK TABLE
	.PSECT
 
;
; PHYSICAL LINK FLAGS AND STATES
;
; STATES:
;
PS$OFF	= 0		;OFF
PS$STR	= 1		;STARTING
PS$WT	= 2		;WAIT
PS$NTI	= 3		;NOT INITIALIZED
PS$VER	= 4		;VERIFICATION WAIT
PS$UP	= 5		;UP
;
; FLAGS:
;
PF$OFF	= 0		;OFF STATE DESIRED
PF$UP	= 1		;UP STATE DESIRED
PF$STA	= 3		;MASK TO DESIRED STATE
 
PF$ENB	= 200		;LINK HAS BEEN ENABLED
PF$EIP	= 100		;CONTROL ENABLE FUNCTION IN PROGRESS
PF$RVR	= 40		;VERIFICATION REQUESTED WHEN NODE INIT SENT
 
;
; RECOVERY FLAGS:
;
RF.CTL	= 3		;COUNT OF OUTSTANDING CONTROL REQUESTS
RF.CLN	= 0		;LOGICAL LINK CLEAN UP REQUIRED
 
RF.WTM	= 30		;MASK FOR ALLOCATION FAILURE INTO WAIT STATE
RF.WTS	= 10		;STOP FUNCTION FLAG
RF.WTD	= 20		;DISABLE FUNCTION FLAG
 
RF.TIM	= 377*400	;MASK FOR TIMEOUT VALUE
RF.TM0	= 1*400		;INITIAL TIMEOUT VALUE
 
;
; FUNCTIONS SUPPORTED BY ADJACENT NODE
;
; NOTE:	THESE DEFINTIONS ARE SYNCHRONIZED WITH THE PROTOCOL
;	DEFINITIONS.
;
PF$SRT	= 1		; ROUTE THROUGH
PF$SLI	= 2		; LINK INTERRCEPT
PF$SRI	= 4		; ROUTING INTERCEPT
PF$SUB	= 10		; MESSAGE UNBLOCKING
;
; FUNCTIONS REQUESTED FROM ADJACENT NODE
;
; NOTE:	THESE DEFINITIONS ARE SYNCHRONIZED WITH THE PROTOCOL
;	DEFINITIONS.
;
PF$RVE	= 1		;REQUEST VERIFICATION MESSAGE
PF$RLI	= 2		;REQUEST LINK INTERCEPT (MEANS THIS IS LEVEL 1 NSP)
PF$RRI	= 4		;REQUEST ROUTING INTERCEPT
 
;
; NODE DATA BASE DEFINTIONS
;
	.ASECT
.=0
D$FLG:	.BLKW	1	; NODE ENTRY FLAGS
D$CHN:	.BLKW	1	; POINTER TO PHYSICAL LINK BLOCK
D$USE:	.BLKB	1	; NUMBER OF LOGICAL LINKS
D$LNG:	.BLKB	1	; LENGTH OF NODE NAME
D$NAM:	.BLKW	3	; NODE NAME
D$LEN:	.BLKW	0	; LENGTH OF NODE ENTRY
	.PSECT
 
;
; NODE ENTRY FLAGS DEFINTIONS:
;
DF$TMP	= 100000	; THIS IS THE SCRATCH NODE NAME ENTRY
DF$LCL	=  40000	; THIS IS THE LOCAL NODE NAME
DF$ADJ	=  20000	; THIS IS AN ADJACENT NODE
DF$REM	=  10000	; THIS IS A NON ADJACENT NODE
DF$LNK	=   4000	; REMOVE ENTRY WHEN USE COUNT GOES TO ZERO
 
DF$FRE	= DF$LCL!DF$ADJ!DF$REM ; MASK TO DETECT A FREE NODE ENTRY
 
;
; PASSWORD DESCRIPTOR ENRTY DEFINITIONS
;
	.ASECT
.=0
V$FLG:	.BLKW	1	; PASSWORD VALIDITY FLAGS
V$RCV:	.BLKB	8.	; RECEIVE PASSWORD
V$XMT:	.BLKB	8.	; TRANSMIT PASSWORD
V$LEN:	.BLKW	0	; LENGTH OF PASSWORD ENTRY
	.PSECT
 
;
; VALIDITY FLAGS DEFINITIONS:
;
VF$RCV	= 100000	; RECEIVE PASSWORD IS VALID
VF$XMT	=  40000	; TRANSMIT PASSWORD IS VALID
 
 
;
; STATISTICS DESCRIPTOR ENTRY DEFINITIONS
;
	.ASECT
.=0
S$SEC:	.BLKW	1	; SECONDS SINCE LAST ZEROED
S$UMS:	.BLKW	1	; USER MESSAGES SENT
S$UMR:	.BLKW	1	; USER MESSAGE RECEIVED
S$EMR:	.BLKW	1	; EXTRANIOUS MESSAGES RECEIVED
S$NKS:	.BLKW	1	; NAKS TRANSMITTED
S$FMT:	.BLKW	1	; FORMAT ERRORS
S$RES:	.BLKW	1	; RESOURCE ALLOCATION FAILURES
S$SNI:	.BLKW	1	; SUCESSFUL NODE INITS
S$UNI:	.BLKW	1	; UNSUCCESSFUL NODE INITS
S$LNK:	.BLKW	1	; CURRENT NUMBER OF LOGICAL LINKS
S$MLK:	.BLKW	1	; MAXIMUM NUMBER OF LOGICAL LINKS
	.BLKW	5	; RESERVED STORAGE
S$LEN:	.BLKW	0	; LENGTH OF THE STATISTICS BLOCK
	.PSECT
 
 
	.ENDM	NSDDB$
	.MACRO	NSPDF$
	.MCALL	NSPIF$
	.MCALL	NCON$,NACC$,NREJ$,NDIS$,NDAT$,NINT$,NRTN$,NRTI$
	.MCALL	NMOD$,NQRY$,NABO$,NXON$,NXOF$,NCBK$,NCAC$
	.MCALL	GTULA$,GTLLA$,GTSEG$,GTCNT$
	NSPIF$		; INVOKE SYSTEM INTERFACE DEFINITIONS
	.MACRO	NSPDF$
	.ENDM
	.ENDM
	.MACRO	NSPIF$
;
; USER FUNCTION CODES (FOR C.MOD)
;
; NOTE: THESE SUBFUNCTION CODES ARE ONLY THOSE CODE SEEN AT THE SYSTEM
;	USER INTERFACE. NSP USES ADDITIONAL SUBFUNCTION CODES INTERNALY.
;
; SUBFUNCTION CODES FOR TRANSMIT ENABLE, TRANMIT COMPLETE,
; RECEIVE COMPLETE.
;
NT$CON	= 0		; CONNECT
NT$DAT	= 2		; DATA
NT$INT	= 4		; INTERRUPT
NT$SNG	= 6		; SINGLE MESSAGE (NOT IMPLEMENTED)
NT$DIS	= 10		; DISCONNECT	(TRANSMIT ONLY)
NT$MOD	= 12		; MODIFY	(TRANSMIT ONLY)
NT$QRY	= 14		; QUERY		(TRANSMIT ONLY)
NT$XON	= 16		; BACK PRESSURE ON (TRANSMIT ONLY)
NT$XOF	= 20		; BACK PRESSURE OFF (TRANSMIT ONLY)
NT$ABO	= 22		;USER ABORT        (TRANSMIT ONLY)
 
;
; SUBFUNCTION CODES FOR RECEIVE ENABLE & BUFFER RETURN.
;
NT$RTN	= 0		; BUFFER RETURN
NT$ACC	= 2		; CONNECT ACCEPT
NT$REJ	= 4		; CONNECT REJECT
NT$SNG	= 6		; SINGLE MESSAGE (NOT IMPLEMENTED)
NT$RTI	= 10		; INTERRUPT MESSAGE RETURN
 
;
; SUBFUNCTION CODES FOR CONTROL ENABLE AND CONTROL COMPLETE.
;
;	THESE ARE SYNCHRONIZED WITH THE NORMAL CONTROL SUBFUNCTIONS.
;
;
NT$ADS	= 0		; ASYNCRONOUS DISCONNECT
NT$ON	= 2		; PHYSICAL LINK ON
NT$STP	= 4		; PHYSICAL LINK STOP
			; BACKPRESSURE VALUES ARE DEFINED ELSEWHERE
NT$NAK	= 22		; NAK COMPLETE FOR SYSTEM INTERFACE
NT$OFF	= 26		; PHYSICAL LINK OFF
;
; FUNCTION CODE MODIFIER FLAGS  (C.STS)
;
; FOR CONNECT INITIATE AND RECEIVE CONNECT INITIATE
;
NT.NFL	= 0			;REQUESTS NO FLOW CONTROL
NT.SFL	= 1			;REQUESTS SEGMENT FLOW CONTROL
NT.MFL	= 2			;REQUESTS MESSAGE FLOW CONTROL
 
;
; FOR TRANSMIT DATA
;
NT.MOM	= 0*20			; MIDDLE SEGMENT OF MESSAGE
NT.BOM	= 2*20			; BEGINNING SEGMENT OF MESSAGE
NT.EOM	= 4*20			; END SEGMENT OF MESSAGE
NT.SOL	= NT.EOM!NT.BOM		; SOLE SEGMENT OF MESSAGE
 
;
; FOR DATA BUFFER RETURN
;
NT.ACK	= 1			; ACKNOWLEDGE SEGMENT
NT.NAK	= 2			; NEGATIVE SEGEMENT ACKNOWLEDGE
NT.XOF	= 1*4			; BACKPRESSURE OFF
NT.XON	= 2*4			; BACKPRESSURE ON
NT.MOD	= 1*20			; MODIFY FLOW COUNT
NT.FCN	= 77*400		; FLOW COUNT MODIFICATION
NT.MD1	= NT.MOD!400		; INCREMENT FLOW COUNT
 
;
; SUCCESS AND  RETURN CODES (C.STS)
;
NS.SUC	= 1			; SUCCESS
 
;
; COMPLETION CODES USED ON CONNECT COMPLETE AND CONNECT RECEIVE
;
NS.NFL	= 1			; SUCCESS - NO FLOW CONTROL
NS.SFL	= 2			; SUCCESS - SEGMENT FLOW CONTROL
NS.MFL	= 3			; SUCCESS - MESSAGE FLOW CONTROL
 
;
; COMPLETION CODES USED ON RECEIVE COMPLETE OF DATA
;
NS.MOM	= NT.MOM		; SUCCESS - MIDDLE SEGMENT OF MESSAGE
NS.BOM	= NT.BOM		; SUCCESS - BEGGING SEGMENT OF MESSAGE
NS.EOM	= NT.EOM		; SUCCESS - END SEGMENT OF MESSAGE
NS.SOL	= NT.BOM!NT.EOM		; SUCCESS - SOLE SEGMENT OF MESSAGE
 
;
; SUCCESS CODES FOR CONTROL COMPLETIONS
;
NS.SET	= 2			; STATE REQUESTED IS ALREADY SET
 
;
;ERROR RETURN CODES (C.STS)
;
NE.DIS	= -1			; LOGICAL LINK DISCONNECTED
NE.ABO	= -2			; LOGICAL LINK ABORTED
NE.REJ	= -3			; LOGICAL LINK REJECTED BY REMOTE USER
NE.NOD	= -4			; CANNOT COMMUNICATE WITH REMOTE NODE
NE.RES	= -5			; NO MORE RESOURCES AVAILABLE
NE.TIM	= -6			; TOO MANY INTERRUPT MESSAGES
NE.ACT	= -7			; LOGICAL LINK ACTIVE
NE.FMT	= -10			; FORMAT ERROR IN CONNECT REQUEST
NE.CLS	= -11			; FLOW CLOSED ON LINK
NE.NDT	= -12			; LINK IN WRONG STATE (NOT IN DATA STATE)
;
; NSP CONFIGURATION PARAMETERS
;
 
;
; SIZES OF RESERVED BUFFER AREAS
;
;/////////////////////////////////
;/////TEMPORARY
;////////
N$$DAT	= 24.			;MAX LENGTH OF AN NSP HEADER
N$$OVR	= N$$DAT+10.		;TOTAL NUMBER OF PROTOCOL OVERHEAD BYTES
N$$OPT	= 16.			;MAX LENGTH OF OPT DATA(CONNECT)
N$$INT	= 16.			;MAX LENGTH OF INTERRRUPT DATA
N$$DIS	= 16.			;MAX LENGTH OF OPT DATA(DISCONNECT)
NP$RTR	= 3.			;MAX # OF RETRIES AFTER TIMEOUT
N.RSRV	= N$$DAT		;NUMBER OF BYTES TO RESERVE FOR NSP HEADER
;
;
; CONNECT INITIATE AND CONNECT PENDING BLOCK OFFSET DEFINITIONS
;
	.ASECT
.=0
N.NODE:	.BLKB	6	; DESTINATION NODE NAME (ASCII SPACE FILLED)
N.SEG:	.BLKW	1	; LOGICAL LINK SEGMENT SIZE
N.DFMT:	.BLKB	1	; DESTINATION DESCRIPTOR FORMAT TYPE
N.DOBJ:	.BLKB	1	; DESTINATION OBJECT TYPE
N.DDL1:			; DESTINATION DESCRIPTOR LENGTH (FORMAT 1)
N.DGRP:	.BLKW	1	; DESTINATION GROUP CODE (FORMAT 2)
N.DDS1:			; DESTINATION PROCESS NAME (FORMAT 1)
N.DUSR:	.BLKW	1	; DESTINATION USER CODE (FORMAT 2)
N.DDL2:	.BLKW	1	; DESTINATION DESCRIPTOR LENGTH (FORMAT 2)
N.DDS2:	.BLKB	12.	; DESTINATION PROCESS NAME (FORMAT 2)
N.SFMT:	.BLKB	1	; SOURCE DESCRIPTOR FORMAT TYPE
N.SOBJ:	.BLKB	1	; SOURCE OBJECT TYPE
N.SDL1:			; SOURCE DESCRIPTOR LENGTH (FORMAT 1)
N.SGRP:	.BLKW	1	; SOURCE GROUP CODE (FORMAT 2)
N.SDS1:			; SOURCE PROCESS NAME (FORMAT 1)
N.SUSR:	.BLKW	1	; SOURCE USER CODE
N.SDL2:	.BLKB	12.	; SOURCE DESCRIPTOR LENGTH (FORMAT 2)
N.SDS2:	.BLKW	1	; SOURCE PROCESS NAME (FORMAT 2)
N.RQDL:	.BLKW	1	; ACCESS REQUESTOR ID LENGTH
N.RQID:	.BLKB	16.	; ACCESS REQUESTOR ID
N.PASL:	.BLKW	1	; ACCESS PASSWORD LENGTH
N.PASS:	.BLKB	8.	; ACCESS CONTROL PASSWORD
N.ACTL:	.BLKW	1	; ACCOUNTING INFORMATION LENGTH
N.ACNT:	.BLKB	16.	; ACCOUNTING INFORMATION
N.OPDL:	.BLKW	1	; OPTIONAL USER DATA LENGTH
N.OPTD:	.BLKB	16.	; OPTIONAL USER DATA
N.LGTH	= .		; LENGTH OF THE CONNECT BLOCK
 
	.IF DF	R$$11D!I$$AS
N.LGTH = -N.LGTH
	.ENDC
 
	.PSECT
 
;
; FORMAT TYPE DEFINITIONS
;
NC.FM0	=	000	; DESCRIPTOR FORMAT 0
NC.FM1	=	001	; DESCRIPTOR FORMAT 1
NC.FM2	=	002	; DESCRIPTOR FORMAT 2
 
	.ENDM	NSPIF$
	.MACRO	NSPIN$
;
;  MODIFICATIONS:
;
;	LW0001	17-MAY-78  LEE WEBBER
;			ADD SUBFUNCTION CODE NT$IDC
;
;
; SUBFUNCTION CODES USED INTERNALLY BY NSP FOR TRANSMIT ENABLE AND
; TRANSMIT COMPLETE.
;
NT$CC	= 12		; CONNECT CONFIRM
NT$LS	= 14		; LINK STATUS
NT$AKD	= 16		; DATA ACK/NAK
NT$AKI	= 20		; INTERRUPT/LS ACK/NAK
NT$ROU	= 22		; ROUTED MESSAGE  (RELEASE RESOURCE ON COMPLETION)
NT$IND	= 24		; INTERCEPTED DATA MESSAGE
NT$INL	= 26		; INTERCEPTED I/LS MESSAGE
NT$IDN	= 30		; INTERCEPT NODE NAK'D DATA SEGMENT
NT$ILN	= 32		; INTERCEPT NODE NAK'D I/LS SEGMENT
NT$IDC	= 34		; INTERCEPTED DC MESSAGE                                ;LW0001
;
; DISCONNECT REASON CODES
;
ER$SSR	= 0		;NO ERROR OF SINGLE MESSAGE REPLY
ER$RES	= 1.		;RESOURCE ERROR
ER$NOD	= 2.		;NODE DOES NOT EXIST
ER$NSD	= 3.		;NODE SHUTTING DOWN
ER$UOB	= 4.		;OBJECT UNSUPPORTED OR DOES NOT EXIST
ER$FMT	= 5.		;INVALID FORMAT FOR OBJECT SPECIFICATION
ER$MLB	= 6.		;MAILBOX FULL FOR QUEUING MESSAGE TO OBJECT
ER$GEN	= 7.		;UNSPECIFIED ERROR CONDITION
ER$TPA	= 8.		;THIRD PARTY ABORTED LINK
ER$ABT	= 9.		;USER PROCESS ABORT REQUEST
ER$IFC	= 24.		;INVALID FLOW CONTROL VALUE REQUESTED
ER$TCN	= 32.		;TOO MANY CONNECTS TO NODE
ER$TCO	= 33.		;TOO MANY CONNECTS TO OBJECT
ER$ACC	= 34.		;ACCESS NOT PERMITTED, UNACCEPTABLE RQSTRID OR PASSWORD
ER$ILS	= 35.		;LOGICAL LINK SERVICES MISMATCH
ER$ACT	= 36.		;UNACCEPTABLE ACOUNT INFORMATION
ER$SSS	= 37.		;SEGMENT SIZE TOO SMALL
ER$ABO	= 38.		;LINK ABORT DUE TO USER FAULT OR CONNECT TIMEOUT
ER$COM	= 39.		;UNABLE TO COMMUNICATE WITH NODE
ER$FCF	= 40.		;FLOW CONTROL FAILURE
ER$STA	= 41.		;MESSAGE RECEIVED FOR IDLE STATE
ER$CDI	= 42.		;CONFIRMATION OF DI MESSAGE
ER$IMG	= 43.		;IMAGE DATA FIELD TOO LONG
;
;	LOGICAL LINK TABLE (LLT) DEFINITIONS - PART 1
;
; THIS TABLE DEFINES THE CONTEXT OF A SINGLE LOGICAL LINK.
; THERE IS ONE SUCH TABLE FOR EACH ACTIVE LOGICAL LINK IN
; THE SYSTEM.
;
;	!------------------------------------------------!
;	!  LINK LEVEL & TYPE	!	STATE		 !
;	!------------------------------------------------!
;	!	LOGICAL LINK ADDRESS (LLA)		 !
;	!------------------------------------------------!
;	! # XMITS IN PROG  DATA ! # XMITS IN PROG  I/LS  !
;	!------------------------------------------------!
;	!	REMOTE NODE POINTER			 !
;	!------------------------------------------------!
;	!	REMOTE LINK ADDRESS			 !
;	!------------------------------------------------!
;	!	LINK FLAGS				 !
;	!------------------------------------------------!
;	!	NEXT DATA SEGMENT NUMBER TO BE ASSIGNED  !
;	!------------------------------------------------!
;	!	NEXT INT/LS SEGMENT NUMBER TO BE ASSIGNED!
;	!------------------------------------------------!
;	!	NEXT DATA SEGMENT NUMBER TO BE RECEIVED  !
;	!------------------------------------------------!
;	!	NEXT INT/LS SEGMENT NUMBER TO BE RECEIVED!
;	!------------------------------------------------!
;	!	LAST DATA SEGMENT NUMBER ACK'D		 !
;	!------------------------------------------------!
;	!	LAST INT/LS SEGMENT NUMBER ACK'D	 !
;	!------------------------------------------------!
;	!	HIGHEST ACKNUM FROM USER ON DATA CHANNEL !
;	!------------------------------------------------!
;	!	DELAYED ACK FLAG ON I/LS CHANNEL	 !
;	!------------------------------------------------!
;	!	NUMBER OF DATA SEGMENTS TO ACK		 !
;	!------------------------------------------------!
;	!	NUMBER OF I/LS SEGMENTS TO ACK		 !
;	!------------------------------------------------!
;	!	PDV & USERS LINK ADDRESS (ULA)		 !
;	!------------------------------------------------!
;	! INTERRUPT COUNT	! TRANSMIT COUNT	 !
;	!------------------------------------------------!
;	!	TRANSMIT QUE HEADER			 !
;	!------------------------------------------------!
;	!	TIMED DATA CCB QUEUE HEADER		 !
;	!------------------------------------------------!
;	!	TIMED INTERRUPT/LS CCB QUEUE HEADER	 !
;	!------------------------------------------------!
;	!  DATA RETRY COUNT	!  DATA TIMER VALUE	 !
;	!------------------------------------------------!
;	!  INT/LS RETRY COUNT	!  INT/LS TIMER VALUE	 !
;	!------------------------------------------------!
;
;
;	LLT DEFINITIONS (CONT'D - PART 2)
;
; THESE SYMBOL DEFINITIONS CORRESPOND TO THE OFFSETS
; PRESENTED IN THE PREVIOUS DIAGRAM FOR AN LLT.
;
; NOTE:
;	IN MOST CASES, THE NSP CODE REFERENCES EACH
;	FIELD BY SYMBOL, INDEPENDENTLY FROM EVERY OTHER
;	FIELD. THERE ARE THE FOLLOWING EXCEPTIONS.
;
;	L.STA & L.LVL MUST HAVE AN OFFSET OF ZERO.
;
;	THESE BYTES MUST NOT BE UNPAIRED:
;		(L.USTA,L.NSTA)
;		(L.TIMD,L.RTRD)
;		(L.TIML,L.RTRL)
;
; THE OFFSET DEFINITIONS ARE:
;
	.ASECT
.=0
L.STA:	.BLKB	1	;STATE BYTE
L.LVL:	.BLKB	1	;LINK LEVEL AND TYPE
L.LLA:	.BLKW	1	;LOCAL LOGICAL LINK ADDRESS
L.TIPI:	.BLKB	1	;# OF TRANSMIT IN PROGRESS I/LS
L.TIPD:	.BLKB	1	;# OF TRANSMITS IN PROGRESS DATA
L.REM:	.BLKW	1	;REMOTE NODE POINTER
L.RLA:	.BLKW	1	;REMOTE LOGICAL LINK ADDRESS
L.FLG:	.BLKW	1	;LINK FLAGS
L.NXN:	.BLKW	1	;NEXT DATA SEGMENT NUMBER TO BE ASSIGNED
L.NIN:	.BLKW	1	;NEXT I/LS SEGMENT NUMBER TO BE ASSIGNED
L.RNO:	.BLKW	1	;NEXT DATA SEGMENT NUMBER TO BE RECEIVED
L.LNO:	.BLKW	1	;NEXT I/LS SEGMENT NUMBER TO BE RECEIVED
L.LDA:	.BLKW	0	;LAST DATA SEGMENT NUMBER ACKNOWLEDGED BY NET
L.USTA:	.BLKB	1	;DISCONNECT SUBSTATE FOR THE USER
L.NSTA:	.BLKB	1	;DISCONNECT SUBSTATE FOR THE NETWORK
L.LIA:	.BLKW	0	;LAST I/LS SEGMENT NUMBER ACKNOWLEDGED BY NET
L.CIQ:	.BLKW	1	;CONNECT INITIATE & CONNECT CONFIRM PENDING QUEUE
L.USA:	.BLKW	1	;HIGHEST DATA SEGMENT NUMBER ACK'D BY USER
L.LSA:	.BLKW	1	;HIGHEST I/LS SEGMENT NUMBER ACK'D BY THIS NODE
L.NDA:	.BLKW	0	;NUMBER OF DATA SEGMENTS TO ACKNOWLEDGE
L.UDQ:	.BLKW	1	;DISCONNECT INITIATE PENDING QUEUE
L.NLA:	.BLKW	0	;NUMBER OF I/LS SEGMENTS TO ACKNOWLEDGE
L.DCR:	.BLKW	1	;DISCONNECT REASON CODE
L.ULA:	.BLKB	1	;USERS LINK ADDRESS (ULA)
L.PDV:	.BLKB	1	;USERS PDV INDEX
L.TC:	.BLKB	1	;NUMBER OF DATA SEGMENTS OR MESSAGES REQUESTED
L.TIC:	.BLKB	1	;NUMBER OF INTERRUPT MESSAGES REQUESTED
L.LSF:	.BLKW	1	;FLOW CONTROL REQUEST COUNT STATUS
L.XQ1:	.BLKW	1	;TRANSMIT QUEUE HEADER
L.XQ2:	.BLKW	1	;TIMED DATA CCB QUEUE HEADER
L.XQ3:	.BLKW	1	;TIMED I/LS CCB QUEUE HEADER
L.LNG1:	.BLKW	0	;LENGTH OF TABLE FOR LEVEL 1
	.IF DF	N$$LV2
L.TIMD:	.BLKB	1	;DATA TIMER VALUE
L.RTRD:	.BLKB	1	;DATA RETRY COUNT
L.TIML:	.BLKB	1	;INT/LS TIMER VALUE
L.RTRL:	.BLKB	1	;INT/LS RETRY COUNT
L.LNG2:	.BLKW	0	;LENGTH OF TABLE FOR LEVEL 2
	.ENDC
	.PSECT
;
;	LLT DEFINITIONS (CONT'D - PART 3)
;
;
; LOGICAL LINK STATE DEFINITIONS:
;
ST$CIS	= 1		;CONNECT INITIATE SENT
ST$CC	= 2		;RECEIVED CI, SENT CC
ST$CIR	= 3		;CONNECT INITIATE RECEIVED
ST$DAT	= 5		;NORMAL DATA TRANSFER
ST$DIP	= 6		;DISCONNECT IN PROGRESS
;
; DISCONNECT SUB-STATES
;
ST$UNR	= 11		;USER NOTIFICATION OF DISCONNECT REQUIRED
ST$DIR	= 12		;DISCONNECT RECEIVED FROM NETWORK
ST$UDI	= 13		;DISCONNECT RECEIVED FROM USER
ST$DIS	= 14		;DISCONNECT SENT (DC RESPONSE REQUIRED)
ST$DID	= 15		;DISCONNECT DONE (NO RESPONSE REQUIRED)
;
; LINK LEVEL AND TYPE DEFINITIONS:
;
LF.RSU	= 100000	; RESOURCE RECOVERY REQUIRED
LF.LCL	=  40000	; LOCAL LOGICAL LINK
LF.INT	=    400	; INTERCEPT LINK
LF.DSP	= 40		;STOP DATA FLOW
LF.DST	= 20		;START DATA FLOW
LF.DFL	= LF.DSP!LF.DST	;DATA FLOW CHANGE BITS
LF.FPN	= 10		;FLOW NOTIFICATION TO LOCAL PROCESS PENDING
;	= 6		;INTERCEPT FLAGS
LF.NPN	= 1		;NAK COMPLETE TO LOCAL PROCESS PENDING
;
; THE FLAG DEFINITIONS ARE:
;
LF.MMF	= 100000	;MY MESSAGE FLOW CONTROL
LF.MSF	= 40000		;MY SEGMENT FLOW CONTROL
LF.HMF	= 20000		;HIS MESSAGE FLOW CONTROL
LF.HSF	= 10000		;HIS SEGMENT FLOW CONTROL
LF.NTS	= 2000		;DATA OR LS RECEIVED IN CIS STATE - SEND NAKS
LF.HF0	= 1000		;LINK IS BACKPRESSURED - DON'T TRANSMIT
LF.NKS	= 400		;OUR USER HAS SENT A DATA NAK, NEVER SENDS I/LS NAK
LF.NKR	= 200		;NSP HAS RECEIVED A DATA NAK.
LF.INR	= 100		;NSP HAS RECVD A I/LS NAK
;
; FLOW CONTROL STATUS DEFINITIONS
;
LS.DLS	= 200		;LINK SERVICE FOR DATA IS NOT OUTSTANDING (UNACKNOWLEDGED)
LS.ILS	= 200		;LINK SERVICE FOR INTERRUPT IS NOT OUTSTANDING
;
; INTERCEPT LINK TABLE
;
; THIS TABLE CONTAINS INFORMATION REQUIRED FOR THE
; INTERCEPT FUNCTION. THERE IS ONE SUCH LINK FOR
; EACH LOGICAL LINK BEING INTERCEPTED ON A GIVEN LINE.
;
;	!------------------------------------------------!
;	!  LINK LEVEL & TYPE	!	STATE		 !
;	!------------------------------------------------!
;	!	LOGICAL LINK ADDRESS (LLA)		 !
;	!------------------------------------------------!
;	! # XMITS IN PROG  DATA ! # XMITS IN PROG  I/LS  !
;	!------------------------------------------------!
;	!	REMOTE NODE INDEX			 !
;	!------------------------------------------------!
;	!	REMOTE LINK ADDRESS			 !
;	!------------------------------------------------!
;	!			! LINE NUMBER		 !
;	!------------------------------------------------!
;	!	USERS LINK ADDRESS  (ULA)		 !
;	!------------------------------------------------!
;	!	LINK FLAGS				 !
;	!------------------------------------------------!
;	!	NEXT DATA SEGMENT NUMBER TO BE ASSIGNED  !
;	!------------------------------------------------!
;	!	NEXT INT/LS SEGMENT NUMBER TO BE ASSIGNED!
;	!------------------------------------------------!
;	!	NEXT DATA SEGMENT NUMBER TO BE RECEIVED  !
;	!------------------------------------------------!
;	!	NEXT INT/LS SEGMENT NUMBER TO BE RECEIVED!
;	!------------------------------------------------!
;	!	LAST DATA SEGMENT NUMBER ACK'D		 !
;	!------------------------------------------------!
;	!	LAST INT/LS SEGMENT NUMBER ACK'D	 !
;	!------------------------------------------------!
;	!	HIGHEST ACKNUM FROM USER ON DATA CHANNEL !
;	!------------------------------------------------!
;	!	DELAYED ACK FLAG ON I/LS CHANNEL	 !
;	!------------------------------------------------!
;	!	NUMBER OF DATA SEGMENTS TO ACK		 !
;	!------------------------------------------------!
;	!	NUMBER OF I/LS SEGMENTS TO ACK		 !
;	!------------------------------------------------!
;	!	INTERCEPTED LINKS ADDRESS		 !
;	!------------------------------------------------!
;	!	HIGHEST ACK FOR USER ON I/LS CHANNEL	 !
;	!------------------------------------------------!
;	!	INTERCEPTED NODES INDEX			 !
;	!------------------------------------------------!
;
;	ILT DEFINITIONS CONTINUED
;
; THESE SYMBOL DEFINITIONS CORRESPOND TO THE OFFSETS
; PRESENTED IN THE PREVIOUS DIAGRAM.
;
; NOTE:
;	IN MOST CASES THE NSP CODE REFERENCES EACH FIELD
;	BY SYMBOL, INDEPENDENTLY FROM EVERY OTHER FIELD.
;	THERE ARE THE FOLLOWING EXCEPTIONS,HOWEVER, WHERE
;	PAIRS OF FIELDS ARE ASSUMED, BY THE NSP CODE, TO
;	OCCUPY ADJACENT BYTES IN THE SAME WORD.
;	THESE BYTES MUST NOT BE UNPAIRED:
;		(L.USTA,L.NSTA)
;		(L.TC,L.TIC)
;
; THE OFFSETS ARE:
;
;	NOTE:
;		THE OFFSETS FOR THE ILT WILL CORRESPOND EXACTLY
;		WITH THE LLT DEFINITIONS, EXCEPT FOR 3 WORDS, AND
;		THIS WILL BE COMMENTED.
	.IF DF	N$$ICF
I.STA	= L.STA		;SAME
I.LVL	= L.LVL		;SAME
I.LLA	= L.LLA		;SAME
I.TIPI	= L.TIPI	;SAME
I.TIPD	= L.TIPD	;SAME
I.REM	= L.REM		;SAME
I.RLA	= L.RLA		;SAME
I.FLG	= L.FLG		;SAME
I.NXN	= L.NXN		;SAME
I.NIN	= L.NIN		;SAME
I.RNO	= L.RNO		;SAME
I.LNO	= L.LNO		;SAME
I.LDA	= L.LDA		;SAME
I.LIA	= L.LIA		;SAME
I.USA	= L.USA		;SAME
I.LSA	= L.LSA		;SAME
;I.ISA	= L.ISA		;SAME
I.NDA	= L.NDA		;SAME
I.NLA	= L.NLA		;SAME
I.USTA	= L.USTA	;SAME
I.NSTA	= L.NSTA	;SAME
I.ILA	= L.ULA		;INTERCEPTED LINKS ADDRESS
I.IREM	= L.TC		;INTERCEPTED LINKS INDEX
	.ENDC
;
;	ILT DEFINITIONS CONTINUED
;
; THE FLAG DEFINITIONS ARE
;
	.IF DF	N$$ICF
IF.NRD	= LF.NKR	;SAME..DATA SEGMENT NAK'D BY NET
IF.NKS	= LF.NKS	;SAME
IF.NTS	= LF.NTS	;REDEFINES..RECV'D DATA/LS IN CIR OR CIS STATE
IF.NRI	= LF.MMF	;REDEFINES..I/LS SEGMENT HAS BEEN NAK'D BY NET
IF.INS	= LF.MSF	;REDEFINES..I/LS NAK HAS BEEN SENT
IF.SND	= 4		;SEND NAK ON DATA CHANNEL LATER
IF.SNL	= 2		;SEND NAK ON I/LS CHANNEL LATER
	.ENDC
;
; SYMBOL DEFINITIONS FOR NSP MESSAGE TYPES
;
;
;
; ROUTE HEADER FLAG DEFINTIONS
;
RH.CNT	= 1		; BLOCKING COUNT FIELD
RH.HDR	= 2		; ROUTE HEADER FIELD
RH.PRI	= 14		; MESSAGE PRIORITY FIELD MASK
RH.PR1	= 04		; MESSAGE PRIORITY 1
RH.EFM	= 20		; COMMUNICATION PROTOCOL FORMAT
RH.RFM	= 100		; ROUTE HEADER FORMAT (1=ASCII)
;
; MSGFLGS DEFINITIONS
;
; EACH NSP MESSAGE SENT OR RECEIVED CONTAINS A MSGFLGS
; FIELD. THIS TABLE DEFINES THE VALUES FOR THAT FIELD.
;
; NOTE: SINCE THESE VALUES ARE USED FOR DISPATCHING,
; 	THEY SHOULD NOT BE MODIFIED WITHOUT EXAMING ROUTINES
; 	RCVMSG AND RCVCTL !
;
; BITS 0,1 (INDICATE AS <0:1>) ARE ALWAYS 0
;
; BITS <2:3> DEFINE THE GENERAL CATAGORY OF MESSAGE
;
MF.DAT	= 0*4		;<2:3>=0  DATA MESSAGE
MF.ACK	= 1*4		;<2:3>=1  ACKNOWLEDGE MESSAGE
MF.CTL	= 2*4		;<2:3>=2  CONTROL MESSAGE
			;<2:3>=4  RESERVED
;
; BITS <4:6> TAKE ON VALUES DEPENDING ON THE VALUE OF <2:3>
; DATA MSG. BITS ARE MD.NN, SINGLE MESSAGE BITS ARE MS.NN
; LINK STATUS BITS ARE ML.NN, AND CONTROL MESSAGE
; BITS ARE MC.NN.
;
MD.IM	= 1*20		;<4>=1  INTERRUPT/LINK SERVICES MESSAGE
MD.BM	= 2*20		;<5>=1  BEGINNING OF MESSAGE
MD.EM	= 4*20		;<6>=1  END OF MESSAGE
MD.ILS	= 2*20		;<5>=1	INTERRUPT
;
; LINK SERVICES DEFINITIONS (LSFLAGS)
;
; FC MOD <0:1>
;
LS.FC0	= 1		; BACKPRESSURE
LS.FC1	= 2		; RELEASE BACKPRESSURE
;
; FCVAL INT <2:3>
;
LS.FCC	= 4		; INTERRUPT REQUEST COUNT
;
; MSGACK <4:5>
;
LS.MAK	= 20		; MESSAGE ACKNOWLEDGE
LS.MNK	= 40		; MESSAGE NEGATIVE ACKNOWLEDGE
;
; RESERVED BITS
;
LS.RSV	= 300		; RESERVED BITS
LS.RES	= LS.RSV!LS.MAK!LS.MNK ; MASK FOR CHECKING RESERVED BITS
MA.DA	= 0*20		;ACKNOWLEDGES DATA SEGMENT
MA.IL	= 1*20		;ACKNOWLEDGES INTERRUPT OF LINKS SERVICES MESSAGE
;
; FOR MC. VALUES, <4:6> IS A VALUE FIELD INDICATING WHAT
; TYPE OF CONTROL MESSAGE THIS IS:
;
MC.NO	= 0*20		;<4:6>=0 NOP MESSAGE
MC.CI	= 1*20		;<4:6>=1 CONNECT INITIATE
MC.CC	= 2*20		;<4:6>=2 CONNECT CONFIRM
MC.DI	= 3*20		;<4:6>=3 DISCONECT INITIATE
MC.DC	= 4*20		;<4:6>=4 DISCONNECT CONFIRM
MC.ST	= 5*20		;<4:6>=5 START UP MESSAGE
			;<4:6>=6 RESERVED
			;<4:6>=7 RESERVED
;
; CONNECT INITIATE
;
; SERVICES
;
; LTYPE <0:1>
;
CL$TYP	= 1		;LOGICAL LINK ESTABLISHED
;
; FCOPT <2:3>
;
CL$SFL	= 4		;SEGMENT FLOW CONTROL
CL$MFL	= 10		;MESSAGE FLOW CONTROL
;
; ACKOPT <4:5>
;
CL$NRM	= 20		;NORMAL LINK (DELIVERY OPTION)
CL$ACK	= 40		;MESSAGE ACK/NAK
;
;MENU BITS FOR ACCESS CONTROL INFORMATION
;
CL.MU1	= 1		;REQUESTOR ID, PASSWORD, AND ACCOUNT FIELDS INCLUDED
CL.MU2	= 2		;USERDATA FIELD INCLUDED
CL.RES	= ^C<CL.MU1!CL.MU2> ;RESERVED MENU BITS
;
; NODE INIT MESSAGE TYPES
;
; STARTTYPE VALUE DEFINITIONS
;
NI.INI	= 1		;INIT MESSAGE
NI.VER	= 2		;VERIFICATION MESSAGE
;
; NODE FUNCTIONS SUPPORTED
;
NI.FRT	= 1		;SUPPORT ROUTE THROUGH
NI.FLI	= 2		;SUPPORT LINK INTERCEPT
NI.FRI	= 4		;SUPPORT ROUTING INTERCEPT
NI.FUB	= 10		;SUPPORT MESSAGE UNBLOCKING
;
; NODE FUNCTIONS REQUESTED
;
NI.RVE	= 1		;REQUEST VERIFICATION MESSAGE
NI.RLI	= 2		;REQUEST LINK INTERCEPT
NI.RRI	= 4		;REQUEST ROUTING INTERCEPT
;
; ACK/NAK FLAGS
;
LA.MSK	= 170000	;MASK TO PERFORM 12 BIT WRAP AROUND
LA.ACK	= 100000	;ACKNUM IDENTIFIER AND ACK REQUIRED FLAG
LA.NAK	= 110000	;NAKNUM IDENTIFIER AND NAK REQUIRED FLAG
LA.NMS	= 010000	;MASK TO TEST FOR NAK AND WRAP AROUND
LA.RES	= 060000	;RESERVED BITS IN ACK/NAK FIELD
;
; TEMPORARY
;
;
; NSP MISCELLANEOUS SYMBOLS
;
ACKMASK=170000		;CLEAR UPPER 4 BITS OF ACKNUM
ACKRES = 60000		;CHECK FOR RESERVED BITS IN ACKNUM
ACKWRAP= 10000		;12 BIT WRAPAROUND ADJUSTMENT
WINDOW = 2048.		;RANGE FOR RECVD DATA AND LINK SERVICE SEGMENTS ON SEGNUMS
ACKPRE = 100000		;ACKNUM PRESENT BIT
A.NAK = 10000		;NAK BIT IN ACKNUM
NETTIM = 5		;TIMING VALUE FOR DATA, INTERRUPT, AND LINK SERVICE MESSAGES
MSGHDR	= 7		;LENGTH OF MESSAGE HEADER FOR INTERRUPT AND DATA MESSAGES
	.ENDM	NSPIN$
	.MACRO	NSPSY$
	.MCALL	NSPIF$,NSPIN$,NSDDB$
	NSPIF$		; INVOKE SYSTEM INTERFACE DEFINITIONS
	NSPIN$		; INVOKE INTERNAL DEFINTIONS
	NSDDB$		; INVOKE THE DATA BASE DEFINITIONS
	.MACRO	NSPSY$
	.ENDM
	.ENDM
	.MACRO	NSPVR$
RT$VER	= 3		; ROUTING VERSION NUMBER
RT$ECO	= 1		; 	  ECO NUMBER
RT$REV	= 0		;	  MINOR REVION LEVEL
 
CM$VER	= 3		; COMMUNICATION VERSION NUMBER
CM$ECO	= 1		;		ECO NUMBER
CM$REV	= 0		;		MINOR REVISION LEVEL
	.ENDM	NSPVR$
	.MACRO	NSSYM$	B
 
NO.TAS ='B' 0			;GENERAL TASK, USER PROCESS
NO.FA1 ='B' 1			;FILE ACCESS LISTENER (V1)
NO.TC1 ='B' 5			;TASK CONTROL LISTENER (V1)
NO.TCL ='B' 17			;TASK CONTROL LISTENER
NO.TLK ='B' 20			;TALK UTILITY
NO.FAL ='B' 21			;FILE ACCESS UTILITY
NO.RTL ='B' 22			;REMOTE TASK LOADER
NO.NCU ='B' 23			;NETWORK CONTROL UTILITY EXECUTOR
NO.DTR ='B' 77			;DECNET TEST RECEIVER
				;
NT.CON ='B' 1			;CONNECT
NT.INT ='B' 2			;INTERRUPT MESSAGE
NT.DSC ='B' 3			;USER SYNCHRONOUS DISCONNECT
NT.ABT ='B' 4			;USER ABORT
NT.ABO ='B' 5			;NETWORK ABORT
NT.MOP ='B' 10			;MOP EVENT
NT.LOG ='B' 11			;EVENT LOG DATA
				;
NE$SSR ='B' 0			;NO ERROR OR SINGLE MESSAGE REPLY
NE$RES ='B' 1.			;RESOURCE ALLOCATION FAILURE
NE$NOD ='B' 2.			;DESTINATION NODE DOES NOT EXIST
NE$NSD ='B' 3.			;NODE SHUTTING DOWN
NE$UOB ='B' 4.			;DESTINATION PROCESS DOES NOT EXIST
NE$FMT ='B' 5.			;INVALID PROCESS NAME FIELD
NE$MLB ='B' 6.			;MAILBOX FULL FOR QUEUING MESSAGE TO OBJECT
NE$GEN ='B' 7.			;UNSPECIFIED ERROR CONDITION
NE$TPA ='B' 8.			;THIRD PARTY ABORTED LOGICAL LINK
NE$ABT ='B' 9.			;LINK ABORT BY DIALOGUE PROCESS
NR$IFC ='B' 24.			;INVALID FLOW CONTROL VALUE
NE$TCN ='B' 32.			;TOO MANY CONNECTS TO NODE
NE$TCO ='B' 33.			;TOO MANY CONNECTS TO DESTINATION PROCESS
NE$ACC ='B' 34.			;ACCESS NOT PERMITTED - UNACCEPTABLE
				; RQSTRID OR PASSWORD
NE$ILS ='B' 35.			;LOGICAL LINK SERVICES MISMATCH
NE$ACT ='B' 36.			;INVALID ACCOUNT INFORMATION - NOT AUTHORIZED OR BROKE
NE$SSS ='B' 37.			;SEGMENT SIZE TOO SMALL
NE$ABO ='B' 38.			;USER PROGRAM FAULTED OR TIMED OUT
NE$COM ='B' 39.			;UNABLE TO COMMUNICATE WITH NODE
NE$FCF ='B' 40.			;FLOW CONTROL FAILURE
NE$STA ='B' 41.			;MESSAGE RECEIVED FOR IDLE STATE
NE$CDI ='B' 42.			;CONFIRMATION OF DISCONNECT INITIATE
				; MESSAGE
NE$IMG ='B' 43.			;IMAGE DATA FIELD TOO LONG
				;
IE.NNT ='B' -80.		;NOT A NETWORK TASK
IE.NDA ='B' -78.		;NO NETWORK DATA AVAILABLE
IE.NRJ ='B' -74.		;CONNECTION REJECTED BY NETWORK
IE.URJ ='B' -73.		;CONNECTION REJECTED BY USER
				;
IS.DAO ='B' 2.			;SUCCESS, BUT DATA OVERRUN
 
	.MACRO	NSSYM$,X
	.ENDM	NSSYM$
 
	.ENDM	NSSYM$
	.MACRO	NTLDF$	C,E,HOME
	.ASECT
	.=0
LR.STS:'C'	.BLKW	1	; FUNCTION CODE, STATUS BITS
				; "SET CEX" REQUEST BLOCK OFFSETS
LR.TCB:'C'	.BLKW	1	; NETACP'S TCB ADDRESS (POWERFAIL RECOVERY)
LR.EFN:'C'	.BLKW	1	; NETACP'S EVENT FLAG MASK WORD (DITTO)
	.=2			; "SET PROCESS" REQUEST BLOCK OFFSETS
LR.PRO:'C'	.BLKW	1	; PROCESS NAME (RAD50)
LO.INC:'C'	.BLKW	1	; INCREMENT VALUE (32. WORD BLOCKS)
LO.PAR:'C'	.BLKW	2	; PARTITION NAME (RAD50)
	.=2			; "SET LINE" REQUEST BLOCK OFFSETS
LR.LIN:'C'	.BLKW	1	; DDM NAME (RAD50)
LR.CTL:'C'	.BLKB	1	; CONTROLLER NUMBER
LR.UNT:'C'	.BLKB	1	; UNIT NUMBER
LO.CSR:'C'	.BLKW	1	; CSR ADDRESS
LO.PRI:'C'	.BLKW	1	; INTERRUPT PRIORITY (1 THRU 7)
LO.VCT:'C'	.BLKW	1	; INTERRUPT VECTOR
			; FUNCTION CODES
LS.CEX='E'1		; "SET CEX"
LS.PRO='E'2		; "SET PROCESS"
LS.LIN='E'3		; "SET LINE"
LX.CEX='E'4		; "CLEAR CEX"
LX.PRO='E'5		; "CLEAR PROCESS"
LX.LIN='E'6		; "CLEAR LINE"
LS.LMC='E'7		; RELOAD ALL KMC MICROCODE (AFTER POWERFAIL)
LS.ON='E'10		; "SET STATE LOCAL ON"
			; STATUS BITS
LS.OPT='E'400		; OPTIONAL PARAMETERS INCLUDED
LS.ECH='E'1000		; ECHO THE TEMPLATE
LS.TOP='E'2000		; LOAD PROCESS AT TOP OF PARTITION
			; "SET PROCESS"/"SET LINE" STATUS BITS
LS.FDX='E'4000		; FULL-DUPLEX
LS.HDX='E'10000		; HALF-DUPLEX
			; "SET CEX" STATUS BITS
LS.NTI='E'4000		; PERFORM NTINIT AS PART OF LOADING CEX (NETLDR)
LS.CXO='E'10000		; PERFORM "SET STATE LOCAL ON" AS PART OF "SET CEX"
LS.UNF='E'20000		; NTINIT UNFIX ITSELF (11S ONLY)
LS.PWF='E'40000		; POWERFAIL RECOVERY, NOT A REAL "SET CEX"
			; "CLEAR PROCESS" STATUS BITS
LS.11D='E'4000		; SPECIAL RSX11D/IAS OVERRIDE SWITCH
	.IF NB	HOME
	.=0		; NETLDR HOME BLOCK OFFSETS
.NTPCB:'C'	.BLKW	1	; NETWORK POOL PCB ADDRESS (NTINIT)
.NTUMR:'C'	.BLKW	1	; NETWORK POOL UMR BLOCK ADDRESS (NTINIT)
.CXCSR:'C'	.BLKW	1	; VNP SLT -> CSR LIST BLOCK ADDRESS
.CXPCB:'C'	.BLKW	1	; COMM EXEC PCB ADDRESS
.CXSYM:'C'	.BLKW	10.	; PROCESS VERIFICATION SYMBOL VALUES
.CXUNL:'C'	.BLKW	1	; FIRST UNLOAD BLOCK ADDRESS
.CXKMC:'C'	.BLKW	1	; FIRST KMC CSR BLOCK ADDRESS
.CXLB1:'C'	.BLKW	6	; FIRST LIBRARY DESCRIPTOR
.CXLB2:'C'	.BLKW	6	; SECOND LIBRARY DESCRIPTOR
.CXLBR:'C'	.BLKW	1	; FIRST LIBRARY DESCRIPTOR BLOCK ADDRESS
		.BLKW	3	; AVAILABLE
	.ENDC
	.PSECT
	.ENDM	NTLDF$
	.MACRO	NTLER$	NUMBER,FORMAT,LINE1,REPLACE,LINE2,TEXT,LAST
$ERR'NUMBER'::
	.WORD	LINE1
	.IF NB	FORMAT
	.IF IDN	FORMAT,<NONE>
	.WORD	0
	.IFF
	.WORD	FMT'FORMAT'
FM.'FORMAT'=0
	.ENDC
	.IFF
	.WORD	FMT0
FM.0=0
	.ENDC
	.WORD	REPLACE
	.WORD	LINE2
	.ASCIZ	\TEXT\
	.IF NB	LAST
		.IF DF	FM.0
FMT0:	.ASCIZ	""
		.ENDC
		.IF DF	FM.1
FMT1:	.ASCIZ	"* "
		.ENDC
		.IF DF	FM.2
FMT2:	.ASCIZ	"* TEMPLATE -- "
		.ENDC
		.IF DF	FM.2A
FMT2A:	.ASCIZ	"* TEMPLATE -- SYMBOL * "
		.ENDC
		.IF DF	FM.2B
FMT2B:	.ASCIZ	"* TEMPLATE -- VECTOR * "
		.ENDC
		.IF DF	FM.3
FMT3:	.ASCIZ	"* TEMPLATE FILE -- "
		.ENDC
		.IF DF	FM.4
FMT4:	.ASCIZ	"* SYMBOL TABLE FILE -- "
		.ENDC
		.IF DF	FM.4A
FMT4A:	.ASCIZ	"* SYMBOL TABLE FILE -- SYMBOL * "
		.ENDC
		.IF DF	FM.5
FMT5:	.ASCIZ	"* PROCESS FILE -- "
		.ENDC
		.IF DF	FM.5A
FMT5A:	.ASCIZ	"* PROCESS FILE -- PARTITION * "
		.ENDC
		.IF DF	FM.6
FMT6:	.ASCIZ	"* IMAGE FILE -- "
		.ENDC
		.IF DF	FM.7
FMT7:	.ASCIZ	""
		.ENDC
		.IF DF	FM.7A
FMT7A:	.ASCIZ	"CHANNEL * "
		.ENDC
		.IF DF	FM.7B
FMT7B:	.ASCIZ	"LINE * "
		.ENDC
		.IF DF	FM.8
FMT8:	.ASCIZ	"CONFIG FILE -- "
		.ENDC
		.IF DF	FM.8A
FMT8A:	.ASCIZ	"CONFIG FILE -- DEVICE * "
		.ENDC
		.IF DF	FM.8B
FMT8B:	.ASCIZ	"CONFIG FILE -- PARTITION * "
		.ENDC
		.IF DF	FM.9
FMT9:	.ASCIZ	"*: DEVICE TABLES -- "
		.ENDC
		.IF DF	FM.10A
FMT10A:	.ASCIZ	"* MICRO-CODE FILE -- "
		.ENDC
		.IF DF	FM.10B
FMT10B:	.ASCIZ	"* DEVICE I/O ERROR, CSR = *, RAM ADDRESS = *"
		.ENDC
		.IF DF	FM.10C
FMT10C:	.ASCIZ	"LIST ALLOC. FAILURE, DEV=*, CSR=*, CNTRLR=*"
		.ENDC
		.IF DF	FM.11
FMT11:	.ASCIZ	"PARTITION * "
		.ENDC
		.IF DF	FM.12
FMT12:	.ASCIZ	"* -- "
		.ENDC
	.ENDC
	.EVEN
	.ENDM	NTLER$
	.MACRO NURDF$
; GENERAL MESSAGE DEFINITIONS
N.TYP	= 0			;(B)OFFSET TO MESSAGE TYPE
	NM.TYP	= 17		;MESSAGE TYPE MASK
	NM.DAT	= 0&NM.TYP	;DATA MESSAGE
	NM.ATT	= 1&NM.TYP	;ATTENTION MESSAGE
	NM.FTR	= 2&NM.TYP	;FEATURES MESSAGE
	NM.CTL	= 3&NM.TYP	;CONTROL MESSAGE
	NM.ALR	= 4&NM.TYP	;ALERT MESSAGE
	NM.CAP	= 5&NM.TYP	;CAPABILITIES MESSAGE
	NM.OTR	= 6&NM.TYP	;***CURRENT OUT OF RANGE VALUE***
N.MFL	= 1			;(BM)OFFSET TO MESSAGE FLAGS
; DATA MESSAGE DEFINITIONS
				;DATA MESSAGE OFFSETS
N.DSEQ	= 2			;(B)SEQUENCE NUMBER
N.DFLG	= 3			;(BM)DATA FLAGS
	ND.ACK	= 1		;ACKNOWLEDGE REQD
	ND.IER	= 2		;INPUT ERROR
	ND.EOF	= 4		;SEGMENT IS END OF FILE
N.DSGC	= 4			;(B)SEGMENT COUNT
N.DDAT	= 5			;START OF DATA
				;DATA SEGMENT CONTROL BYTE DEFINITIONS
	ND.CMP	= 200		;COMPRESSION FLAG
				;CONTROL BYTE=0 => END OF RECORD MARK
; ATTENTION MESSAGE DEFINITIONS
				;ATTENTION MESSAGE OFFSETS
N.ALGD	= 2			;(B)"LAST GOOD" ID
N.ACOD	= 3			;(B)ATTENTION CODE OFFSET
				;ATTENTION CODE VALUES
				;0 IS RESERVED
	N.ASTC	= 1		;STATUS CHANGE
	N.AACK	= 2		;DATA ACKNOWLEDGEMENT
	N.ARQS	= 3		;REQUESTED
	N.AABC	= 4		;OUTPUT ABORT RECEIVED OR INPUT ABORT COMPLETE
	N.APLE	= 5		;PAGE LIMIT EXCEEDED
N.AFLG	= 4			;(BM)(EX)ATTENTION FLAGS (UP TO 3 BYTES REQ'D)
				;COMMON FLAGS
				;BYTE 1 FLAGS
	NA.FAT	= 1		;FATAL ERROR
	NA.OFL	= 2		;OFFLINE
	NA.PAU	= 4		;PAUSED
	NA.OMD	= 10		;OUT OF MEDIA
	NA.JAM	= 20		;JAMMED
	NA.OOF	= 40		;OPERATOR OFFLINE
	NA.NOE	= 100		;NON OPERATOR ERROR
				;BYTE 2 FLAGS
	NA.OUF	= 1		;OUTPUT FULL
	NA.NAC	= 2		;DEVICE NOT ACCESSIBLE
	NA.DTO	= 4		;DEVICE TIME OUT
	NA.RNA	= 10		;RESOURCE NOT AVAILABLE
				;LINE PRINTER SPECIFIC ERRORS
	NA.PSE	= 20		;PAPER SLEW ERROR
	NA.INK	= 40		;OUT OF INK
				;RESERVED CODE
				;BYTE 3 FLAGS
	NA.OVP	= 1		;ILLEGAL OVERPRINT
			 	;PUNCHED CARD SPECIFIC ERRORS
				;BYTE 2 FLAGS
	NA.PF	= 20		;PICK FAILURE
	NA.RAP	= 40		;READ AFTER PUNCH ERROR
	NA.REG	= 100		;REGISTRATION ERROR
				;BYTE 3 FLAGS
	NA.IVP	= 1		;INVALID PUNCH ERROR
; N.APGC	= 		;(2B)PAGE CNTR (PREV FLD EXTNSBLE, NO FIXED OFFSET)
; FEATURES MESSAGES DEFINITIONS
				;FEATURES MESSAGE OFFSETS
N.FSEQ	= 2			;(B)FEATURES SEQUENCE NUMBER
N.NSPC  = 3			;(B) NO. OF FEATURES SPECS IN MSG
N.FSPC  = 4			;OFFSET TO 1ST FEATURE SPEC
				;REMAINING OFFSETS RELATIVE TO BEG OF A FEATURE SPEC
N.FID	= 0			;(B)FEATURES IDENTIFIER
				;COMMON UNIT RECORD DEVICE FEATURES
	FE.ESC	=	0	;RESERVED FOR FUTURE ESCAPE CODE
	FE.DAT	=	1	;(CLASS 1) DATA MODE
	   DM.ASC	=	1	;7 BIT ASCII
	   DM.CLI	=	2	;COLUMNIMAGE
	   DM.EBC	=	3	;EBCDIC
	   DM.AUG	=	4	;AUGMENTED COLUMNIMAGE
	   DM.AS8	=	5	;8 BIT ASCII
	FE.SER	=	2	;(CLASS 1) SERIAL NUMBER
	FE.LCR	=	3	;(CLASS 0) LOWER CASE RAISE
	FE.FWD	= 	4	;(CLASS 1) FORM WIDTH
	FE.EOF	=	5	;(CLASS 1) EOF RECOGNITION
	   EO.ASC	=	1	;ASCII
		EOFASC	=	7417	;ASCII EOF (COLUMN 1) PUNCH
	   EO.IMG	=	2	;IMAGE
	FE.DVT	=	6	;(CLASS 1) DEVICE TYPE
	FE.TRN	=	7	;(CLASS 0) RECORD TRUNCATION
	FE.FNM	=	8.	;(CLASS 1) FORM NAME
	FE.DWD	=	9.	;(CLASS 1) DEVICE WIDTH
				;DEVICE SPECIFIC FEATURES
				;LINE PRINTER
	LP.HT	=	130.	;(CLASS 1) HORIZONTAL TAB STOP
	LP.SFC	=	131.	;(CLASS 0) STANDARD VERTICAL FORMS CONTROL
	LP.OVP	=	132.	;(CLASS 1) OVERPRINT LIMIT
	LP.CVF	=	133.	;(CLASS 1) CUSTOM VFU
	LP.FCC	=	134.	;(CLASS 0) FORTRAN CARRIAGE CONTROL
	LP.VFR	=	135.	;(CLASS 1) VARIABLE FORMS RATIO
	   VF.6LI	=	1	;6 LINES PER INCH
	   VF.8LI	=	2	;8 LINES PER INCH
	LP.CHS	=	136.	;(CLASS 1) CHARACTER SET
	   CH.64	=	1	;64 CHARACTER SET
	   CH.96	=	2	;96 CHARACTER SET
	LP.PLE	=	137.	;(CLASS 1) PAGE LIMIT ENFORCEMENT
	LP.OPV	=	138.	;(CLASS 1) OPTICAL VFU NAME
				;CARD READER/PUNCH
	CD.CWD =	130.	;(CLASS 1) CARD WIDTH
				;SPECIAL FEATURE ID
	FE.ALL	=	255.	;AFFECTS ALL FEATURES(READ OR SET TO STD.)
N.FFLG	=	1		;(BM)FEATURES FLAGS
	NF.CMD	= 1		;SET FEATURES=1, READ=0
	NF.STD	= 2		;STANDARD FLAG
N.FCLS	=	2		;(B)FEATURE CLASS
	FC.CL0	= 0		;CLASS 0 FEATURE => <BIT> FORM
	FC.CL1	= 1		;CLASS 1 FEATURE => <CNT><...> FORM
	FC.SST	= 2		;SET TO STANDARD
	FC.CLM	= 3		;CLASS MASK
N.FRSP	=	3		;FEATURE RESPONSE FIELD
	FR.USF	= 1		;UNSUPPORTED FEATURE
	FR.BCL	= 2		;BAD CLASS SPEC'D
	FR.NST	= 3		;NO STANDARD VALUE
	FR.ERR	= 4		;FEATURE DATA OR FORMAT ERROR
	FR.CPN	= 5		;CHANGE PENDING
	FR.NEB	= 6		;NOT ENOUGH BUFFER (FOR REPORT)
	FR.DNP	= 7		;DEVICE NOT PAUSED
N.FDAT	= 4			;BEG FEATURES DATA(FORMAT CLASS DEPENDENT)
;CONTROL MESSAGE DEFINITIONS
				;CONTROL MESSAGE OFFSETS
N.CSEQ	= 2			;(B)CONTROL SEQUENCE NUMBER
N.CCMD	= 3			;(B)CONTROL COMMAND
	NC.AUE	=	1	;(INTERRUPT) ABORT UNTIL EOF
	NC.AUC	=	2	;(INTERRUPT) ABORT UNTIL CLEARED
	NC.CAB	=	3	;	CLEAR OUTPUT ABORT/ ACK INPUT ABORT
	NC.RQS	=	4	;	REQUEST STATUS
	NC.DMP	=	5	;	DUMP OUTPUT BUFFERS
	NC.PAU	=	6	;(INTERRUPT) PAUSE
	NC.RES	=	7	;(INTERRUPT) RESUME
	NC.RQC	=	9.	;	REQUEST CAPABILITIES
N.CRES	= 4			;(B)CONTROL RESULT CODE
				;NC.AUE,NC.AUC RESPONSE
	NR.ABS	=	0	;ABORT STATE
	NR.NAB	=	1	;NOTHING TO ABORT
				;NC.AUE RESPONSE
	NR.NOE	=	2	;NO EOF DEFINED
				;NC.CAB	RESPONSE
	NR.ACC	=	0	;ABORT COMPLETE CLEARED
	NR.ACN	=	1	;ABORT COMPLETE NOT SET
				;NC.RQS RESPONSE
	NR.ATT	=	0	;ATTENTION MSG FOLLOWS
				;NC.DMP RESPONSE
	NR.DMP	=	0	;OUTPUT BEING DUMPED
	NR.NOB	=	1	;NO OUTPUT BUFFERED
				;NC.PAU RESPONSE
	NR.DPS	=	0	;DEVICE WILL PAUSE
	NR.PAU	=	1	;DEVICE ALREADY PAUSED
	NR.NDP	=	2	;NO DATA TRANSFER TO PAUSE
				;NC.RES RESPONSE
	NR.RES	=	0	;DEVICE WILL RESUME
	NR.NPS	=	1	;DEVICE NOT PAUSED
	NR.NDR	=	2	;NO DATA TRANSFER TO RESUME
				;NC.RQC	RESPONSE
	NR.CAP	=	0	;CAPABILITIES FOLLOWS
; CAPABILITIES MESSAGE DEFINITIONS
				;CAPABILITIES MESSAGE OFFSETS
N.PCNT	= 2			;LIST COUNT BYTE
N.PCAP	= 3			;START OF CAPABILITIES LIST
	.ENDM	NURDF$
	.MACRO	NXOF$ LLA
	.MCALL	$$MOVB,$$QUE
	$$MOVB	LLA,C.LIN
	$$QUE	NT$XOF,FC.XME
	.ENDM
	.MACRO	NXON$ LLA
	.MCALL	$$MOVB,$$QUE
	$$MOVB	LLA,C.LIN
	$$QUE	NT$XON,FC.XME
	.ENDM
	.MACRO	ONCASE
	IF
	$$PUSH	$$CSTA
$$CSTA=0
	.ENDM
	.MACRO	OPNW$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	.IF B	<LUN>
	QDPB$	3,16400,<.MBXLU>,EFN,,IOST,AST,<PRMLST>
	.IFF
	QDPB$	3,16400,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDC
	.ENDM	OPNW$
	.MACRO	OPNW$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDP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
	.IFT
	.IF DF	M$$MGE
P.HDR:'L' .BLKW 1
	.ENDC
P.PRO:'L' .BLKW 1
P.ATT:'L' .BLKW 2
	.IF NDF	P$$LAS
P.LGTH='B'P.PRO
	.IFF
P.LGTH='B'.
	.ENDC
	.IFF
	.PSECT
PS.OUT='B'100000
PS.CKP='B'40000
PS.CKR='B'20000
PS.CHK='B'10000
PS.FXD='B'4000
PS.PER='B'2000
PS.LIO='B'1000
PS.NSF='B'400
PS.COM='B'200
PS.PIC='B'100
PS.SYS='B'40
PS.DRV='B'20
PS.DEL='B'10
PS.APR='B'7
	.ASECT
.=0
A.PCBL:'L'.BLKW	1
A.PRI:'L'.BLKB	1
A.IOC:'L'.BLKB	1
A.TCB:'L'.BLKW	1
A.TCBL:'L'.BLKW	1
A.STAT:'L'.BLKB	1
A.MPCT:'L'.BLKB	1
A.PCB:'L'.BLKW	1
A.LGTH='B'.
	.PSECT
AS.DEL='B'10
AS.EXT='B'4
AS.WRT='B'2
AS.RED='B'1
	.ENDC
	.MACRO	PCBDF$	X,Y,Z
	.ENDM
	.ENDM
	.MACRO	PDVDF$	L,B,LST
 
	.RADIX 8
	.ASECT
.=0
 
.IIF NB,LST,	.LIST
;
;	PROCESS DESCRIPTOR VECTOR OFFSETS AND BIT DEFINITIONS
;
 
Z.DSP:'B'	.BLKW	1	; RELOCATION BIAS OF DISPATCH TABLE
	.BLKW	1	; VIRTUAL ADDRESS OF DISPATCH TABLE
 
	.IF DF	X$$MCB
Z.QUE:'B'	.BLKW	1	; ADDRESS OF SCHEDULER LEVEL QUEUE
	.ENDC
Z.SCH:'B'	.BLKW	1	; ADDRESS OF SCHEDULER DATA BASE
Z.NAM:'B'	.BLKW	1	; PROCESS NAME (RAD50)
Z.LLN:'B'	.BLKB	1	; # OF LOGICAL LINES (LLC'S ONLY)
Z.FLG:'B'	.BLKB	1	; FLAGS BYTE
	.IF DF 	X$$MCB!R$$11M!R$$11S
Z.PCB:'B'	.BLKW	1	; PCB OF LOADED PROCESS PARTITION
	.ENDC
	.IF DF	R$$11D!I$$AS
Z.GCD:'B'	.BLKW	1	; ADDRESS OF GCD NODE( 0 = PROCESS NOT RESIDENT )
	.ENDC
Z.LEN='L'	.-Z.DSP		; LENGTH OF PDV
Z.DAT:'B'	.BLKW	1	; BIAS OF LLC DATA BASE
Z.MAP:'B'			; DISPLACEMENT OF LLC MAPPING TABLE
	.NLIST
	.PSECT
	.LIST
;
; FLAGS BYTE BIT DEFINTIONS
;
ZF.DDM='L'   1		; PROCESS IS A DDM
ZF.DLC='L'   2		; PROCESS IS A DLC
ZF.LLC='L'   4		; PROCESS IS A LLC
ZF.MFL='L'  10		; PROCESS IS MARKED FOR LOAD ( WITH NS )
ZF.KMX='L'  20		; PROCESS IS A DDM FOR A KMC DEVICE
ZF.MUX='L'  40		; PROCESS IS A DDM FOR A MULTIPLEXER DEVICE
ZF.LMC='L' 100		; PROCESS REQUIRES MICRO-CODE TO BE LOADED
ZF.TIM='L' 200		; PROCESS REQUESTS TIMER SUPPORT
 
.IIF NB,LST,	.NLIST
 
	.PSECT		; BACK TO BLANK PSECT
 
	.ENDM	PDVDF$
	.MACRO PDV$DF	LLCLST,DLCLST,DDMLST
 
	PDN=-1
 
	.IRP	NAM,<LLCLST>	; NUMBER LLC'S
	PDN=PDN+1
	NAM=PDN
	PD$'NAM==PDN*2
	.ENDM
 
	.IRP	NAM,<DLCLST>	; NUMBER DLC'S
	PDN=PDN+1
	NAM=PDN
	PD$'NAM==PDN*2
	.ENDM
 
	.IRP	NAM,<DDMLST>	; NUMBER DDM'S
	PDN=PDN+1
	NAM=PDN
	PD$'NAM==PDN*2
	.ENDM
 
	.ENDM	PDV$DF
	.MACRO	PKTDF$,L,B,SYSDEF
	.ASECT
.=177774
A.KSR5:'L' .BLKW 1
A.DQSR:'L' .BLKW 1
	.BLKW	1
A.CBL:'L' .BLKW	1
A.BYT:'L' .BLKW	1
A.AST:'L' .BLKW	1
A.NPR:'L' .BLKW	1
A.PRM:'L' .BLK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 LINE IS TO BE PRINTED, THEY MUST BE ENCLOSED IN <>'S
 
LB:	.BYTE	32.		; OPCODE
	.BYTE	LB'C		; COUNT
1$:	.BYTE	LINES
 
	LB'C=	.-1$
 
	.ENDM
	.MACRO	P2$	LB,STRING
 
	; TEXT MUST BE ENCLOSED IN </       />
 
LB:	.BYTE	33.		; OPCODE
	.BYTE	LB'C		; COUNT
1$:	.ASCII	STRING
 
	LB'C=	.-1$
 
	.ENDM
	.MACRO	QDPB$E	LBL,DIC,FNC,LUN,EFN,PRI,IOST,AST,PRMLST
	.MCALL	OFF$,DIR$
	.IF  B	LBL
	.ERROR	;MISSING ADDRESS LABEL
	.MEXIT
	.ENDC
	.IF NDF N.IOFN
	.NLIST
	.IRP	X,<,<N.IOFN,2>,<N.IOLU,2>,<N.IOEF,1>,<N.IOPR,1>>
	OFF$	X
	.ENDR
	.IRP	X,<<N.IOSB,2>,<N.IOAE,2>,<N.IOPL>>
	OFF$	X
	.ENDR
	.LIST
	.ENDC
	MOV	#<12.*400+DIC>,LBL
	MOV	FNC,LBL+N.IOFN
	.IIF NB <LUN>,	MOV	LUN,LBL+N.IOLU
	.IIF NB <EFN>,	MOVB	EFN,LBL+N.IOEF
	.IIF NB <PRI>,	MOVB	PRI,LBL+N.IOPR
	.IIF NB <IOST>,	MOV	IOST,LBL+N.IOSB
	.IIF NB <AST>,	MOV	AST,LBL+N.IOAE
	.IF NB	<PRMLST>
	.NLIST
$$$ARG = N.IOPL
	.LIST
	.IRP	X,<PRMLST>
	.IIF NB <X>,	MOV	X,LBL+$$$ARG
	.NLIST
$$$ARG = $$$ARG+2
	.LIST
	.ENDR
	.ENDC
	DIR$	#LBL
	.ENDM	QDPB$E
	.MACRO	RAND SUBR,ADDR,SIZE
	.IF NB	ADDR
	MOV	ADDR,$RADDR
	.ENDC
	.IF NB	SIZE
	MOV	SIZE,SYSFDB+F.RSIZ
	.ENDC
	CALL	SUBR
	.ENDM
.MACRO	RCIMDF
.PSECT	RCIDAT,RW,D,GBL,REL,OVR
RECCNT:	.WORD	0
.PSECT
.ENDM
	.MACRO	RECMAP
	.IF DF	M$$MGE
	.MCALL	HWDDF$
	HWDDF$
	MOV	UISAR6,KISAR6
	.ENDC
	.ENDM	RECMAP
	.MACRO	RECW$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	QDPB$	3,15000,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	RECW$
	.MACRO	RECW$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,3,#15000,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	RECW$E
	.MACRO	RECW$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	QDPB$S	3,#15000,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	RECW$S
	.MACRO	REC$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	QDPB$	1,15000,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	REC$
	.MACRO	REC$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,1,#15000,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	REC$E
	.MACRO	REC$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	QDPB$S	1,#15000,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	REC$S
	.MACRO	REGSV
	JSR	R5,.REGSV
	.ENDM
	.MACRO	REJW$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$
	.IF B	<LUN>
	$CON$	3,16020,<.MBXLU>,EFN,IOST,AST,98.,PRMLST
	.IFF
	$CON$	3,16020,LUN,EFN,IOST,AST,98.,PRMLST
	.ENDC
	.ENDM	REJW$
	.MACRO	REJW$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$E
	$CON$E	LABEL,3,#16020,LUN,EFN,IOST,AST,PRMLST
	.ENDM	REJW$E
	.MACRO	REJW$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$S
	.IF B	<LUN>
	$CON$S	3,#16020,<#.MBXLU>,EFN,IOST,AST,#98.,PRMLST
	.IFF
	$CON$S	3,#16020,LUN,EFN,IOST,AST,#98.,PRMLST
	.ENDC
	.ENDM	REJW$S
	.MACRO	REJ$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$
	.IF B	<LUN>
	$CON$	1,16020,<.MBXLU>,EFN,IOST,AST,98.,PRMLST
	.IFF
	$CON$	1,16020,LUN,EFN,IOST,AST,98.,PRMLST
	.ENDC
	.ENDM	REJ$
	.MACRO	REJ$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$E
	$CON$E	LABEL,1,#16020,LUN,EFN,IOST,AST,PRMLST
	.ENDM	REJ$E
	.MACRO	REJ$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	$CON$S
	.IF B	<LUN>
	$CON$S	1,#16020,<#.MBXLU>,EFN,IOST,AST,#98.,PRMLST
	.IFF
	$CON$S	1,#16020,LUN,EFN,IOST,AST,#98.,PRMLST
	.ENDC
	.ENDM	REJ$S
	.MACRO	RESMAP
	.IF DF	M$$MGE
	.MCALL	HWDDF$
	HWDDF$
	MOV	(SP)+,KISAR6
	.ENDC
	.ENDM
	.MACRO	RESRG	LIST
	.IRP	R,<LIST>
	MOV	(SP)+,R
	.ENDM
	.ENDM
.MACRO	RESSTK ARGLIN
.IRP	ARG,<ARGLIN>
  MOV	  (SP)+,ARG
.ENDM
.ENDM
.MACRO	RIDF
NODLEN	= 6.
LINLEN	= 5.
LENCNT	= 3.
.ASECT
.=0
MSBFHD:	.BLKW	1
LILEN:	.BLKW	1
LIADDR:	.BLKW	1
LIPTR:	.BLKW	1
MSGCOD:	.BLKB	1
MSGCNT:	.BLKB	2
STATE:	.BLKB	1
SBSTAT:	.BLKB	1
RETCOD:	.BLKB	1
OPTION:	.BLKB	1
RMNODE:	.BLKB	NODLEN+1
LINE:	.BLKB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$FLG:'L	.BLKW	1		; CONTROL FLAGS:
 RF.CVR	='B	100000		;  RESOURCE RECOVERY IN PROGRESS.
 RF.LIN	='B	001000		;  RESOURCE LINE SERVICE PENDING.
 RF.CCB	='B	000400		;  CCB PENDING.
 ;		000377		;  PIPE BEING FLUSHED.
R$RWT:'L	.LSTHD			; RESOURCE WAIT QUEUE.
R$TCQ:'L	.BLKW	1		; RESOURCE LINE SERVICE QUEUE.
R$PCB:'L	.BLKW	1		; NUMBER OF PCBS FOLLOWED BY
	.POOL			; THE POINTER TO THE PCB TABLE.
R$TCB:'L	.BLKW	1		; NUMBER OF TCBS FOLLOWED BY
	.BLKW	0		; THE TCB TABLE.
	.PSECT
	.ENDM	RMDDB$
	.MACRO	RMDF$	L,B
 
;+
; THIS MACRO DEFINES THE SYMBOLS WHICH THE RESOURCE MANAGER USES
; TO GENERATE RETURN CODES TO THE USER PROGRAM.
;-
 
 
; <RESPONSE> CODE DEFINITIONS
 
RC.FIN='B		0.		; FINAL RESPONSE, NO ERROR
RC.INT='B		1.		; INTERMEDIATE RESPONSE
RC.ACC='B		2.		; HANDOFEE ACCEPTS RESOURCE
RC.ANP='B		20.		; ACCESS NOT PERMITTED
RC.IAC='B		21.		; INVALID ACCOUNTING INFORMATION
RC.IRC='B		22.		; INVALID OR UNSUPPORTED REQUEST TYPE
RC.ICT='B		23.		; INVALID REQUEST CONCATENATION
RC.RQO='B		24.		; CONTROL ID ALREADY IN USE
RC.RNE='B		25.		; SPECIFIED RESOURCE DOES NOT EXIST
RC.RNA='B		26.		; REQUESTED RESOURCE NOT AVAILABLE
RC.IRD='B		27.		; INVALID RESOURCE DESCRIPTOR FORMAT
RC.GND='B		28.		; GENERIC DESCRIPTOR NOT SUPPORTED
RC.SHN='B		29.		; SHARED ACCESS NOT SUPPORTED
RC.RSO='B		30.		; TOO MANY USERS OF THE RESOURCE
RC.MLN='B		31.		; MULTI-LINK USAGE NOT SUPPORTED
RC.SLN='B		32.		; SINGLE-LINK USAGE NOT SUPPORTED
RC.ISO='B		33.		; INVALID SERVOR OPTION FIELD
RC.SNE='B		34.		; SPECIFIED SERVOR DOES NOT EXIST
RC.CNO='B		35.		; TOO MANY CONNECTIONS TO SERVOR
RC.RNS='B		36.		; RESOURCE NOT SUPPORTED BY SERVOR
RC.RJS='B		37.		; REQUEST REJECTED BY SERVOR
RC.RSI='B		38.		; RESOURCE OR SERVOR STATE INCONSISTENCY
RC.RSE='B		39.		; REQUEST MESSAGE SEQUENCE ERROR
RC.HNE='B		40.		; HANDOFEE DOES NOT EXIST
RC.REJ='B		41.		; HANDOFEE REJECTS RESOURCE
RC.ACA='B		42.		; ACCEPTANCE OF HANDOFF ABORTED
 
 
; <RESPONSE> MESSAGE DATA
 
RD.PNC='B		1.		; DATA PIPE NOT CONNECTED
RD.STR='B		2.		; START THRESHOLD ERROR
RD.NDI='B		1.		; REQUESTED RESOURCE NOT ONLINE
 
 
; <STATUS-REPORT> MESSAGE DATA
 
RP.RCV='B		1.		; RECEIVE ERROR THRESHOLD ERROR
RP.REP='B		2.		; REPLY THRESHOLD ERROR
RP.NAK='B		3.		; NAK THRESHOLD ERROR
RP.TRM='B		4.		; HARD TERMINAL ERROR
RP.IRQ='B		5.		; INTERVENTION REQUIRED AT TERMINAL
RP.PWF='B		6.		; POWERFAIL
RP.DSC='B		7.		; DATA PIPE DISCONNECTED
 
 
	.PSECT
	.ENDM
	.MACRO	RSXOK$
	CMP	$CRAVL-2,#3
	.IIF NDF,R$$11S, RSX$OK = 0
	.IF DF	RSX$OK
	BNE	.+20
	MOV	#.TT0,-(SP)
	ADD	#U.SCB,(SP)
	CMP	#$TT0,@(SP)+
	.ENDC
	BEQ	.+4
	SEC
	.ENDM	RSXOK$
	.MACRO	SABDF$
;
; SMART ASCII STATUS BYTE DEFINITIONS
;
; ONLY THE LOW BYTE OF THE STATUS WORD IS BEING USED TO AVOID CONFLICT
; WITH FUTURE RESERVATIONS OF BITS BY THE COMM/EXEC.
;
; ERROR CODES
;
SA.ABO	=	100377		; OPERATION ABORTED.
SA.NBF	=	100376		; COULD NOT OBTAIN BUFFER.
SA.NCH	=	100375		; NO CHARACTERISTICS DEFINED.
SA.BCH	=	100374		; BAD CHARACTERISTICS DEFINED.
SA.PAR	=	100373		; PARITY ERROR.
SA.OVR	=	100372		; OVER-RUN ERROR.
SA.BRK	=	100371		; BREAK OR FRAMING ERROR.
SA.IES	=	100370		; ILLEGAL ESCAPE SEQUENCE.		;**ADP07
;
; SUCCESS CODES
;
SA.SUC	=	000001		; OPERATION SUCCESSFUL.
SA.IMM	=	000002		; IMMEDIATE INTERRUPT.
SA.DFI	=	000003		; DEFERRED INTERRUPT.
SA.DFW	=	000004		; DEFERRED WAKE.
SA.WAK	=	000005		; WAKE.
SA.RRD	=	000006		; READ BUFFER BEING RESET.
SA.BFE	=	000007		; LOCAL EDIT EMPTIED BUFFER.
SA.FFL	=	000010		; FIELD FULL ON READ.
SA.TMO	=	000011		; READ TIMED OUT.
SA.XMF	=	000012		; TRANSMITTER QUIET.
SA.ESQ	=	000013		; ESCAPE SEQUENCE.			;**ADP05
;									;**ADP05
; FUNCTION CODE MODIFIERS						;**ADP05
;									;**ADP05
SA.WT	=	000000		; NORMAL WRITE.				;**ADP05
SA.FWT	=	001000		; FORCED WRITE.				;**ADP05
;									;**ADP05
SA.RD	=	000000		; NORMAL READ.				;**ADP05
SA.RDI	=	001000		; READ INITIATE.			;**ADP05
SA.RDR	=	002000		; READ RESUME.				;**ADP05
;
; SMART ASCII CCB FLAGS DEFINITIONS (INPUT FROM LLC)
;
SA.CHR	=	040000		; CHARACTERISTICS POINTED TO BY C.BUF2
SA.BF2	=	020000		; CHARACTERISTICS IN C.BUF2		;**ADP10
SA.TMP	=	010000		; CHARACTERISTICS ARE TEMPORARY		;**ADP10
	.ENDM	SABDF$
	.MACRO	SATDF$
	.ASECT
.=0
TIMER:	.BLKW	1		; DCOPS TIMER (MUST BE FIRST IN LT)
;
RCCB:	.BLKW	1		; CURRENT RECIEVE ENABLE CCB
RMAX:	.BLKW	1		; RECIEVE BUFFER COUNT REMAINING.
RLMT:	.BLKW	1		; RECIEVE BUFFER DATA LIMIT		;**ADP10
;
TCCB:	.BLKW	1		; CURRENT TRANSMIT ENABLE CCB
;									;**-1
XCCB:	.BLKW	1		; CURRENT TRANSMIT CCB
;
ECCB:	.BLKW	1		; CURRENT ECHO CCB
;
LINE:	.BLKW	1		; SYSTEM LINE NUMBER
;
; PROCESSING CHARACTERISTICS CCB POINTERS
;
IPRCH:	.BLKW	1		; CURRENT INPUT
IPRCHD:	.BLKW	1		; DEFAULT INPUT
OPRCH:	.BLKW	1		; CURRENT OUTPUT
OPRCHD:	.BLKW	1		; DEFAULT OUTPUT
;
TBUF:	.BLKW	1		; POINTER TO TAB STOP TABLE		;**ADP04
PBUF:	.BLKW	1		; POINTER TO PROMPT STRING		;**ADP04
DBUF:	.BLKW	2		; DEFERRED PROCESSING SILO.		;**ADP04
IBUF:	.BLKW	2		; COPY OF INPUT LINE.			;**ADP04
IBEG:	.BLKW	1		; STARTING ADDRESS OF ICOPY.		;**ADP04
ESQPT:	.BLKW	1		; ESCAPE SEQUENCE POINTER.		;**ADP07
OBUF:	.BLKW	2		; CURRENT POSITION IN OUTPUT.		;**ADP04
OCNT:	.BLKW	1		; CHARACTERS LEFT TO TRANSLATE.		;**ADP04
TCCBQ:	.BLKW	1		; COUNT OF XMIT CCBS OUTSTANDING.
ECCBQ	=	TCCBQ+1		; ECHO CCBS OUTSTANDING.
FPOS:	.BLKW	1		; FIELD STARTING POSITION:
ROW	=	FPOS+0		; FIELD STARTING ROW
COL	=	FPOS+1		; FIELD STARTING COLUMN
CPOS:	.BLKW	1		; CURRENT CURSOR POSITION:
HPOS	=	CPOS+0		; CURRENT HORIZONTAL POSITION
VPOS	=	CPOS+1		; CURRENT VERTICAL POSITION
SSIZ:	.BLKW	1		; SCREEN SIZE:
HSIZ	=	SSIZ+0		; TERMINAL SCREEN WIDTH
VSIZ	=	SSIZ+1		; TERMINAL SCREEN LENGTH
LCNT:	.BLKB	1		; LINES REMAINING IN PAGE.		;**ADP06
PCHR:	.BLKB	1		; FIELD PAINT CHARACTER
OSTS:	.BLKB	1		; RESOURCE STATUS:			;**ADP10
RWAIT	=	   200		;  WAITING ON RESOURCE			;**ADP10
RWTXMT	=	   300		;   ON TRANSMIT.			;**ADP10
RWTFLD	=	   240		;   ON FIELD POSITION.			;**ADP10
RWTPRM	=	   220		;   ON PROMPT.				;**ADP10
RWTLIN	=	   210		;   ON LINE RE-TYPE.			;**ADP10
RWTPNT	=	   204		;   ON FIELD PAINT.			;**ADP10
RWTECO	=	   202		;   ON ECHO.				;**ADP10
ITIM:	.BLKB	1		; TIMEOUT VALUE IN SECONDS
LCHR:	.BLKB	1		; LAST CHARACTER TYPED.
SCHR:	.BLKB	1		; LAST CHARACTER RECIEVED FROM SILO.
PFLG:	.BLKB	1		; PROCESSING FLAGS
PFLDFR	=	   001		;  DEFER INPUT PROCESSING
PFLECO	=	   002		;  ALLOW ECHOING
PFLNHB	=	004		;  INHIBIT INITIALIZATION OF FIELD	;**ADP11
PFLILM	=	   010		;  INPUT LIMIT SPECIFIED		;**ADP10
PFLRTM	=	   020		;  RESOURCE TIMEOUT IN PROGRESS		;**ADP04
PFLITM	=	   040		;  INPUT TIMEOUT IN PROGRESS		;**ADP03
PFLFLS	=	   100		;  OUTPUT FLUSHING CONTROL
PFLACK	=	   200		;  ACKNOWLEDGE OUTPUT DONE
TTYP:	.BLKB	1		; GENERIC TERMINAL TYPE
PGFMT:	.BLKB	1		; PAGE FORMATTING CONTROLS
PGFSHT	=	   001		;  SIMULATE HORIZONTAL TABS
PGFSFF	=	   002		;  SIMULATE FORM FEEDS
PGFSVT	=	   004		;  SIMULATE VERTICAL TABS
PGFLC	=	   010		;  TERMINAL HAS LOWER CASE		;**ADP02
PGFFF	=	   020		;  TERMINAL HAS HARDWARE FORMFEED	;**ADP02
PGFHT	=	   040		;  TERMINAL HAS HARDWARE TABS		;**ADP02
PGFVID	=	   100		;  TERMINAL IS A VIDEO			;**ADP02
PGFDEL	=	   200		;  HARDCOPY DELETE IN PROGRESS		;**ADP02
PAD:	.BLKB	1		; PADDING CLASS				;**ADP06
	.EVEN
DLTLN	=	.		; LENGTH OF LINE TABLE ENTRY.
	.PAGE
;
; PROCESSING FLAGS CCB FORMAT
;
.=0
MODE:	.BLKB	1		; GENERIC PROCESSING MODE
	.BLKB	1		; FLAGS
MODFLG	=	100000		;  MODIFIED PROCESSING MODE
ICCFLG	=	040000		;  INPUT MASK DEFINED
ECCFLG	=	020000		;  ECHO MASK DEFINED
OCCFLG	=	010000		;  OUTPUT MASK DEFINED
CLSFLG	=	004000		;  CLASS MAP DEFINED			;**ADP07
IEDIT:	.BLKB	1		; INPUT EDIT BIT FLAGS
IEDBT8	=	   001		;  RETAIN BIT 8
IEDIG0	=	   002		;  IGNORE NULLS
IEDRLC	=	   004		;  RAISE LOWER CASE
IEDCLF	=	   010		;  INSERT LINE FEEDS AFTER CARRIAGE RETURNS
IEDESC	=	   020		;  CONVERT 175-176 TO 33 (ESC)
IEDHDW	=	   200		;  IGNORE HARDWARE ERROR CHARACTERS
IISTD:	.BLKB	1		; INPUT INTERRUPT STANDARD MAP
IISCTC	=	   001		;  ^C - DEFERRED INTERRUPT, ECHO WITH CRLF
IISCTT	=	   002		;  ^T - IMMEDIATE INTERRUPT, NO ECHO
IISCTS	=	   004		;  ^S - IMMEDIATE INTERRUPT, NO ECHO
IISCTQ	=	   010		;  ^Q - IMMEDIATE INTERRUPT, NO ECHO
IISCTO	=	   020		;  ^O - IMMEDIATE INTERRUPT, ECHO WITH CRLF
IWCLS:	.BLKW	1		; INPUT I/W CLASS MAP
IWCFMT	=	000003		;  FORMATTING CONTROL CHARACTERS
IWCNFM	=	000014		;  NON-FORMATTING CONTROL CHARACTERS
IWCNUM	=	000060		;  NUMERICS
IWCALP	=	000300		;  ALPHABETICS
IWCPC0	=	001400		;  NUMERIC PUNCTUATION ".-,"
IWCPC1	=	006000		;  REMAINING PUNCTUATION
IWCHDW	=	140000		;  HARDWARE ERROR ACTION		;**ADP09
IWSTD:	.BLKB	1		; INPUT WAKE STANDARD MAP
IWSCR	=	   001		;  CR - ECHOED
IWSLF	=	   002		;  LF - ECHOED
IWSESC	=	   004		;  ESC - ECHOED
IWSBEL	=	   010		;  BEL - ECHOED
IWSFF	=	   020		;  FF - ECHOED
IWSCTZ	=	   040		;  ^Z - ECHOED WITH CRLF
IWSESQ	=	   100		;  ESCAPE SEQUENCE - NOT ECHOED		;**ADP05
IWSFFL	=	   200		;  FIELD FULL				;**ADP09
ILEDT:	.BLKB	1		; LOCAL EDIT ENABLES
ILEDEL	=	   001		;  DEL - DELETE CHARACTER
ILECTW	=	   002		;  ^W - DELETE TO PUNCTUATION
ILECTU	=	   004		;  ^U - DELETE LINE
ILECTR	=	   010		;  ^R - REDISPLAY LINE
ILEBFE	=	   200		;  WAKE ON BUFFER EMPTY
FLOW:	.BLKB	1		; FLOW CONTROLS
FLWCTO	=	   001		;  ENABLE ^O OUTPUT FLUSHING
FLWCTS	=	   002		;  ENABLE ^S & ^Q OUTPUT CONTROLS
FLWPAG	=	   004		;  ENABLE PAGE OUTPUT CONTROLS
OEDIT:	.BLKB	1		; OUTPUT STANDARD EDIT MAP
OEDBT8	=	   001		;  RETAIN BIT 8
OEDCTX	=	   002		;  NON-FORMATTING CONTROLS -> ^X
OEDBEL	=	   004		;  BELL -> ^X				;**ADP01
OEDESC	=	   010		;  ESCAPE -> $				;**ADP01
OEDCLF	=	   020		;  INSERT CRLF ON SCREEN OVERFLOW	;**ADP01
OEDFLC	=	   040		;  LOWER CASE -> 'X			;**ADP01
OEDFUC	=	   100		;  UPPER CASE -> 'X			;**ADP01
OEDRLC	=	   200		;  RAISE LOWER CASE			;**ADP01
ICCMSK:	.BLKB	10		; INPUT I/W CONTROL CHARACTER MASK
ECCMSK:	.BLKB	4		; ECHO CONTROL CHARACTER MASK
OCCMSK:	.BLKB	4		; OUTPUT CONTROL CHARACT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	.BYTE	.B!200
	.BYTE	.A/200
	.ENDM
	.MACRO SLTDF$	L,B,LST
	.ASECT
	.=0
 
.IIF NB,LST,	.LIST
;
;	SYSTEM LINE TABLE OFFSETS AND FLAG WORD BIT DEFINITIONS
;
L.FLG:'B'	.BLKW	1	; FLAGS WORD
L.DDM:'B'	.BLKB	1	; DDM PROCESS INDEX
L.DLC:'B'	.BLKB	1	; DLC PROCESS INDEX
L.DDS:'B'	.BLKW	1	; DDM LINE TABLE ADDRESS
L.DLM:'B'	.BLKW	1	; DLC LINE TABLE RELOCATION BIAS
L.DLS:'B'	.BLKW	1	; DLC LINE TABLE ( VIRTUAL ) ADDRESS
L.CTL:'B'	.BLKB	1	; CONTROLLER NUMBER
L.UNT:'B'	.BLKB	1	; MULTIPLEXER UNIT NUMBER
L.LEN='L'.			; LENGTH OF EACH SLT ENTRY
;
;	FLAG WORD DEFINITIONS
;
LF.BWT='L'000007	; BUFFER WAIT QUEUE COUNT
LF.TIM='L'000010	; LINE NEEDS TIMER SERVICE
LF.MTP='L'000020	; LINE IS MULTI-POINT
LF.DLO='L'000040	; LINE IS DIAL-OUT
LF.MDC='L'000100	; LINE NEEDS MODEM CONTROL
;	000200	UNUSED
;	000400	UNUSED
;	001000	UNUSED
LF.ENA='L'002000	; LINE IS TO BE ENABLED AT INITIALIZATION TIME
LF.MFL='L'004000	; LINE IS MARKED FOR LOAD AT INITIALIZATION TIME
LF.REA='L'010000	; LINE IS REASSIGNABLE
LF.UNL='L'020000	; LINE IS MARKED FOR UNLOAD
LF.RDY='L'040000	; LINE IS READY (DDM,DLC PROCESSES AND LINE TABLES ASSIGNED)
LF.ACT='L'100000	; LINE IS ACTIVE ( LINE IS ASSIGNED TO AN LLC )
 
.IIF NB,LST,	.NLIST
 
	.PSECT	; RETURN TO BLANK PSECT
	.ENDM	SLTDF$
	.MACRO SLTSYM	NAM,DLC,LLC,FLG,CNT,UNT,SLN
 
	S'SLN'DD=NAM		; SLN DDM
	S'SLN'DL=DLC		; SLN DLC
	S'SLN'LL=LLC		; SLN LLC
	S'SLN'CN=CNT		; SLN CONTROLLER NUMBER
	S'SLN'UN=UNT		; SLN UNIT NUMBER
	.IF NB FLG
	S'SLN'SF=FLG		; SLN FLAG VALUE
	.IFF
	S'SLN'SF=0		; SLN FLAG VALUE DEFAULT
	.ENDC
	NAM'CNT'UNT=1		; CONTROLLER-UNIT NUMBER EXISTS
	SSL'SLN=0		; COUNT NUMBER OF STATIONS ON THIS LINE
	STATN=0			; START WITH STATION 0 ON THIS LINE ( USED BY STA$DF )
 
	.ENDM	SLTSYM
	.MACRO SLT$DF	NAM,DLC,LLC,FLG,CNT,UNT,ENB
 
;
;	SYSTEM LINE TABLE DEFINITIONS
;
	SLN=SLN+1
	SLTSYM NAM,DLC,LLC,FLG,\CNT,\UNT,\SLN
 
	.ENDM	SLT$DF
	.MACRO	SNDW$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	QDPB$	3,14400,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	SNDW$
	.MACRO	SNDW$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,3,#14400,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	SNDW$E
	.MACRO	SNDW$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	QDPB$S	3,#14400,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	SNDW$S
	.MACRO	SND$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	QDPB$	1,14400,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	SND$
	.MACRO	SND$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,1,#14400,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	SND$E
	.MACRO	SND$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	QDPB$S	1,#14400,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	SND$S
	.MACRO	SPAW$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	.IF B	<LUN>
	QDPB$	3,16420,<.MBXLU>,EFN,,IOST,AST,<PRMLST>
	.IFF
	QDPB$	3,16420,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDC
	.ENDM	SPAW$
	.MACRO	SPAW$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,3,#16420,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	SPAW$E
	.MACRO	SPAW$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	.IF B	<LUN>
	QDPB$S	3,#16420,<#.MBXLU>,EFN,,IOST,AST,<PRMLST>
	.IFF
	QDPB$S	3,#16420,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDC
	.ENDM	SPAW$S
	.MACRO	SPA$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	.IF B	<LUN>
	QDPB$	1,16420,<.MBXLU>,EFN,,IOST,AST,<PRMLST>
	.IFF
	QDPB$	1,16420,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDC
	.ENDM	SPA$
	.MACRO	SPA$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,1,#16420,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	SPA$E
	.MACRO	SPA$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	.IF B	<LUN>
	QDPB$S	1,#16420,<#.MBXLU>,EFN,,IOST,AST,<PRMLST>
	.IFF
	QDPB$S	1,#16420,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDC
	.ENDM	SPA$S
.MACRO	SPDF
NODLEN	= 6.
PASLEN	= 8.
.ASECT
.=0
CMLKNM:	.BLKW	1
LINCOU:	.BLKW	1
NEXLIN:	.BLKW	1
STATE:	.BLKB	1
RETCOD:	.BLKB	1
OPTION:	.BLKB	1
NODE:	.BLKB	NODLEN+1
LINE:	.BLKB	4
PASWOR:	.BLKB	PASLEN+1
REQSTA:	.BLKB	1
FLAGS:	.BLKB	1
CTXTLN	= .
.PSECT
SETUP	= 1.
PROC	= 2.
FINISH	= 3.
KNLNST	= 001
DEFHOS	= 0.
LINHOS	= 1.
LOCLOO	= 4.
NODOPR	= 6.
NODMAI	= 7.
LINSTA	= 8.
LINOPR	= 9.
LINMAI	= 10.
DEFREC	= 11.
DEFTRA	= 12.
LOGTGT	= 13.
.MACRO	SPDF
.ENDM
.ENDM
.MACRO	SPMDF
.MCALL	CONFIG,CONDF
CONFIG
CONDF
.MACRO	TABENT FLAG,INDEX,TYPCOD,VALUES
.IF     NE FLAG
  INDEX   = .-CONTAB
  .BYTE   TYPCOD
  .IRP    $$TEMP,<VALUES>
    .BYTE   $$TEMP
  .ENDM
  .BYTE	0
.ENDC
.ENDM
.PSECT	SPDAT,RW,D,GBL,REL,OVR
CONTAB:
TABENT	FS$HOS,DFHOIX,SP$DHO,<<NODE,0.>>
TABENT	FS$HOS,LNHOIX,SP$LHO,<<LINE,4.>,<NODE,0.>>
TABENT	FS$PAS,DFRCIX,SP$DRP,<<PASWOR,8.>>
TABENT	FS$PAS,DFTRIX,SP$DTP,<<PASWOR,8.>>
TABENT	FS$LLP,LCLPIX,SP$LLP,<<REQSTA,1.>,<LINE,4.>>
TABENT  FS$LST,LNSTIX,SP$LST,<<LINE,4.>,<REQSTA,1.>>
.PSECT
.ENDM
.MACRO	SRDF
.MCALL	CONFIG
CONFIG
SERFLG	= 1.
TIMFLG	= 2.
BLKFLG	= 3.
TEMFLG  = 24.
SERBIT	= 1.
TIMBIT	= 2.
FLGGRP	= 0.
FLGMSK	= SERBIT!TIMBIT
CMOLUN	= 1.
CMILUN	= CMOLUN+1
.IF NE	F$TRACE
TRCLUN	= CMILUN+1.
NETLUN	= TRCLUN+1.
.IFF
NETLUN	= CMILUN+1.
.ENDC
LNKLUN	= NETLUN+1.
FILLUN	= LNKLUN+F$LKLU
NCOLUN	= FILLUN+F$INLU+F$OTLU+F$IRLU+F$ORLU
LINLUN	= NCOLUN+1.
.MACRO	SRDF
.ENDM
.ENDM
.MACRO	SRMDF
.PSECT	SRDAT,RW,D,GBL,REL,OVR
ORWTHD:	.WORD	0
ORWTTL:	.WORD	ORWTHD
UNWTHD:	.WORD	0
UNWTTL:	.WORD	UNWTHD
INPRHD:	.WORD	0
INPRTL:	.WORD	INPRHD
.IF	DF	R$$11D!I$$AS
NETPUD:	.WORD	0
.ENDC
.PSECT
.ENDM
	.MACRO STASYM SL,PDI,STA
	SSL'SL=SSL'SL+1			; ONE MORE STATION ON THIS SYSTEM LINE
	S'SL'C'STA=PDI			; REMEMBER PROCESS DESCR. INDEX
	.ENDM STASYM
	.MACRO STA$DF ID,LLC
	STASYM \SLN,\PD$'LLC,\STATN	; DEFINE STATION'S SYMBOLS
	STATN=STATN+1			; ONE MORE MULTIDROP STATION
	STATBL=STATBL+1			; TOTAL NUMBER OF STATIONS
	.ENDM STA$DF
	.MACRO	STOPDV,SRC	;STORES DEST PDV IN CCB
	MOVB	SRC,C.STA(R5)
	BISB	#200,C.STA(R5)
	.ENDM
	.MACRO	STOULA,SRC	;STORES ULA IN CCB
	MOVB	SRC,C.LIN(R5)
	.ENDM
	.MACRO SWTCHI	AA,BB
	.IF NB AA
	MOV	AA,SYSFDB+F.URBD+2	; NEW BUFFER ADDRESS
	.IFF
	MOV	#$BFR,SYSFDB+F.URBD+2	; DEFAULT BUFFER ADDRESS
	.ENDC
	.IF NB BB
	MOV	BB,SYSFDB+F.URBD	; NEW BUFFER SIZE
	.ENDC
	.ENDM	SWTCHB
	.MACRO SWTCHO	AA,BB
	.IF NB AA
	MOV	AA,SYSFDB+F.NRBD+2	; NEW BUFFER ADDRESS
	.IFF
	MOV	#$BFR,SYSFDB+F.NRBD+2	; DEFAULT BUFFER ADDRESS
	.ENDC
	.IF NB BB
	MOV	BB,SYSFDB+F.NRBD	; NEW BUFFER SIZE
	.ENDC
	.ENDM	SWTCHB
	.MACRO	SYSTATE
	.IF	DF,R$$11M
	  IF
	  $$SYS	\$$STNM,10
	.IFF
	  MOV     R0,-(SP)
	  MOV     R1,-(SP)
	  MOV     R2,-(SP)
	  MOV     R3,-(SP)
	  MOV     R4,-(SP)
	  MOV     R5,-(SP)
	.ENDC
	.IF	DF,R$$11D!I$$AS
	  .INH0
	.ENDC
	.ENDM
	.MACRO	TCBDF$,L,B,SYSDEF
	.ASECT
.=0
T.LNK:'L' .BLKW	1
T.PRI:'L' .BLKB	1
T.IOC:'L' .BLKB	1
T.CPCB:'L' .BLKW 1
T.NAM:'L' .BLKW	2
T.RCVL:'L' .BLKW 2
T.ASTL:'L' .BLKW 2
T.EFLG:'L' .BLKW 2
T.UCB:'L' .BLKW	1
T.TCBL:'L' .BLKW 1
T.STAT:'L' .BLKW 1
T.ST2:'L' .BLKW 1
T.ST3:'L' .BLKW 1
T.DPRI:'L' .BLKB 1
T.LBN:'L' .BLKB	3
T.LDV:'L' .BLKW	1
T.PCB:'L' .BLKW	1
T.MXSZ:'L' .BLKW 1
T.ACTL:'L' .BLKW 1
T.ATT:'L' .BLKW 2
T.OFF:'L' .BLKW 1
	.BLKB 1
T.SRCT:'L' .BLKB 1
T.RRFL:'L' .BLKW 2
	.IF NB	SYSDEF
	.IF NDF	P$$LAS
T.LGTH='B'T.ATT
	.IFF
T.LGTH='B'.
	.ENDC
T.EXT='B'0
	.IFF
TS.EXE='B'100000
TS.RDN='B'40000
TS.MSG='B'20000
TS.NRP='B'10000
TS.RUN='B'4000
TS.OUT='B'400
TS.CKP='B'200
TS.CKR='B'100
TS.BLK='B'TS.CKP!TS.CKR!TS.EXE!TS.MSG!TS.NRP!TS.OUT!TS.RDN
T2.AST='B'100000
T2.DST='B'40000
T2.CHK='B'20000
T2.CKD='B'10000
T2.BFX='B'4000
T2.FXD='B'2000
T2.TIO='B'1000
T2.CAF='B'400
T2.HLT='B'200
T2.ABO='B'100
T2.STP='B'40
T2.STP='B'20
T2.SPN='B'10
T2.SPN='B'4
T2.WFR='B'2
T2.WFR='B'1
T3.ACP='B'100000
T3.PMD='B'40000
T3.REM='B'20000
T3.PRV='B'10000
T3.MCR='B'4000
T3.SLV='B'2000
T3.CLI='B'1000
T3.RST='B'400
T3.NSD='B'200
T3.CAL='B'100
T3.ROV='B'40
T3.NET='B'20
	.ENDC
	.PSECT
	.MACRO	TCBDF$	X,Y,Z
	.ENDM
	.ENDM
.MACRO	TEMMDF
.PSECT	TEMDAT,RW,D,LCL,REL,OVR
TEMWLN	= 13.
TEMBLN	= TEMWLN*2
TEMBLK:	.BLKW	TEMWLN
.PSECT
.ENDM
	.MACRO	THEN
	$$LAB	\$$STNM,\$$TRNM
	.ENDM
.MACRO	TMPDF
C$HELP	= 1.
C$STEX	= 11.
C$STST	= 12.
C$STLG	= 13.
C$STHS	= 14.
C$STPW	= 15.
C$STLN	= 16.
C$STPC	= 17.
C$STLL	= 18.
C$STCX	= 19.
C$CLHS	= 21.
C$CLPW	= 22.
C$CLLN	= 23.
C$CLPC	= 24.
C$CLCX	= 25.
C$LDRM	= 31.
C$LDVI	= 32.
C$LDKN	= 33.
C$LPRM	= 41.
C$LPLN	= 42.
C$SHCT	= 51.
C$SHST	= 52.
C$SHEX	= 53.
C$SHQU	= 54.
C$SHLK	= 55.
C$ZERO	= 61.
C$EXIT	= 71.
IE$NOD	= -1.
IE$NDN	= -2.
IE$LIN	= -3.
IE$PAS	= -4.
IE$CSR	= -5.
IE$VCT	= -6.
IE$PRI	= -7.
IE$FIL	= -8.
IE$BCT	= -9.
IE$BLN	= -10.
IE$OPT	= -11.
IE$PFX	= -12.
IE$KEY	= -13.
IE$CMD	= -14.
IE$PRO	= -15.
IE$PAR	= -16.
IE$INC	= -17.
IE$MEX	= -18.
LO$OPT	= 1
LO$TOP	= 2
LO$ECO	= 4
LO$FDX	= 10
LO$HDX	= 20
LF$LIN	= 1.
LF$STR	= 2.
NS$ON	= 1.
NS$OFF	= 2.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T:	.WORD	0
BLKTYP:	.WORD	0
BLKLEN:	.WORD	0
TMPSIZ	= .-CMTYPE
.PSECT
.ENDM
.MACRO	TRDF
NODLEN	= 6.
BPSLEN	= 8.
.ASECT
.=0
CMLKNM:	.BLKW	1
LSLKNM:	.BLKW	1
STATE:	.BLKB	1
RETCOD:	.BLKB	1
OPTION:	.BLKB	1
TGNODE:	.BLKB	NODLEN+1
SVNODE:	.BLKB	NODLEN+1
LINE:	.BLKB	4
BOOPAS:	.BLKB	BPSLEN+1
CTXTLN	= .
.PSECT
CONFIG	= 1.
PROC	= 2.
FINISH	= 3.
BADBIT	= 370
NOTNAM	= 001
SRVINC	= 002
BPSINC	= 004
.MACRO	TRDF
.ENDM
.ENDM
.MACRO	TRIMDF
.PSECT	TRIDAT,RW,D,GBL,REL,OVR
NTLSTD:	.BLKW	1
GCD:	.BLKW	2
OPAR3:	.BLKW	1
OPDR3:	.BLKW	1
.PSECT
.ENDM
	.MACRO	TRUE,COMP,OP1,OP2
	$$GNCM	COMP,<OP1>,<OP2>,0
	.ENDM
	.MACRO	TRUEB,COMP,OP1,OP2
	$$GNCM	COMP,<OP1>,<OP2>,0,B
	.ENDM
.MACRO	TSDF
NODLEN	= 6.
.ASECT
.=0
CMLKNM:	.BLKW	1
LPLKNM:	.BLKW	1
COUNT:	.BLKW	1
MSGADR:	.BLKW	1
MSGLEN:	.BLKW	1
BLKLEN:	.BLKW	1
STATE:	.BLKB	1
RETCOD:	.BLKB	1
OPTION:	.BLKB	1
NODE:	.BLKB	NODLEN+1
LINE:	.BLKB	4
BLKTYP:	.BLKB	1
CTXTLN	= .
.PSECT
NODTES	= 1.
LINTES	= 2.
FINISH	= 3.
TESNOD	= 0.
TESLIN	= 1.
MXBKTY	= 2.
MXBKLN	= 300.-2.
.MACRO	TSDF
.ENDM
.ENDM
	.MACRO	TSK$DF	A,B
	.ENDM
	.MACRO	TTDF$	L,B
	.ASECT
;+
;		    PIPE CONTROL BLOCK (PCB)
;
;		+----------------------------------+	000
;		!		P.RSV		   !
;		+----------------------------------+	002
;		!	    P.RES / P.OPN	   !
;		+----------------------------------+	004
;		!	    P.REF / P.CBTN	   !
;		+----------------------------------+	006
;		!		P.USER		   !
;		+----------------------------------+	010
;		!		P.STS		   !
;		+----------------------------------+	012
;		!				   !
;		+		P.BPQ		   +
;		!				   !
;		+----------------------------------+	016
;		!		  !	P.LLA	   !
;		+----------------------------------+	020
;		!	P.SPI	  !	P.NUM	   !
;		+----------------------------------+	022
;		!		P.SEG		   !
;		+----------------------------------+	024
;-
 
;  PCB OFFSET DEFINITIONS
 
.=0
P.RSV:'L	.BLKW	1		; RESERVED WORD
P.RES:'L				; * POINTER TO RESERVED TERMINAL LIST
P.OPN:'L	.BLKW	1		; ** POINTER TO OPEN TERMINAL LIST
P.REF:'L				; * POINTER TO REFERED CONTROL TERMINAL LIST
P.CBTN:'L	.BLKW	1		; ** CURRENT BTN FOR MULTI-SEGMENT MSSAGES
P.USER:'L	.BLKW	1		; USER IDENTIFICATION NUMBER
P.STS:'L	.BLKW	1		; PIPE STATUS:
 PS.CI	='B	000001		;  CONNECT INITIATED
 PS.CC	='B	000002		;  CONNECT COMPLETED
 PS.DIP	='B	000004		;  DISCONNECT INITIATE PENDING
 PS.ABO	='B	000010		;  ABORT PENDING
 PS.BP	='B	000020		;  LINK IS BACK-PRESSURED
 PS.NKP	='B	000040		;  NAK PENDING
 PS.IMP	='B	000100		;  INTERRUPT MESSAGE PENDING
 PS.CTL	='B	010000		;  * PIPE IS CONTROL PIPE
 PS.DAT	='B	020000		;  ** PIPE IS DATA PIPE
;				   BIT MASKS:
 PS.RCN	='B PS.CI!PS.CC!PS.DIP	;  PIPE READY FOR CONNECT
P.BPQ:'L	.BLKW	2		; BACK-PRESSURE QUEUE
P.LLA:'L	.BLKB	1		; LOGICAL LINK ADDRESS OF PIPE
	.BLKB	1		; (RESERVED)
P.NUM:'L	.BLKB	1		; PIPE NUMBER
P.SPI:'L	.BLKB	1		; PDV INDEX OF PIPE OWNER
P.SEG:'L	.BLKW	1		; LINK SEGMENT SIZE
PCBLEN ='B .			; LENGTH OF PCB
; NOTE:'L
; *  - CONTROL PIPE ONLY
; ** - DATA PIPE ONLY
;+
;
;		  TERMINAL CONTROL BLOCK (TCB)
;
;		+--------------------------------+	000
;		!		T.LNK		 !
;		+--------------------------------+	002
;		!		T.OLNK		 !
;		+--------------------------------+	004
;		!		T.PCBR		 !
;		+--------------------------------+	006
;		!		T.PCBD		 !
;		+--------------------------------+	010
;		!		T.RID		 !
;		+--------------------------------+	012
;		!		T.STS		 !
;		+--------------------------------+	014
;		!	T.FLG	 !	T.TT	 !
;		+--------------------------------+	016
;		!	T.SPI	 !	T.NUM	 !
;		+--------------------------------+	020
;		!	T.NAML	 !	T.OBJ	 !
;		+--------------------------------+	022
;		!				 !
;		=		T.NAM		 =
;		!				 !
;		+--------------------------------+	030
;		!		T.WCNT		 !
;		+--------------------------------+	032
;		!		T.RCNT		 !
;		+--------------------------------+	034
;		!		T.DMRB		 !
;		+--------------------------------+	036
;		!		T.DMVA		 !
;		+--------------------------------+	040
;
;-
 
;
;  TCB OFFSET DEFINITIONS
;
 
.=0
T.LNK:'L	.BLKW	1		; LINK TO NEXT RESERVED TERMINAL
T.OLNK:'L	.BLKW	1		; LINK TO NEXT OPENED TERMINAL
T.PCBR:'L	.BLKW	1		; LINK TO RESERVER'S CONTROL/DATA PCB
T.PCBD:'L	.BLKW	1		; LINK TO DATA PCB/HANDOFFEE'S CONTROL PCB
T.RID:'L	.BLKW	1		; REQUESTOR ID FOR RESERVER
T.STS:'L	.BLKW	1		; TERMINAL STATUS:
 TS.CLP	='B	000001		;  CLOSE PENDING
 TS.OPP	='B	000002		;  OPEN PENDING
 TS.OP	='B	000004		;  OPEN TERMINAL
 TS.RLP	='B	000010		;  RELEASE PENDING
 TS.RS	='B	000020		;  RESERVED
 TS.HP	='B	000040		;  HANDOFF PENDING
 TS.SRP	='B	000200		;  STATUS REPORT PENDING
 TS.OSP	='B	000400		;  OPERATIONAL STATUS PENDING
 TS.STE	='B	001000		;  START ERROR PENDING
 TS.PWF	='B	002000		;  POWERFAIL PROCESSING PENDING
;					   BIT MASKS:
 TS.OCP	='B TS.CLP!TS.OPP!TS.OP		;  OPEN OR CLOSE PENDING
 TS.ROP	='B TS.OCP!TS.RLP!TS.HP		;  READY FOR OPEN
 TS.RHF	='B TS.ROP!TS.SRP		;  READY FOR HANDOFF
 TS.RRL	='B TS.CLP!TS.OPP!TS.RLP!TS.HP	;  READY FOR RELEASE
T.TT:'L	.BLKB	0		; RESOURCE TYPE:
 TT.V62	='B	  1.		;  VT62 TERMINAL
 TT.V52	='B	  2.		;  VT52 TERMINAL
 TT.L36	='B	  3.		;  LA36 TERMINAL
 TT.L18	='B	  4.		;  LA180 PRINTER
 TT.DDC	='B	  5.		;  DDCMP LINE
 TT.LE	='B	  6.		;  LP11 LINE PRINTER
 TT.LP	='B	  7.		;  LP20 LINE PRINTER
 TT.CR	='B	  8.		;  CR11 CARD READER
 TT.CD	='B	  9.		;  CD20 CARD READER
T.FLG:'L	.BLKW	1		; CONTROL FLAGS:
 TF.DEA	='B	040000		;  RESOURCE DEASSIGNED
 TF.DIS	='B	020000		;  LINE DISABLED
;		000377		; (RESOURCE TYPE)
;					   BIT MASKS:
 TF.RAL	='B	TF.DEA!TF.DIS		;  READY FOR ALLOCATION
T.NUM:'L	.BLKB	1		; TERMINAL NUMBER
T.SPI:'L	.BLKB	1		; SERVER PROCESS INDEX
T.OBJ:'L	.BLKB	1		; RESOURCE OBJECT TYPE
T.NAML:'L	.BLKB	1		; TERMINAL NAME LENGTH
T.NAM:'L	.BLKB	6		; TERMINAL NAME (ASCII)
T.WCNT:'L	.BLKW	1		; WRITE COUNT
T.RCNT:'L	.BLKW	1		; READ COUNT
T.DMRB:'L	.BLKW	1		; RELOCATION BIAS OF DIALOG MANAGER BUFFER
T.DMVA:'L	.BLKW	1		; VIRTUAL ADDRESS OF DIALOG MANAGER BUFFER
TCBLEN	='B .			; LENGTH OF TCB
 
	.PSECT
	.ENDM
	.MACRO	T1$	LB
 
LB:	.BYTE	40., 0		; OPCODE, COUNT
 
	.ENDM
	.MACRO	T2$	LB
 
LB:	.BYTE	41., 0		; OPCODE, COUNT
 
	.ENDM
	.MACRO	UCBDF$,L,B
	.ASECT
.=177772
U.CLI:'L' .BLKW	1
U.LUIC:'L' .BLKW 1
U.OWN:'L' .BLKW 1
U.DCB:'L' .BLKW	1
U.RED:'L' .BLKW	1
U.CTL:'L' .BLKB	1
U.STS:'L' .BLKB	1
U.UNIT:'L' .BLKB 1
U.ST2:'L' .BLKB	1
U.CW1:'L' .BLKW	1
U.CW2:'L' .BLKW	1
U.CW3:'L' .BLKW	1
U.CW4:'L' .BLKW	1
U.SCB:'L' .BLKW	1
U.ATT:'L' .BLKW	1
U.BUF:'L' .BLKW	1
	.BLKW	1
U.CNT:'L' .BLKW	1
U.ACP='B'U.CNT+2
U.VCB='B'U.CNT+4
U.CBF='B'U.CNT+2
U.UIC='B'U.CNT+<9.*2>
	.PSECT
DV.REC='B'1
DV.CCL='B'2
DV.TTY='B'4
DV.DIR='B'10
DV.SDI='B'20
DV.SQD='B'40
DV.MXD='B'100
DV.UMD='B'200
DV.SWL='B'1000
DV.ISP='B'2000
DV.OSP='B'4000
DV.PSE='B'10000
DV.COM='B'20000
DV.F11='B'40000
DV.MNT='B'100000
U2.DH1='B'100000
U2.DJ1='B'40000
U2.RMT='B'20000
U2.L8S='B'10000
U2.NEC='B'4000
U2.CRT='B'2000
U2.ESC='B'1000
U2.LOG='B'400
U2.SLV='B'200
U2.DZ1='B'100
U2.HLD='B'40
U2.AT.='B'20
U2.PRV='B'10
U2.L3S='B'4
U2.VT5='B'2
U2.LWC='B'1
U2.R04='B'100000
U2.7CH='B'10000
UC.ALG='B'200
UC.NPR='B'100
UC.QUE='B'40
UC.PWF='B'20
UC.ATT='B'10
UC.KIL='B'4
UC.LGH='B'3
US.BSY='B'200
US.MNT='B'100
US.FOR='B'40
US.MDM='B'20
US.ABO='B'1
US.MDE='B'2
US.WCK='B'10
US.DSB='B'10
US.CRW='B'4
US.ECH='B'2
US.OUT='B'1
US.FRK='B'2
US.SHR='B'1
US.LAB='B'4
US.OFL='B'1
US.RED='B'2
US.PUB='B'4
US.UMD='B'10
	.MACRO	UCBDF$,X,Y
	.ENDM
	.ENDM
	.MACRO UNT$DF A,B,C,D,E,F,G,H,I,J,K,L,M
	.ENDM	UNT$DF
	.MACRO	VNPBPT	AA,BB
	.MCALL	ERMSG$,ERBLK$,ERRPT$
	.IF NB BB
	BR	1$
	ERMSG$	<AA>
	ERBLK$
1$:	MOV	#2$,-(SP)	; SET RETURN ADDRESS
	ERRPT$	,$EROUT
2$:
	.LIST MEB
	BPT
	.NLIST MEB
	.ENDC
	.ENDM	VNPBPT
	.MACRO	VNPDF$	C,E
	.ASECT
	.=0
LR.STS:'C'	.BLKW	1	; FUNCTION CODE, STATUS BITS
 
; "NODE ON" REQUEST BLOCK OFFSETS
 
LR.BLK:'C'	.BLKW	1	; NETLDR DATA BLOCK ADDRESS
 
; "SET PROCESS" REQUEST BLOCK OFFSETS
 
	.=LR.BLK
LR.PRO:'C'	.BLKW	1	; PROCESS NAME (RAD50)
LO.INC:'C'	.BLKW	1	; INCREMENT VALUE (32. WORD BLOCKS)
LO.PAR:'C'	.BLKW	2	; PARTITION NAME (RAD50)
 
; "SET LINE" OR "SET STATE" REQUEST BLOCK OFFSETS
 
	.=LR.BLK
LR.LIN:'C'	.BLKW	1	; DDM NAME (RAD50)
LR.CTL:'C'	.BLKB	1	; CONTROLLER NUMBER
LR.UNT:'C'	.BLKB	1	; UNIT NUMBER
LO.CSR:'C'	.BLKW	1	; CSR ADDRESS
LO.PRI:'C'	.BLKW	1	; INTERRUPT PRIORITY (1 THRU 7)
LO.VCT:'C'	.BLKW	1	; INTERRUPT VECTOR
LO.CHA:'C'	.BLKW	1	; DEVICE CHARACTERISTICS (NON-MUX ONLY)
 
; "SET PASSWORD" REQUEST BLOCK OFFSETS
 
	.=LR.BLK
LR.PAS:'C'	.BLKW	4	; MAX 8 ASCII CHARACTERS
LR.NOD:'C'	.BLKW	2	; NODE NAME INS RAD50 ( 6 ALPHA )
 
; FUNCTION CODES
 
LS.CEX='E'1		; "NODE ON"
LS.PRO='E'2		; "SET PROCESS"
LS.LIN='E'3		; "SET LINE"
LX.CEX='E'4		; "NODE OFF"
LX.PRO='E'5		; "CLEAR PROCESS"
LX.LIN='E'6		; "CLEAR LINE"
LS.LMC='E'7		; RELOAD ALL KMC MICROCODE (AFTER POWERFAIL)
LS.TST='E'10		; TEST ( VNP TEST ROUTINES )
LS.PAS='E'11		; SET/CLEAR PASSWORD
LS.ENA='E'12		; ENABLE/DISABLE LINE
LS.XIT='E'13		; EXIT FROM VNP
LS.NTI='E'14		; RUN NTINIT
LS.ACP='E'15		; MOUNT ACP
LS.SHL='E'16		; SHOW STATE KNOWN LINES
LS.HST='E'17		; SET HOST
	; STATUS BITS
LS.OPT='E'400		; OPTIONAL PARAMETERS INCLUDED
LS.ECH='E'1000		; ECHO THE TEMPLATE
LS.TOP='E'2000		; TOP-DOWN LOADING
LS.FDX='E'4000		; FULL-DUPLEX
LS.HDX='E'10000		; HALF-DUPLEX
LS.CXO='E'10000		; PERFORM 'SET STA LOC ON' AS PART OF 'SET CEX'
LS.UNF='E'20000		; NTINIT SHOULD 'UNFIX' ITSELF WHEN FINISHED
	.PSECT
	.ENDM	VNPDF$
	.MACRO	V62DF$	LST
 
	.MCALL	D1$,D2$,D2H$,D2F$,D2T$,D3$,D3H$,D3F$,D3T$,D4$
	.MCALL	A1$,A2$,A3$,A4$,A5$,A6$,A7$,A8$,A9$,A10$,A11$
	.MCALL	L1$,L2$,L3$,L4$
	.MCALL	F1$,F2$,F3$,F4$,F5$,F6$
	.MCALL	I1$,I2$,I3$,I4$,I5$,I6$
	.MCALL	P1$,P2$
	.MCALL	T1$,T2$
	.MCALL	C1$,C2$,C3$,C4$
	.MCALL	ASCII$, CNT$, CPH$, SEBC$
 
	.IF	B,LST
	.NLIST
	.ENDC
 
; VIDEO ATTRIBUTES
 
	V.N=	0		; NORMAL VIDEO
	V.R=	100		; REVERSE VIDEO
 
; FIELD INITIALIZATION CHARACTERS (STANDARD)
 
	I.N=	0		; NULLS
	I.S=	40		; SPACES
	I.D=	56		; DOTS
	I.U=	137		; UNDERLINES
 
; FIELD ATTRIBUTES
 
	; DATA TYPE DESCRIPTOR
 
	D.A=	0		; ALPHABETIC
	D.X=	1		; ALPHANUMBERIC
	D.N=	2		; NUMBERIC
	D.S=	3		; SIGNED NUMBERIC
	D.D=	4		; ANY DISPLABLE CHAR
 
	; FIELD DEFINATIONS
 
	F.E=	20		; EMPTY FIELD
	F.F=	40		; FULL FIELD
	F.AX=	100		; AUTO XMIT
	F.AT=	200		; AUTO TAB
 
	F.RJ=	20*400		; RIGHT JUSTIFIED
	F.M=	40*400		; MODIFIED FIELD
 
; COMMAND PACKET HEADER
 
	H.KBL=	60		; KEYBOARD LOCK
	H.KBU=	40		; KEYBOARD UNLOCK
	H.KIL=	10		; KILL INPUT REQUEST
	H.CBS=	4		; RETURN COMMAND BUFFER SIZE
	H.STS=	2		; SEND STATUS
 
 
; INPUT REQUEST FLAGS
 
 
	I.FUP=	1		; XMIT FORMS UNPACKED
	I.MNC=	2		; XMIT MENU FIELD NUMBERS AND CONTENTS
	I.AXE=	4		; AUTO-TRANSMIT ENABLED
	I.FKP=	10		; ENABLE FUNCTION KEY PAD
	I.SID=	20		; SEND TERMINAL ID
	I.CMB=	40		; CLEAR MODIFIER BITS
 
 
; FUNCTION KEY CODES
 
 
	F.PF0=	0		; PROGRAM FUNCTION KEY #0
	F.PF1=	1
	F.PF2=	2
	F.PF3=	3
	F.PF4=	4
	F.PF5=	5
	F.PF6=	6
	F.PF7=	7
	F.PF8=	10
	F.PF9=	11
	F.PF10=	12		; PROGRAM FUNCTION KEY #10  (PERIOD)
 
	F.UNX=	41		; UNSHIFTED NEXT
	F.SNX=	42		; SHIFTED NEXT
	F.PRT=	43		; PRINT
	F.ENT=	44		; ENTER
	F.ABO=	45		; ABORT
 
; FUNCTION KEY FLAGS
 
	F.SF=	100		; SEND FORM
	F.SM=	200		; SEND MENU
	F.SFM=	300		; SEND FORM AND MENU
 
	.IF	B,LST
	.LIST
	.ENDC
 
	.ENDM
	.MACRO	WHILE
	IF
	$$LAB	\$$STNM,10
	.ENDM
	.MACRO	XMIW$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	QDPB$	3,14410,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	XMIW$
	.MACRO	XMIW$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,3,#14410,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	XMIW$E
	.MACRO	XMIW$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	QDPB$S	3,#14410,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	XMIW$S
	.MACRO	XMI$	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$
	QDPB$	1,14410,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	XMI$
	.MACRO	XMI$E	LABEL,LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$E
	QDPB$E	LABEL,1,#14410,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	XMI$E
	.MACRO	XMI$S	LUN,EFN,IOST,AST,PRMLST
	.MCALL	QDPB$S
	QDPB$S	1,#14410,LUN,EFN,,IOST,AST,<PRMLST>
	.ENDM	XMI$S
	.MACRO	$CON$	DIC,FNC,LUN,EFN,IOST,AST,P0,P1,P2,P3,P4,P5,P6
	.MCALL	QDPB$
	.IF NB	<P2>
	QDPB$	DIC,FNC,LUN,EFN,,IOST,AST,<P1,P2,P3,P4,P5,P6>
	.IFF
	QDPB$	DIC,FNC,LUN,EFN,,IOST,AST,<P1,P0,P3,P4,P5,P6>
	.ENDC
	.ENDM	$CON$
	.MACRO	$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,C.STS(NODE)
	.IF NB	OFFSET
	MOV	NODE,@'OFFSET'+2(BASE)
	MOV	NODE,OFFSET'+2(BASE)
	.IFF
	MOV	NODE,@2(BASE)
	MOV	NODE,2(BASE)
	.ENDC
	.IFF
	CLR	(R4)
	BIS	#CS.LST,C.STS(R4)
	.IF NB  OFFSET
	MOV	R4,@'OFFSET'+2(BASE)
	MOV	R4,OFFSET'+2(BASE)
	.IFF
	MOV	R4,@2(BASE)
	MOV	R4,2(BASE)
	.ENDC
	.ENDC
	.ENDM
	.MACRO	$GNDF$	FLG
	.IF NB	<FLG>
	.IF IDN	<FLG>,<NT.LON>
	.NLIST
$$$FLG = 16440
	.LIST
	.IFF
	.IF IDN	<FLG>,<NT.TYP>
	.NLIST
$$$FLG = 16650
	.LIST
	.IFF
	.ERROR	FLG	;ILLEGAL FLAG
	.ENDC
	.ENDC
	.IFF
	.NLIST
$$$FLG = 16630
	.LIST
	.ENDC
	.ENDM	$GNDF$
	.MACRO	$INTSX
	JSR	R4,$INTSX
	.ENDM
	.MACRO	$INTXT
	CALLR	$INTX7
	.ENDM
	.MACRO	$LIBCL	OFF,REG,LBL,SAVE6
;MACRO TO CALL A LIBRARY PROCESS THROUGH LINETABLE
;	OFF = OFFSET FROM LINETABLE POINTER
;	REG = LINETABLE POINTER
;	LBL = OFFSET INTO LIBRARY PROCESS (IF LIBRARY STB FILE IS LINKED
;			WITH CALLING PROCESS THIS FIELD MAY BE A LABEL)
;	SAVE6 = IF DEFINED SAVE CURRENT KISAR6 MAPPING
	.IF	DF M$$MGE
	.IF	NB SAVE6
	MOV	@#KISAR6,-(SP)
	.ENDC
	MOV	OFF(REG),@#KISAR6
	CALL	@#LBL
	.IFF
	MOV	OFF(REG),-(SP)
	ADD	#LBL,(SP)
	CALL	@(SP)+
	.IFT
	.IF	NB SAVE6
	MOV	(SP)+,@#KISAR6
	.ENDC
	.ENDC
	.ENDM
	.MACRO	$LIBCM	OFF,REG,LBL,SAVE6
;MACRO TO CALL A LIBRARY PROCESS THROUGH LINETABLE
;	OFF = OFFSET FROM LINETABLE POINTER
;	REG = LINETABLE POINTER
;	LBL = OFFSET INTO LIBRARY PROCESS (IF LIBRARY STB FILE IS LINKED
;			WITH CALLING PROCESS THIS FIELD MAY BE A LABEL)
;	SAVE6 = IF DEFINED SAVE CURRENT KISAR6 MAPPING
	.IF	DF M$$MGE
	.IF	NB SAVE6
	MOV	@#KISAR6,-(SP)
	.ENDC
	MOV	OFF(REG),@#KISAR6
	CALL	@#LBL
	.IFF
	MOV	OFF(REG),-(SP)
	ADD	#LBL,(SP)
	CALL	@(SP)+
	.IFT
	.IF	NB SAVE6
	MOV	(SP)+,@#KISAR6
	.ENDC
	.ENDC
	.ENDM
	.MACRO	$LIBCN	OFF,REG,LBL,SAVE6
;MACRO TO CALL A LIBRARY PROCESS THROUGH LINETABLE
;	OFF = OFFSET FROM LINETABLE POINTER
;	REG = LINETABLE POINTER
;	LBL = OFFSET INTO LIBRARY PROCESS (IF LIBRARY STB FILE IS LINKED
;			WITH CALLING PROCESS THIS FIELD MAY BE A LABEL)
;	SAVE6 = IF DEFINED SAVE CURRENT KISAR6 MAPPING
	.IF	DF M$$MGE
	.IF	NB SAVE6
	MOV	@#KISAR6,-(SP)
	.ENDC
	MOV	OFF(REG),@#KISAR6
	CALL	@#LBL
	.IFF
	MOV	OFF(REG),-(SP)
	ADD	#LBL,(SP)
	CALL	@(SP)+
	.IFT
	.IF	NB SAVE6
	MOV	(SP)+,@#KISAR6
	.ENDC
	.ENDC
	.ENDM
	.MACRO	$MVBYT,SRC,DST
	.IF	B	DST
		.ERROR	;DESTINATION FIELD NOT PRESENT
	.IFF
		.NTYPE	$TYP,DST
		.IF	EQ	$TYP&70
		CLR	DST
		BISB	SRC(R5),DST
		.IFF
		MOVB	SRC(R5),DST
		.ENDC
	.ENDC
	.ENDM
	.MACRO	$MVFBF RX,OFF
	.IF DF	M$$MGE
	MOV	OFF(RX),-(SP)
	.ENDC
	MOV	OFF+2(RX),-(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
	OPCODE	OP1,OP2
	.ENDC
	.ENDM
	.MACRO	$$GETB SRC,DST
	.NTYPE	$$TYPE,DST
	.IF	EQ $$TYPE&70	;REGISTER
	  CLR	  DST
	  BISB	  SRC,DST
	.IFF
	  MOVB	  SRC,DST
	  .IF	  EQ $$TYPE-46	;PUSH
	    CLRB    1(SP)
	  .ENDC
	.ENDC
	.ENDM
	.MACRO	$$GNAB,A,B,BYTE
	.IF	NB B
	  $$GEN2  CMP'BYTE,<A>,<B>
	.IFF
	  .IF	  NB A
	    $$GEN1  ,TST'BYTE,<A>
	  .ENDC
	.ENDC
	.ENDM
	.MACRO	$$GNBT,A,B,BYTE
	.IF	NB B
	  $$GEN2  BIT'BYTE,<A>,<B>
	.IFF
	  .IF	  NB A
	    $$GEN1  ,TST'BYTE,<A>
	  .ENDC
	.ENDC
	.ENDM
	.MACRO	$$GNCM,COMP,OP1,OP2,DIF,BYTE
	.IF	IDN <SET>,<COMP>
	  $$GNBT  <OP1>,<OP2>,BYTE
	  $$BGND  NE,DIF
	.IFF
	  .IF	  IDN <CLEAR>,<COMP>
	    $$GNBT  <OP1>,<OP2>,BYTE
	    $$BGND  EQ,DIF
	  .IFF
	    $$GNAB  <OP1>,<OP2>,BYTE
	    $$BGND  COMP,DIF
	  .ENDC
	.ENDC
	.ENDM
	.MACRO	$$INMC FLAG
	.MCALL	ENDPROC,IF,ENDIF,WHILE,ENDWHILE,ONCASE,CASE,ENDCASE
	.MCALL	PROCLC,JMPPROC,DO,THEN,ELSE,TRUE,FALSE,TRUEB,FALSEB
	.MCALL	$$PUSH,$$POP,$$POPI,$$ELSE,$$BGNN,$$BGND,$$LAB,$$STSM
	.MCALL	$$GEN1,$$GEN2,$$GNCM,$$GNBT,$$GNAB
	.IF	IDN <FLAG>,<SYSTEM>
	  .MCALL  SYSTATE,ENDSYSTATE
	.ENDC
	.IF	DF,R$$11M
	  .MCALL  SWSTK$,$$SYS
	.ENDC
	.IF	DF,R$$11D!I$$AS
	  .MCALL  .INH0,.ENB0
	.ENDC
	.ENDM
	.MACRO	$$INSY
$$CSTA=0
$$PRST=7
$$STNM=0
$$TRNM=0
$$STIX=777
	.ENDM
	.MACRO 	$$LAB N1,N2
	$$GEN1	N1'N2'$:
	.ENDM
	.MACRO	$$MOV SRC,DST
	.IF	NB SRC
	  .IF	  IDN <#0>,<SRC>
	    CLR	    DST(R4)
	  .IFF
	    MOV	    SRC,DST(R4)
	  .ENDC
	.ENDC
	.ENDM
	.MACRO	$$MOVB SRC,DST
	.IF	NB SRC
	  .IF	  IDN <#0>,<SRC>
	    CLRB    DST(R4)
	  .IFF
	    MOVB    SRC,DST(R4)
	  .ENDC
	.ENDC
	.ENDM
	.MACRO	$$POP VAR
$$STIX=$$STIX+1
	$$POPI	<VAR>,\$$STIX
	.ENDM
	.MACRO	$$POPI VAR,NUM
VAR'=$$S'NUM
	.ENDM
	.MACRO	$$PUSH VAL
	$$STSM	$$S,\$$STIX,<VAL>
$$STIX=$$STIX-1
	.ENDM
	.MACRO	$$QUE MODCOD,FCNCOD
	MOV	#<MODCOD*400!FCNCOD>,C.FNC(R4)
	MOVB	#<200+PD$NSP>,C.LIN+1(R4)
	CALL	$LLCRS
	.ENDM
	.MACRO	$$SET WORD
	.IF	NB WORD
	  .WORD   WORD
	.IFF
	  .WORD   0
	.ENDC
	.ENDM
	.MACRO	$$SETB BYTE
	.IF	NB BYTE
	  .BYTE   BYTE
	.IFF
	  .BYTE   0
	.ENDC
	.ENDM
	.MACRO	$$SNOD STNG,MAXLEN
	.NCHR	$$TEMP,<STNG>
	$$TEMP=MAXLEN-$$TEMP
	.IF LT	$$TEMP
	.ERROR	;STRING TOO LONG
	.BLKB	MAXLEN
	.IFF
	.ASCII	/STNG/
	.REPT	$$TEMP
	.BYTE	<' >
	.ENDM
	.ENDC
	.ENDM
	.MACRO	$$STID OBJ,FMT,NAME,GROUP,USER
	.NARG	$$NARG
	.IF NB	FMT
	$$FMT	=FMT
	.IFF
	$$FMT	=0
	.ENDC
	.IF NB	OBJ
	$$OBJ	=OBJ
	.IFF
	$$OBJ	=0
	.ENDC
	.BYTE	$$FMT,$$OBJ	;SET FORMAT AND OBJECT TYPE
	.IF LE	$$NARG-2	;IF 1 OR 2 ARGUMENTS
	.IF NE	$$FMT
	.ERROR	;INVALID DESCRIPTOR
	.ENDC
	.BLKB	18.		;FORMAT 0 - UNDEFINED DESCRIPTOR
	.IFF
	.IF EQ	$$NARG-3	;IF 3 ARGUMENTS
	.IF NE	$$FMT-1		;MUST BE FORMAT 1
	.ERROR	;INVALID DESCRIPTOR
	.ENDC
	$$STST	NAME,16.
	.IFF
	.IF EQ	$$NARG-4	;IF 4 ARGUMENTS
	.ERROR	;INVALID DESCRIPTOR
	.ENDC
				;MUST BE 5 ARGUMENTS
	.IF NE	$$FMT-2		;AND MUST BE FORMAT 2
	.ERROR	;INVALID DESCRIPTOR
	.ENDC
	$$SET	GROUP
	$$SET	USER
	$$STST	NAME,12.
	.ENDC
	.ENDC
	.ENDM
	.MACRO	$$STSM NAME,NUMB,VAL
NAME'NUMB'='VAL
	.ENDM
	.MACRO	$$STST STNG,MAXLEN
	.NCHR	$$TEMP,<STNG>
	$$TMP0=MAXLEN-$$TEMP
	.IF	LT $$TMP0
	  .ERROR  ;STRING TOO LONG
	  .BLKB	MAXLEN+2
	.IFF
	  $$SET	$$TEMP
	  .ASCII  /STNG/
	  .BLKB  $$TMP0
	.ENDC
	.ENDM
	.MACRO	$$SYS N1,N2
	$$GEN1	,SWSTK$,N1'N2'$
	.ENDM
	.MACRO	.BIN	AA,BB
	.EVEN
	.IF DF	M$$MGE
	.BLKW	2
	.IFF
	.BLKW	1
	.ENDC
	.ENDM	.BIN
	.MACRO	.CNB
	.BLKB	1
	.ENDM	.CNB
	.MACRO	.CNW
	.EVEN
	.BLKW	1
	.ENDM	.CNW
	.MACRO	.CORE	AA,BB
	.EVEN
	.IF DF	M$$MGE
	.BLKW	2
	.IFF
	.BLKW	1
	.ENDC
	.ENDM	.CORE
	.MAC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