Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/debugging-tools/dts/dtsnsp.mac
There are no other files named dtsnsp.mac in the archive.
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1978 BY DIGITAL EQUIPMENT CORPORATION
;
	TITLE DTSNSP - DTS NSP INTERFACE MODULE

;THIS MODULE CONTAINS ALL THE COMMON ROUTINES WHICH PERFORM THE
; INTERFACE FUNCTIONS TO THE NETWORK

	SEARCH DTSUNV,MACSYM,MONSYM
	SALL

	DBUGF==0		;DEBUG FLAG

	EXTERN LCBLST

	ENTRY OPNLNK
	ENTRY ACPLNK
	ENTRY RLSLNK,RLDLNK,RHNLNK,RODLNK,RTNLNK,RUSLNK,RPWLNK,RACLNK,RDALNK
	ENTRY RCNLNK,RSSLNK
	ENTRY SNDLNK,RCVLNK,CLZLNK,REJLNK,SIMLNK,RIMLNK
	ENTRY STCICS,STCICT,STDACS,STDACT,STIMCS,STIMCT
	ENTRY CLCICS,CLCICT,CLDACS,CLDACT,CLIMCS,CLIMCT
	ENTRY ERXLNK
	ENTRY PRTOBJ
	ENTRY PRTACC,PRTOPD,PRTRSN,PRTSGS
	ENTRY SETCLR
	ENTRY DCXERR
	ENTRY LOAD11

;******************************************************************************
;********************  ASSEMBLY CONDITIONAL SWITCH FOR DTR ********************
;******************************************************************************
	DTRSW==1		;INCLUDE CODE FOR DTR
	DTSSW==1		;INCLUDE CODE FOR DTS
;******************************************************************************


	PAGE
	SUBTTL OPNLNK - OPEN A NETWORK CONNECTION LOGICAL LINK

;
;OPNLNK - ROUTINE TO DO AN OPENF FOR LOGICAL LINK
;
;ACCEPTS LCBPTR: POINTER TO LCB
;
;	CALL OPNLNK
;
;RETURNS+1:FAILURE, ERROR CODES STORED IN LCB
;	+2:SUCCESS
;
OPNLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   (T1,LCBJFN)	;GET THE JFN FOR THIS LCB
	LOAD   (T2,LCBBSZ)	;GET THE BYTE SIZE
	LSH    T2,<^D36-POS(OF%BSZ)-1> ;PUT IT IN OF%BSZ
	TXO    (T2,<OF%RD+OF%WR>) ;SET READ, WRITE FLAGS
	OPENF			;DO THE OPEN JSYS
	 ERJMP OPNERR			;FAILED
;	SETONE LCBOFG		;TURN ON THE OPEN FLAG IN LCB
	RETSKP			;DONE, MAKE GOOD RETURN



OPNERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.OPNER	;GET DTS ERROR CODE
	RETBAD ER1LNK		;STORE IT IN LCB



	PAGE
	SUBTTL RLSLNK - READ LINK STATUS FOR LINK
;&RLSLNK - READ LINK STATUS FOR LINK
;
;RLSLNK - ROUTINE TO DO A READ LINK STATUS OPERATION FOR A LINK
;
;ACCEPTS Q1(LCBPTR)/ POINTER TO LCB
;
;	CALL RLSLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
RLSLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   T1,LCBJFN	;GET THE JFN FOR THIS LINK
	MOVX   T2,.MORLS	;READ LINK STATUS FUNCTION CODE
	MTOPR			;READ LINK STATUS MTOPR
	 ERJMP RLSERR		;JSYS ERROR
	STOR   T3,LCBSTS	;STORE LINK STATUS BITS AND ABORT REASON
	RETSKP			;GOOD RETURN



RLSERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.RLSER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL RLDLNK - READ LINK DATA FOR LINK
;&RLDLNK - READ LINK DATA FOR LINK
;
;RLDLNK - ROUTINE TO READ LINK DATA ASSOCIATED WITH LCB'S LINK
;
;ACCEPTS Q1(LCBPTR)/ POINTER TO LCB
;
;	CALL RLDLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
RLDLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
;	CALL   ILKDTA		;INITIALIZE THE LINK DATA AREA
;	PRTERR (<INIT LINK DATA AREA FAILED>,<RET>) ;COULDN'T INIT BAD RETURN
	CALL   RHNLNK		;READ HOST NAME
	HALTF
	CALL   RODLNK		;READ OBJECT DESCRIPTOR & GROUP/USER
	HALTF
	CALL   RTNLNK		;READ TASK NAME
	HALTF
	CALL   RUSLNK		;READ USER ID
	HALTF
	CALL   RPWLNK		;READ PASSWORD
	HALTF
	CALL   RACLNK		;READ ACCOUNT
	HALTF
	CALL   RDALNK		;READ OPTIONAL DATA
	HALTF
	CALL   RCNLNK		;READ CONNECT OBJECT NUMBER
	HALTF
	RETSKP			;DONE, RETURN
	PAGE
	SUBTTL RHNLNK - READ HOST NAME FOR LINK
;&RHNLNK - READ HOST NAME FOR LINK
;
;RHNLNK - ROUTINE TO READ HOST NAME ASSOCIATED WITH LCB'S LINK
;
;ACCEPTS Q1(LCBPTR)/ POINTER TO LCB
;
;	CALL RHNLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
RHNLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   T1,LCBJFN	;GET JFN FOR THIS LINK
	MOVX   T2,.MORHN	;FUNCTION CODE FOR READ HOST NAME
	LOAD   T3,LCBHST	;STRING POINTER FOR HOST NAME
	MTOPR			;READ THE LINK DATA MTOPR
	 ERJMP RHNERR		;ERROR ON JSYS
	RETSKP			;DONE, RETURN



RHNERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.RHNER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL RODLNK - READ OBJECT-DESCRIPTOR FOR LINK
;&RODLNK - READ OBJECT-DESCRIPTOR FOR LINK
;
;RODLNK - ROUTINE TO READ OBJECT-DESCRIPTOR ASSOCIATED WITH LCB'S LINK
;
;ACCEPTS Q1(LCBPTR)/ POINTER TO LCB
;
;	CALL RODLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
RODLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   T1,LCBJFN	;GET JFN FOR THIS LINK
	MOVX   T2,.MOROD	;FUNCTION CODE FOR READ OBJECT-DESCRIPTOR
	LOAD   T3,LCBODS	;STRING POINTER FOR OBJECT-DESCRIPTOR
;	LOAD   T4,LCBSVR	;GET SERVER FLAG
;	SKIPE  T4		;FUNCTION VALID ONLY FOR SERVER
	MTOPR			;MTOPR TO READ OBJ-DESCR
	 ERJMP RODERR		;ERROR ON JSYS
	STOR   T4,LCBGPU	;STORE GROUP/USER CODE
	RETSKP			;DONE, RETURN



RODERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.RODER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL RTNLNK - READ TASK NAME FOR LINK
;&RTNLNK - READ TASK NAME FOR LINK
;
;RTNLNK - ROUTINE TO READ TASK NAME ASSOCIATED WITH LCB'S LINK
;
;ACCEPTS Q1(LCBPTR)/ POINTER TO LCB
;
;	CALL RTNLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
RTNLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   T1,LCBJFN	;GET JFN FOR THIS LINK
	MOVX   T2,.MORTN	;FUNCTION CODE FOR READ TASK NAME
	LOAD   T3,LCBTSK	;STRING POINTER FOR TASK NAME
	MTOPR			;READ THE LINK DATA MTOPR
	 ERJMP RTNERR		;ERROR ON JSYS
	RETSKP			;DONE, RETURN



RTNERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.RTNER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL RUSLNK - READ USER ID FOR LINK
;&RUSLNK - READ USER ID FOR LINK
;
;RUSLNK - ROUTINE TO READ USER ID ASSOCIATED WITH LCB'S LINK
;
;ACCEPTS Q1(LCBPTR)/ POINTER TO LCB
;
;	CALL RUSLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
RUSLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   T1,LCBJFN	;GET JFN FOR THIS LINK
	MOVX   T2,.MORUS	;FUNCTION CODE FOR READ USER ID
	LOAD   T3,LCBUSE	;STRING POINTER FOR USER ID
;	LOAD   T4,LCBSVR	;GET SERVER FLAG
;	SKIPE  T4		;FUNCTION VALID ONLY FOR SERVER
	MTOPR			;READ THE LINK DATA MTOPR
	 ERJMP RUSERR		;ERROR ON JSYS
	RETSKP			;DONE, RETURN



RUSERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.RUSER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL RPWLNK - READ PASSWORD FOR LINK
;&RPWLNK - READ PASSWORD FOR LINK
;
;RPWLNK - ROUTINE TO READ PASSWORD ASSOCIATED WITH LCB'S LINK
;
;ACCEPTS Q1(LCBPTR)/ POINTER TO LCB
;
;	CALL RPWLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
RPWLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   T1,LCBJFN	;GET JFN FOR THIS LINK
	MOVX   T2,.MORPW	;FUNCTION CODE FOR READ PASSWORD
	LOAD   T3,LCBPAS	;STRING POINTER FOR PASSWORD
;	LOAD   T4,LCBSVR	;GET SERVER FLAG
;	SKIPE  T4		;FUNCTION VALID ONLY FOR SERVER
	MTOPR			;READ THE LINK DATA MTOPR
	 ERJMP RPWERR		;ERROR ON JSYS
	STOR   T4,LCBPWC	;STORE PASSWORD BYTE COUNT
	RETSKP			;DONE, RETURN



RPWERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.RPWER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL RACLNK - READ ACCOUNT FOR LINK
;&RACLNK - READ ACCOUNT FOR LINK
;
;RACLNK - ROUTINE TO READ ACCOUNT ASSOCIATED WITH LCB'S LINK
;
;ACCEPTS Q1(LCBPTR)/ POINTER TO LCB
;
;	CALL RACLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
RACLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   T1,LCBJFN	;GET JFN FOR THIS LINK
	MOVX   T2,.MORAC	;FUNCTION CODE FOR READ ACCOUNT STRING
	LOAD   T3,LCBACT	;STRING POINTER FOR ACCOUNT STRING
;	LOAD   T4,LCBSVR	;GET SERVER FLAG
;	SKIPE  T4		;FUNCTION VALID ONLY FOR SERVER
	MTOPR			;READ THE LINK DATA MTOPR
	 ERJMP RACERR		;ERROR ON JSYS
	RETSKP			;DONE, RETURN



RACERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.RACER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL RDALNK - READ OPTIONAL DATA FOR LINK
;&RDALNK - READ OPTIONAL DATA FOR LINK
;
;RDALNK - ROUTINE TO READ THE OPTIONAL DATA FOR A LINK
;
;ACCEPTS Q1(LCBPTR)/ POINTER TO LCB
;
;	CALL RDALNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
RDALNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   T1,LCBJFN	;GET JFN FOR THIS LINK
	MOVX   T2,.MORDA	;FUNCTION CODE FOR READ OPTIONAL DATA
	LOAD   T3,LCBOPT	;STRING POINTER FOR OPTIONAL DATA
	MTOPR			;READ THE LINK DATA MTOPR
	 ERJMP RDAERR		;ERROR ON JSYS
	STOR   T4,LCBROC	;STORE RECEIVED OPTIONAL DATA BYTE COUNT
	RETSKP			;DONE, RETURN



RDAERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.RDAER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL RCNLNK - READ CONNECT OBJECT NUMBER FOR LINK
;&RCNLNK - READ CONNECT OBJECT NUMBER FOR LINK
;
;RCNLNK - ROUTINE TO READ CONNECT OBJECT NUMBER ASSOCIATED WITH LCB'S LINK
;
;ACCEPTS Q1(LCBPTR)/ POINTER TO LCB
;
;	CALL RCNLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
RCNLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   T1,LCBJFN	;GET JFN FOR THIS LINK
	MOVX   T2,.MORCN	;FUNCTION CODE FOR READ CONNECT OBJECT NUMBER
;	LOAD   T3,LCBSVR	;GET SERVER FLAG
;	SKIPE  T3		;FUNCTION VALID ONLY FOR SERVER
	MTOPR			;READ THE LINK DATA MTOPR
	 ERJMP RCNERR		;ERROR ON JSYS
	STOR   T3,LCBCON	;STORE OBJECT NUMBER IN LCB
	RETSKP			;DONE, RETURN



RCNERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.RCNER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL RSSLNK - READ SEGMENT SIZE FOR LINK
;&RSSLNK - READ SEGMENT SIZE FOR LINK
;
;RSSLNK - ROUTINE TO READ SEGMENT SIZE FOR A LINK
;
;ACCEPTS Q1(LCBPTR)/ POINTER TO LCB
;
;	CALL RSSLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
RSSLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   T1,LCBJFN	;GET THE JFN FOR THIS LINK
	MOVX   T2,.MORSS	;READ SEGMENT SIZE FUNCTION CODE
	MTOPR			;READ LINK STATUS MTOPR
	 ERJMP RSSERR		;JSYS ERROR
	STOR   T3,LCBSGS	;STORE SEGMENT SIZE IN LCB
	RETSKP			;GOOD RETURN



RSSERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.RSSER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL ACPLNK - ACCEPT A LOGICAL LINK CONNECTION
;&ACPLNK - ACCEPT A LOGICAL LINK CONNECTION
;
;ACPLNK - ROUTINE TO ACCEPT A LOGICAL LINK CONNECTION
;
;ACCEPTS Q1(LCBPTR)/POINTER TO LCB 
;
;	CALL ACPLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
ACPLNK:				;ENTRY
	LOAD   (T1,LCBJFN)	;GET JFN FOR THIS LINK
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	MOVX   (T2,.MOCC)	;ACCEPT CONNECT FUNCTION CODE
	LOAD   (T3,LCBOSP)	;POINTER TO OPTIONAL DATA TO SEND
	SETZI  T4,0		;CLEAR TO ZERO
	SKIPE  T3		;SKIP IF NO ACCEPT DATA
	LOAD   T4,LCBSOC	;GET SEND OPTIONAL DATA BYTE COUNT 
	MTOPR			;DO THE MTOPR TO ACCEPT CONNECTION
	 ERJMP ACPERR		;ERROR ON JSYS
	RETSKP			;DONE, RETURN



ACPERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.ACPER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL SNDLNK - SEND OUTPUT FOR AN LCB
;&SNDLNK - SEND OUTPUT FOR AN LCB
;
;SNDLNK - SENDS OUTPUT MESSAGES ON THE SEND MESSAGE QUEUE FOR A PARTICULAR
; LINK CONTROL BLOCK
;
;ACCEPTS IN (LCBPTR): POINTER TO LCB FOR WHICH ACTION IS REQUESTED
;
;	CALL SNDLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
SNDLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   (T1,LCBJFN)	;GET JFN FOR THIS LINK
	LOAD   (T2,LCBSMB)	;GET POINTER TO SEND MESSAGE BUFFER
	OPSTR  (<MOVN T3,>,LCBCSZ) ;GET MESSAGE SIZE
	SETZI  T4,0
;	LOAD T4,LCBSTS		;GET LINK STATUS
;	TXNN T4,MO%EOM		;GOT LOGICAL MESSAGE?
;	JRST SNDLN1		;NO, JUST SEND SOME BYTES
	JE LCBSLM,,SNDLN1	;GO DO SOUT IF NOT SENDING MESSAGE
	SOUTR			;YES, SEND THE MESSAGE OUT
	 ERJMP SNDERR		;ERROR ON JSYS
	INCR   LCBSND		;BUMP TOTAL SEND COUNT
	LOAD T3,LCBCSZ		;GET MESSAGE LENGTH SENT
	OPSTRM <ADDM T3,>,LCBSBC ;ADD MESSAGE LENGTH TO SEND BYTE COUNT
	RETSKP			;RETURN TO CALLER
SNDLN1:				;HERE SEND JUST STRING
	SOUT			;SEND THE STRING
	 ERJMP SNDERR
	LOAD T3,LCBCSZ		;GET MESSAGE LENGTH SENT
	OPSTRM <ADDM T3,>,LCBSBC ;ADD MESSAGE LENGTH TO SEND BYTE COUNT
	RETSKP			;RETURN, WITHOUT BUMPING COUNTS



SNDERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.SNDER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL RCVLNK - RECEIVE MESSAGE ON LOGICAL LINK CONNECTION
;&RCVLNK - RECEIVE MESSAGE ON LOGICAL LINK CONNECTION
;
;RCVLNK - ROUTINE TO RECEIVE ON A LOGICAL LINK CONNECTION
;
;ACCEPTS IN (LCBPTR): POINTER TO LCB FOR WHICH ACTION IS REQUESTED
;
;	CALL RCVLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
RCVLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   (T1,LCBJFN)	;GET THIS LINKS JFN
	LOAD   T2,LCBRMB	;GET POINTER TO RECEIVE BUFFER
	OPSTR  <MOVN T3,>,LCBCSZ ;GET NEGATIVE OF NUMBER OF BYTES TO READ
	JN LCBRLM,,RCVLN2	;DO SINR IF USER WANTS MESSAGE
	LOAD T4,LCBSTS		;GET LINK STATUS
	TXNN T4,MO%EOM		;GOT LOGICAL MESSAGE?
	JRST RCVLN1		;NO, JUST READ SOME BYTES
RCVLN2:
	SINR			;YES, READ MESSAGE
	 ERJMP RCVERR
	INCR   LCBRCV		;BUMP RECEIVE COUNT
	LOAD T3,LCBCSZ		;GET MESSAGE LENGTH SENT
	OPSTRM <ADDM T3,>,LCBRBC ;ADD MESSAGE LENGTH TO RECEIVE BYTE COUNT
	RETSKP			;DONE, RETURN GOOD
RCVLN1:				;HERE TO JUST SEND STRING
	SIN			;READ A STRING
	 ERJMP RCVERR		;GO TO ERROR ROUTINE ON JSYS FAILURE
	LOAD T3,LCBCSZ		;GET MESSAGE LENGTH SENT
	OPSTRM <ADDM T3,>,LCBRBC ;ADD MESSAGE LENGTH TO RECEIVE BYTE COUNT
	RETSKP			;DONE, RETURN GOOD



RCVERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.RCVER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL CLZLNK - CLOSE A LOGICAL LINK CONNECTION
;&CLZLNK - CLOSE A LOGICAL LINK CONNECTION
;
;CLZLNK - ROUTINE TO DO AN IMPLICIT REJECT OR SYNCHRONOUS DISCONNECT
;	   ON A LOGICAL LINK
;
;ACCEPTS Q1(LCBPTR): POINTER TO LCB
;
;	CALL CLZLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
CLZLNK:				;ENTRY
	LOAD   (T1,LCBJFN)	;GET JFN FOR THIS LINK
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   (T2,LCBFLG)	;GET LCB FLAG WORD
	TXNE   T2,LCB%RJ	;SKIP IF RELEASE JFN FLAG NOT ON
	TXO    T1,CO%NRJ	;SET DO NOT RELEASE JFN 
	TXNE   T2,LCB%AB	;SKIP IF ABORT FLAG NOT ON
	TXO    T1,CZ%ABT	;SET ABORT FLAG
	CLOSF			;DO THE CLOSE
	 ERJMP  CLZERR		;ERROR ON JSYS
	RETSKP			;DONE, RETURN



CLZERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.CLZER	;GET DTS ERROR CODE
	RETBAD ER1LNK		;STORE IT IN LCB



	PAGE
	SUBTTL REJLNK - REJECT OR EXPLICIT CLOSE FOR LINK
;&REJLNK - REJECT OR EXPLICIT CLOSE FOR LINK
;
;REJLNK - ROUTINE TO DO AN EXPLICIT CLOSE OR REJECT FOR A LOGICAL LINK
;
;ACCEPTS Q1(LCBPTR): POINTER TO LCB
;
;	CALL REJLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
REJLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   (T1,LCBJFN)	;GET JFN FOR THIS LINK
	MOVX   (T2,.MOCLZ)	;SET ABORT FUNCTION CODE
	LOAD   (T3,LCBRSN)	;GET ABORT REASON CODE
	LOAD   (T4,LCBFLG)	;GET LCB FLAG WORD
	TXNE   (T4,LCB%AB)	;ABORT ??
	HRLI   T2,(T3)		;YES, PUT REASON CODE IN LH T2
	LOAD   (T3,LCBOSP)	;POINTER TO OPTIONAL DATA TO SEND
	SETZI  T4,0		;CLEAR TO ZERO
	SKIPE  T3		;SKIP IF NO ACCEPT DATA
	LOAD   T4,LCBSOC	;GET SEND OPTIONAL DATA BYTE COUNT 
	MTOPR			;DO MTOPR TO DO CLOSE/REJECT
	 ERJMP REJERR		;ERROR ON JSYS
	RETSKP			;DONE, RETURN



REJERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.REJER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL SIMLNK - SEND INTERRUPT MESSAGE ON LINK
;&SIMLNK - SEND INTERRUPT MESSAGE ON LINK
;
;SIMLNK - ROUTINE TO SEND AN INTERRUPT MESSAGE ON A LOGICAL LINK
;
;ACCEPTS Q1(LCBPTR): POINTER TO LCB
;
;	CALL SIMLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
SIMLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   (T1,LCBJFN)	;GET JFN FOR THIS LINK
	MOVX   T2,.MOSIM	;SET SEND INTERRUPT MESSAGE FUNCTION CODE
	LOAD   (T3,LCBPIM)	;GET POINTER TO INTERRUPT MESSAGE
	LOAD   (T4,LCBSZI)	;GET SIZE OF INTERRUPT MESSAGE
	MTOPR			;DO MTOPR TO SEND INTERRUPT MESSAGE
	 ERJMP SIMERR		;ERROR ON JSYS
	INCR   LCBISC		;BUMP THE INTERRUPT MESSAGE SEND COUNT
;	INCR   LCBIOC		;BUMP THE OUTSTANDING COUNT
	RETSKP			;DONE, RETURN



SIMERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.SIMER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL RIMLNK - RECEIVE INTERRUPT MESSAGE ON LINK
;&RIMLNK - RECEIVE INTERRUPT MESSAGE ON LINK
;
;RIMLNK - ROUTINE TO RECEIVE AN INTERRUPT MESSAGE ON A LOGICAL LINK
;
;ACCEPTS Q1(LCBPTR): POINTER TO LCB
;
;	CALL RIMLNK
;
;RETURNS+1: FAILURE
;	+2: SUCCESS
;
RIMLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
	LOAD   (T1,LCBJFN)	;GET JFN FOR THIS LINK
	MOVX   (T2,.MORIM)	;SET READ INTERRUPT MESSAGE FUNCTION CODE
	LOAD   (T3,LCBPIM)	;GET POINTER TO INTERRUPT MESSAGE
	MTOPR			;DO MTOPR TO RECEIVE INTERRUPT MESSAGE
	 ERJMP RIMERR		;ERROR ON JSYS
	STOR   T4,LCBSZI	;STORE SIZE OF INTERRUPT MSG OBTAINED
	INCR   LCBIRC		;BUMP THE INTERRUPT MESSAGE RECEIVE COUNT
	RETSKP			;DONE, RETURN



RIMERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.RIMER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL STXXXX/CLXXXX - SET AND CLEAR INTERRUPT CHANNELS
;&STXXXX/CLXXXX - SET AND CLEAR INTERRUPT CHANNELS
;
;STXXXX/CLXXXX - ROUTINES TO SET AND CLEAR THE INTERRUPT CHANNELS FOR LOGICAL LINKS
;STCICS - SET CONNECTION EVENT FOR SERVER
;STCICT - SET CONNECTION EVENT FOR TARGET
;STDACS - SET DATA EVENT FOR SERVER
;STDACT - SET DATA EVENT FOR TARGET
;STIMCS - SET INTERRUPT MESSAGE EVENT FOR SERVER
;STIMCT - SET INTERRUPT MESSAGE EVENT FOR TARGET
;CLCICS - CLEAR CONNECTION EVENT FOR SERVER
;CLCICT - CLEAR CONNECTION EVENT FOR TARGET
;CLDACS - CLEAR DATA EVENT FOR SERVER
;CLDACT - CLEAR DATA EVENT FOR TARGET
;CLIMCS - CLEAR INTERRUPT MESSAGE EVENT FOR SERVER
;CLIMCT - CLEAR INTERRUPT MESSAGE EVENT FOR TARGET
;
;	NOTE: THESE SYMBOLS SPECIFY THE INTERRUPT CHANNELS USED
;
;		COCHNS - CONNECTION EVENT INTERRUPT FOR SERVER LINKS
;		COCHNT - CONNECTION EVENT INTERRUPT FOR TARGET LINKS
;		DACHNS - DATA EVENT INTERRUPT FOR SERVER LINKS
;		DACHNT - DATA EVENT INTERRUPT FOR TARGET LINKS
;		IMCHNS - INTERRUPT MESSAGE EVENT INTERRUPT FOR SERVER LINKS
;		IMCHNT - INTERRUPT MESSAGE EVENT INTERRUPT FOR TARGET LINKS
;
;ACCEPTS LCBPTR: POINTER TO LCB
;
;	CALL STXXXX
;	CALL CLXXXX
;
;RETURNS+1:FAILURE
;	+2:SUCCESS
;



	PAGE
STCICS:				;ENTRY TO SET CONNECT REQUEST INTERRUPT CHAN
	MOVX   T3,<FLD(COCHNS,MO%CDN)+FLD(.MONCI,MO%INA)+FLD(.MONCI,MO%DAV)>
	JRST   SETCLR		;SKIP OTHER ENTRIES
STCICT:				;ENTRY TO SET CONNECTION EVENT CHANNEL
	MOVX   T3,<FLD(COCHNT,MO%CDN)+FLD(.MONCI,MO%INA)+FLD(.MONCI,MO%DAV)>
	JRST   SETCLR		;SKIP OTHER ENTRIES
STDACS:				;ENTRY TO SET DATA AVAILABLE CHAN
	MOVX   T3,<FLD(.MONCI,MO%CDN)+FLD(.MONCI,MO%INA)+FLD(DACHNS,MO%DAV)>
	JRST   SETCLR		;SKIP OTHER ENTRIES
STDACT:				;ENTRY TO SET DATA AVAILABLE CHAN
	MOVX   T3,<FLD(.MONCI,MO%CDN)+FLD(.MONCI,MO%INA)+FLD(DACHNT,MO%DAV)>
	JRST   SETCLR		;SKIP OTHER ENTRIES
STIMCS:				;ENTRY TO SET INTERRUPT MESSAGE CHAN
	MOVX   T3,<FLD(.MONCI,MO%CDN)+FLD(IMCHNS,MO%INA)+FLD(.MONCI,MO%DAV)>
	JRST   SETCLR		;SKIP OTHER ENTRIES
STIMCT:				;ENTRY TO SET INTERRUPT MESSAGE CHAN
	MOVX   T3,<FLD(.MONCI,MO%CDN)+FLD(IMCHNT,MO%INA)+FLD(.MONCI,MO%DAV)>
	JRST   SETCLR		;SKIP OTHER ENTRIES
CLCICS:				;ENTRY TO CLEAR CONNECT REQUEST CHAN
CLCICT:
	MOVX   T3,<FLD(.MOCIA,MO%CDN)+FLD(.MONCI,MO%INA)+FLD(.MONCI,MO%DAV)>
	JRST   SETCLR		;SKIP OTHER ENTRIES
CLDACS:				;ENTRY TO CLEAR DATA AVAILABLE CHAN
CLDACT:
	MOVX   T3,<FLD(.MONCI,MO%CDN)+FLD(.MONCI,MO%INA)+FLD(.MOCIA,MO%DAV)>
	JFCL			;SKIP OTHER ENTRIES
CLIMCS:				;ENTRY TO CLEAR INTERRUPT MESSAGE CHAN
CLIMCT:
	MOVX   T3,<FLD(.MONCI,MO%CDN)+FLD(.MOCIA,MO%INA)+FLD(.MONCI,MO%DAV)>
	PAGE
SETCLR:				;COMMON ENTRY
	SKIPN  LCBPTR		;SKIP IF GOOD LCB POINTER
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	SAVEAC <T1,T2,T3>	;SAVE AC'S
	MOVX   T1,<ASCIZ/LCB/>	;GET THE ID FOR AN LCB
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF IT MATCHES
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	LOAD   (T1,LCBJFN)	;GET THE JFN FOR THIS LCB
	MOVX   (T2,.MOACN)	;GET THE CODE FOR ASSIGN INTERRUPT CHAN
	MTOPR			;DO THE JSYS
	 ERJMP SETERR		;ERROR ON FAILURE
	RETSKP			;DONE, RETURN GOOD



SETERR:				;HERE TO HANDLE JSYS ERROR
	MOVX   T2,.SETER	;GET DTS ERROR CODE
	RETBAD ERRLNK		;STORE IT IN LCB



	PAGE
	SUBTTL ERRLNK - JSYS ERROR ON LINK ROUTINE
;&ERRLNK - JSYS ERROR ON LINK ROUTINE
;
;ERRLNK - ROUTINE TO HANDLE "LINK JSYS ERRORS" AND PROVIDE COMMON 
;	ERROR HANDLING FOR NETWORK ERROR CONDITIONS
;
;ACCEPTS:	T2/ DTS ERROR NUMBER
;		LCBPTR/ POINTER TO LCB
;
;CALLED BY:	ERCAL ERRLNK
;		CALL  ERRLNK
;		ERJMP ERRLNK
;		CALLRET ERRLNK
;
;RETURNS+1: ALWAYS, WITH ERROR INFO STORED IN LCBLER
;
ERRLNK:				;ENTRY
IFE DBUGF,<XLIST>		;CONDITIONAL DEBUG CODE
IFN DBUGF,<			;CONDITIONAL DEBUG CODE
	SKIPN  LCBPTR		;SHOULDN'T BE HERE WITH NO LCB'S
	PRTERR (<INVALID LCB POINTER>,<HALTF>)
	MOVX   T1,<ASCIZ/LCB/>	;GET THE VALID LCB ID
	OPSTRM (<CAME T1,>,LCBID) ;SKIP IF GOOD LCB
	PRTERR (<INVALID LCB FOUND>,<HALTF>)
	>			;END OF CONDITIONAL DEBUG CODE
	LIST
				;ENTRY POINT FOR JSYS' WITH +1 ALWAYS RETURN
	PUSH   P,T1		;SAVE T1
	PUSH   P,T2		;SAVE DTS ERROR NUMBER
				;GET THE LAST MONITOR ERROR CODE
	MOVX   T1,.FHSLF	;THIS PROCESS
	GETER			;GET IT FROM MONITOR
	 JSHLT (<GETER FAILED>)	;SHOULD NEVER GET HERE !!!!!
	HRLI   T2,0		;CLEAR THE PROCESS HANDLE, LEAVE MONITOR ERROR
	POP    P,T1		;RESTORE DTS ERROR NUMBER
	CALL   ER2LNK		;STORE ERROR CODES IN LCB
	POP    P,T1		;RESTORE T1
	RET			;DONE, RETURN


ER1LNK:				;ENTRY POINT FOR JSYS' WITH ERROR IN AC1
	STOR   T1,LCBLER	;STORE MONITOR ERROR IN LCB
	STOR   T2,LCBDER	;STORE DTS ERROR CODE IN LCB
	RET			;DONE, RETURN

ER2LNK:				;ENTRY POINT FOR JSYS' WITH ERROR IN AC2
	STOR   T1,LCBDER	;STORE DTS ERROR CODE IN LCB
	STOR   T2,LCBLER	;STORE MONITOR ERROR IN THE LCB
	RET			;DONE, RETURN


ERXLNK:				;ENTRY TO PRINT DTS/MONITOR STRINGS
	LOAD   T2,LCBDER	;GET DTS ERROR
	LOAD   T1,LCBLER	;GET THE DTS/MONITOR ERROR CODES
	HRLI   T1,(T2)		;PUT BOTH IN 1
	CALL   DYXERR		;CALL ROUTINE TO PRINT DTS ERROR MSG
	RET			;DONE, RETURN
	PAGE
	SUBTTL ILKDTA - INITIALIZE THE LINK DATA AREA
;&ILKDTA - INITIALIZE THE LINK DATA AREA
;
;ILKDTA - ROUTINE TO GET STORAGE FOR, AND SET UP THE STRING POINTERS
;	FOR THE LINK DATA AREA ASSOCIATED WITH A LINKS LCB
;
;ACCEPTS Q1(LCBPTR)/ POINTER TO LCB
;
;	CALL ILKDTA
;
;RETURNS+1: FAILURE, IF COULD NOT OBTAIN STORAGE
;	+2: SUCCESS
;
ILKDTA:				;ENTRY
	JN     (LCBHST,,ILKDT1)	;ALREADY GOT A LINK DATA AREA ?
	MOVEI  T1,NWLKDA	;NO, GET SIZE OF LINK DATA AREA
;	CALL   M%GMEM		;GET STORAGE FOR STRINGS
	JFCL
;	JUMPE  [RET]		;TAKE FAILURE RETURN, NO STORAGE
	HRLI   T2,(POINT 7,0)	;MAKE IT A 7 BIT BYTE POINTER
	STOR   T2,LCBHST	;POINTER TO HOST STRING
	ADDI   T2,NWLKHN	;NUMBER OF WORDS FOR HOST STRING
	STOR   T2,LCBODS	;POINTER TO OBJECT-DESCRIPTOR STRING
	ADDI   T2,NWLKOD	;NUMBER OF WORDS FOR OBJECT DESCRIPTOR
	STOR   T2,LCBTSK	;POINTER TO TASK NAME STRING
	ADDI   T2,NWLKTS	;NUMBER OF WORDS FOR TASK NAME STRING
	STOR   T2,LCBUSE	;POINTER TO USER ID STRING
	ADDI   T2,NWLKUI	;NUMBER OF WORDS FOR USERID STRING
	HRLI   T2,(POINT 8,0)	;8 BIT BYTES FOR PASSWORD
	STOR   T2,LCBPAS	;POINTER TO PASSWORD STRING
	ADDI   T2,NWLKPW	;NUMBER OF WORDS FOR PASSWORD
	HRLI   T2,(POINT 7,0)	;7 BIT BYTES FOR ACCOUNT
	STOR   T2,LCBACT	;POINTER TO ACCOUNT STRING
	ADDI   T2,NWLKAC	;NUMBER OF WORDS FOR ACCOUNT
	HRLI   T2,(POINT 8,0)	;8 BIT BYTES FOR OPTIONAL DATA
	STOR   T2,LCBOPT	;POINTER TO OPTIONAL DATA STRING
	ADDI   T2,NWLKOP	;NUMBER OF WORDS FOR OPTIONAL DATA
ILKDT1:				;HERE TO RETURN IF ALREADY INIT
	RETSKP
	PAGE
	SUBTTL PRTOBJ - PRINT HOST-OBJECT-DESCRIPTOR.TASKNAME FOR LINK
;&PRTOBJ - PRINT HOST-OBJECT-DESCRIPTOR.TASKNAME FOR LINK
;
;PRTOBJ - ROUTINE TO PRINT OUT NAME OF CONNECTOR
;
;ACCEPTS: T1/DESTINATION DESIGNATOR
;	  LCBPTR/ POINTER TO LCB
;
;	CALL PRTOBJ
;
;RETURNS+1: ALWAYS
;
PRTOBJ:				;ENTRY
	HRROI  T1,BUFFER	;POINT TO TEXT BUFFER
	SETZI  T3,0		;TERMINATE ON NULL
	LOAD   T2,LCBHST	;GET POINTER TO HOST NAME
	SOUT
	MOVEI  T2,"-"
	BOUT
	LOAD   T2,LCBODS	;GET POINTER TO OBJECT DESCRIPTOR
	SOUT
	MOVEI  T2,"."
	BOUT
	LOAD   T2,LCBTSK	;GET POINTER TO TASK NAME
	SOUT
	HRROI  T1,BUFFER	;POINT TO BUFFER
	CALL   SNDSTR		;WRITE STRING TO USER
	RET			;DONE, RETURN
	PAGE
	SUBTTL PRTACC - PRINT ACCESS CONTROL INFORMATION FOR LINK
;&PRTACC - PRINT ACCESS CONTROL INFORMATION FOR LINK
;
;PRTACC - ROUTINE TO OUTPUT THE ACCESS CONTROL INFORMATION
;
;ACCEPTS: T1/ DESTINATION DESIGNATOR
;	  LCBPTR/ POINTER TO LCB
;
;	CALL PRTACC
;
;RETURNS+1: ALWAYS
;
PRTACC:				;ENTRY
	HRROI  T1,BUFFER	;POINT TO TEXT BUFFER
	HRROI  T2,[ASCIZ/USER-ID(/] ;OUTPUT HEADER
	SETZI  T3,0		;TERMINATE ON NULL
	SOUT			;OUTPUT STRING
	LOAD   T2,LCBUSE	;GET POINTER TO USER ID FOR LINK
	SOUT			;OUTPUT STRING
	HRROI  T2,[ASCIZ/) PASSWORD(/]
	SOUT			;OUTPUT STRING
	LOAD   T2,LCBPAS	;GET POINTER TO PASSWORD FOR LINK
	LOAD   T3,LCBPWC	;GET COUNT OF CHARS IN PASSWORD
	SOUT			;OUTPUT STRING
	HRROI  T2,[ASCIZ/) ACCOUNT(/]
	SOUT			;OUTPUT STRING
	LOAD   T2,LCBACT	;GET POINTER TO ACCOUNT
	SOUT			;OUTPUT STRING
	HRROI  T2,[ASCIZ/)/]
	SOUT
	HRROI  T1,BUFFER	;POINT TO BUFFER
	CALL   SNDSTR		;WRITE TO USER
	RET			;DONE, RETURN
	PAGE
	SUBTTL PRTOPD - PRINT OPTIONAL DATA
;&PRTOPD - PRINT OPTIONAL DATA
;
;PRTOPD - ROUTINE TO PRINT THE OPTIONAL DATA RECEIVED ON EITHER
;	A CONNECTION OR DISCONNECTION
;
;ACCEPTS: T1/ DESTINATION DESIGNATOR
;	    LCBPTR/ POINTER TO LCB
;
;	CALL PRTOPD
;
;RETURNS+1: ALWAYS
;
PRTOPD:				;ENTRY
	STKVAR <OPDPTR,COUNT>	;VARIABLES
	HRROI  T1,BUFFER	;POINT TO TEXT BUFFER
	LOAD   T2,LCBOPT	;GET POINTER TO OPT DATA
	MOVEM  T2,OPDPTR	;SAVE COPY OF POINTER TO OPT DATA
	JUMPE  T2,R		;ANY OPT DATA ?? , NO JUST RETURN
	LOAD   T3,LCBROC	;GET COUNT OF OPT DATA BYTES RECEIVED
	JUMPE  T3,R		;IF ZERO COUNT, JUST RETURN
	MOVEM  T3,COUNT		;SAVE COUNT OF # OF BYTES
AA:	MOVEI  T3,10		;PRINT OCTAL VALUE OF EACH BYTE
	HRLI   T3,(<NO%LFL+NO%MAG+NO%ZRO+FLD(3,NO%COL)>) ;OUTPUT 3 DIGITS
PRTOP1:				;HERE FOR NEXT OPT DATA BYTE
	SOSGE  COUNT		;GOT ALL BYTES ?
	JRST   PRTOP2		;YES, STRING BUILT
	ILDB   T2,OPDPTR	;GET NEXT OPT DATA BYTE
	NOUT			;OUTPUT THE 8 BIT BYTE AS 3 OCTAL DIGITS
	 JSRET (<NOUT FAILED>)
	JRST   PRTOP1		;DO NEXT BYTE


PRTOP2:				;HERE WHEN ALL OPT DATA BYTES IN STRING
	HRROI  T1,BUFFER	;POINT TO BUFFER WHERE STRING IS
	CALLRET SNDSTR		;WRITE IT TO USER
	PAGE
	SUBTTL PRTRSN - PRINT DISCONNECT REASON CODE
;&PRTRSN - PRINT DISCONNECT REASON CODE
;
;PRTRSN - ROUTINE TO OUTPUT THE DISCONNECT REASON CODE
;
;ACCEPTS: T1/ DESTINATION DESIGNATOR
;	  LCBPTR/ POINTER TO LCB
;
;	CALL PRTRSN
;
;RETURNS+1: ALWAYS
;
PRTRSN:				;ENTRY
	HRROI  T1,BUFFER	;POINT TO TEXT BUFFER
	LOAD   T2,LCBSTS	;GET THE STATUS & REASON CODE
	HRRZI  T2,(T2)		;ISOLATE JUST THE REASON CODE
	MOVEI  T3,^D10		;OUTPUT IT IN DECIMAL
	NOUT			;OUTPUT THE NUMBER
	 JSRET (<NOUT FAILED>)
	HRROI  T1,BUFFER	;POINT TO BUFFER
	CALLRET SNDSTR		;WRITE TO USER & RETURN
	PAGE
	SUBTTL PRTSGS - PRINT SEGMENT SIZE FOR LINK
;&PRTSGS - PRINT SEGMENT SIZE FOR LINK
;
;PRTSGS - ROUTINE TO PRINT OUT THE SEGMENT SIZE FOR A LINK
;
;ACCEPTS: T1/ DESTINATION DESIGNATOR
;	  LCBPTR/ POINTER TO LCB
;
;	CALL PRTSGS
;
;RETURNS+1: ALWAYS
;
PRTSGS:				;ENTRY
	HRROI  T1,BUFFER	;POINT TO BUFFER
	LOAD   T2,LCBSGS	;GET THE SEGMENT SIZE FROM LCB
	MOVEI  T3,^D10		;PRINT IN DECIMAL
	NOUT
	 JSRET (<NOUT FAILED>)
	HRROI  T1,BUFFER	;GET BUFFER POINTER
	CALLRET SNDSTR		;GO WRITE FOR USER & RETURN

	PAGE
	SUBTTL STRCMP - STRING COMPARISON ROUTINE
;&STRCMP - STRING COMPARISON ROUTINE
;
;STRCMP - STRING COMPARE FOR ANY BYTE SIZE STRING, STRICTLY EQUAL COMPARE
;	  NO UPPER/LOWER CASE STUFF
;
;ACCEPTS: T1/ BYTE POINTER TO STRING 
;	  T2/ BYTE POINTER TO STING TO COMPARE WITH
;	  T3/ LENGTH TO COMPARE
;
;	CALL  STRCMP
;
;RETURNS+1: STRINGS UNEQUAL, T1,T2/ UPDATED
;	+2: STRINGS EQUAL
STRCMP:				;ENTRY
	STKVAR <STRPT1,STRPT2> ;VARIABLES
	MOVEM  T1,STRPT1	;SAVE POINTER TO FIRST STRING
	MOVEM  T2,STRPT2	;AND SECOND ALSO
STRCM1:				;LOOP THRU HERE FOR EACH BYTE OF STRINGS
	ILDB   T1,STRPT1	;GET BYTE FROM FIRST STRING
	ILDB   T2,STRPT2	;AND BYTE FROM SECOND
	CAME   T1,T2		;COMPARE THEM
	RET			;NOT EQUAL, RETURN +1
	SOJG   T3,STRCM1	;EQUAL, LOOP FOR NEXT BYTE
	MOVE   T1,STRPT1	;RESTORE UPDATED POINTERS
	MOVE   T2,STRPT2
	RETSKP			;DONE, RETURN
	PAGE
	SUBTTL LOAD11 - LOAD A PDP-11 FORMATTED INTEGER
;&LOAD11 - LOAD A PDP-11 FORMATTED INTEGER
;
;LOAD11 - ROUTINE TO LOAD AN -11 FORMATTED INTEGER INTO ITS -20 EQUIVALENT
;
;ACCEPTS: T1/ 8 BIT BYTE POINTER TO STRING
;	  T2/ COUNT OF BYTES IN INTEGER
;
;	CALL   LOAD11
;
;RETURNS+1: ALWAYS, T1/ UPDATED POINTER
;		    T2/ INTEGER RESULT
;
LOAD11:				;ENTRY TO LOAD11 ROUTINE
	STKVAR <PTR,INTGR>
	MOVEM  T1,PTR		;SAVE THE POINTER
	SETZM  INTGR		;INIT THE RESULT VARIABLE
	SETZI  T3,0		;INITIALIZE SHIFT VALUE
LDNX11:				;HERE TO GET EACH -11 BYTE
	ILDB   T1,PTR		;GET BYTE
	LSH    T1,(T3)		;SHIFT PROPER NUMBER OF PLACES
	ADDM   T1,INTGR		;ADD IT INTO RESULT
	ADDI   T3,8		;INCREMENT SHIFT AMOUNT TO NEXT HIGHER BYTE
	SOJG   T2,LDNX11	;DECREMENT BYTE COUNT, DONE ? NO, DO NEXT BYTE
	MOVE   T1,PTR		;YES, RESTORE UPDATED POINTER
	MOVE   T2,INTGR		;PICK UP THE RESULT
	RET			;DONE, RETURN
	PAGE
	SUBTTL ERROR - STANDARD ERROR ROUTINE
;&ERROR - STANDARD ERROR ROUTINE
;
;
;
ERROR::				;ENTRY
	PUSH   P,T1		;SAVE T1
	MOVEI  T1,.PRIIN	;GET PRIMARY INPUT
	CFIBF			;CLEAR THE INPUT BUFFER TYPEAHEAD
	 ERJMP .+1		;FORGET IT IF ERROR
	MOVEI  T1,.PRIOU	;PRIMARY OUTPUT
	DOBE			;WAIT FOR OUTPUT BUFFER TO EMPTY
	 ERJMP .+1		;FORGET THE ERROR
	
	HRROI  T1,[ASCIZ/
? DTS: JSYS ERROR - /]
	CALL   SNDMSG		;OUTPUT ERROR MESSAGE HEADER
	 ERJMP .+1		;FORGET ERROR
	MOVEI  T1,.PRIOU	;PRIMARY OUTPUT
	HRLOI  T2,.FHSLF	;OUR PROCESS, LAST ERROR
	SETZI  T3,0		;WHOLE STRING
	ERSTR			;OUTPUT ERROR STRING
	 JFCL
	 JFCL
	POP    P,T1
	RET			;DONE, RETURN

	PAGE
	SUBTTL DCXERR - DECNET ERROR MESSAGE ROUTINE

;ACCEPTS: T1/ DESTINATION POINTER
;	  T2/ DECNET ERROR NUMBER
;
;	CALL DCXERR
;
;RETURNS+1: ALWAYS

	DXTBSZ==^D50		;SIZE OF ERROR TABLE

DCXERR:				;ENTRY POINT
	HRRZI T3,(T2)		;ISOLATE REASON CODE
	MOVX T2,"("		;SURROUND WITH PARENS
	BOUT
	MOVE T2,T3		;RESTORE REASON CODE VALUE
	MOVX T3,<FLD(^D10,NO%MAG)> ;CODE IS DECIMAL
	NOUT			;OUTPUT THE REASON CODE NUMBER
	MOVE T3,T2
	MOVX T2,")"
	BOUT
	CAIL T3,0		;RANGE CHECK ERROR NUMBER
	CAIL T3,DXTBSZ		;BETWEEN 0 AND DEFINED TABLE SIZE
	SKIPA T2,[POINT 7,[ASCIZ\?ERROR OUT OF RANGE\]] ;IF NOT !
	MOVE T2,DCXTBL(T3)	;GET POINTER TO ERROR TEXT
	SETZI T3,0		;STOP ON NULL
	SETZI T4,0
	SOUT
	RET

;MACRO TO MAKE ENTRIES IN DCX ERROR TABLE

DEFINE DCXER (CODE,TEXT,BASE<DCXTBL>),<
	.ORG BASE+CODE
	POINT 7,[ASCIZ\TEXT\]
	.ORG
>
DCXTBL:				;DECNET ERROR TEXT TABLE

REPEAT DXTBSZ,<POINT 7,[ASCIZ\UNDEFINED NSP ERROR\]> ;MAKE TABLE SPACE
				; & UNDEFINED ENTRIES

	DCXER (.DCX0,<NO SPECIAL ERROR>)
	DCXER (.DCX1,<RESOURCE ALLOCATION FAILURE>)
	DCXER (.DCX2,<DESTINATION NODE DOES NOT EXIST>)
	DCXER (.DCX3,<NODE SHUTTING DOWN>)
	DCXER (.DCX4,<DESTINATION PROCESS DOES NOT EXIST>)
	DCXER (.DCX5,<INVALID NAME FIELD>)
	DCXER (.DCX9,<USER ABORT>)
	DCXER (.DCX11,<UNDEFINED ERROR>)
	DCXER (.DCX21,<CI WITH ILLEGAL DESTINATION ADDRESS>)
	DCXER (.DCX24,<FLOW CONTROL VIOLATION>)
	DCXER (.DCX32,<TOO MANY CONNECTIONS TO NODE>)
	DCXER (.DCX33,<TOO MANY CONNECTIONS TO DESTINATION PROCESS>)
	DCXER (.DCX34,<ACCESS NOT PERMITTED>)
	DCXER (.DCX35,<LOGICAL LINK SERVICES MISMATCH>)
	DCXER (.DCX36,<INVALID ACCOUNT>)
	DCXER (.DCX37,<SEGMENT SIZE TOO SMALL>)
	DCXER (.DCX38,<PROCESS ABORTED>)
	DCXER (.DCX39,<NO PATH TO DESTINATION NODE>)
	DCXER (.DCX40,<LINK ABORTED DUE TO DATA LOSS>)
	DCXER (.DCX41,<DESTINATION LOGICAL LINK ADDRESS DOES NOT EXIST>)
	DCXER (.DCX42,<CONFIRMATION OF DISCONNECT INITIATE>)
	DCXER (.DCX43,<IMAGE DATA FIELD TOO LONG>)

	PAGE
	SUBTTL DYXERR - DTS ERROR HANDLING ROUTINE
;&DYXERR - DTS ERROR HANDLING ROUTINE
;
;DYXERR - ROUTINE TO TYPE OUT A DTS ERROR STRING
;
;ACCEPTS IN T1/	DTS ERROR NUMBER,,MONITOR ERROR
;
;	CALL   DYXERR
;
;RETURNS +1:	ALWAYS
;

DYXERR::			;ENTRY
	HRROI T2,ERRSTR		;SET UP STRING POINTER FOR ERROR STRING
	MOVEI T3,.FHSLF		;THIS FORK
	CALL ERRORB		;BUILD THE ERROR STRING
	HRROI T1,ERRSTR		;GET POINTER TO STRING
	CALL   SNDMSG			;TYPE OUT THE MESSAGE
	RET			;AND EXIT
	PAGE
;
;ROUTINE TO BUILD AN ERROR MESSAGE STRING
;
;ACCEPTS IN T1/ DTS ERROR CODE,,MONITOR JSYS ERROR CODE
;	    T2/	POINTER TO WHERE TO PUT THE STRING
;	    T3/	FORK HANDLE
;
;RETURNS +1:	T2/	UPDATED STRING POINTER
;
ERRORB:	STKVAR <ERRORC,ERRORP,ERRORH>
	MOVEM T1,ERRORC		;SAVE THE ERROR NUMBERS
	MOVEM T3,ERRORH		;SAVE FORK HANDLE
	MOVE T1,T2		;SET UP POINTER TO ERROR STRING
	HRROI T2,[ASCIZ/? DTS: /]
	SETZ T3,
	SOUT			;OUTPUT THE TEXT
	HLRZ T2,ERRORC		;NOW TYPE THE ERROR MESSAGE
	SUBI T2,ERRCD0		;GET OFFSET INTO ERROR CODE TABLE
	SKIPL T2		;ERROR?
	CAIL T2,ERRTBL		;IS ERROR CODE IN CORRECT RANGE?
	SKIPA T2,[-1,,[ASCIZ/UNKNOWN DTS ERROR/]]
	HRRO T2,ERRTAB(T2)	;YES, GET POINTER TO ERROR STRING
	SOUT			;TYPE OUT THE ERROR MESSAGE
	MOVEM T1,ERRORP		;SAVE THE POINTER
	MOVE T1,ERRORH		;GET THE LAST ERROR CODE FOR THE FORK
	GETER
	HRLM  T2,ERRORH		;SAVE IT FOR LATER
	MOVE T1,ERRORP		;GET BACK THE POINTER
	HRROI T2,[ASCIZ/ - /]
	SETZ T3,
	SOUT			;NOW PRINT OUT THE LAST ERROR
	HRL  T2,ERRORH		;GET THE FORK HANDLE
	HRR   T2,ERRORC		;GET THE MONITOR ERROR CODE
	SETZ T3,		;NO LENGTH LIMIT
	ERSTR			;TYPE OUT MESSAGE
	 JFCL
	 JRST [	HRROI T2,[ASCIZ/NO ERROR MESSAGE FOR ERROR CODE: /]
		SOUT
		MOVE T2,ERRORC	;NOW TYPE OUT ERROR CODE IN OCTAL
		MOVEI T3,10
		NOUT
		 JFCL
		JRST .+1]
	HRROI T2,[BYTE (7)12,15] ;CR/LF
	SETZ T3,
	SOUT			;FINISH THE MESSAGE
	MOVE T2,T1		;RETURN WITH UPDATED POINTER IN T2
	RET			;AND RETURN
	PAGE
	SUBTTL DTS ERROR CODES AND MESSAGES
;&DTS ERROR CODES AND MESSAGES
;
;DTS ERROR CODES
;
	ERRCD0==100000		;STARTING ERROR CODE VALUE

DEFINE ERR (ERRSYM,ERRMSG) <
IF1 <IFDEF ERRSYM,<PRINTX ERROR CODE "ERRSYM" IS MULTIPLY DEFINED>>
IFNDEF ERRNUM,<ERRNUM==ERRCD0>
IF1 <	ERRSYM==ERRNUM>
	[ASCIZ\ERRMSG\]
IF1 <	ERRNUM==ERRNUM+1>>

ERRTAB:				;BEGINNING OF ERROR TABLE
ERR .ERR1,<DTS INITIALIZATION FAILURE>
ERR .ERR2,<ILLEGAL DTS COMMAND>
ERR .ERR3,<DTS TERMINATION FAILURE>
ERR .ERR4,<UNKNOWN NETWORK NAME>
ERR .ERR5,<LINK OPEN FAILURE>
ERR .ERR6,<SET CONNECT INTERRUPT CHANNEL FAILURE>
ERR .ERR7,<INVALID MESSAGE LOG JFN OR POINTER>
ERR .ERR8,<SET DATA INTERRUPT CHANNEL FAILURE>
ERR .ERR9,<UNABLE TO OBTAIN MESSAGE LOG JFN>
ERR .ERR10,<OPEN FAILED FOR MESSAGE LOG>
ERR .ERR11,<CLOSE FAILED FOR MESSAGE LOG>
ERR .ERR12,<CURRENTLY UNIMPLEMENTED FUNCTION>
ERR .ERR13,<LINK CONNECTION LOST>
ERR .OPNERR,<LINK OPEN FAILED>
ERR .RLSER,<READ LINK STATUS FAILED>
ERR .RLDER,<READ LINK DATA FAILED>
ERR .RHNER,<READ LINK HOST NAME FAILED>
ERR .RODER,<READ LINK OBJECT-DESCRIPTOR FAILED>
ERR .RTNER,<READ LINK TASK-NAME FAILED>
ERR .RUSER,<READ LINK USERID FAILED>
ERR .RPWER,<READ LINK PASSWORD FAILED>
ERR .RACER,<READ LINK ACCOUNT FAILED>
ERR .RDAER,<READ LINK OPTIONAL-DATA FAILED>
ERR .RCNER,<READ LINK OBJECT-NUMBER FAILED>
ERR .RSSER,<READ LINK SEGMENT-SIZE FAILED>
ERR .ACPER,<ACCEPT LINK CONNECTION FAILED>
ERR .SNDER,<SEND LINK FAILED>
ERR .RCVER,<RECEIVE LINK FAILED>
ERR .CLZER,<CLOSE LINK FAILED>
ERR .REJER,<REJECT LINK FAILED>
ERR .SIMER,<SEND LINK INT MSG FAILED>
ERR .RIMER,<RECEIVE LINK INT MSG FAILED>
ERR .SETER,<SET/CLEAR LINK INTERRUPT ASSIGNMENT FAILED>

				;END OF ERROR TABLE
	ERRTBL==.-ERRTAB	;ERROR TABLE LENGTH


	PAGE
	SUBTTL LITERAL POOL AND CONSTANTS

	XLIST
LTPOOL:	LIT			;BEGINNING OF LITERAL POOL
	LIST

STDPAT:				;STANDARD DATA PATTERN FOR DTR
STDINT:	POINT 8,.+1		;POINTER TO STANDARD INTERRUPT MESSAGE
	BYTE (8)"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P"
	BYTE (8)"Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5"
	BYTE (8)"6","7","8","9"
	PAGE
	SUBTTL VARIABLE DATA STORAGE
;&VARIABLE DATA STORAGE
	RELOC   <<.+140>/1000+1>*1000-140	;ORG AT NEXT HIGHER PAGE BOUNDARY
	VAR
BUFFER:	BLOCK 50		;TEXT BUFFER
ERRSTR:	BLOCK 20		;ERROR STRING BUFFER

	END