Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/debugging-tools/dts/dynets.mac
There is 1 other file named dynets.mac in the archive. Click here to see a list.
;<GUNN.DYNETS>DYNETS.MAC.97,  1-May-78 13:23:06, Edit by GUNN
;FIX PART OF FILE THAT GOT CORRUPTED
;<GUNN.DYNETS>DYNETS.MAC.96,  5-Dec-77 11:13:02, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.95,  2-Dec-77 12:24:03, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.94, 28-Nov-77 19:51:48, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.93, 28-Nov-77 14:28:14, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.92, 28-Nov-77 14:20:46, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.91, 10-Nov-77 11:34:35, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.90,  8-Nov-77 10:21:14, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.89,  1-Nov-77 09:38:06, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.88, 25-Oct-77 16:06:20, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.87, 24-Oct-77 11:45:50, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.86, 14-Oct-77 10:56:34, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.85, 11-Oct-77 09:17:18, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.84, 11-Oct-77 08:49:52, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.83,  4-Oct-77 08:57:19, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.81, 27-Sep-77 11:12:16, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.80, 27-Sep-77 10:51:22, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.79, 27-Sep-77 08:45:29, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.78, 26-Sep-77 12:18:16, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.77, 20-Sep-77 13:22:35, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.76, 16-Sep-77 09:20:18, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.75, 14-Sep-77 13:29:31, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.74,  9-Sep-77 13:52:21, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.73, 29-Aug-77 12:02:42, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.72, 23-Aug-77 15:25:14, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.71, 22-Aug-77 16:36:53, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.70, 19-Aug-77 16:39:27, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.69, 15-Aug-77 08:52:11, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.68, 15-Aug-77 08:51:38, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.67, 10-Aug-77 16:53:11, EDIT BY GUNN
;<GUNN.DYNETS>DYNETS.MAC.66, 10-Aug-77 08:36:29, EDIT BY GUNN
;<GUNN>DYNETS.MAC.65,  8-Aug-77 09:59:30, EDIT BY GUNN
;<GUNN>DYNETS.MAC.64,  6-Aug-77 19:52:54, EDIT BY GUNN
;<GUNN>DYNETS.MAC.63,  6-Aug-77 19:26:13, EDIT BY GUNN
;<GUNN>DYNETS.MAC.62,  6-Aug-77 19:02:12, EDIT BY GUNN
;<GUNN>DYNETS.MAC.61,  5-Aug-77 15:09:15, EDIT BY GUNN
;<GUNN>DYNETS.MAC.60,  5-Aug-77 14:31:31, EDIT BY GUNN
;<GUNN>DYNETS.MAC.59,  5-Aug-77 10:03:17, EDIT BY GUNN
;<GUNN>DYNETS.MAC.58,  5-Aug-77 08:57:56, EDIT BY GUNN
;<GUNN>DYNETS.MAC.57,  2-Aug-77 12:02:47, EDIT BY GUNN
;<GUNN>DYNETS.MAC.56,  1-Aug-77 15:30:26, EDIT BY GUNN
;<GUNN>DYNETS.MAC.55, 28-Jul-77 22:27:32, EDIT BY GUNN
;<GUNN>DYNETS.MAC.54, 28-Jul-77 17:04:15, EDIT BY GUNN
;<GUNN>DYNETS.MAC.53, 26-Jul-77 15:09:02, EDIT BY GUNN
;<GUNN>DYNETS.MAC.52, 26-Jul-77 10:57:36, EDIT BY GUNN
;<GUNN>DYNETS.MAC.51, 21-Jul-77 16:58:29, EDIT BY GUNN
;<GUNN>DYNETS.MAC.50, 20-Jul-77 15:12:14, EDIT BY GUNN
;<GUNN>DYNETS.MAC.49, 19-Jul-77 09:00:50, EDIT BY GUNN
;<GUNN>DYNETS.MAC.48, 19-Jul-77 08:51:28, EDIT BY GUNN
;<GUNN>DYNETS.MAC.47, 18-Jul-77 15:50:36, EDIT BY GUNN
;<GUNN>DYNETS.MAC.46, 15-Jul-77 16:34:19, EDIT BY GUNN
;<GUNN>DYNETS.MAC.45, 14-Jul-77 16:50:41, EDIT BY GUNN
;<GUNN>DYNETS.MAC.44, 14-Jul-77 16:36:28, EDIT BY GUNN
;<GUNN>DYNETS.MAC.43, 14-Jul-77 16:29:59, EDIT BY GUNN
;<GUNN>DYNETS.MAC.42, 12-Jul-77 14:48:10, EDIT BY GUNN
;<GUNN>DYNETS.MAC.41,  8-Jul-77 16:07:48, EDIT BY GUNN
;<GUNN>DYNETS.MAC.40,  8-Jul-77 13:42:12, EDIT BY GUNN
;<GUNN>DYNETS.MAC.39,  7-Jul-77 15:54:14, EDIT BY GUNN
;<GUNN>DYNETS.MAC.38,  7-Jul-77 11:55:39, EDIT BY GUNN
;<GUNN>DYNETS.MAC.37,  6-Jul-77 09:17:00, EDIT BY GUNN
;<GUNN>DYNETS.MAC.36,  5-Jul-77 16:01:11, EDIT BY GUNN
;<GUNN>DYNETS.MAC.35,  1-Jul-77 16:41:26, EDIT BY GUNN
;<GUNN>DYNETS.MAC.34, 30-Jun-77 16:46:01, EDIT BY GUNN
;<GUNN>DYNETS.MAC.33, 30-Jun-77 16:25:41, EDIT BY GUNN
;<GUNN>DYNETS.MAC.32, 30-Jun-77 16:00:56, EDIT BY GUNN
;<GUNN>DYNETS.MAC.31, 30-Jun-77 12:36:42, EDIT BY GUNN



;COPYRIGHT (C) 1977 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 DYNETS - DECNET DYNAMIC NETWORK EXERCISER SYSTEM
	SUBTTL SYMBOL DEFINTIONS
	SEARCH MONSYM, MACSYM
	.REQUIRE SYS:MACREL
	SALL
;
; ACCUMULATOR DEFINITIONS
;
	T1=1		;TEMPORARY
	T2=2		;TEMPORARY
	T3=3		;TEMPORARY
	T4=4		;TEMPORARY
	Q1=5		;PRESERVED
	Q2=6		;PRESERVED
	Q3=7		;PRESERVED
	P1=10		;PRESERVED
	P2=11		;PRESERVED
	P3=12		;PRESERVED
	P4=13		;PRESERVED
	P5=14		;PRESERVED
	P6=15		;PRESERVED (CAUTION, USED BY SOME MACROS IN MACSYM)
	CX=16		;RESERVED FOR SUPPORT CODE
	P=17		;PUSH-DOWN POINTER
;
; VERSION NUMBER DEFINITIONS
;
	VMAJOR==1		;MAJOR VERSION OF DYNETS
	VMINOR==1		;MINOR VERSION NUMBER
	VEDIT==^D91		;EDIT NUMBER
	VWHO==0			;GROUP WHO LAST EDITED PROGRAM 
				; (0=DEC DEVELOPMENT)
	VDYNETS== <VWHO>B2+<VMAJOR>B11+<VMINOR>B17+VEDIT
	NCHPW==5		;NUMBER OF ASCII CHARACTERS PER WORD
	BUFSIZ==200		;SIZE OF INPUT TEXT BUFFER
	ATMSIZ==BUFSIZ		;SIZE OF ATOM BUFFER FOR COMND JSYS
	GJFSIZ==.GJATR+2	;SIZE OF GTJFN BLOCK USED BY COMND JSYS
	FDBSIZ==.CMDEF+2	;SIZE OF FUNCTION DESCRIPTOR BLOCK
	LKNSIZ==6/NCHPW		;SIZE OF LINK NAME BUFFER
	MSNSIZ==6/NCHPW		;SIZE OF MESSAGE NAME BUFFER
	PDLEN==^D200		;PUSH-DOWN STACK LENGTH
	BYSWDF==^D36		;DEFAULT FOR BYTE SWITCH
	EVSWDF==^D100		;DEFAULT FOR EVERY SWITCH
	RLSWDF==250		;DEFAULT FOR RECORD LENGTH SWITCH
;
;DEFINITIONS FOR GTJFN BLOCK DEFAULTS
;
	GEN==GJ%NS+GJ%XTN	;FLAGS & GENERATION
	SRC==.PRIIN,,.PRIOU	;SOURCE DESIGNATOR FOR INPUT/OUTPUT
	DEV==[ASCIZ/DCN:/]	;DEFAULT DEVICE POINTER
	DIR==0			;DEFAULT DIRECTORY POINTER
	NAM==[ASCIZ//]		;DEFAULT NAME POINTER
	EXT==TSKNAM		;DEFAULT EXTENSION POINTER
	PRO==0			;DEFAULT PROTECTION POINTER
	ACT==0			;DEFAULT ACCOUNT POINTER
	JFN==0			;JFN TO ASSOCIATE WITH FILE-SPEC
	F2==0,,5		;FLAGS2 & EXTENSION COUNT
	CPP==0			;EXACT COPY BUFFER POINTER
	CPC==0			;AVAILABLE BYTE COUNT IN COPY BUFFER
	RTY==CMDBLK+.CMRTY	;RETRY BUFFER POINTER
	BFP==CMDBLK+.CMBFP	;DESTINATION BUFFER POINTER
	ARB==ARBBLK		;POINTER TO ATTRIBUTE BLOCK
;
;DEFINITION OF GTJFN ARGUMENT BLOCK STRUCTURE
;
	DEFSTR (GJGEN,<.GJGEN(T1)>,35,36)
	DEFSTR (GJSRC,<.GJSRC(T1)>,35,36)
	DEFSTR (GJDEV,<.GJDEV(T1)>,35,36)
	DEFSTR (GJDIR,<.GJDIR(T1)>,35,36)
	DEFSTR (GJNAM,<.GJNAM(T1)>,35,36)
	DEFSTR (GJEXT,<.GJEXT(T1)>,35,36)
	DEFSTR (GJPRO,<.GJPRO(T1)>,35,36)
	DEFSTR (GJACT,<.GJACT(T1)>,35,36)
	DEFSTR (GJJFN,<.GJJFN(T1)>,35,36)
	DEFSTR (GJF2,<.GJF2(T1)>,35,36)
	DEFSTR (GJCPP,<.GJCPP(T1)>,35,36)
	DEFSTR (GJCPC,<.GJCPC(T1)>,35,36)
	DEFSTR (GJRTY,<.GJRTY(T1)>,35,36)
	DEFSTR (GJBFP,<.GJBFP(T1)>,35,36)
	DEFSTR (GJATR,<.GJATR(T1)>,35,36)
;
;DEFINITIONS FOR ARBITRARY ATTRIBUTE BLOCK DEFAULTS
;
	ARBSIZ==5
	PAGE
	SUBTTL LOCAL MACRO DEFINITIONS
;
;MACROS USED WITHIN THE DYNAMIC EXERCISER
;
;
;MACRO TO GENERATE COMMAND TABLE ENTRIES
;
DEFINE TB(RTN,TXT)
<	[ASCIZ/TXT/] ,, RTN
>
;
;MACRO TO WRITE MESSAGE ON THE CURRENT OUTPUT DEVICE
;
DEFINE WRTMSG (STRING),<
	HRROI  T1,[ASCIZ/STRING/]
	CALL   SNDMSG
>


DEFINE WRTSTR (STRING),<
	HRROI  T1,[ASCIZ/STRING/]
	CALL   SNDSTR
>
	PAGE
	SUBTTL MAIN ENTRY POINT AND INITIALIZATION
;
;BEGIN THE DYNAMIC EXERCISER SYSTEM
;
START:				;MAIN ENTRY POINT
	RESET			;RESET THE UNIVERSE
	MOVE   P,[IOWD PDLEN,PDL] ;SET UP STACK
	SETZM  TAKFLG		;MARK THAT TAKE FILE NOT BEING PROCESSED
;
;PERFORM INTIALIZATION OF THE DYNETS ENVIRONMENT
;
	CALL   STRTMS		;PRINT START MESSAGE & GET START TIMES
	CALL   PSIINI##		;INITIALIZE - SOFTWARE INTERRUPT SYSTEM
	CALL   MEMINI##		;INITIALIZE - MEMORY SUBSYSTEM
	CALL   TCBINI##		;INITIALIZE - LOCAL VARIABLES
	;...
	PAGE
	SUBTTL COMMAND PARSER AND DISPATCH
	;
	;...
	;
RENTER:	HRROI  T1,PROMPT	;GET POINTER TO PROMPT STRING
	MOVEM  T1,CMDBLK+.CMRTY	;PUT RE-TYPE PROMPT POINTER IN STATE BLOCK
	HRROI  T1,BUFFER	;GET POINTER TO INPUT TEXT BUFFER
	MOVEM  T1,CMDBLK+.CMPTR	;SAVE POINTER TO COMMAND STRING
	MOVEM  T1,CMDBLK+.CMBFP	;SAVE POINTER TO START-OF-BUFFER
	MOVE   T1,[.PRIIN,,.PRIOU] ;GET PRIMARY INPUT,, OUTPUT JFN'S
	MOVEM  T1,CMDBLK+.CMIOJ	;SAVE PRIMARY JFN'S
	MOVEI  T1,PARSE1	;GET RE-PARSE ADDRESS
	MOVEM  T1,CMDBLK+.CMFLG	;SAVE RE-PARSE ADDRESS
	SETZM  CMDBLK+.CMINC	;INITIALIZE # OF CHARACTERS AFTER POINTER
	MOVEI  T1,BUFSIZ*NCHPW	;GET # OF CHARACTERS IN BUFFER AREA
	MOVEM  T1,CMDBLK+.CMCNT	;SAVE INITIAL # OF FREE CHARACTER POSITIONS
	HRROI  T1,ATMBFR	;GET POINTER TO ATOM BUFFER
	MOVEM  T1,CMDBLK+.CMABP	;SAVE POINTER TO LAST ATOM INPUT
	MOVEI  T1,ATMSIZ*NCHPW	;GET # OF CHARACTERS IN ATOM BUFFER
	MOVEM  T1,CMDBLK+.CMABC	;SAVE COUNT OF SPACE LEFT IN ATOM BUFFER
PARSE:				;HERE TO BEGIN PARSE OF NEXT COMMAND
	SKIPE  TAKFLG		;COMMANDS COMING FROM FILE ?
	JRST   [HLRZ   T1,CMDBLK+.CMIOJ	;YES, GET INPUT JFN
		GTSTS			;GET CURRENT STATUS
		TXNE   T2,GS%EOF	;AT EOF ?
		JRST   [MOVE   T1,[.PRIIN,,.PRIOU] ;YES, RESET TO TTY
			MOVEM  T1,CMDBLK+.CMIOJ
			SETZM  TAKFLG		;TURN OFF TAKE FLAG
			JRST   PARSE]		;START PARSE AGAIN
		HRRZ   T1,OUTJFN	;NOT AT EOF, GET OUTPUT JFN
		DVCHR			;SEE IF IT'S TERMINAL
		LDB    T2,[POINTR (T2,DV%TYP)] ;ISOLATE DEVICE TYPE
		CAIN   T2,.DVTTY	;IS IT TTY ?
		JRST   .+1		;YES, NO NEED TO WRITE PROMPT
		CALL   TSTCOL		;NO, SEE IF CR/LF NEEDED
		HRROI  T1,PROMPT 	;PUT PROMPT ON TERMINAL
		PSOUT
		JRST .+1]		;RETURN TO INLINE CODE
	HRROI  T1,PROMPT	;GET POINTER TO PROGRAM'S PROMPT STRING
	CALL   CMDINI		;OUTPUT THE PROMPT
PARSE1:	MOVE   P,[IOWD PDLEN,PDL] ;SET UP STACK AGAIN
	MOVX   T1,<CZ%NCL!.FHSLF> ;INDICATE ALL JFN'S SHOULD BE RELEASED
	CLZFF			;RELEASE ALL UNOPEN JFN'S
	 ERCAL JSERR0		;UNEXPECTED ERROR
	CALL   CLRGJF		;GO CLEAR GTJFN BLOCK
	MOVEI  T1,GJFBLK	;GET ADDRESS OF GTJFN BLOCK
	MOVEM  T1,CMDBLK+.CMGJB	;STORE POINTER TO GTJFN BLOCK
	MOVEI  T1,CMDBLK	;GET POINTER TO COMMAND STATE BLOCK
	MOVEI  T2,[FLDDB. (.CMKEY,,CMDTAB)] ;GET FUNCTION BLOCK
	COMND			;DO INITIAL PARSE
	 ERJMP CMDERR		;ERROR, GO CHECK EOF ON TAKE FILE
	TXNN   T1,CM%NOP	;VALID COMMAND ENTERED ?
	JRST   PARSE5		;YES, GO DISPATCH TO PROCESSING ROUTINE
	WRTMSG   <? DYNETS: No such DYNETS command as ">
	MOVE   T1,CMDBLK+.CMABP	;GET POINTER TO ATOM BUFFER
	CALL   SNDSTR		;OUTPUT STRING ENTERED BY USER
	WRTSTR   <"
>				;OUTPUT END-OF-MESSAGE
	JRST   PARSE		;GO TRY TO GET A COMMAND AGAIN

PARSE5:	HRRZ   T1,(T2)		;GET DISPATCH ADDRESS
	CALL   (T1)		;PERFORM REQUESTED FUNCTION
	JRST   PARSE		;GO PARSE NEXT COMMAND
	PAGE
	SUBTTL .DECLA - DECLARE (SERVER NAME)
;
;ROUTINE TO PERFORM A DECLARE COMMAND
;
; DECLARE (SERVER NAME) SERVER-NAME /BYTE:N
;
; CALLED BY COMMAND PARSER MAINLINE
; THE ROUTINE PARSES A NETWORK FILE SPEC OF THE FORM 
; "SRV:SERVERNAME-DESCRIPTOR.TASKNAME"
; UPON SUCCESS IT THEN CALLS A SUBROUTINE TO BUILD A
; SERVER CONTROL BLOCK AND DO AN OPENF ON THE OBTAINED
; NETWORK JFN
;
.DECLA:				;ENTRY TO DECLARE COMMAND
	HRROI  T2,[ASCIZ/SERVER NAME/] ;GET NOISE TEXT
	CALL   SKPNOI		;PARSE NOISE FIELD
	 RET			;RETURN ON FAILURE
	HRRZI  T1,GJFBLK	;GET ADDRESS OF GTJFN BLOCK
	HRLI   T1,(1B<.GJGEN>+1B<.GJDEV>+1B<.GJF2>) ;SET OVERRIDE BITS
	HRROI  T2,DFAULT	;DEFAULT FIELDS
	CALL   PTGTNM		;GO PARSE SOURCE NAME
	 RET			;RETURN ON FAILURE
	MOVEM  T1,.DEARG	;SAVE THE JFN IN ARGUMENT BLOCK
	MOVEI  T1,BYSWDF	;GET BYTE SWITCH DEFAULT VALUE
	MOVEM  T1,.DEARG+.DEBYT	;PUT IT IN BYTE SWITCH
	MOVEI  T1,CMDBLK	;GET ADDRESS OF COMMAND STATE BLOCK
	MOVEI  T2,[FLDDB. (.CMSWI,,DECSWI,,,[FLDDB. (.CMCFM)])]
	CALL   PSWTCH		;GO PARSE SWITCH FIELD/COMMAND END
	 RET
	MOVEI  T1,.DEARG	;GET ADDRESS OF ARGUMENT BLOCK
	CALL   NETDCL##		;CALL DECLARE COMMAND EXECUTOR
	SKIPA			;BAD RETURN, SKIP CONFIRMATION
	CALL   CONFRM		;SEND CONFIRMATIOM MESSAGE
	RET			;DONE, RETURN TO CALLER
DFAULT:	EXP <GJ%NS>		;NO EXTENSION
	POINT  7,[ASCIZ/SRV:/]	;SERVER 
	BLOCK 1			;NO EXTENSION FOR ATTRIBUTES
	PAGE
	SUBTTL .DISES - DISESTABLISH COMMAND
;
;ROUTINE TO PERFORM A DISESTABLISH COMMAND
;
; DISESTABLISH (FROM OBJECT) TARGET-NAME (ON) LINK-NAME
;
.DISES:				;ENTRY TO DISESTABLISH COMMAND
	HRROI  T2,[ASCIZ/FROM OBJECT/] ;GET NOISE TEXT
	CALL   SKPNOI		;PARSE NOISE FIELD
	 RET
	HRRZI  T1,GJFBLK	;GET ADDRESS OF GTJFN BLOCK
	CALL   PTGTNM		;GO PARSE TARGET NAME
	 RET			;RETURN ON FAILURE
	MOVEM  T1,.DIJFN+.DIARG	;SAVE THE JFN IN ARGUMENT BLOCK
;	HRROI  T2,[ASCIZ/ON/]	;GET NOISE TEXT
;	CALL   SKPNOI		;PARSE NOISE FIELD
;	 RET
;	HRROI  T1,[ASCIZ/LINK NAME/] ;HELP STRING
;	HRROI  T2,LKNBUF	;GET ADDRESS OF RETURNED ARGUMENT
;	CALL   PARBST		;GO PARSE LINK NAME FIELD
	CALL   ENDCOM		;PARSE COMMAND END CONFIRMATION
	 RET
	MOVEI  T1,.DIARG	;GET ADDRESS OF ARG BLOCK
	CALL   NETDIS##		;CALL DISESTABLISH COMMAND EXECUTOR
	SKIPA			;BAD RETURN, SKIP CONFIRMATION
	CALL   CONFRM		;SEND CONFIRMATIOM MESSAGE
	RET			;DONE, RETURN TO CALLER
	PAGE
	SUBTTL .ESTAB - ESTABLISH COMMAND
;
;ROUTINE TO PERFORM AN ESTABLISH COMMAND
;
; ESTABLISH (LOGICAL LINK TO) TARGET-NAME [/WAIT:NN!/NOWAIT] [/BYTE:NN] [/RECL:NNN]
;
.ESTAB:				;ENTRY TO ESTABLISH COMMAND
	HRROI  T2,[ASCIZ/LOGICAL LINK TO/] ;GET NOISE TEXT
	CALL   SKPNOI		;PARSE NOISE FIELD
	 RET			;RETURN ON ERROR
;	HRROI  T1,[ASCIZ/LINK NAME/] ;HELP STRING
;	HRROI  T2,LKNBUF	;GET ADDRESS OF RETURNED ARGUMENT
;	CALL   PARBST		;GO PARSE LINK NAME FIELD
;	HRROI  T2,[ASCIZ/TO/]	;GET NOISE TEXT
;	CALL   SKPNOI		;PARSE NOISE FIELD
;	 RET			;RETURN ON ERROR
	HRRZI  T1,GJFBLK	;GET ADDRESS OF GTJFN BLOCK
	CALL   PTGTNM		;GO PARSE TARGET NAME
	 RET			;RETURN ON FAILURE
	MOVEM  T1,.ESARG	;SAVE THE JFN IN ARGUMENT BLOCK
	SETOM  .ESARG+.ESWAT	;DEFAULT WAIT FOREVER
	SETZM  .ESARG+.ESREC	;DEFAULT NO RECORD LENGTH
	MOVEI  T1,BYSWDF	;GET BYTE SWITCH DEFAULT VALUE
	MOVEM  T1,.ESARG+.ESBYT	;PUT IT IN BYTE SWITCH
	MOVEI  T1,CMDBLK	;GET ADDRESS OF COMMAND STATE BLOCK
	MOVEI  T2,[FLDDB. (.CMSWI,,ESTSWI,,,[FLDDB. (.CMCFM)])]
	CALL   PSWTCH		;GO PARSE SWITCH FIELD/COMMAND END
	 RET			;RETURN ON ERROR
	MOVEI  T1,ESTSWI+4	;ADDRESS OF NOWAIT SWITCH
	CAMN   T1,.ESARG+.ESWAT	;NOWAIT SWITCH GIVEN ??
	SETZM  .ESARG+.ESWAT	;YES, DON'T WAIT
	MOVEI  T1,.ESARG	;GET ADDRESS OF ARG BLOCK
	CALL   NETEST##		;CALL ESTABLISH COMMAND EXECUTOR
	SKIPA			;BAD RETURN, SKIP CONFIRMATION
	CALL   CONFRM		;SEND CONFIRMATIOM MESSAGE
	RET			;DONE, RETURN
	PAGE
	SUBTTL .INTER - INTERRUPT COMMAND
;
;ROUTINE TO PERFORM AN INTERRUPT COMMAND
;
; INTERRUPT (OBJECT) TARGET-NAME [/EVERY:N]
;
.INTER:				;ENTRY TO INTERRUPT COMMAND
	HRROI  T2,[ASCIZ/OBJECT/] ;GET NOISE TEXT
	CALL   SKPNOI		;PARSE NOISE FIELD
	 RET			;RETURN ON ERROR
	HRRZI  T1,GJFBLK	;GET ADDRESS OF GTJFN BLOCK
	CALL   PTGTNM		;GO PARSE TARGET NAME
	 RET			;RETURN ON FAILURE
	MOVEM  T1,.INARG	;STORE JFN
;	HRROI  T2,[ASCIZ/ON/]	;GET NOISE TEXT
;	CALL   SKPNOI		;PARSE NOISE FIELD
;	 RET			;RETURN ON ERROR
;	HRROI  T1,[ASCIZ/LINK NAME/] ;HELP STRING
;	HRROI  T2,LKNBUF	;GET ADDRESS OF RETURNED ARGUMENT
;	CALL   PARBST		;GO PARSE LINK NAME FIELD
;	HRROI  T2,[ASCIZ/WITH MSG/] ;GET NOISE TEXT
;	CALL   SKPNOI		;PARSE NOISE FIELD
;	 RET			;RETURN ON ERROR
;	HRROI  T1,[ASCIZ/MSG NAME/] ;HELP STRING
;	HRROI  T2,MSNBUF	;GET ADDRESS OF RETURNED ARGUMENT
;	CALL   PARBST		;GO PARSE LINK NAME FIELD
	MOVEI  T1,EVSWDF		;DEFAULT FOR SWITCH VALUE
	MOVEM  T1,.INARG+.INEVR	;STORE DEFAULT
	MOVEI  T1,CMDBLK	;GET ADDRESS OF COMMAND STATE BLOCK
	MOVEI  T2,[FLDDB. (.CMSWI,,INTSWI,,,[FLDDB. (.CMCFM)])]
	CALL   PSWTCH		;GO PARSE SWITCH FIELD/COMMAND END
	 RET			;RETURN ON ERROR
	MOVEI  T1,.INARG	;GET ADDRESS OF ARG BLOCK
	CALL   NETINT##		;CALL INTERRUPT COMMAND EXECUTOR
	SKIPA			;BAD RETURN, SKIP CONFIRMATION
	CALL   CONFRM		;SEND CONFIRMATIOM MESSAGE
	RET			;DONE, RETURN TO CALLER
	PAGE
	SUBTTL .LISTN - LISTEN COMMAND
;
;ROUTINE TO PERFORM A LISTEN COMMAND
;
; LISTEN (FOR OBJECT) TARGET-NAME [/TIME:N] [/ACCEPT!/REJECT]
;
.LISTN:				;ENTRY TO LISTEN COMMAND
	HRROI  T2,[ASCIZ/FOR OBJECT/] ;GET NOISE TEXT
	CALL   SKPNOI		;PARSE NOISE FIELD
	 RET			;RETURN ON ERROR
	HRRZI  T1,GJFBLK	;GET ADDRESS OF GTJFN BLOCK
	CALL   PTGTNM		;GO PARSE TARGET NAME
	 RET			;RETURN ON FAILURE
	MOVEM  T1,.LIARG	;STORE JFN IN ARGUMENT BLOCK
	MOVE   T1,[.INFIN]	;MAXIMUM POS VALUE
	MOVEM  T1,.LIARG+.LITIM	;STORE DEFAULT VALUE
	SETOM  .LIARG+.LIACC	;SET DEFAULT FOR ACCEPT/REJECT
	MOVEI  T1,CMDBLK	;GET ADDRESS OF COMMAND STATE BLOCK
	MOVEI  T2,[FLDDB. (.CMSWI,,LISSWI,,,[FLDDB. (.CMCFM)])]
	CALL   PSWTCH		;GO PARSE SWITCH FIELD/COMMAND END
	 RET			;RETURN ON ERROR
	MOVEI  T1,LISSWI+5	;ACCEPT
	CAMN   T1,.LIARG+.LIACC	;SKIP IF NOT ACCEPT
	SETOM  .LIARG+.LIACC	;SET TRUE, "ACCEPT"
	MOVEI  T1,LISSWI+6	;REJECT
	CAMN   T1,.LIARG+.LIACC	;SKIP IF NOT REJECT
	SETZM  .LIARG+.LIACC	;SET FALSE, "REJECT"
				;ELSE DEFAULT USED
	MOVEI  T1,.LIARG	;GET ADDRESS OF ARG BLOCK
	CALL   NETLIS##		;CALL LISTEN COMMAND EXECUTOR
	SKIPA			;BAD RETURN, SKIP CONFIRMATION
	CALL   CONFRM		;SEND CONFIRMATIOM MESSAGE
	RET			;DONE, RETURN TO CALLER
	PAGE
	SUBTTL .PURGE - PURGE COMMAND
;
;ROUTINE TO PERFORM A PURGE COMMAND
;
; PURGE (OBJECT) TARGET-NAME 
;
.PURGE:				;ENTRY TO PURGE COMMAND
	HRROI  T2,[ASCIZ/OBJECT/] ;GET NOISE TEXT
	CALL   SKPNOI		;PARSE NOISE FIELD
	 RET			;RETURN ON ERROR
	HRRZI  T1,GJFBLK	;GET ADDRESS OF GTJFN BLOCK
	CALL   PTGTNM		;GO PARSE TARGET NAME
	 RET			;RETURN ON FAILURE
	MOVEM  T1,.PUARG	;STORE JFN IN ARGUMENT BLOCK
;	HRROI  T2,[ASCIZ/ON/]	;GET NOISE TEXT
;	CALL   SKPNOI		;PARSE NOISE FIELD
;	 RET			;RETURN ON ERROR
;	HRROI  T1,[ASCIZ/LINK NAME/] ;HELP STRING
;	HRROI  T2,LKNBUF	;GET ADDRESS OF RETURNED ARGUMENT
;	CALL   PARBST		;GO PARSE LINK NAME FIELD
	CALL   ENDCOM		;PARSE COMMAND END CONFIRMATION
	 RET
	MOVEI  T1,.PUARG	;GET ADDRESS OF ARG BLOCK
	CALL   NETPUR##		;CALL PURGE COMMAND EXECUTOR
	SKIPA			;BAD RETURN, SKIP CONFIRMATION
	CALL   CONFRM		;SEND CONFIRMATIOM MESSAGE
	RET			;DONE, RETURN TO CALLER
	PAGE
	SUBTTL .RECVE - RECEIVE COMMAND
;
;ROUTINE TO PERFORM A RECEIVE COMMAND
;
; RECEIVE (FROM) TARGET-NAME [/TIMEOUT:N] [/RECL:N] [/BYTE:NN]
; RECEIVE (FROM) TARGET-NAME (LOGGING ON) MSG-LOG-FILE [/TIMEOUT:N] [/RECL:N] [/BYTE:NN] <-- (V2)
;
.RECVE:				;ENTRY TO RECEIVE COMMAND
	HRROI  T2,[ASCIZ/FROM/] ;GET NOISE TEXT
	CALL   SKPNOI		;PARSE NOISE FIELD
	 RET			;RETURN ON ERROR
	HRRZI  T1,GJFBLK	;GET ADDRESS OF GTJFN BLOCK
	CALL   PTGTNM		;GO PARSE TARGET NAME
	 RET			;RETURN ON FAILURE
	MOVEM  T1,.REARG	;STORE JFN IN ARGUMENT BLOCK
;	HRROI  T2,[ASCIZ/ON/]	;GET NOISE TEXT
;	CALL   SKPNOI		;PARSE NOISE FIELD
;	 RET			;RETURN ON ERROR
;	HRROI  T1,[ASCIZ/LINK NAME/] ;HELP STRING
;	HRROI  T2,LKNBUF	;GET ADDRESS OF RETURNED ARGUMENT
;	CALL   PARBST		;GO PARSE LINK NAME FIELD
	SETZM  .REMLN+.REARG	;CLEAR MESSAGE LOG JFN
	SETOM  .REARG+.RETOU	;DEFAULT FOR TIMEOUT SWITCH
	MOVEI  T1,RLSWDF	;DEFAULT FOR RECORD LENGTH SWITCH
	MOVEM  T1,.REARG+.REREC	;STORE IT IN ARG BLOCK
	MOVEI  T1,BYSWDF	;GET BYTE SWITCH DEFAULT VALUE
	MOVEM  T1,.REARG+.REBYT	;PUT IT IN BYTE SWITCH
	MOVEI  T1,CMDBLK	;GET ADDRESS OF COMMAND STATE BLOCK
	MOVEI  T2,[FLDDB. (.CMSWI,,RECSWI,,,[FLDDB. (.CMCFM)])]
	CALL   PSWTCH		;GO PARSE SWITCH FIELD/COMMAND END
	 RET			;RETURN ON ERROR
	MOVEI  T1,.REARG	;GET ADDRESS OF ARG BLOCK
	CALL   NETRCV##		;CALL RECEIVE COMMAND EXECUTOR
	SKIPA			;BAD RETURN, SKIP CONFIRMATION
	CALL   CONFRM		;SEND CONFIRMATIOM MESSAGE
	RET			;DONE, RETURN TO CALLER
	PAGE
	SUBTTL .SEND - SEND COMMAND
;
;ROUTINE TO PERFORM A SEND COMMAND
;
; SEND (TO) TARGET-NAME (FROM MESSAGE FILE) MSG-NAME [/TIMES:N] [/DELAY:N] [/BYTE:NN]
;
.SEND:				;ENTRY TO SEND COMMAND
	HRROI  T2,[ASCIZ/TO/]	;GET NOISE TEXT
	CALL   SKPNOI		;PARSE NOISE FIELD
	 RET			;RETURN ON ERROR
	HRRZI  T1,GJFBLK	;GET ADDRESS OF GTJFN BLOCK
	CALL   PTGTNM		;GO PARSE TARGET NAME
	 RET			;RETURN ON FAILURE
	MOVEM  T1,.SEARG	;STORE JFN IN ARGUMENT BLOCK
;	HRROI  T2,[ASCIZ/ON/]	;GET NOISE TEXT
;	CALL   SKPNOI		;PARSE NOISE FIELD
;	 RET			;RETURN ON ERROR
;	HRROI  T1,[ASCIZ/LINK NAME/] ;HELP STRING
;	HRROI  T2,LKNBUF	;GET ADDRESS OF RETURNED ARGUMENT
;	CALL   PARBST		;GO PARSE LINK NAME FIELD
	HRROI  T2,[ASCIZ/FROM MESSAGE FILE/] ;GET NOISE TEXT
	CALL   SKPNOI		;PARSE NOISE FIELD
	 RET			;RETURN ON ERROR
	SETZM  .SEMFN+.SEARG	;CLEAR MESSAGE FILE JFN
	MOVEI  T1,GJFBLK	;GET ADDRESS OF GTJFN BLOCK
	CALL   PFILNM		;GO PARSE MESSAGE LOG FILE NAME FIELD
	 RET			;RETURN ON ERROR
	MOVEM  T1,.SEMFN+.SEARG	;STORE MESSAGE FILE JFN IN ARG BLOCK
	MOVEI  T1,1		;DEFAULT FOR TIMES SWITCH
	MOVEM  T1,.SEARG+.SETIM	;STORE IT
	SETZM  .SEARG+.SEDEL	;DEFAULT FOR DELAY SWITCH
	SETZM  .SEARG+.SEINT	;DEFAULT NO INTERRUPT MESSAGES
	MOVEI  T1,BYSWDF	;GET BYTE SWITCH DEFAULT VALUE
	MOVEM  T1,.SEARG+.SEBYT	;PUT IT IN BYTE SWITCH
	MOVEI  T1,CMDBLK	;GET ADDRESS OF COMMAND STATE BLOCK
	MOVEI  T2,[FLDDB. (.CMSWI,,SENSWI,,,[FLDDB. (.CMCFM)])]
	CALL   PSWTCH		;GO PARSE SWITCH FIELD/COMMAND END
	 RET			;RETURN ON ERROR
	MOVEI  T1,.SEARG	;GET ADDRESS OF ARG BLOCK
	CALL   NETSND##		;CALL THE SEND COMMAND EXECUTOR
	SKIPA			;BAD RETURN, SKIP CONFIRMATION
	CALL   CONFRM		;SEND CONFIRMATIOM MESSAGE
	RET			;DONE, RETURN TO CALLER
	PAGE
	SUBTTL .SET - SET COMMAND
;
;ROUTINE TO PERFORM A SET COMMAND
;
; SET FUNCTION-NAME MODIFIER (TO) VALUE
;
.SET:				;ENTRY TO SET COMMAND
;	HRROI  T2,[ASCIZ/FUNCTION/] ;GET NOISE TEXT
;	CALL   SKPNOI		;PARSE NOISE FIELD
;	 RET			;RETURN ON ERROR
	MOVEI  T1,CMDBLK	;GET POINTER TO COMMAND STATE BLOCK
	MOVEI  T2,[FLDDB. (.CMKEY,,FNCTAB)] ;GET FUNCTION BLOCK
	COMND			;DO INITIAL PARSE
	 ERJMP CMDERR		;ERROR, GO CHECK EOF ON TAKE FILE
	TXNN   T1,CM%NOP	;VALID FUNCTION ENTERED ?
	JRST   SET1		;YES, GO TO PROCESSING ROUTINE
	WRTMSG   <? DYNETS: No such FUNCTION as ">
	MOVE   T1,CMDBLK+.CMABP	;GET POINTER TO ATOM BUFFER
	CALL   SNDSTR		;OUTPUT STRING ENTERED BY USER
	WRTSTR   <"
>				;OUTPUT END-OF-MESSAGE
;
;HERE WITH VALID FUNCTION
;
SET1:				;ENTRY WITH FUNCTION IN T2
	HRRZ   T1,(T2)		;GET ROUTINE ADDRESS
	CALL   (T1)		;AND CALL IT
	 RET			;BAD RETURN
	CALL   ENDCOM		;PARSE COMMAND END CONFIRMATION
	 RET
;	CALL   NETSET##		;CALL SET COMMAND EXECUTOR
;	SKIPA			;BAD RETURN, SKIP CONFIRMATION
	CALL   CONFRM		;SEND CONFIRMATIOM MESSAGE
	RET			;DONE, RETURN TO CALLER
	PAGE

SETACC:			;HERE TO SET ALLOWABLE ACCESS CONTROL
	RET

SETDEF:				;HERE TO DO SET DEFAULT .....
	MOVEI  T2,[FLDDB. (.CMKEY,,DEFTAB)] ;THE DEFAULTS
	CALL   PKEYWD
	 RET
	CALL   (T1)
	 RET
	RETSKP

SETATR:				;HERE TO SET DEFAULT ATTRIBUTES
	HRROI  T2,[ASCIZ/TO/]
	CALL   SKPNOI
	 RET
	MOVEI  T1,CMDBLK
	MOVEI  T2,[FLDDB. (.CMTXT,,,DEFAULT STRING)]
	COMND
	 ERJMP CMDERR
	HRROI  T1,ARBUID	;WHERE TO PUT STRING
	MOVE   T2,CMDBLK+.CMABP	;GET POINTER TO ATOM BUFFER
	MOVEI  T3,250
	SETZI  T4,0		;TO NULL OR 250
	SOUT
	MOVEI   T1,2
	MOVEM   T1,ARBBLK	;RESET ATTRIBUTE BLCK COUNT
	RETSKP

;
;DUMMY ROUTINES TO DO SETTING OF DEFAULT INDIVIDUAL ARBITRARY ATTRIBUTES
; THIS CODE MUST BE ADDED IN THE FUTURE
;
SETBDT:				;HERE TO SET BINARY OPTIONAL DATA
SETBPW:				;HERE TO SET BINARY PASSWORD
SETCHG:				;HERE TO SET CHARGE
SETDTA:				;HERE TO SET OPTIONAL DATA
SETPWD:				;HERE TO SET OPTIONAL DATA
SETUID:				;HERE TO SET USERID
	RET			;DUMMY RETURN

	PAGE
	SUBTTL .TAKE - TAKE COMMAND 
;
;PERFORM TAKE COMMAND
;
; TAKE (COMMANDS FROM) FILE-SPEC (LOGGING OUTPUT ON) FILE-SPEC
;
.TAKE:	HRROI T2,[ASCIZ/COMMANDS FROM/] ;GET NOISE TEXT
	CALL SKPNOI		;GO PARSE NOISE FIELD
	 RET			;FAILED, RETURN FAILURE
	CALL CLRGJF		;GO CLEAR GTJFN BLOCK
	MOVX T1,GJ%OLD		;GET EXISTING FILE FLAG
	MOVEM T1,GJFBLK+.GJGEN	;STORE GTJFN FLAGS
	HRROI T1,[ASCIZ/CMD/]	;GET DEFAULT FILE TYPE FIELD
	MOVEM T1,GJFBLK+.GJEXT	;STORE DEFAULT EXTENSION
	MOVEI T1,CMDBLK		;GET ADDRESS OF COMMAND STATE BLOCK
	MOVEI T2,[FLDDB. (.CMFIL)] ;GET FUNCTION DESCRIPTOR BLOCK ADDRESS
	COMND			;PARSE INPUT FILE SPEC
	 ERJMP CMDERR		;ERROR, GO CHECK EOF ON TAKE FILE
	TXNN T1,CM%NOP		;PARSED FILE-SPEC OK ?
	JRST TAKE10		;YES, GO ON AND SAVE INPUT JFN
	WRTMSG <? DYNETS: Invalid file specification, >
	CALLRET PUTERR		;OUTPUT ERROR STRING TO TERMINAL
;
; HERE ON A GOOD INPUT FILE SPEC
;
TAKE10:	MOVEM T2,INJFN		;SAVE INPUT JFN FOR COMMANDS
	HRROI T2,[ASCIZ/LOGGING OUTPUT ON/] ;GET NOISE TEXT
	CALL SKPNOI		;GO PARSE NOISE FIELD
	 RET			;FAILED, RETURN FAILURE
	CALL CLRGJF		;GO CLEAR GTJFN BLOCK USED BY COMND JSYS
	MOVX T1,GJ%FOU		;GET FLAG SAYING FILEIS FOR OUTPUT USE
	MOVEM T1,GJFBLK+.GJGEN	;SAVE GTJFN FLAGS
	SETZM NAMBUF		;INITIALIZE FILENAME BUFFER
	HRROI T1,NAMBUF		;GET POINTER TO WHERE FILENAME IS TO GO
	MOVE T2,INJFN		;GET INPUT JFN
	MOVX T3,<FLD(.JSAOF,JS%NAM)> ;GET FLAG BITS SAYING OUTPUT NAME ONLY
	JFNS			;GET FILE NAME OF INPUT FILE
	SKIPE NAMBUF		;ANY FILENAME ?
	HRROI T1,NAMBUF		;YES, GET A POINTER TO THE FILE NAME FOR INPUT
	MOVEM T1,GJFBLK+.GJNAM	;STORE DEFAULT NAME OF OUTPUT FILE
	HRROI T1,[ASCIZ/LOG/]	;GET DEFAULT FILE TYPE OF OUTPUT FILE
	MOVEM T1,GJFBLK+.GJEXT	;STORE DEFAULT EXTENSION
	MOVEI T1,CMDBLK		;GET ADDRESS OF COMMAND STATE BLOCK
	MOVEI T2,[FLDDB. (.CMFIL)] ;GET FILE-SPEC FUNCTION BLOCK ADDRESS
	COMND			;PARSE OUTPUT FILE SPEC
	 ERJMP CMDERR		;ERROR, GO CHECK EOF ON TAKE FILE
	TXNN T1,CM%NOP		;FILE SPEC PARSED OK ?
	JRST TAKE20		;YES, GO ON TO SAVE JFN
	WRTMSG <? DYNETS: Invalid file specification, >
	CALLRET PUTERR		;GO OUTPUT CORRECT MESSAGE AND RETURN
	PAGE
;
; HERE TO SAVE OUTPUT JFN AND GET COMMAND CONFIRMATION
;
TAKE20:	MOVEM T2,OUTJFN		;SAVE LOGGIN FILE JFN
	CALL ENDCOM		;GO PARSE COMMAND CONFIRMATION
	 RET			;RETURN, BAD CONFIRMATION
;
; OPEN INPUT AND OUTPUT FILES
;
	MOVE T1,INJFN		;GET INPUT JFN
	MOVE T2,[7B5+OF%RD]	;7 BIT BYTES, READ ACCESS
	OPENF			;OPEN INPUT FILE
	 JRST  [WRTMSG <? DYNETS: Cannot OPEN command file, >
		CALLRET PUTERR]	;GO ISSUE REST OF MESSAGE AND RETURN
	MOVE T1,OUTJFN		;GET OUTPUT JFN
	CAIN T1,.PRIOU		;STILL PRIMARY OUTPUT JFN ?
	JRST TAKE30		;NO OUTPUT JFN, GO ON
	MOVE T2,[7B5+OF%WR]	;7 BIT BYTES, WRITE ACCESS
	OPENF			;OPEN OUTPUT FILE
	 JRST  [MOVE T1,INJFN	;GET INPUT JFN AGAIN
		CLOSF		;CLOSE INPUT FILE
		 JFCL		;IGNORE ERRORS HERE
		WRTMSG <? DYNETS: cannot OPEN logging file, >
		CALLRET PUTERR]	;GO OUTPUT REST OF MESSAGE
;
; NOW SAVE NEW JFN'S AND RETURN TO PARSER
;
TAKE30:	HRLZ T1,INJFN		;GET INPUT JFN
	HRR T1,OUTJFN		;GET OUTPUT JFN
	MOVEM T1,CMDBLK+.CMIOJ	;SAVE NEW JFN'S
	SETOM TAKFLG		;MARK THAT COMMANDS ARE COMING FROM FILE
	HRRZ   T1,OUTJFN	;GET OUTPUT JFN
	HRROI  T2,BUFFER	;POINT TO COMMAND BUFFER
	SETZI  T3,0		;WRITE TO NULL BYTE
	SETZI  T4,0
	SOUT			;WRITE TAKE COMMAND IN LOG FILE
	CALL   CONFRM		;SEND CONFIRMATIOM MESSAGE
	RET			;RETURN TO PARSER
	PAGE
	SUBTTL	HELP AND EXIT COMMANDS
;
; HELP COMMAND
;
; HELP (WITH DYNETS)
;
.HELP:	HRROI T2,[ASCIZ/WITH DYNETS/] ;GET NOISE WORDS
	CALL SKPNOI		;GO PARSE NOISE FIELD
	 RET			;FAILED, RETURN FAILURE
	CALL ENDCOM		;GO PARSE END OF COMMAND
	 RET			;BAD CONFIRMATION, RETURN
	CALL   CONFRM		;SEND CONFIRMATIOM MESSAGE
	HRROI T1,HLPMSG		;GET POINTER TO HELP MESSAGE
	CALL   SNDMSG		;OUTPUT HELP MESSAGE
	RET			;GO PARSE NEXT COMMAND

; EXIT COMMAND

.EXIT:	HRROI T2,[ASCIZ/TO MONITOR/] ;GET NOISE PHRASE
	CALL SKPNOI		;GO PARSE NOISE FIELD
	 RET			;FAILED, RETURN FAILURE
	CALL ENDCOM		;GO PARSE END OF COMMAND
	 RET			;BAD CONFIRMATION, RETURN
	CALL   CONFRM		;SEND CONFIRMATIOM MESSAGE
	CALL   ENDMSG		;GO CALCULATE RUN-TIME & PRINT ENDUP MSG
	SETOM T1		;INDICATE ALL FILES SHOULD BE CLOSED
	CLOSF			;CLOSE ALL OPEN FILES
	 JSERR			;UNEXPECTED ERROR
	HALTF			;RETURN TO MONITOR
	JRST START		;IF CONTINUE'D, START OVER
	PAGE
	SUBTTL .WAIT - WAIT COMMAND
;
;.WAIT - ROUTINE TO PERFORM A WAIT COMMAND
;	THIS IS USEFUL FOR RUNNING DYNETS FROM BATCH OR NEWRUN
;
.WAIT:				;ENTRY
	HRROI  T2,[ASCIZ\AND DON'T ISSUE NEXT PROMPT\] ;NOISE PHRASE
	CALL   SKPNOI		;PARSE NOISE
	 RET
	CALL   ENDCOM		;GET COMMAND END
	 RET
	CALL   CONFRM		;ISSUE CONFIRMATION MESSAGE
	WAIT			;JUST GO TO SLEEP
	RET			;RETURN IF WE EVER WAKE UP
	PAGE
	SUBTTL	COMMAND ERROR SUBROUTINES
;
; INVALID END-OF-COMMAND
;
CFMERR:
	WRTMSG <? DYNETS: Garbage at end-of-command> ;OUTPUT ERROR MESSAGE
	RET			;RETURN TO WHENCE WE CAME ...
;
; SUBROUTINE TO TEST COLUMN POSITION AND OUTPUT CRLF IF NEEDED
;
TSTCOL::			;ENTRY
	SAVEAC <T1,T2,T3,T4>	;SAVE THE AC'S
	MOVEI  T1,.PRIOU	;GET PRIMARY OUTPUT DESIGNATOR
	RFPOS			;READ FILE POSITION
	HRRZ   T2,T2		;KEEP JUST THE COLUMN POSITION
	JUMPE  T2,R		;IF AT COLUMN 1 DO NOT OUTPUT CRLF
	HRROI  T1,[BYTE (7)012,015] ;CR/LF
	CALLRET SNDSTR		;OUTPUT CARRIAGE RETURN/LINE FEED & RETURN
;
; ROUTINE TO OUTPUT THE JSYS MESSAGE ON AN ERROR FROM A GTJFN OR OPENF
;
; CALL:		CALL PUTERR
; RETURNS: +1 ALWAYS
;
PUTERR:				;ENTRY
	HRROI  T1,MSGBUF	;BUILD STRING IN BUFFER
	HRLOI T2,.FHSLF		;OUR FORK, LAST ERROR CODE
	SETZM T3		;
	ERSTR			;OUTPUT ERROR STRING
	 JFCL			;IGNORE
	 JFCL			;IGNORE
	HRROI  T1,MSGBUF	;POINT TO BUFFER
	CALL   SNDSTR		;SEND IT
	RET			;RETURN TO WHENCE WE CAME ...
	PAGE
	SUBTTL PUTATM - ROUTINE TO TYPE THE CONTENTS OF THE ATOM BUFFER
;
;ACCEPTS IN T1/	POINTER TO ASCIZ PREFIX STRING TO BE TYPED
;		CALL TYPATM
;RETURNS: +1 ALWAYS
;
TYPATM:	STKVAR <ATOMPT>
	MOVEM T1,ATOMPT		;SAVE ATOM POINTER
	WRTMSG <? DYNETS: >	;OUTPUT INITIAL PART OF MESSAGE
	MOVE T1,ATOMPT		;RESTORE ATOM POINTER
	CALL   SNDSTR		;OUTPUT THE STRING
	WRTSTR < ">		;OUTPUT PUNCTUATION
	HRROI T1,ATMBFR		;GET POINTER TO THE ATOM BUFFER
	CALL   SNDSTR		;OUTPUT THE TEXT ENTERED
	WRTSTR <">		;OUTPUT END OF LINE
	RET			;RETURN
	PAGE
	SUBTTL	PARSING SUBROUTINES
;
; ROUTINE TO PARSE AN END-OF-COMMAND
;
; CALL:		CALL ENDCOM
; RETURNS: +1	 BAD CONFIRMATION, MESSAGE ALREADY ISSUED
;	   +2	SUCCESS, COMMAND CONFIRMED
;
ENDCOM:	MOVEI T1,CMDBLK		;GET ADDRESS OF COMMAND STATE BLOCK
	MOVEI T2,[FLDDB. (.CMCFM)] ;GET FUNCTION BLOCK FOR CONFIM
	COMND			;PARSE CONFIRMATION
	 ERJMP CMDERR		;ERROR, GO CHECK EOF ON TAKE FILE
	TXNE T1,CM%NOP		;VALID END-OF-COMMAND SEEN ?
	JRST [ CALLRET CFMERR ]	;NO, ISSUE ERROR MESSAGE AND RETURN
ENDCO1:				;HERE TO JUST ECHO COMMAND LINE
	SKIPN  TAKFLG		;DOING TAKE COMMAND ?
	RETSKP			;NO, RETURN
	HRROI  T1,BUFFER	;YES, GO SEND THE COMMAND
	CALL   SNDSTR
	RETSKP			;SUCCESS, RETURN
;
;
; ROUTINE TO PARSE NOISE PHRASE
;
; CALL:	T2/ POINTER TO NOISE PHRASE
;		CALL SKPNOI
; RETURNS: +1	 ERROR, INVALID NOISE PHRASE
;	   +2 	SUCCESS, NOISE PHRASE PARSED OK
;
SKPNOI:	MOVE T1,[NOIFDB,,NOIFDB+1] ;SET TO CLEAR FUNCTION DESCRIPTOR BLOCK
	SETZM NOIFDB		;CLEAR FIRST WORD OF BLOCK
	BLT T1,NOIFDB+FDBSIZ-1	;CLEAR FUNCTION DESCRIPTOR BLOCK
	MOVX T1,.CMNOI		;GET FUNCTION TO PERFORM
	STOR T1,CM%FNC,NOIFDB	;STORE FUNCTION CODE IN FDB
	MOVEM T2,NOIFDB+.CMDAT	;STORE POINTER TO NOISE PHRASE IN FDB
	MOVEI T1,CMDBLK		;GET ADDRESS OF COMMAND STATE BLOCK
	MOVEI T2,NOIFDB		;GET ADDRESS OF FUNCTION BLOCK
	COMND			;PARSE NOISE WORD
	 ERJMP CMDERR		;ERROR, GO CHECK EOF ON TAKE FILE
	TXNN T1,CM%NOP		;NOISE PHRASE PARSED OK ?
	RETSKP			;YES, RETURN SUCCESS
	HRROI T1,[ASCIZ/INVALID GUIDE PHRASE/] ;NO, ERROR MESSAGE
	CALLRET TYPATM		;OUTPUT THE TEXT ENTERED AND RETURN
	PAGE
	SUBTTL CMDINI - ROUTINE TO INITIALIZE COMMAND STATE BLOCK AND OUTPUT PROMPT
;
;ACCEPTS IN T1/	POINTER TO ASCIZ PROMPT STRING
;		CALL CMDINI
;RETURNS: +1 ALWAYS,	WITH THE REPARSE ADDRESS SET TO THE ADDRESS OF THE
;			CALL TO CMDINI.
;
;
CMDINI:	MOVEM T1,CMDBLK+.CMRTY	;SAVE POINTER TO PROMPT STRING IN STATE BLOCK
	POP P,SAVRET		;SET UP RETURN ADR FROM CMDINI AND FROM REPARSE
	MOVEM P,SAVREP		;SAVE STACK POINTER TO BE RESET ON REPARSE
	MOVEI T1,REPARS		;GET ADDRESS OF REPARSE ROUTINE
	MOVEM T1,CMDBLK+.CMFLG	;SAVE ADDRESS OF REPARSE ROUTINE IN STATE BLOCK
	MOVEI T1,CMDBLK		;GET ADDRESS OF COMMAND STATE BLOCK
	MOVEI T2,[FLDDB. (.CMINI)] ;GET FUNCTION DESCRIPTOR BLOCK
	COMND			;INITIALIZE COMMAND SCANNER JSYS
	 ERJMP CMDERR		;ERROR, GO SEE IF END OF "TAKE FILE"
	JRST @SAVRET		;RETURN
;
;
; HERE TO PROCESS A REPARSE
;
REPARS:	MOVE P,SAVREP		;RESET STACK POINTER
	JRST @SAVRET		;RETURN TO CALLER OF CMDINI
	PAGE
	SUBTTL PTGTNM - PARSE TARGET NAME FILE SPEC
;
;PTGTNM - ROUTINE TO PARSE TARGET-NAME NETWORK FILE SPEC AND RETURN
;	AND RETURN JFN AND FILE-SPEC STRING
;
;ACCEPTS: T1/ POINTER TO GTJFN ARGUMENT BLOCK OR 0 TO USE DEFAULT BLOCK
;	NOTE: THE POINTER TAKES FLAGS IN LEFT-HALF FOR OVERRIDE FIELDS
;		SEE THE SETJFN ROUTINE
;
;	CALL PTGTNM
;
;RETURNS+1: FAILURE, SENDS ERROR MSG TO TERM
;	+2: SUCCESS, T1/ JFN OBTAINED  TGTBUF/ FILE-SPEC STRING
;
PTGTNM:				;ENTRY POINT
	STKVAR <SAVAC>		;DECLARE AUTOMATIC VARIABLE TO HOLD T1
	MOVEM  T1,SAVAC		;SAVE T1
	CALL   CLRGJF		;CLEAR GTJFN BLOCK
	MOVE   T1,SAVAC		;RESTORE T1
	TXNN   T1,777777	;DON'T PUT IN ADDRESS IF SUPPLIED BY CALLER
	HRRI   T1,GJFBLK	;GET ADDRESS OF GTJFN BLOCK
	CALL   SETJFN		;SET UP LONG FORM GTJFN BLOCK DEFAULTS
	MOVEI  T1,CMDBLK	;GET ADDRESS OF COMMAND STATE BLOCK
	MOVEI  T2,[FLDDB. (.CMFIL,CM%SDH,,NETWORK FILE SPEC)] ;FDB FOR FILE SPEC
	COMND			;PARSE NETWORK FILE SPEC
	 ERJMP CMDERR		;ERROR, GO CHECK EOF ON TAKE FILE
	TXNN   T1,CM%NOP	;SKIP IF FILE SPEC NOT PARSED
	JRST   PTGT1 		;OK, GO SAVE JFN AND PARSE NEXT FIELD
	WRTMSG   <? DYNETS: INVALID NETWORK FILE SPEC, >
	CALLRET PUTERR		;OUTPUT ERROR STRING TO TERMINAL
;
;HERE ON GOOD NETWORK FILESPEC PARSE
;
PTGT1:				;GOT GOOD NETWORK FILE SPEC
	MOVEM  T2,SAVAC		;SAVE THE JFN
	MOVE   T1,CMDBLK+.CMABP	;GET ATOM BUFFER POINTER
	HRROI  T2,TGTBUF	;GET PLACE TO HOLD IT
	SETZI  T3,0		;INDICATE MOVE STRING TO NULL BYTE
	CALL   MOVSTR		;MOVE THE STRING TO TEMP
	MOVE   T1,SAVAC		;RESTORE THE JFN
	RETSKP			;DONE, GOOD RETURN
	PAGE
	SUBTTL PFILNM - PARSE FILE NAME SPEC
;
;PFILNM - ROUTINE TO PARSE FILE SPEC AND RETURN JFN AND FILE-SPEC STRING
;
;ACCEPTS: T1/ POINTER TO GTJFN ARGUMENT BLOCK
;
;	CALL PFILNM
;
;RETURNS+1: FAILURE, SENDS ERROR MSG TO TERM
;	+2: SUCCESS, T1/ JFN OBTAINED  FILBUF/ FILE-SPEC STRING
;
PFILNM:				;ENTRY POINT
	STKVAR <SAVAC>		;GET A VARIABLE
	MOVEM  T1,SAVAC		;SAVE T1
	CALL   CLRGJF		;CLEAR GTJFN BLOCK
	MOVE   T1,SAVAC		;RESTORE T1
	TXNN   T1,.RHALF	;USE ADDRESS SUPPLIED BY CALLER IF PROVIDED
	HRRI   T1,GJFBLK	;GET ADDRESS OF GTJFN BLOCK
	MOVX   T2,GJ%OLD	;FILE MUST EXIST
	MOVEM  T2,.GJGEN(T1)	;STORE IN GTJFN BLOCK
	HRROI  T2,[ASCIZ/DSK:/]	;USERS DISK AREA
	MOVEM  T2,.GJDEV(T1)	
	MOVEI  T1,CMDBLK	;GET ADDRESS OF COMMAND STATE BLOCK
	MOVEI  T2,[FLDDB. (.CMFIL,CM%SDH,,MESSAGE FILE SPEC)] ;FDB FOR FILE SPEC
	COMND			;PARSE MESSAGE FILE SPEC
	 ERJMP CMDERR		;ERROR, GO CHECK EOF ON TAKE FILE
	TXNN   T1,CM%NOP	;SKIP IF FILE SPEC NOT PARSED
	JRST   PFIL1 		;OK, GO SAVE JFN AND PARSE NEXT FIELD
	WRTMSG   <? DYNETS: INVALID MESSAGE FILE SPEC, >
	CALLRET PUTERR		;OUTPUT ERROR STRING TO TERMINAL
;
;HERE ON GOOD NETWORK FILESPEC PARSE
;
PFIL1:				;GOT GOOD NETWORK FILE SPEC
	MOVEM  T2,SAVAC		;SAVE THE JFN
	MOVE   T1,CMDBLK+.CMABP	;GET ATOM BUFFER POINTER
	HRROI  T2,FILBUF	;GET PLACE TO HOLD IT
	SETZI  T3,0		;INDICATE MOVE STRING TO NULL BYTE
	CALL   MOVSTR		;MOVE THE STRING TO TEMP
	MOVE   T1,SAVAC		;RESTORE THE JFN
	RETSKP			;DONE, GOOD RETURN
	PAGE
	SUBTTL PARBST - PARSE AN ARBITRARY STRING FIELD
;
;PARBST - PARSE AN ARBITRARY STRING FIELD
;
;ARGUMENTS:
; T1/STRING POINTER TO HELP TEXT
; T2/ADDRESS OF BUFFER TO PLACE THE PARSED STRING
;
;	CALL PARBST
;
;RETURNS+1: ALWAYS
;
PARBST:				;ENTRY POINT
	STKVAR <STRPTR>		;DECLARE VARIABLE FOR POINTER
	MOVEM  T2,STRPTR	;SAVE IT
	MOVEI  T2,[FLDDB. (.CMFLD,,,LINK NAME,DUMMY)] ;FUNCTION DESCRIPTOR BLOCK
	HRROM  T1,.CMHLP(T2)	;STORE POINTER TO HELP TEXT
	MOVEI  T1,CMDBLK	;GET ADDRESS OF COMMAND STATE BLOCK
	COMND			;PARSE ARBITRARY LINK NAME
	 ERJMP CMDERR		;ERROR, GO CHECK EOF ON TAKE FILE
				;SAVE THE ARBITRARY NAME
	MOVE   T1,CMDBLK+.CMABP	;GET ATOM BUFFER POINTER
	MOVE   T2,STRPTR	;RESTORE POINTER TO RETURN AREA
	MOVEI  T3,6		;MOVE SIX BYTES
	CALL   MOVSTR		;MOVE STRING FROM ATOM BUFFER TO TEMP
	RET			;DONE, RETURN TO CALLER
	PAGE
	SUBTTL PSWTCH - PARSE SWITCH ROUTINE
;
;PSWTCH - GENERAL SUBROUTINE TO PARSE A SWITCH AT END OF COMMAND LINE
;
; ARGUMENTS:
; T2/ POINTER TO THE FDB FOR SWITCHES WITH LOOKUP TABLE EXTENSION
;
;	CALL PSWTCH
;
;RETURNS+1: FAILURE
;	+2: SUCCESS, WITH PROVIDED ARG BLOCK UPDATED
;
PSWTCH:				;ENTRY POINT TO SWITCH PARSE
	SAVEAC <T3,T4>		;SAVE THE AC'S
	STKVAR <SVFDBP,AUXTAB>	;GET VARIABLE FOR FDB PTR & AUX TABLE
	MOVEM  T2,SVFDBP	;SAVE POINTER TO FDB
PNXSW:				;HERE TO PARSE NEXT SWITCH
	MOVEI  T1,CMDBLK	;GET ADDRESS OF COMMAND STATE BLOCK
	COMND			;PARSE SWITCH FIELD
	 ERJMP CMDERR		;ERROR, GO CHECK EOF ON TAKE FILE
	TXNE   T1,CM%NOP	;SKIP IF GOOD SWITCH FIELD PARSED
	JRST   [WRTMSG   <? DYNETS: INVALID SWITCH>
		RET]		;TAKE FAILURE RETURN
;
;HERE WITH VALID SWITCH
;
	HRL    T4,(T2)		;GET VALUE REQUIRED FLAG FROM TABLE
	JUMPGE T4,NOVAL		;VALUE NOT REQUIRED IF NOT NEGATIVE
	TXNN   T1,CM%SWT	;SKIP IF SWITCH ENDS WITH COLON
	JRST   PSWTC1		;NO VALUE SUPPLIED, CAN'T STORE
	MOVE   T4,SVFDBP	;RESTORE THE FDB POINTER
	MOVE   T4,.CMDAT(T4)	;GET ADDRESS OF SWITCH TABLE
	HRRZ   T4,(T4)		;GET THE MAXIMUM SIZE OF TABLE
	ADDI   T2,(T4)		;GET ADDRESS OF AUXILIARY ENTRY
	MOVEM  T2,AUXTAB	;SAVE IT
	HLRZ   T2,(T2)		;GET ADDRESS OF FDB FOR VALUE
	MOVEI  T1,CMDBLK	;GET COMMAND STATE BLOCK ADDR
	COMND			;PARSE FOR SWITCH VALUE
	 ERJMP CMDERR		;JSYS FAILURE
	TXNE   T1,CM%NOP	;NO PARSE ?
	JRST   [WRTMSG <? DYNETS: INVALID VALUE FOR SWITCH>
		RET]		;TAKE FAILURE RETURN
	MOVE   T4,AUXTAB	;RESTORE ADDRESS OF AUXILIARY TABLE
	HRRZ   T4,(T4)		;GET ADDRESS OF WHERE TO STORE SWITCH VALUE
	MOVEM  T2,(T4)		;STORE VALUE IN CALLERS ARG BLOCK
	MOVE   T2,SVFDBP	;RESTORE POINTER TO FDB
	TXNE   T1,CM%EOC	;END OF COMMAND SEEN ?
	JRST   ENDCOM		;YES, GO PARSE END OF COMMAND
	JRST   PNXSW		;ELSE GO PARSE NEXT SWITCH
	PAGE
;
;HERE IF SWITCH DOESN'T TAKE A VALUE
;
NOVAL:				;ENTRY
	MOVE   T4,SVFDBP	;RESTORE THE FDB POINTER
	MOVE   T4,.CMDAT(T4)	;GET ADDRESS OF SWITCH TABLE
	HRRZ   T4,(T4)		;GET THE MAXIMUM SIZE OF TABLE
	ADDI   T2,(T4)		;GET ADDRESS OF AUXILIARY ENTRY
	HRRZ   T4,(T2)		;GET ADDRESS OF WHERE TO STORE SWITCH VALUE
	MOVEM  T2,(T4)		;STORE VALUE IN CALLERS ARG BLOCK
	MOVE   T2,SVFDBP	;RESTORE POINTER TO FDB
PSWTC1:				;ENTRY FROM PRECEDING CODE
	TXNN   T1,CM%EOC	;END OF COMMAND SEEN ?
	JRST   PNXSW		;NO, GO PARSE NEXT SWITCH
	CALLRET ENDCO1		;YES, GO PUT OUT COMMAND LINE AND RETURN
	PAGE
	SUBTTL PKEYWD - PARSE KEYWORD ROUTINE
;
;PKEYWD - ROUTINE TO PERFORM A PARSE OF A KEYWORD FIELD
;
;ACCEPTS T2: ADDRESS OF FDB FOR KEYWORD FUNCTION
;
;	CALL PKEYWD
;
;RETURNS+1: FAILURE
;	+2: SUCCESS, USER DATA FROM LH OF KEYWORD TABLE IN T1
;
PKEYWD:				;ENTRY
	MOVEI  T1,CMDBLK	;GET ADDRESS OF COMMAND STATE BLOCK
	COMND			;PARSE THE KEYWORD
	 ERJMP CMDERR
	TXNE   T1,CM%NOP	;PARSED OK ?
	JRST   [WRTMSG <? DYNETS: INVALID KEYWORD> ;NO, TELL'EM
		RET]			;AND RETURN BAD
	HRRZ   T1,(T2)		;GET THE USER INFO FROM TABLE
	RETSKP			;AND RETURN +1
	PAGE
	SUBTTL	GENERAL SUBROUTINES
;
; ROUTINE TO CLEAR GTJFN BLOCK USED BY COMND JSYS
;
; CALL:		CALL CLRGJF
; RETURNS: +1 ALWAYS

CLRGJF:	MOVE T1,[GJFBLK,,GJFBLK+1] ;SET UP TO CLEAR GTJFN BLOCK
	SETZM GJFBLK		;CLEAR FIRST WORD OF BLOCK
	BLT T1,GJFBLK+GJFSIZ-1	;CLEAR GTJFN BLOCK
	RET			;RETURN TO WHENCE WE CAME ...


; ROUTINE TO OUTPUT COMMAND LINE TO TERMINAL IF PROCESSING TAKE FILE
;
; CALL:		CALL TAKTST
; RETURNS: +1	ALWAYS, COMMAND LINE OUTPUT IF NEEDED
COMMENT \ THIS ROUTINE IS NO LONGER NEEDED

TAKTST:
	SKIPN TAKFLG		;COMMANDS COMING FROM FILE ?
	RET			;NO, RETURN
	HRROI T1,BUFFER		;YES, GET POINTER TO COMMAND LINE
	PSOUT			;OUTPUT COMMAND LINE TO TTY
	HRRZ   T1,OUTJFN	;AND TO LOG FILE
	HRROI  T2,BUFFER
	SETZI  T3,0
	SETZI  T4,0
	SOUT
	RET
\
	PAGE
;
;SNDMSG - ROUTINE TO SEND TEXT TO TERMINAL AND LOG FILE IF PROCESSING
;	A TAKE COMMAND, THIS ROUTINE TAKES CARE OF DETERMINING IF COMMANDS 
;	ARE COMING FROM A TAKE FILE AND WHETHER THE LOG IS GOING TO
;	A TERMINAL OF A DISK FILE, BOTH THE TERMINAL AND THE LOG WILL
;	ALWAYS GET THE PROPER TEXT
;
;ACCEPTS: T1/ STRING POINTER TO TEXT
;
;	CALL   SNDMSG		;TO SEND STARTING ON NEW LINE
;	CALL   SNDSTR		;TO SEND JUST THE STRING
;
;RETURNS+1: ALWAYS
;
SNDMSG::			;ENTRY TO SEND A MESSAGE
	CALL   TSTCOL		;MESSAGE STARTS A NEW LINE
SNDSTR::			;ENTRY TO SEND A STRING
	MOVE   T4,T1		;HOLD T1
	PSOUT			;ALWAYS WRITE TO TERMINAL
	SKIPN  TAKFLG		;DOING TAKE ?
	RET			;NO, THEN JUST RETURN
	HRRZ   T1,OUTJFN	;YES, GET THE LOG JFN
	DVCHR			;FIND THE DEVICE TYPE
	LDB    T2,[POINTR (T2,DV%TYP)] ;ISOLATE DEVICE TYPE
	CAIN   T2,.DVTTY	;IS IT TTY ?
	RET			;YES, RETURN
	HRRZ   T1,OUTJFN	;NO, THEN WRITE TO LOG
	MOVE   T2,T4		;POINT TO THE STRING
	SETZ   T3,0
	SOUT			;WRITE IT OUT
	RET			;DONE, RETURN

	PAGE

;
;CMDERR - ROUTINE TO PROCESS ERRORS ON EXECUTING A COMND JSYS
;	  IF END OF FILE REACHED ON A TAKE FILE, THE NEXT COMMAND
;	  IS SIMPLY PROCESSED.  ELSE AN ERROR MESSAGE IS ISSUED AND
;	  THE PROGRAM IS RESTARTED.
;
; CALL:		JRST CMDERR

CMDERR:	SKIPN TAKFLG		;PROCESSING A TAKE FILE ?
	JRST CMER10		;NO, GO ISSUE ERROR MESSAGE
	HLRZ T1,CMDBLK+.CMIOJ	;GET INPUT FILE JFN FOR TAKE FILE
	GTSTS			;GET THE FILE'S STATUS
	TXNN T2,GS%EOF		;AT END OF FILE ?
	JRST CMER10		;NO, GO ISSUE ERROR MESSAGE
	HRRZ   T1,CMDBLK+.CMIOJ	;YES, CLOSE .LOG FILE
	CLOSF
	 ERCAL JSERR0
	HLRZ   T1,CMDBLK+.CMIOJ	;CLOSE .CMD FILE
	CLOSF
	 ERCAL JSERR0
	MOVE T1,[.PRIIN,,.PRIOU] ;GET STANDARD PRIMARY JFN'S
	MOVEM T1,CMDBLK+.CMIOJ	;RESET INPUT AND OUTPUT JFN'S
	SETZM TAKFLG		;MARK THAT TAKE FILE NOT BEING PROCESSED
	JRST PARSE		;GO PROCESS NEXT COMMAND

CMER10:				;OUTPUT MESSAGE
	WRTMSG <? DYNETS: Unexpected COMND JSYS error, restarting...> 
	JRST ENTVEC+1		;GO SIMULATE A "REENTER"
	PAGE
	SUBTTL SETJFN - SET UP LONG FORM GTJFN BLOCK
;
;SETJFN - 
;
;ROUTINE TO SET UP A GTJFN ARGUMENT BLOCK FOR LONG FORM GTJFN
; IN A FORMAT COMPATIBLE WITH THE NETWORK INTERFACE
;
; ARGUMENTS
; T1/BIT MAP,,ARGUMENT BLOCK ADDR OR 0
; T2/POINTER TO ASCIZ FILE SPEC OR 0
;
;	CALL   SETJFN
;
; RETURNS+1: ALWAYS
;
SETJFN:				;ENTRY POINT
	ACVAR  <BTMAP,OFFSET>
	MOVX   T3,GEN		;GET DEFAULT GENERATION AND FLAGS
	STOR   T3,GJGEN		;STORE IT IN ARGUMENT BLOCK
	MOVX   T3,SRC		;GET DEFAULT SOURCE/DESTUNATION 
	STOR   T3,GJSRC		;STORE IT IN ARGUMENT BLOCK
	HRROI  T3,DEV		;GET DEFAULT DEVICE STRING
	STOR   T3,GJDEV		;STORE IT IN ARGUMENT BLOCK
	HRROI  T3,NAM		;GET DEFAULT FILE NAME STRING
	STOR   T3,GJNAM		;STORE IT IN ARGUMENT BLOCK
	HRROI  T3,EXT		;GET DEFAULT EXTENSION STRING
	STOR   T3,GJEXT		;STORE IT IN ARGUMENT BLOCK
	MOVX   T3,F2		;GET DEFAULT
	STOR   T3,GJF2		;STORE IT IN ARGUMENT BLOCK
	MOVEI  T3,ARB		;GET DEFAULT POINTER TO ATTRIBUTE BLOCK
	STOR   T3,GJATR		;STORE IT IN ARGUMENT BLOCK
				;HERE REPLACE WORDS IN ARG BLOCK IF SPECIFIED
				; IN BIT MAP IN LEFT HALF OF T1
	HLLZ   BTMAP,T1		;GET JUST THE BIT MAP
NXT:	JFFO   BTMAP,GO		;OFFSET TO FIRST WORD TO REPLACE
	RET			;RETURN IF NONE TO REPLACE
GO:	LSH    BTMAP,1(OFFSET)	;SHIFT TO CLEAR LEFTMOST BIT
	MOVNI  T3,1(OFFSET)	;NEGATIVE TO SHIFT RIGHT
	LSH    BTMAP,(T3)	;RESTORE TO ORIGINAL POSITION
	ADDI   OFFSET,(T1)	;OFFSET INTO TABLE
	MOVE   T3,(T2)		;GET THE WORD TO REPLACE, THEY ARE CONTIGUOUS
	MOVEM  T3,(OFFSET)	;PUT IT IN RESULT TABLE
	ADDI   T2,1		;BUMP TO NEXT REPLACEMENT WORD
	JRST   NXT		;GO BACK AND DO NEXT
	RET
	PAGE
	SUBTTL MOVSTR - SUBROUTINE TO MOVE BYTE STRING
;
;MOVSTR - MOVES A BYTE STRING OF ANY LENGTH FROM SOURCE TO DESTINATION
;
;ARGUMENTS:
; T1/BYTE POINTER TO SOURCE STRING
; T2/BYTE POINTER TO DESTINATION STRING
; T3/NUMBER OF BYTES TO MOVE OR 0
;
;	CALL MOVSTR
;
;RETURNS+1:ALWAYS
; IF T3 IS ZERO THE STRING WILL BE MOVED UNTIL THE FIRST NULL BYTE IS
; FOUND IN THE SOURCE STRING. THE NULL BYTE WILL BE MOVED TO THE DESTINATION
; STRING
;
MOVSTR:				;ENTRY TO MOVSTR SUBROUTINE
	STKVAR <SOURCE,DEST,LENGTH> ;DECLARE DYNAMIC VARIABLES
	JXF    T1,.LHALF,FIX1	;FIX UP BYTE POINTER IF ALL ONES
	HRLI   T1,440700	;STANDARD BYTE POINTER
FIX1:	MOVEM  T1,SOURCE	;SAVE SOURCE BYTE POINTER
	JXF    T2,.LHALF,FIX2	;FIX UP BYTE POINTER IF ALL ONES
	HRLI   T2,440700	;STANDARD BYTE POINTER
FIX2:	MOVEM  T2,DEST		;SAVE DESTINATION STRING BYTE POINTER
	MOVNM  T3,LENGTH	;STORE NEGATIVE OF LENGTH AS LOOP DERAIL
MOV1:	ILDB   T1,SOURCE	;GET BYTE FROM SOURCE
	IDPB   T1,DEST		;STORE IT IN DESTINATION
	AOSE   LENGTH		;DONE IF MOVED LENGTH IN T3
	JUMPN  T1,MOV1		;IF NOT NULL BYTE, GO MOVE NEXT BYTE
	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/ * [DYNETS 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
	 ERJMP [HRROI T1,[ASCIZ/? DYNETS: INITIALIZATION FAILED/]
		CALL SNDMSG
		HALTF
		JRST START]
	MOVEM T1,BEGTIM		;SAVE BEGINNING TIME
	GTAD			;GET CURRENT DATE AND TIME
	 ERJMP [HRROI T1,[ASCIZ\? DYNETS: INITIALIZATION FAILED\]
		CALL SNDMSG
		JRST START]
	MOVEM T1,BEGDTE		;SAVE THE STARTING DATE/TIME
	HRROI T1,MSGBUF		;OUTPUT TO MESSAGE BUFFER
	MOVE T2,BEGDTE		;DATE/TIME WE STARTED
	SETZI T3,		;TAKE DEFAULT FORMAT
	ODTIM
	 ERJMP [HRROI T1,[ASCIZ\? DYNETS: INITIALIZATION FAILED\]
		CALL SNDMSG
		HALTF
		JRST START]
	HRROI T2,[ASCIZ\ * [DYNETS STARTING]\]
	SOUT			;AND MESSAGE
	 ERJMP [HRROI  T1,[ASCIZ/? DYNETS: INITIALIZATION FAILED, COULDN'T OUTPUT START MESSAGE/]
		CALL   SNDMSG
		HALTF
		JRST   START]
	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
;
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
	 ERJMP [HRROI  T1,[ASCIZ"? DYNETS: TERMINATION FAILURE, COULDN'T OUTPUT CURRENT DATE/TIME"]
		CALL   SNDMSG
		HALTF
		JRST   .-1]
	HRROI  T2,[ASCIZ/ * [DYNETS TERMINATING]/] ;THE MESSAGE
	SETZI  T3,0		;TERMINATE ON NULL
	SOUT
	 ERJMP [HRROI  T1,[ASCIZ/? DYNETS: TERMINATION FAILURE, COULDN'T OUTPUT TERMINATE MESSAGE/]
		CALL   SNDMSG
		HALTF
		JRST   .-1]
;
;CALCULATE HI-PRECISION ELAPSED TIME
;
	HRROI  T2,[ASCIZ/ (ELAPSED TIME:  /]
	SOUT
	 ERJMP [HRROI  T1,[ASCIZ/? DYNETS: TERMINATION FAILURE, COULDN'T OUTPUT TERMINATE MESSAGE/]
		CALL   SNDMSG
		HALTF
		JRST   .-1]
	PUSH   P,T1		;SAVE STRING POINTER
	TIME			;GET TIME NOW
	 ERJMP [HRROI  T1,[ASCIZ/? DYNETS: TERMINATION FAILURE, COULDN'T GET CURRENT TIME/]
		CALL   SNDMSG
		HALTF
		JRST   .-1]
	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   Q1,OT%NDA	;TIME ONLY, NO DATE
	ODTNC			;GET TIME IN INTERNAL FORMAT
	 ERJMP [HRROI  T1,[ASCIZ/? DYNETS: TERMINATION FAILURE, COULDN'T OUTPUT ELAPSED TIME/]
		CALL   SNDMSG
		HALTF
		JRST   .-1]
	HRROI  T2,[ASCIZ/)/]
	SOUT
	 ERJMP .+1
	HRROI  T1,MSGBUF	;POINT TO BUFFER
	CALL   SNDMSG		;WRITE IT TO CURRENT OUTPUT DEVICE
	RET			;DONE, RETURN
	PAGE
	SUBTTL CONSTANTS AND TABLES
;
;COMMAND DISPATCH TABLE
;
CMDTAB:	CMDSIZ-1,,CMDSIZ	;CURRENT,,MAX SIZE OF COMMAND TABLE
	TB (.DECLA,DECLARE)	;DECLARE TO BE OBJECT ON HOST
	TB (.DISES,DISESTABLISH) ;BREAK LOGICAL LINK CONNECTION
	TB (.ESTAB,ESTABLISH)	;MAKE A LOGICAL LINK CONNECTION
	TB (.EXIT,EXIT)		;EXIT TO MONITOR
	TB (.HELP,HELP)		;OUTPUT HELP MESSAGE
	TB (.INTER,INTERRUPT)	;SEND INTERRUPT MESSAGES
;	TB (.LISTN,LISTEN)	;ACCEPT NETWORK LOGICAL LINK CONNECTIONS
	TB (.PURGE,PURGE)	;FLUSH WITH ASYNCHRONOUS DISCONNECT
	TB (.RECVE,RECEIVE)	;RECEIVE MESSAGES ON LOGICAL LINK
	TB (.SEND,SEND)		;SEND MESSAGES ON LOGICAL LINK
	TB (.SET,SET)		;SET SYSTEM PARAMETERS
	TB (.TAKE,TAKE)		;TAKE (COMMANDS FROM) FILE-SPEC ...
	TB (.WAIT,WAIT)		;WAIT, DON'T PROMPT
	CMDSIZ==.-CMDTAB	;SET LENGTH OF COMMAND TABLE
;
;FUNCTION TABLE FOR SET COMMAND
;
FNCTAB:	FNCSIZ-1,,FNCSIZ-1	;CURRENT,,MAXIMUM TABLE ENTRIES
	TB (SETACC,ACCESS-CONTROL) ;SET ACCESS CONTROL
	TB (SETDEF,DEFAULT)	;NETWORK DEFAULTS
	FNCSIZ==.-FNCTAB	;SET LENGTH OF FUNCTION TABLE
;
;KEYWORD TABLE FOR DEFAULT
;
DEFTAB:	DEFSIZ-1,,DEFSIZ-1	;CURRENT,,MAXIMUM TABLE ENTRIES
	TB (SETATR,ATTRIBUTES)	;SET DEFAULT ATTRIBUTES
	TB (SETBDT,BDATA)	;SET DEFAULT BDATA
	TB (SETBPW,BPASSWORD)	;SET DEFAULT BPASSWORD
	TB (SETCHG,CHARGE)	;SET DEFAULT CHARGE
	TB (SETDTA,DATA)	;SET DEFAULT DATA
	TB (SETPWD,PASSWORD)	;SET DEFAULT PASSWORD
	TB (SETUID,USERID)	;SET DEFAULT USERID
	DEFSIZ==.-DEFTAB	;LENGTH OF TABLE


	PAGE
;
;SWITCH TABLE FOR ESTABLISH COMMAND
;
ESTSWI:	ESWSIZ-1,,ESWSIZ-1	;CURRENT,,MAXIMUM TABLE ENTRIES
	TB (-1,BYTE:)		;LINK BYTE SIZE SWITCH 
	TB (0,NOWAIT)		;DON'T WAIT FOR LINK TO BE ESTABLISHED
	TB (-1,RECL:)		;RECORD LENGTH FOR LINK
	TB (-1,WAIT:)		;WAIT FOR LINK ESTABLISHMENT
	ESWSIZ==.-ESTSWI	;SET LENGTH OF SWITCH TABLE
	$FDB2,,.ESARG+.ESBYT	;AUXILIARY SWITCH TABLE
	0,,.ESARG+.ESWAT
	$FDB2,,.ESARG+.ESREC
	$FDB2,,.ESARG+.ESWAT
;
;SWITCH TABLE FOR LISTEN COMMAND
;
LISSWI:	LISSIZ-1,,LISSIZ-1	;CURRENT,,MAXIMUM TABLE ENTRIES
	TB (0,ACCEPT)		;ACCEPT ALL CONNECTIONS
	TB (0,REJECT)		;REJECT CONNECTION FROM SPECIFIED OBJECT
	TB (-1,TIME:)		;TIME TO WAIT FOR CONNECTIONS
	LISSIZ==.-LISSWI	;SET LENGTH OF SWITCH TABLE
	0,,.LIARG+.LIACC	;AUX SWITCH TABLE
	0,,.LIARG+.LIACC
	$FDB2,,.LIARG+.LITIM
;
;SWITCH TABLE FOR SEND COMMAND
;
SENSWI:	SENSIZ-1,,SENSIZ-1	;CURRENT,,MAXIMUM TABLE ENTRIES
	TB (-1,BYTE:)		;LINK BYTE SIZE SWITCH 
	TB (-1,DELAY:)		;AMOUNT TO DELAY BETWEEN EACH MESSAGE
	TB (-1,INTERRUPT:)	;FREQ TO SEND INT MSG
	TB (-1,RECL:)		;RECORD LENGTH FOR LINK
	TB (-1,TIMES:)		;NUMBER OF TIMES TO SEND THE MESSAGE
	SENSIZ==.-SENSWI	;SET LINGTH OF SWITCH TABLE
	$FDB2,,.SEARG+.SEBYT	;AUX SWITCH TABLE
	$FDB2,,.SEARG+.SEDEL
	$FDB2,,.SEARG+.SEINT
	$FDB2,,.SEARG+.SEREC
	$FDB2,,.SEARG+.SETIM
;
;SWITCH TABLE FOR RECEIVE COMMAND
;
RECSWI:	RECSIZ-1,,RECSIZ-1	;CURRENT,, MAXIMUM TABLE ENTRIES
	TB (-1,BYTE:)		;LINK BYTE SIZE SWITCH 
	TB (-1,RECL:)		;RECORD LENGTH
	TB (-1,TIMEOUT:)	;TIMEOUT PERIOD FOR RECEIVE WAIT
	RECSIZ==.-RECSWI	;SET LENGTH OF SWITCH TABLE
	$FDB2,,.REARG+.REBYT	;AUX SWITCH TABLE
	$FDB2,,.REARG+.REREC
	$FDB2,,.REARG+.RETOU
;
;SWITCH TABLE FOR INTERRUPT COMMAND
;
INTSWI:	INTSIZ-1,,INTSIZ-1	;CURRENT,,MAXIMUM TABLE ENTRIES
	TB (-1,EVERY:)		;FREQUENCY OF INTERRUPT MESSAGES
	INTSIZ==.-INTSWI	;SET LENGTH OF SWITCH TABLE
	$FDB2,,.INARG+.INEVR	;AUX SWITCH TABLE
;
;SWITCH TABLE FOR DECLARE COMMAND
;
DECSWI:	DECSIZ-1,,DECSIZ-1	;CURRENT,,MAXIMUM TABLE ENTRIES
	TB (-1,BYTE:)		;BYTE SIZE OF LINK
	TB (-1,DELAY:)		;RECEIVE/SEND DELAY
	TB (-1,RECL:)		;RECORD LENGTH FOR LINK
	DECSIZ==.-DECSWI	;SET LENGTH OF SWITCH TABLE
	$FDB2,,.DEARG+.DEBYT	;AUX SWITCH TABLE
	$FDB2,,.DEARG+.DEDEL
	$FDB2,,.DEARG+.DEREC
;
;FUNCTION DESCRIPTOR BLOCK FOR SWITCH VALUE
;
$FDB2:	FLDDB. (.CMNUM,,^D10,,,)
PROMPT:	ASCIZ /DYNETS>/			;PROMPT STRING
;
; ENTRY VECTOR DEFINITION
;
ENTVEC:	JRST START		;MAIN ENTRY POINT
	JRST RENTER		;REENTER ENTRY POINT
	EXP VDYNETS		;VERSION OF DYNETS PROGRAM
;
;POINTER TO LINK NAME TEMPORARY STORAGE
;
HLDLNK:	POINT 7,TMPBUF		;TEMPORARY FOR LINK NAME
ARBBLK:				;ARBITRARY ATTRIBUTE BLOCK
	EXP    ARBSIZ
	POINT  7,ARBUID
	POINT  7,ARBPWD
	POINT  7,ARBACT
	POINT  7,ARBDAT
	PAGE
;
; HELP TEXT
;
	.DIRECTIVE FLBLST	;LIST FIRST LINE BINARY ONLY
HLPMSG:	ASCIZ #
DYNETS Program

FUNCTION
	THE DECNET DYNAMIC NETWORK EXERCISER SYSTEM (DYNETS) IS A TEST SYSTEM
	WHICH ALLOWS THE TESTER TO MANIPULATE LOGICAL LINK CONNECTIONS FROM
	A TIME-SHARING TERMINAL OR FROM A COMMAND STRING PREVIOUSLY PLACED IN
	A CONTROL FILE.

COMMANDS
	"DECLARE (SERVER NAME) 'SERVER-NAME'"
	"ESTABLISH (LOGICAL LINK TO) 'TARGET-NAME' 'SWITCHES'"
	"EXIT (TO MONITOR)"
	"HELP (WITH DYNETS)"
	"RECEIVE (FROM) 'TARGET-NAME' 'SWITCHES'"
	"SEND (TO) 'TARGET-NAME' (FROM MESSAGE FILE) 'MSG-FILE-NAME'
		'SWITCHES'"
	"SET 'FUNCTION-NAME' (TO) 'VALUE' 
	"TAKE (COMMANDS FROM) 'FILE-SPEC' (LOGGING OUTPUT ON) 'FILE-SPEC'"

RESTRICTIONS



HINTS

EXAMPLES

	ESTABLISH (LOGICAL LINK TO) RSX11A-TASK-MIRROR /BYTE:7 /RECL:50 /WAIT:60
	ESTABLISH (LOGICAL LINK TO) RSX11A-TASK-MIRROR /BYTE:36 /RECL:20 /WAIT:-1
	RECEIVE (FROM) RSX11A-TASK-MIRROR
	SEND (TO) RSX11A-TASK-MIRROR (FROM MESSAGE FILE) FOX.TXT /INTERRUPT:25 /DELAY:5
	EXIT (TO MONITOR)

#
	.DIRECTIVE NO FLBLST		;TURN OFF FIRST LINE BINARY LISTING
	PAGE
	XLIST
LTPOOL:	LIT			;BEGINNING OF LITERAL POOL
	LIST
	PAGE
	SUBTTL	VARIABLE DATA STORAGE
	RELOC <<.+140>/1000+1>*1000-140 ;PUT IMPURE STORAGE ON NEXT PAGE BOUNDARY
;
; The version of the GLX runtime system used with DTR searches for
; the lowest number page which does not exist in the address space
; since the SAVE command in TOPS-20 Release 3 and later does not
; save zero pages we must ensure that at least one word in each page
; is non-zero

	EXP -1			;Make sure each page is non-zero
TMPBUF:	BLOCK ATMSIZ		;TEMPORARY BUFFER
	EXP -1			;Make sure each page is non-zero
TGTBUF:	BLOCK ATMSIZ		;TEMPORARY BUFFER
	EXP -1			;Make sure each page is non-zero
LKNBUF:	BLOCK LKNSIZ		;TEMPORARY BUFFER
	EXP -1			;Make sure each page is non-zero
MSNBUF:	BLOCK MSNSIZ		;TEMPORARY BUFFER
	EXP -1			;Make sure each page is non-zero
FILBUF:	BLOCK ATMSIZ		;TEMPORARY BUFFER
	EXP -1			;Make sure each page is non-zero
SAVRET:	BLOCK 1			;RETURN ADDRESS OF CMDINI CALLER
	EXP -1			;Make sure each page is non-zero
SAVREP:	BLOCK 1			;SAVED STACK POINTER TO RESTORE ON REPARSE
	EXP -1			;Make sure each page is non-zero
CMDBLK:	BLOCK .CMGJB+5		;COMMAND STATE BLOCK FOR COMND JSYS
	EXP -1			;Make sure each page is non-zero
BUFFER:	BLOCK BUFSIZ		;INPUT TEXT STORED HERE
	EXP -1			;Make sure each page is non-zero
ATMBFR:	BLOCK ATMSIZ		;ATOM BUFFER FOR COMND JSYS
	EXP -1			;Make sure each page is non-zero
MSGBUF:	BLOCK BUFSIZ		;MESSAGE BUFFER
	EXP -1			;Make sure each page is non-zero
GJFBLK:	BLOCK GJFSIZ		;GTJFN BLOCK FOR COMND JSYS
	EXP -1			;Make sure each page is non-zero
PDL:	BLOCK PDLEN		;PUSH DOWN POINTER
	EXP -1			;Make sure each page is non-zero
NOIFDB:	BLOCK FDBSIZ		;FUNCTION DESCRIPTOR BLOCK FOR NOISE WORDS
	EXP -1			;Make sure each page is non-zero
NAMBUF:	BLOCK 8			;BUFFER FOR NAME OF INPUT FILE
	EXP -1			;Make sure each page is non-zero
INJFN:	BLOCK 1			;INPUT JFN FOR TAKE COMMAND
	EXP -1			;Make sure each page is non-zero
OUTJFN:	BLOCK 1			;OUTPUT JFN FOR TAKE COMMAND
	EXP -1			;Make sure each page is non-zero
TIMBUF:	BLOCK 5			;DYNETS START DATE/TIME STRING
	EXP -1			;Make sure each page is non-zero
BEGDTE:	BLOCK 1			;DYNETS START DATE/TIME INTERNAL FORMAT
	EXP -1			;Make sure each page is non-zero
BEGTIM:	BLOCK 1			;DYNETS START TIME IN MILLISECONDS
	EXP -1			;Make sure each page is non-zero
DAYS:	BLOCK 1
	EXP -1			;Make sure each page is non-zero
TIMFRC:	BLOCK 1
	EXP -1			;Make sure each page is non-zero
TAKFLG:	BLOCK 1			;NON-ZERO IF PROCESSING INDIRECT FILE
	EXP -1			;Make sure each page is non-zero
TSKNAM:	BLOCK 8			;DEFAULT EXTENSION (TASK-NAME)
	.ORG   TSKNAM
	ASCIZ /DYNETS/		;INITIAL DEFAULT
	.ORG


	EXP -1			;Make sure each page is non-zero
ARBUID:	BLOCK 5			;STORAGE FOR DEFAULT USERID STRING
	.ORG   ARBUID
	ASCIZ/USERID:SQM/	;INITIAL DEFAULT USERID
	.ORG


	EXP -1			;Make sure each page is non-zero
ARBPWD:	BLOCK 6			;STORAGE FOR PASSWORD
	.ORG   ARBPWD
	ASCIZ/PASSWORD:JPCAXS/	;INITIAL DEFAULT PASSWORD
	.ORG


	EXP -1			;Make sure each page is non-zero
ARBACT:	BLOCK 5			;STORAGE FOR DEFAULT CHARGE STRING
	.ORG   ARBACT
	ASCIZ/CHARGE:07995/	;INITIAL DEFAULT CHARGE
	.ORG


	EXP -1			;Make sure each page is non-zero
ARBDAT:	BLOCK 5			;STORAGE FOR DATA STRING
	.ORG   ARBDAT
	ASCIZ/DATA:A51200/	;INITIAL DEFAULT DATA
	.ORG

	PAGE
.DEARG:				;ARG BLOCK FOR CALL TO NETDCL
	.DEJFN==:.-.DEARG	;OFFSET FOR LINK JFN
	BLOCK 1			;JFN OBTAINED FOR LINK 
	.DETGT==:.-.DEARG	;OFFSET FOR SERVERNAME-DESCRIPTOR STRING PTR
	POINT 7,TGTBUF		;POINTER TO FILE STRING FOR ABOVE JFN
	.DEBYT==:.-.DEARG	;OFFSET FOR LINK BYTE SIZE
	BLOCK 1			;BYTE SIZE FOR LINK
	.DEREC==:.-.DEARG	;OFFSET FOR RECORD LENGTH
	BLOCK 1			;RECORD LENGTH
	.DEDEL==:.-.DEARG	;OFFSET FOR DELAY
	BLOCK 1			;DELAY
.DIARG:				;ARG BLOCK FOR CALL TO NETDIS
	.DIJFN==:.-.DIARG	;OFFSET FOR LINK JFN
	BLOCK 1			;JFN OBTAINED FOR LINK 
	.DITGT==:.-.DIARG	;OFFSET FOR SERVERNAME-DESCRIPTOR STRING PTR
	POINT 7,TGTBUF		;POINTER TO FILE STRING FOR ABOVE JFN
	.DILKN==:.-.DIARG	;OFFSET FOR LINK NAME STRING POINTER
	POINT 7,LKNBUF		;POINTER TO LINK NAME BUFFER
.ESARG:				;ARG BLOCK FOR CALL TO NETEST
	.ESJFN==:.-.ESARG	;OFFSET FOR LINK JFN
	BLOCK 1			;JFN OBTAINED FOR LINK 
	.ESTGT==:.-.ESARG	;OFFSET FOR SERVERNAME-DESCRIPTOR STRING PTR
	POINT 7,TGTBUF		;POINTER TO FILE STRING FOR ABOVE JFN
	.ESLKN==:.-.ESARG	;OFFSET FOR LINK NAME STRING POINTER
	POINT 7,LKNBUF		;POINTER TO LINK NAME BUFFER
	.ESWAT==:.-.ESARG	;OFFSET FOR WAIT SWITCH
	BLOCK 1			;VALUE OF WAIT SWITCH
	.ESBYT==:.-.ESARG	;OFFSET FOR LINK BYTE SIZE
	BLOCK 1			;BYTE SIZE FOR LINK
	.ESREC==:.-.ESARG	;OFFSET FOR RECORD LENGTH
	BLOCK 1			;RECORD LENGTH
.INARG:				;ARG BLOCK FOR CALL TO NETINT
	.INJFN==:.-.INARG	;OFFSET FOR LINK JFN
	BLOCK 1			;JFN OBTAINED FOR LINK 
	.INTGT==:.-.INARG	;OFFSET FOR SERVERNAME-DESCRIPTOR STRING PTR
	POINT 7,TGTBUF		;POINTER TO FILE STRING FOR ABOVE JFN
	.INLKN==:.-.INARG	;OFFSET FOR LINK NAME STRING POINTER
	POINT 7,LKNBUF		;POINTER TO LINK NAME BUFFER
	.INMSN==:.-.INARG	;OFFSET FOR MESSAGE NAME STRING POINTER
	POINT 7,MSNBUF		;POINTER TO MESSAGE NAME BUFFER
	.INEVR==:.-.INARG	;OFFSET FOR EVERY SWITCH
	BLOCK 1			;VALUE OF EVERY SWITCH
	.INBYT==:.-.INARG	;OFFSET FOR LINK BYTE SIZE
	BLOCK 1			;BYTE SIZE FOR LINK
.LIARG:				;ARG BLOCK FOR CALL TO NETLIS
	.LIJFN==:.-.LIARG	;OFFSET FOR LINK JFN
	BLOCK 1			;JFN OBTAINED FOR LINK 
	.LITGT==:.-.LIARG	;OFFSET FOR SERVERNAME-DESCRIPTOR STRING PTR
	POINT 7,TGTBUF		;POINTER TO FILE STRING FOR ABOVE JFN
	.LITIM==:.-.LIARG	;OFFSET FOR TIME SWITCH
	BLOCK 1			;VALUE OF TIME SWITCH
	.LIACC==:.-.LIARG	;OFFSET FOR ACCEPT/REJECT SWITCHES
	BLOCK 1			;VALUE OF ACCEPT/REJECT SWITCH
	.LIBYT==:.-.LIARG	;OFFSET FOR LINK BYTE SIZE
	BLOCK 1			;BYTE SIZE FOR LINK
.PUARG:				;ARG BLOCK FOR CALL TO NETPUR
	.PUJFN==:.-.PUARG	;OFFSET FOR LINK JFN
	BLOCK 1			;JFN OBTAINED FOR LINK 
	.PUTGT==:.-.PUARG	;OFFSET FOR SERVERNAME-DESCRIPTOR STRING PTR
	POINT 7,TGTBUF		;POINTER TO FILE STRING FOR ABOVE JFN
	.PULKN==:.-.PUARG	;OFFSET FOR LINK NAME STRING POINTER
	POINT 7,LKNBUF		;POINTER TO LINK NAME BUFFER
.REARG:				;ARG BLOCK FOR CALL TO NETRCV
	.REJFN==:.-.REARG	;OFFSET FOR LINK JFN
	BLOCK 1			;JFN OBTAINED FOR LINK 
	.RETGT==:.-.REARG	;OFFSET FOR SERVERNAME-DESCRIPTOR STRING PTR
	POINT 7,TGTBUF		;POINTER TO FILE STRING FOR ABOVE JFN
	.RELKN==:.-.REARG	;OFFSET FOR LINK NAME STRING POINTER
	POINT 7,LKNBUF		;POINTER TO LINK NAME BUFFER
	.REMLN==:.-.REARG	;OFFSET FOR MESSAGE LOG JFN
	BLOCK 1			;JFN OF MESSAGE LOG FILE
	.RETOU==:.-.REARG	;OFFSET FOR TIMEOUT SWITCH
	BLOCK 1			;TIMEOUT SWITCH VALUE
	.REREC==:.-.REARG	;OFFSET FOR RECL SWITCH
	BLOCK 1			;RECL SWITCH VALUE
	.REBYT==:.-.REARG	;OFFSET FOR BYTE SWITCH
	BLOCK 1			;BYTE SIZE SWITCH
.SEARG:				;ARG BLOCK FOR CALL TO NETSND
	.SEJFN==:.-.SEARG	;OFFSET FOR LINK JFN
	BLOCK 1			;JFN OBTAINED FOR LINK 
	.SETGT==:.-.SEARG	;OFFSET FOR SERVERNAME-DESCRIPTOR STRING PTR
	POINT 7,TGTBUF		;POINTER TO FILE STRING FOR ABOVE JFN
	.SELKN==:.-.SEARG	;OFFSET FOR LINK NAME STRING POINTER
	POINT 7,LKNBUF		;POINTER TO LINK NAME BUFFER
	.SEMFN==:.-.SEARG	;OFFSET FOR MESSAGE FILE JFN/STRING POINTER
	BLOCK 1			;MESSAGE FILE JFN
	.SETIM==:.-.SEARG	;OFFSET FOR TIMES SWITCH
	BLOCK 1			;TIMES SWITCH VALUE
	.SEDEL==:.-.SEARG	;OFFSET FOR DELAY SWITCH
	BLOCK 1			;DELAY SWITCH VALUE
	.SEBYT==:.-.SEARG	;OFFSET FOR LINK BYTE SIZE
	BLOCK 1			;BYTE SIZE FOR LINK
	.SEREC==:.-.SEARG	;OFFSET FOR RECORD LENGTH
	BLOCK 1			;RECORD LENGTH
	.SEINT==:.-.SEARG	;OFFSET FOR INTERRUPT FREQ
	BLOCK 1			;INTERRUPT FREQ
	VAR
	END <3,,ENTVEC>