Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/debugging-tools/dts/dtssup.mac
There are no other files named dtssup.mac in the archive.


;COPYRIGHT (C) 1978 BY
;DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
;
;
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
;ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND WITH THE
;INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY  OTHER
;COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
;OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
;TRANSFERRED.
;
;
;THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
;AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
;CORPORATION.
;
;DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
;SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
;
	TITLE DTSSUP - DECNET TRANSMITTER TEST SYSTEM
	SUBTTL SYMBOL DEFINTIONS


	SEARCH DTSUNV,MONSYM,MACSYM
	.REQUIRE SYS:MACREL

	SALL
;
; VERSION NUMBER DEFINITIONS
;
	VMAJOR==1		;MAJOR VERSION OF DTS
	VMINOR==0		;MINOR VERSION NUMBER
	VEDIT==^D1		;EDIT NUMBER
	VWHO==0			;GROUP WHO LAST EDITED PROGRAM 
				; (0=DEC DEVELOPMENT)
	VDTS== <VWHO>B2+<VMAJOR>B11+<VMINOR>B17+VEDIT
	NCHPW==5		;NUMBER OF ASCII CHARACTERS PER WORD
	BUFSIZ==^D200

	CONTOT==^D60		;CONNECT TIME-OUT INTERVAL IN SECONDS
	HITYPE==^D10		;HIGHEST TEST TYPE

	INTERN LCBLST
	INTERN IHBLK

	ENTRY PRERRJ
	ENTRY PRERRN
	ENTRY PRINFN
	ENTRY PRWARN
	ENTRY PRDCXE


	PAGE
	SUBTTL MAIN ENTRY POINT AND INITIALIZATION
;
;THIS IS THE MAINLINE MODULE FOR THE DTS SYSTEM. THIS MODULE PERFORMS
; THE FOLLOWING FUNCTIONS:
;
;	(1) ESTABLISHES THE DTS ENVIRONMENT
;	(2) INITIALIZES THE PROGRAM INTERRUPT SYSTEM
;	(3) INITIALIZES THE MEMORY MANAGEMENT FACILITY
;	(4) CALLS DTSCMD TO OBTAIN EACH COMMAND TO BE EXECUTED
;	(5) STARTS TESTS TO EACH NODE
;
DTS:				;MAIN ENTRY POINT
	RESET			;RESET THE UNIVERSE
	MOVE   P,[IOWD PDLEN,PDL] ;SET UP STACK
	CALL DTS1		;CALL THE MAINLINE CODE
	CALL ENDMSG		;WHEN DONE PRINT END MESSAGE
	HALTF			;AND STOP
	JRST .-1		;DON'T ALLOW CONTINUE

	PAGE
	SUBTTL MAINLINE DRIVER 

;HERE TO DO INITIALIZATION, CALL PARSER, GET JFN,
; MAKE INITIAL CONNECTION, AND CALL TEST SPECIFIC MODULE

DTS1:				;MAINLINE CODE
	STKVAR <TCBPTR>		;STORAGE FOR TCB ADDRESS
	CALL   STRTMS		;PRINT START MESSAGE & GET START TIMES
	MOVEI T1,IHBLK		;GET ADDRESS OF INTERRUPT BLOCK
	CALL   PSIINI		;INITIALIZE - SOFTWARE INTERRUPT SYSTEM

DTSNXT:				;TOP OF LOOP HERE FOR EACH TEST
	MOVE T1,[.FHSLF,,.TIMAL] ;CLEAR ALL PENDING TIMER INTERRUPTS
	SETZI T2,
	LDB T3,[POINT 9,IHBLK+4,8] ;GET TIME INTERRUPT CHANNEL
	TIMER
	 JSCONT
	SETZM AWOKEN		;SAY HAVEN'T AWOKEN YET
	MOVEI T1,LCBBLK		;SET UP POINTER LIST OF LCB'S
	MOVEM T1,LCBLST		;THERE IS ONLY ONE NOW
	MOVE LCBPTR,LCBLST	;SET GLOBAL LCB POINTER
	CALL INILCB		;SET UP INITIAL VALUES IN LCB

RENTER:
	MOVEI T1,ARGBLK		;GET ADDRESS OF ARG BLOCK
	CALL DTSCMD##		;GET NEXT COMMAND
	RET			;+1 RETURN ON EXIT COMMAND
	MOVEM T1,TCBPTR		;SAVE POINTER TO TCB
	MOVE T2,.DTTYP(T1)	;GET TEST TYPE FROM DTS TCB
	TXZ T2,200		;CLEAR PRINT OPTION
	CAIL T2,0		;RANGE CHECK TEST TYPE CODE
	CAILE T2,3		;BETWEEN 0 & 3 OK
	PRTERR <INVALID TEST TYPE>,,<$GOTO(DTSNXT)>
	MOVEI T1,.DTNOD(T1)	;POINT TO ARG BLOCK FOR DTSJFN
	CALL DTSJFN		;GET A JFN TO OUR PARTNER DTR
	STOR T1,LCBJFN		;STORE THE LINK JFN
	CALL OPNLNK		;GO OPEN THE LINK
	JRST   [CALL ERXLNK		;PRINT LINK ERROR
		LOAD T1,LCBJFN
		RLJFN			;RELEASE THE JFN
		 JSCONT 
		JRST DTSNXT]		;GO CLEAN UP AND RESTART
	MOVEI T1,IHCON2		;GET ADDR OF GLOBAL CONNECT ROUTINE
	STOR T1,LCBCID		;PUT IN LCB
	MOVEI T1,IHDAT2		;GET ADDR OF GLOBAL DATA ROUTINE
	STOR T1,LCBDID		;PUT IN LCB
	SETZI T3,		;CLEAR FOR CHANNEL #'S
	LDB T1,[POINT 9,IHBLK+1,8] ;GET CHANNEL NUMBER FOR CONNECT
	STOR T1,MO%CDN,T3	;STORE IT IN AC
	LDB T1,[POINT 9,IHBLK+2,8] ;GET CHANNEL NUMBER FOR DATA AVAILABLE
	STOR T1,MO%DAV,T3
	LDB T1,[POINT 9,IHBLK+3,8] ;GET CHANNEL NUMBER FOR INTERRUPT MESSAGE
	STOR T1,MO%INA,T3
	CALL SETCLR		;GO SET INTERRUPT CHANNEL
	JRST   [CALL ERXLNK	;PRINT LINK ERROR
		JRST DTSRST]	;GET CLEAN UP AND RESTART

	;...
	PAGE
	;
	;... 
	;

;NOW MAKE SOME ATTEMPT TO VERIFY THAT DTR HAS DONE THE PROPER THING
; THE DTR SPECIFICATION HAS SEVERAL FLAWS IN IT....
; NAMELY, THE SPEC WAS APPARENTLY WRITTEN WITH A SPECIFIC IMPLEMENTATION
; IN MIND, I.E., RSX11M
; 
; 1) DTR ALWAYS DISCONNECTS A LINK WITH REASON CODE ZERO TO INDICATE
;	NON SUPPORT OF TEST OPTION, THERE SHOULD BE A SPECIFIC CODE
;	TO INDICATE THIS TO DTS
;
;
; WE WILL MAKE THE FOLLOWING ASSUMPTIONS......
;
; 1) IF WE GET A CONNECT EVENT INTERRUPT, THEN THE DTR PROCESS MUST HAVE
;	EXISTED AND EITHER ACCEPTED OR REJECTED THE LINK
;
; 2) IF THE ERROR REASON CODE IS EITHER 0 OR 11, THEN THE DISCONNECT OR
;	REJECT WAS PRODUCED BY THE DTR PROCESS AND IT IS SAFE TO PROCEED
;	WITH ANY OF THE TESTS
;
; 3) EACH OF THE SPECIFIC TESTS ARE RESPONSIBLE FOR CHECKING LINK
;	STATUS AND INSURING THAT IT AGREES WITH WHAT IS EXPECTED FOR
;	THAT TEST

	MOVEI T1,CONTOT		;GET CONNECT TIMEOUT PERIOD
	CALL SLEEP		;WAIT FOR CONNECTION

	LOAD T1,LCBSTS		;GET LINK STATUS
	TXZN T1,MO%WFC		;STILL WAITING FOR CONNECT ?
	TXZN T1,<MO%CON!MO%SYN!MO%ABT> ;OR SOME STATUS ?
	PRTERR <CONNECT TIME-OUT, OR INVALID LINK STATUS>,,<$GOTO(DTSRST)>;NO..

	LOAD T1,LCBRSN		;GET THE ERROR REASON CODE
	CAIE T1,0		;ZERO ?
	CAIN T1,.DCX9		;OR NINE ? (USER ABORT)
	SKIPA			;YES, IT'S OK
	PRTDCX <T1>,<CONNECT TO DTR FAILED>,,<$GOTO(DTSRST)> ;NO, SAY WHY

	MOVE T1,TCBPTR		;YES, RESTORE POINTER TO TCB
	MOVE T2,.DTTYP(T1)	;GET TEST TYPE FROM DTS TCB
	TXZ T2,200		;CLEAR PRINT OPTION
	CALL @TESTBL(T2)	;DISPATCH TO TEST ROUTINE
	CALL CONFRM		;SEND CONFIRMATIOM MESSAGE
	JRST DTSNXT		;LOOP TO NEXT TEST

TESTBL:				;TEST DISPATCH TABLE
	DTSCON			;TESTYPE=0 - CONNECT TEST
	DTSDAT			;TESTYPE=1 - DATA TEST
	DTSDIS			;TESTYPE=2 - DISCONNECT TEST
	DTSINT			;TESTYPE=3 - INTERRUPT TEST
	BLOCK ^D<HITYPE-3>	;SPACE FOR EXPANSION

;HERE TO CLOSE AND RELEASE JFN IF CONNECTION FAILS

DTSRST:
	SETONE LCBABT		;ABORT IT
	CALL CLZLNK		;CLOSE AND RELEASE JFN
	CALL ERXLNK		;ERROR
	JRST DTSNXT		;GO DO NEXT TEST

	PAGE
	SUBTTL INILCB - INITIALIZE A LINK CONTOL BLOCK (LCB)

;
;ACCEPTS: LCBPTR/ ADDRESS OF LCB 
;
;	CALL INILCB
;
;RETURNS+1: ALWAYS, LCB INITIALIZED WITH DEFAULT VALUES
;

	PGSIZ==1000		;SIZE OF A PAGE IN WORDS
	LCB.BS==^D8		;EIGHT BIT BYTES FOR LINK
	LCB.MS==^D36/LCB.BS*PGSIZ ;MAXIMUM NUMBER OF BYTES PER MESSAGE 

INILCB:				;ENTRY POINT
	SETZM (LCBPTR)		;CLEAR FIRST WORD
	MOVEI T1,(LCBPTR)	;GET ADDRESS OF LCB
	AOJ T1,0		;MAKE THE TO ADDRESS
	HRLI T1,(LCBPTR)	;GET FROM ADDRESS
	BLT T1,LCBSIZ-1(LCBPTR)	;ZERO LCBSIZ # OF WORDS
	MOVX   T1,<ASCIZ/LCB/>	;GET THE ASCII ID STRING
	STOR   T1,LCBID		;STORE IN ID FIELD
	MOVX   T1,LCB.BS	;GET DEFAULT BYTE SIZE
	STOR   T1,LCBBSZ	;STORE IT
	MOVX   T1,LCB.MS	;GET MAXIMUM MESSAGE SIZE
	STOR   T1,LCBMSZ	;STORE IT
	MOVEI T1,LKDATA		;GET ADDR OF LINK DATA AREA
	MOVE T1,[POINT 7,HOSTNM]
	STOR T1,LCBHST		;POINTER TO HOST STRING
	MOVE T1,[POINT 7,OBJDSC]
	STOR T1,LCBODS		;POINTER TO OBJECT-DESCRIPTOR STRING
	MOVE T1,[POINT 7,TASKNM]
	STOR T1,LCBTSK		;POINTER TO TASK NAME STRING
	MOVE T1,[POINT 7,USERID]
	STOR T1,LCBUSE		;POINTER TO USER ID STRING
	MOVE T1,[POINT 8,PASSWD]
	STOR T1,LCBPAS		;POINTER TO PASSWORD STRING
	MOVE T1,[POINT 7,ACCOUN]
	STOR T1,LCBACT		;POINTER TO ACCOUNT STRING
	MOVE T1,[POINT 8,OPDATA]
	STOR T1,LCBOPT		;POINTER TO OPTIONAL DATA STRING
	RET			;DONE, RETURN

	PAGE
	SUBTTL CONFRM - CONFIRM COMMAND EXECUTION
;
;CONFRM - ROUTINE TO PRINT COMMAND CONFIRMATION MESSAGE
;
CONFRM:				;ENTRY
	HRROI  T1,MSGBUF	;BUILD CONFIRMATION LINE IN BUFFER
	SETOI  T2,0
	SETZI  T3,0
	ODTIM			;OUTPUT THE DATE/TIME
	 ERJMP .+1
	HRROI  T2,[ASCIZ/ * [DTS OK]/]
	SETZI  T3,0
	SETZI  T4,0
	SOUT			;AND THE TEXT
	HRROI  T1,MSGBUF	;POINT TO BUFFER
	CALL   SNDMSG		;WRITE IT TO PROPER PLACE
	RET

	PAGE
	SUBTTL STRTMS - PRINT START UP MESSAGE
;
;STRTMS - ROUTINE TO GET AND SAVE START DATE AND TIME AND PRINT
;	A BANNER LINE TO TELL THE WORLD WE ARE STARTING
;
STRTMS:				;ENTRY
	TIME			;GET HI PRECISION TIME IN MS
	 JSRET
	MOVEM  T1,BEGTIM	;SAVE BEGINNING TIME
	GTAD			;GET CURRENT TIME AND DATE
	 JSRET
	MOVEM  T1,BEGDTE	;SAVE THE STARTING DATE/TIME
	HRROI  T1,MSGBUF	;OUTPUT TO MESSAGE BUFFER
	MOVE   T2,BEGDTE	;DATE/TIME WE STARTED
	SETZI  T3,0		;TAKE DEFAULT FORMAT
	ODTIM			;PRINT DATE/TIME
	 JSRET
	HRROI  T2,[ASCIZ/ * [DTS STARTING]/]
	SOUT			;AND MESSAGE
	 JSRET
	HRROI  T1,MSGBUF	;POINT TO MESSAGE BUFFER
	CALL   SNDMSG		;SEND IT
	RET			;DONE, RETURN TO CALLER

	PAGE
	SUBTTL ENDMSG - PRINT ENDUP MESSAGE
;
;ENDMSG - ROUTINE TO TAKE TIME WE STOPPED AND PRINT END UP MESSAGE
;	AND THE AMOUNT OF TIME WE RAN FOR
;

	AC5==5			;ALTERNATE DEFINITION SINCE Q1
				; IS GLOBAL LCB POINTER

ENDMSG:				;ENTRY
	HRROI  T1,MSGBUF	;BUILD MESSAGE IN BUFFER
	SETOI  T2,0		;CURRENT DATE/TIME
	SETZI  T3,0		;TAKE DEFAULT FORMAT
	ODTIM			;OUTPUT DATE/TIME
	 JSRET
	HRROI  T2,[ASCIZ/ * [DTS TERMINATING]/] ;THE MESSAGE
	SETZI  T3,0		;TERMINATE ON NULL
	SOUT
	 JSRET
;
;CALCULATE HI-PRECISION ELAPSED TIME
;
	HRROI  T2,[ASCIZ/ (ELAPSED TIME:  /]
	SOUT
	 JSRET
	PUSH   P,T1		;SAVE STRING POINTER
	TIME			;GET TIME NOW
	 JSRET
	SUB    T1,BEGTIM	;ELAPSED TIME IN MS
	IDIVI  T1,(T2)		;MAKE IN SECONDS
	MOVEM  T2,TIMFRC	;STORE FRACTION OF SECONDS
	IDIV   T1,[^D60*^D60*^D24] ;MAKE FRACTION OF DAY IN SECONDS
	MOVEM  T1,DAYS		;STORE DAYS
	POP    P,T1		;RESTORE STRING POINTER
	HRRZI  T4,(T2)		;GET SECONDS PAST MIDNIGHT
	SETZI  T2,0
	SETZI  T3,0
	MOVX   AC5,OT%NDA	;TIME ONLY, NO DATE
	ODTNC			;GET TIME IN INTERNAL FORMAT
	 JSRET
	HRROI  T2,[ASCIZ/)/]
	SOUT
	 JSRET
	HRROI  T1,MSGBUF	;POINT TO BUFFER
	CALL   SNDMSG		;WRITE IT TO CURRENT OUTPUT DEVICE
	RET			;DONE, RETURN

	PAGE
	SUBTTL PRDCXE - PRINT DECNET ERROR MESSAGE

;ACCEPTS:	T1/ DESTINATION POINTER
;		T2/ DECNET ERROR NUMBER
;
;CALLED BY:	JSP P5,PRDCXE
;
;RETURNS+2:	ALWAYS

PRDCXE:
	PUSH P,T1
	HRROI T1,BUFFER
	HRROI T2,[ASCIZ\? DTS: \]
	SETZI T3,0
	SETZI T4,0
	SOUT
	HRRO   T2,(P5)		;GET POINTER TO USERS TEXT
	SOUT
	HRROI T2,[ASCIZ\ - \]
	SOUT
	POP P,T2
	PUSH P,T2
	CALL DCXERR
	HRROI T1,BUFFER
	CALL SNDMSG
	POP P,T1		;RESTORE T1
	JRST 1(P5)		;RETURN +2

	PAGE
	SUBTTL PRWARN - PRINT WARNING MESSAGE ROUTINE

;
;PRWARN - ROUTINE TO PRINT A WARNING MESSAGE,
;	USED IN CONJUNCTION WITH PRTWRN MACRO
;

PRINFN:				;ENTRY TO PRINT INFO MESSAGE
	HRROI T2,[ASCIZ\# DTS: \]
	SKIPA
PRWARN:				;ENTRY
	HRROI  T2,[ASCIZ/% DTS: /] ;GET POINTER TO HEADER STRING
	HRROI  T1,BUFFER	;GET POINTER TO TEXT BUFFER
	SETZI  T3,0		;TERMINATE ON NULL
	SOUT			;OUTPUT STRING
	HRRO   T2,(P5)		;GET POINTER TO WARNING TEXT
	SOUT			;OUTPUT TO BUFFER
	HRROI  T1,BUFFER	;POINTER TO START OF BUFFER
	CALL   SNDMSG		;GO WRITE IT TO USER
	JRST   1(P5)		;RETURN SKIP

	PAGE
	SUBTTL PRERRN - PRINT ERROR MESSAGE ROUTINE

;
;PRERRN - ROUTINE TO PRINT AN ERROR MESSAGE,
;	USED IN CONJUNCTION WITH PRTERR MACRO
;
PRERRN:				;ENTRY
	HRROI  T1,BUFFER	;GET POINTER TO TEXT BUFFER
	HRROI  T2,[ASCIZ/? DTS: /] ;GET POINTER TO HEADER STRING
	SETZI  T3,0		;TERMINATE ON NULL
	SOUT			;OUTPUT STRING
	HRRO   T2,(P5)		;GET POINTER TO ERROR TEXT
	SOUT			;OUTPUT TO BUFFER
	HRROI  T1,BUFFER	;POINTER TO START OF BUFFER
	CALL   SNDMSG		;GO WRITE IT TO USER
	JRST   1(P5)		;RETURN SKIP

	PAGE
	SUBTTL PRERRJ - PRINT JSYS ERROR MESSAGE

;ACCEPTS:	T1/ ADDRESS OF JSYS
;		(P)/ NO-OP INSTRUCTION WITH ADDRESS OF TEXT
;
;CALLED BY: JSRET,JSCONT,JSHLT MACROES

PRERRJ:				;ENTRY
	PUSH P,T4		;GET SOME WORK AC'S
	PUSH P,T3
	PUSH P,T2
	PUSH P,T1		;SAVE ERCAL+1 ADDRESS OF FAILING JSYS
	PUSH P,-4(P)		;SAVE ADDRESS OF INST FOLLOWING CALL
	HRROI T1,BUFFER		;GET POINTER TO TEXT BUFFER
	HRROI T2,[ASCIZ/? DTS: /] ;GET POINTER TO HEADER STRING
	SETZI T3,0		;TERMINATE ON NULL
	SETZI T4,0
	SOUT			;OUTPUT STRING
	POP P,T2		;RESTORE ADDRESS OF INST FOLLOWING CALL
	HRRO T2,(T2)		;GET POINTER TO TEXT
	SOUT			;OUTPUT TO BUFFER
	HRROI T2,[ASCIZ\  \]
	SOUT
	POP P,T2		;RESTORE ADDRESS FOLLOWING ERCAL
	SUBI T2,2		;GET ADDRESS OF JSYS
	CALL JSERRM		;GO BUILD JSYS ERROR MESSAGE
	HRROI T1,BUFFER		;POINTER TO START OF BUFFER
	CALL SNDMSG		;GO WRITE IT TO USER
	POP P,T2
	POP P,T3
	POP P,T4
	RET			;DONE, RETURN

	PAGE
	SUBTTL JSERRM - JSYS ERROR MESSAGE ROUTINE

;
;JSERRM - ROUTINE TO PRINT ERROR TEXT AND MONITOR ERROR MESSAGE FOR JSYS
;		IN FORMAT "jsys AT nnnn FAILED - error string"
;
;	USED IN CONJUNCTION WITH JSCONT, JSRET, & JSHLT MACROS
;
;ACCEPTS:	T1/ DESTINATION POINTER
;		T2/ ADDRESS OF JSYS
;
;CALLED BY:	CALL JSERRM
;
;RETURNS+1:	ALWAYS
;
JSERRM:				;ENTRY
	STKVAR <PC>		;STORAGE FOR ADDRESS OF JSYS
	MOVEM T2,PC		;SAVE ADDRESS OF JSYS
	HRRZ T2,(T2)		;GET JSYS CODE
	MOVE T2,JSTBL(T2)	;GET POINTER TO JSYS NAME
	SETZI T3,0
	SETZI T4,0
	SOUT
	HRROI T2,[ASCIZ/ JSYS FAILED AT /]
	SOUT
	HRRZ T2,PC		;RESTORE THE JSYS ADDRESS
	MOVEI T3,10		;PRINT IN OCTAL
	NOUT
	 JFCL
	SETZI T3,0
	HRROI T2,[ASCIZ\ - \]
	SOUT
	HRLOI T2,.FHSLF		;OUR PROCESS, LAST ERROR
	ERSTR			;OUTPUT MONITOR ERROR STRING
	 JFCL
	 JFCL
	RET			;DONE, RETURN

	PAGE
	SUBTTL JSYS ERROR TABLE

;MACRO TO MAKE ENTRIES IN TABLE

DEFINE JS (NAME,JSNO,BASE<JSTBL>),<
	.ORG BASE+JSNO
	POINT 7,[ASCIZ/NAME/]
	.ORG>

;TABLE OF JSYS NAMES FOR USE BY JSERRM ROUTINE

JSTBL:	BLOCK 1000		;STORAGE FOR TABLE

	;NOW MAKE ENTRIES IN THE TABLE

	JS LOGIN,1
	JS CRJOB,2
	JS LGOUT,3
	JS CACCT,4
	JS EFACT,5
	JS SMON,6
	JS TMON,7
	JS GETAB,10
	JS ERSTR,11
	JS GETER,12
	JS GJINF,13
	JS TIME,14
	JS RUNTM,15
	JS SYSGT,16
	JS GNJFN,17
	JS GTJFN,20
	JS OPENF,21
	JS CLOSF,22
	JS RLJFN,23
	JS GTSTS,24
	JS STSTS,25
	JS DELF,26
	JS SFPTR,27
	JS JFNS,30
	JS FFFFP,31
	JS RDDIR,32		;OBSOLETE
	JS CPRTF,33		;NOT IN MONITOR (NIM)
	JS CLZFF,34
	JS RNAMF,35
	JS SIZEF,36
	JS GACTF,37
	JS STDIR,40		;OBSOLETE
	JS DIRST,41
	JS BKJFN,42
	JS RFPTR,43
	JS CNDIR,44		;NOT IN MONITOR (NIM)
	JS RFBSZ,45
	JS SFBSZ,46
	JS SWJFN,47
	JS BIN,50
	JS BOUT,51
	JS SIN,52
	JS SOUT,53
	JS RIN,54
	JS ROUT,55
	JS PMAP,56
	JS RPACS,57
	JS SPACS,60
	JS RMAP,61
	JS SACTF,62
	JS GTFDB,63
	JS CHFDB,64
	JS DUMPI,65
	JS DUMPO,66
	JS DELDF,67
	JS ASND,70
	JS RELD,71
	JS CSYNO,72		;NOT IN MONITOR (NIM)
	JS PBIN,73
	JS PBOUT,74
	JS PSIN,75		;NOT IN MONITOR (NIM)
	JS PSOUT,76
	JS MTOPR,77
	JS CFIBF,100
	JS CFOBF,101
	JS SIBE,102
	JS SOBE,103
	JS DOBE,104
	JS GTABS,105		;OBSOLETE
	JS STABS,106		;OBSOLETE
	JS RFMOD,107
	JS SFMOD,110
	JS RFPOS,111
	JS RFCOC,112
	JS SFCOC,113
	JS STI,114
	JS DTACH,115
	JS ATACH,116
	JS DVCHR,117
	JS STDEV,120
	JS DEVST,121
	JS MOUNT,122		;OBSOLETE
	JS DSMNT,123		;OBSOLETE
	JS INIDR,124		;OBSOLETE
	JS SIR,125
	JS EIR,126
	JS SKPIR,127
	JS DIR,130
	JS AIC,131
	JS IIC,132
	JS DIC,133
	JS RCM,134
	JS RWM,135
	JS DEBRK,136
	JS ATI,137
	JS DTI,140
	JS CIS,141
	JS SIRCM,142
	JS RIRCM,143
	JS RIR,144
	JS GDSTS,145
	JS SDSTS,146
	JS RESET,147
	JS RPCAP,150
	JS EPCAP,151
	JS CFORK,152
	JS KFORK,153
	JS FFORK,154
	JS RFORK,155
	JS RFSTS,156
	JS SFORK,157
	JS SFACS,160
	JS RFACS,161
	JS HFORK,162
	JS WFORK,163
	JS GFRKH,164
	JS RFRKH,165
	JS GFRKS,166
	JS DISMS,167
	JS HALTF,170
	JS GTRPW,171
	JS GTRPI,172
	JS RTIW,173
	JS STIW,174
	JS SOBF,175
	JS RWSET,176
	JS GETNM,177
	JS GET,200
	JS SFRKV,201
	JS SAVE,202
	JS SSAVE,203
	JS SEVEC,204
	JS GEVEC,205
	JS GPJFN,206
	JS SPJFN,207
	JS SETNM,210
	JS FFUFP,211
	JS DIBE,212
	JS FDFRE,213		;NOT IN MONITOR (NIM)
	JS GDSKC,214
	JS LITES,215		;OBSOLETE
	JS TLINK,216
	JS STPAR,217
	JS ODTIM,220
	JS IDTIM,221
	JS ODCNV,222
	JS IDCNV,223
	JS NOUT,224
	JS NIN,225
	JS STAD,226
	JS GTAD,227
	JS ODTNC,230
	JS IDTNC,231
	JS FLIN,232
	JS FLOUT,233
	JS DFIN,234
	JS DFOUT,235

	JS CRDIR,240
	JS GTDIR,241
	JS DSKOP,242
	JS SPRIW,243
	JS DSKAS,244
	JS SJPRI,245
	JS STO,246

	JS ASNDP,260		;NOT IN MONITOR (NIM)
	JS RELDP,261		;NOT IN MONITOR (NIM)
	JS ASNDC,262		;NOT IN MONITOR (NIM)
	JS RELDC,263		;NOT IN MONITOR (NIM)
	JS STRDP,264		;NOT IN MONITOR (NIM)
	JS STPDP,265		;NOT IN MONITOR (NIM)
	JS STSDP,266		;NOT IN MONITOR (NIM)
	JS RDSDP,267		;NOT IN MONITOR (NIM)
	JS WATDP,270		;NOT IN MONITOR (NIM)

	JS ATNVT,274		;TOPS20AN
	JS CVSKT,275		;TOPS20AN
	JS CVHST,276		;TOPS20AN
	JS FLHST,277		;TOPS20AN

	JS GCVEC,300
	JS SCVEC,301
	JS STTYP,302
	JS GTTYP,303
	JS BPT,304		;OBSOLETE
	JS GTDAL,305
	JS WAIT,306
	JS HSYS,307
	JS USRIO,310
	JS PEEK,311
	JS MSFRK,312
	JS ESOUT,313
	JS SPLFK,314
	JS ADVIS,315		;NOT IN MONITOR (NIM)
	JS JOBTM,316		;NOT IN MONITOR (NIM)
	JS DELNF,317
	JS SWTCH,320		;OBSOLETE
	JS TFORK,321
	JS RTFRK,322
	JS UTFRK,323
	JS SCTTY,324

	JS SETER,336
;NEW (NOT IN BBN TENEX) 	JSYS'S ADDED STARTING AT 500

	JS RSCAN,500
	JS HPTIM,501
	JS CRLNM,502
	JS INLNM,503
	JS LNMST,504
	JS RDTXT,505		;OBSOLETED BY RDTTY AND TEXTI
	JS SETSN,506
	JS GETJI,507
	JS MSEND,510
	JS MRECV,511
	JS MUTIL,512
	JS ENQ,513
	JS DEQ,514
	JS ENQC,515
	JS SNOOP,516
	JS SPOOL,517
	JS ALLOC,520
	JS CHKAC,521
	JS TIMER,522
	JS RDTTY,523
	JS TEXTI,524
	JS UFPGS,525
	JS SFPOS,526
	JS SYERR,527
	JS DIAG,530
	JS SINR,531
	JS SOUTR,532
	JS RFTAD,533
	JS SFTAD,534
	JS TBDEL,535
	JS TBADD,536
	JS TBLUK,537
	JS STCMP,540
	JS SETJB,541
	JS GDVEC,542
	JS SDVEC,543
	JS COMND,544
	JS PRARG,545
	JS GACCT,546
	JS LPINI,547
	JS GFUST,550
	JS SFUST,551
	JS ACCES,552
	JS RCDIR,553
	JS RCUSR,554
	JS MSTR,555
	JS STPPN,556
	JS PPNST,557
	JS PMCTL,560
	JS PLOCK,561
	JS BOOT,562
	JS UTEST,563
	JS USAGE,564

; HOLE - SLOT 565 AVAILABLE

	JS VACCT,566
	JS NODE,567
	JS ADBRK,570
	JS SINM,571		;NOT IN MONITOR (NIM)
	JS SOUTM,572		;NOT IN MONITOR (NIM)
	JS SWTRP,573		;NOT IN MONITOR (NIM)

;TEMPORARY 	JSYS DEFINITIONS

	JS SNDIM,750		;TOPS20AN	
	JS RCVIM,751		;TOPS20AN	
	JS ASNSQ,752		;TOPS20AN	
	JS RELSQ,753		;TOPS20AN	

	JS THIBR,770
	JS TWAKE,771
	JS MRPAC,772
	JS SETPV,773		;NOT IN MONITOR (NIM)
	JS MTALN,774
	JS TTMSG,775


	PAGE
	SUBTTL IHCONN - INTERRUPT HANDLER FOR CONNECT/DISCONNECT NETWORK EVENTS

;IHCONN - ROUTINE TO HANDLE SOFTWARE INTERRUPTS CAUSED BY ARRIVAL OF NSP
; CONNECT CONFIRM OR CONNECT REJECT MESSAGE TYPES

IHCONN:				;ENTRY, HERE ON EACH CONNECT INTERRUPT
	$ISAVE (COINTL)		;SET UP INTERRUPT ENVIRONMENT
	SKIPN LCBPTR,LCBLST	;GET HEAD OF LCB LIST, IF NOT EMPTY
	PRTERR (<UNSOLICITED CONNECT INTERRUPT>,<RET>) ;YES
IHCON1:
	LOAD T1,LCBCID		;GET CONNECT INTERRUPT DISPATCH ADDRESS
	SKIPE T1		;THERE?
	CALL (T1)		;YES, CALL THE DISPATCH ROUTINE
	LOAD LCBPTR,LCBCHN	;GET NEXT LCB IN LIST
	JUMPN LCBPTR,IHCON1
	RET			;RETURN

;ROUTINE TO GET CURRENT LINK STATUS ON CONNECT INTERRUPT

IHCON2:				;HERE ON CONNECT INTERRUPT 
	CALL RLSLNK		;READ STATUS
	RETBAD ERXLNK
	RET			;DONE

	PAGE
	SUBTTL IHDATA - INTERRUPT HANDLER FOR DATA AVAILABLE INTERRUPT

IHDATA:				;ENTRY, HERE ON DATA AVAILABLE
	$ISAVE (DAINTL)		;SET UP INTERRUPT ENVIRONMENT
	SKIPN LCBPTR,LCBLST	;GET HEAD OF LCB LIST, IF NOT EMPTY
	PRTERR (<UNSOLICITED DATA INTERRUPT>,<RET>) ;YES
IHDAT1:
	LOAD T1,LCBDID		;GET DATA INTERRUPT DISPATCH ADDRESS
	SKIPE T1		;THERE?
	CALL (T1)		;YES, CALL THE DISPATCH ROUTINE
	LOAD LCBPTR,LCBCHN	;GET NEXT LCB IN LIST
	JUMPN LCBPTR,IHDAT1
	RET			;RETURN

;ROUTINE TO GET CURRENT LINK STATUS ON DATA AVAILABLE INTERRUPT

IHDAT2:				;HERE ON DATA OR ABORT
	CALL RLSLNK		;READ STATUS
	RETBAD ERXLNK
	RET

	PAGE
	SUBTTL IHIMSG - INTERRUPT HANDLER FOR INTERRUPT MESSAGE

IHIMSG:				;ENTRY, HERE ON INTERRUPT MESSAGE ARRIVAL
	$ISAVE (IMINTL)		;SET UP INTERRUPT ENVIRONMENT
	SKIPN LCBPTR,LCBLST	;GET HEAD OF LCB LIST, IF NOT EMPTY
	PRTERR (<UNSOLICITED IMSG INTERRUPT>,<RET>) ;YES
IHIMS1:
	LOAD T1,LCBIID		;GET DATA INTERRUPT DISPATCH ADDRESS
	SKIPE T1		;THERE?
	CALL (T1)		;YES, CALL THE DISPATCH ROUTINE
	LOAD LCBPTR,LCBCHN	;GET NEXT LCB IN LIST
	JUMPN LCBPTR,IHIMS1
	RET			;RETURN

	PAGE
	SUBTTL IHTIME - INTERRUPT HANDLER FOR TIME OUT INTERRUPT

IHTIME:				;ENTRY, HERE ON TIME OUT
	$ISAVE (DAINTL)		;SET UP INTERRUPT ENVIRONMENT
	SKIPN LCBPTR,LCBLST	;GET HEAD OF LCB LIST, IF NOT EMPTY
	PRTERR (<UNSOLICITED TIMER INTERRUPT>,<RET>) ;YES
IHTIM1:
	LOAD T1,LCBTID		;GET TIMER INTERRUPT DISPATCH ADDRESS
	SKIPE T1		;THERE?
	CALL (T1)		;YES, CALL THE DISPATCH ROUTINE
	LOAD LCBPTR,LCBCHN	;GET NEXT LCB IN LIST
	JUMPN LCBPTR,IHTIM1
	RET			;RETURN
	SUBTTL LITERAL POOL AND CONSTANTS

	XLIST
LTPOOL:	LIT			;BEGINNING OF LITERAL POOL
	LIST

	PAGE
	SUBTTL VARIABLE DATA STORAGE

	RELOC   <<.+140>/1000+1>*1000-140	;ORG AT NEXT HIGHER PAGE BOUNDARY
	VAR

DBUGF1:	BLOCK 1			;DEBUG FLAG
BUFFER:	BLOCK 50		;TEXT BUFFER
ERRSTR:	BLOCK 20		;ERROR STRING BUFFER

	PAGE
;*******************************************************************************
;
;VARIABLES FOR DTR/DTS MODE
;
;*******************************************************************************



DTRFLG:	BLOCK 1			;FLAG FOR DTR MODE
	.ORG   DTRFLG
	EXP    .FWORD		;TURN ON FOR NOW
	.ORG
DTSFLG:	BLOCK 1			;FLAG FOR DTS MODE

; ENTRY VECTOR DEFINITION

ENTVEC:	JRST DTS		;MAIN ENTRY POINT
	JRST RENTER		;REENTER ENTRY POINT
	EXP VDTS		;VERSION OF DTS PROGRAM

IHBLK:				;INTERRUPT ROUTINE ADDRESSES
	4
	COINTL,,IHCONN
	DAINTL,,IHDATA
	IMINTL,,IHIMSG
	DAINTL,,IHTIME


MSGBUF:	BLOCK BUFSIZ		;MESSAGE BUFFER
PDL:	BLOCK PDLEN		;PUSH DOWN POINTER
TIMBUF:	BLOCK 5			;DTS START DATE/TIME STRING
BEGDTE:	BLOCK 1			;DTS START DATE/TIME INTERNAL FORMAT
BEGTIM:	BLOCK 1			;DTS START TIME IN MILLISECONDS
DAYS:	BLOCK 1
TIMFRC:	BLOCK 1
LCBLST:	BLOCK 1			;HEAD OF LCB LIST
LCBBLK:	BLOCK LCBSIZ		;LCB STORAGE

;STORAGE FOR LINK DATA

LKDATA:
HOSTNM:	BLOCK NWLKHN
OBJDSC:	BLOCK NWLKOD
TASKNM:	BLOCK NWLKTS
USERID:	BLOCK NWLKUI
PASSWD:	BLOCK NWLKPW
ACCOUN:	BLOCK NWLKAC
OPDATA:	BLOCK NWLKOP


	PAGE
	SUBTTL TEST CODE %%%%%% TO BE DELETED %%%%%%%

;%%%%%%%%%%%%%%%
;TEST DATA
;%%%%%%%%%%%%%%%%%

;TIME DEF

	SEC==^D1000	;SECONDS
	MIN==SEC*^D60	;MINUTES
	HRS==MIN*^D60	;HOURS

;PRINT OPTION

	PRINT=200

;TEST TYPES

	CONNECT==0
	DATA==1
	DISCONNECT==2
	INTERRUPT==3

;SUBTYPES 

	ACCEPT==1
	REJECT==0

	DISC==0
	ABORT==1

	SINK==0
	SEQ==1
	PAT==2
	ECH==3

	STDATA==2
	NODATA==0
	USDATA==4

ARGBLK:
	<^D60*^D1000>	;TIME TO TEST IN MILLISECONDS
	BLOCK 1		;BUFFERS TO SEND
	BLOCK 1		;BAUD RATE
	POINT 7,[ASCIZ/2102/]	;NODE NAME POINTER
	^D2		;COUNT OF OPT DATA BYTES
	PRINT		;TESTYTPE + PRINT OPT
	REJECT+STDATA	;SUBTYPE
	BLOCK ^D14


	END <3,,ENTVEC>