Google
 

Trailing-Edge - PDP-10 Archives - BB-M836C-BM - tools/rmtcon/rmtcnp.mac
There are 3 other files named rmtcnp.mac in the archive. Click here to see a list.
DECVER==0
MCNVER==1


	XLIST
DEFINE NAME	(MCNVER,DECVER),<

TITLE	RMTCNP DECSYSTEM KL10 NETWORK INTERCONNECT SERVER, VERSION MCNVER'.'DECVER>
	LIST
	LALL

NAME	\MCNVER,\DECVER

; ****************************************************************
; This "NI SERVER" runs under "TOPS20" only.			 !
; ****************************************************************

;COPYRIGHT 1985
;LARGE SYSTEMS DIAGNOSTICS GROUP
;DIGITAL EQUIPMENT CORPORATION
;MARLBORO, MASS. 01752

;GARY PAPAZIAN

SEARCH	KCUNV,MONSYM,MACSYM,UUOSYM

	NOSYM
	SALL
;Parse.Mac user interface

	INTERN	DISABL,ENABLE
	INTERN	HELP,PGMHDR,PGMNAM,PGNAME,PROMPT,.QUIT
	INTERN	CONECT,SHOW,MAINCM

	EXTERN	$ATOM,CFM,CONSW,PRTNBR,TARADH,TARADL,PRHEX,HEX
	EXTERN	DBGFLG,LOGFLG,TRCFLG,P%CARC,SBINIT
	EXTERN	SPRFLG,T%TWD,TTEXIT,$REMOTE,CTRSTR
	EXTERN	START,STARTA,C$QUIT,IPAG,I%L2FL,I%L3FL,I%L1FL
	EXTERN	INTAKE,ECHOF,CMFILE,CSB,DIAT20,GTJDEV,GTJDIR
	EXTERN	GTJEXT,GTJFIL,GTJFLG,$CCL,RRID,SPR1,SPR4
	EXTERN	RESCON,RELCON,RRCT,RCADR,SALLAD,NODSEL
	EXTERN	PWFLG,PWORDH,PWORDL

;Data push list definitions

	DP=16				;Define dp as data list pointer

DEFINE	PUSHD	(ARG),<			;Push data on data stack
	IRP	ARG
<	PUSH	DP,ARG>>

DEFINE	POPD	(ARG),<			;Pop data from data stack
	IRP	ARG
<	POP	DP,ARG>>
SUBTTL	COMMAND PARSING TABLES
;#***********************************************************************
; CMTAB cmd,addr	cmd  = keyword to parse for
;			addr = dispatch address or return value (data)
;#***********************************************************************
;This is the top level command table.

	SCMTAB	MAINCM			;Start command table, top level
	CMTAB	CONNECT,CONECT		;Connect (to node/port) command
	CMTAB	DISABLE,DISABL		;Disable spear, logging, trace, debug
	CMTAB	DISPLAY,DISPLA		;Display spear, log, trace, debug flags
	CMTAB	ENABLE,ENABLE		;Enable spear, logging, trace, debug
	CMTAB	EXIT,.QUIT		;Command to exit i.E. Quit
	CMTAB	HELP,HELP		;Help command
	CMTAB	IDENTIFY,REQU		;Request id command
	CMTAB	QUIT,.QUIT		;Quit, exit to kcmon
	CMTAB	READ-COUNTERS,RDCTRS	;Read counters
	CMTAB	REDEFINE,REDEFINE	;Redefine remote tty switch char
	CMTAB	SET-PASSWORD,SETPW	;Set password
	CMTAB	SHOW,SHOW		;Show local/remote/all node addresses
	ECMTAB				;End command table, top level

;This table is used with the 'ENABLE and DISABLE' command.

	SCMTAB	ENATAB			;Start of enable command table
	CMTAB	DEBUG,1			;Enable debug
	CMTAB	LOGGING,2		;Enable logging command
	CMTAB	SPEAR-REPORTING,3	;Enable spear command
	CMTAB	TRACE,4			;Enable program trace
	ECMTAB				;End of enable command table

;These tables are used with the 'CONNECT' command.

	SCMTAB	CONTAB
	CMTAB	NODE,0			;12 digit hex
	CMTAB	PORT,1			;0,1,2,3
	ECMTAB

	SCMTAB	PRTTAB			;Port 0,1,2,3
	CMTAB	0,0
	CMTAB	1,1
	CMTAB	2,2
	CMTAB	3,3
	ECMTAB

;This table is used with the 'DISPLAY' command

	SCMTAB	DISTAB			;Start of display-address table
	CMTAB	ALL,0			;Display state of all
	CMTAB	DEBUG,1			;Display state of debug
	CMTAB	LOGGING,2		;Display state of logging
	CMTAB	SPEAR-REPORTING,3	;Display state of spear
	CMTAB	TRACE,4			;Display state of trace
	ECMTAB				;End of display address command table
; **************************************************************************
; *     Top level command parser  (see COMND JSYS for field/format defs)   *
; **************************************************************************

;The macro used to build the command descriptor block is (cmddb.) And has the
;Following format (type,flags,data,help,default,additional command data block),
;The type field will contain the command function code, the function codes are:
;
;  .Cmkey= 0    ;keyword		.Cmusr= 12   ;user name
;  .Cmnum= 1    ;number			.Cmcma= 13   ;comma
;  .Cmnoi= 2    ;guide (noise) word	.Cmini= 14   ;init line
;  .Cmswi= 3    ;switch			.Cmdev= 16   ;device name
;  .Cmifi= 4    ;input file		.Cmtxt= 17   ;text to action char
;  .Cmofi= 5    ;output file		.Cmqst= 21   ;quoted string
;  .Cmfil= 6    ;general filespec	.Cmuqs= 22   ;unquoted string
;  .Cmfld= 7    ;arbitrary field	.Cmtok= 23   ;token
;  .Cmcfm= 10   ;confirm		.Cmnux= 24   ;number delimited
;  .Cmdir= 11   ;directory name                      ; by non-digit
;
;The flag field will contain one of the following flags or will be represented
;By two commas (,,), this indicates to the macro that this field is blank.
;The flags are:
;		Cm%hpp		;help pointer is present
;		Cm%dpp		;default pointer is present
;		Cm%sdh		;suppress default help message
;
;The data field is dependent on the command function, see tops20 monitor call
;Manual commd jsys v544.  This field may be omitted by using two commas (,,).
;
;The help field points to a message to be printed if the question mark (?)
;Is typed.  This field may be omitted by using two commas (,,).
;
;The default field is pointer to a string to be used if the escape is the first
;Character to be typed.  This field may be omitted by using two commas (,,).
;
;The alternate command block is a pointer to a command block to be parsed if
;The parse failed in the first command block.  This field may be omited.
;
;The function field is always used but not all other fields are necessarily
;Used.  If a field to the right is to be used, the unused fields separating
;The fields must be represented by two commas (,,).
;
;KCUNV.MAC uses the COMND JSYS in the following manner:
;
;	CMD	[CMDDB.(TYPE,FLAGS,DATA,etc)],<text>
;
;Where CMD, CMDDB., <text> are KCUNV functions
;and (type,flags,data,etc) are COMND JSYS fields.
;
;See JSYS, KCMON.MEM, KCUNV,KCSUB, MONSYM, MACSYM, UUOSYM
SUBTTL	TOP LEVEL PARSER

PGMNAM:	ASCIZ/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| DECSYSTEM 20 NETWORK INTERCONNECT SERVER  |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
/

PGMHDR:	ASCIZ/
/

PGNAME:	SIXBIT	/RMTCON/			;Program name

PROMPT:	ASCIZ/RMTCON> /			;Program prompt for top level
SUBTTL	CONNECT PORT/NODE COMMAND
; ***********************************************************************
; 1. CONNECT PORT inputs a port number (0-3) & stores it in PRTNBR which
;    is used as the CHANNEL-ID in LLMOP argument blocks.
;
; 2. CONNECT NODE inputs a 12 digit hex number (no spaces allowed) & stores
;    it in TARADH & TARADL which is used as the destination address in the
;    RESERVE CONSOLE argument block & other LLMOP's.
; ***********************************************************************

CONECT:	CMD	[CMDDB.(.CMKEY,,CONTAB)]

	HRRZ	AC1,(AC2)
	JRST	@$CON(AC1)		;Dispatch to port or node

$CON:	.CONN
	.CONP

.CONP:	GUIDE	<NUMBER>		;Port

	CMD	[CMDDB.(.CMKEY,,PRTTAB)]

	HRRZ	AC1,(AC2)		;Get port number
	MOVEM	AC1,PRTNBR		;Save
	CMDCFM
	RTN

.CONN:	GUIDE	<ADDRESS>		;node

	CMD	[CMDDB.(.CMFLD,,,<12 DIGIT HEX ADDRESS>)]

	GO	HEX			;Input hex digits
	CAIE	AC4,^D12		;12 Digits ?
	CMDERR	<WRONG FORMAT>		; No,report error
	CMDCFM

	MOVEM	AC10,TARADH		;Put node number and entry bit in table
	MOVEM	AC11,TARADL
	GO	RESCON			;Go reserve (conect) node
	 JRST	.CONNX			; Cannot reserve, exit

	PMSG	<T[O [D[ISCONNECT & RETURN TO COMMAND MODE, TYPE A SINGLE CONTROL->
	MOVE	TTEXIT
	ADDI	100
	PNTCHR
	SKIPE	DBGFLG			;Debug mode?
	 PMSG	<^L[OCAL ->		; Yes
	PCRLF
	GO	$REMOTE			;Do RCSEND & RCPOLL's (in RMTCNM)

.CONNX:	RTN
SUBTTL	ENABLE COMMAND
;#***********************************************************************
; Enable debug, logging, spear or trace
;#***********************************************************************

ENABLE:	CMD	[CMDDB.(.CMKEY,,ENATAB)]

	HRRZ	AC1,(AC2)		;Set up to go to proper enable routine
	CMDCFM
	JRST	@$ENA(AC1)

$ENA:	Z
	EN.DBG				;1
	EN.LOG				;2
	EN.SPEAR			;3
	EN.TRACE			;4

EN.DBG:	SETOM	DBGFLG			;Enable debug
	RTN

EN.LOG:	MOVE	AC0,CONSW		;Get console switches
	TLO	AC0,SW.LOG		;Set the log switch
        MOVEM	AC0,CONSW		;Save the console switches
	SETOM	LOGFLG			;Set enable logging word
	RTN

EN.SPEAR:SETOM	SPRFLG			;Enable spear
	RTN

EN.TRACE:SETOM	TRCFLG			;Enable trace
	RTN
SUBTTL	DISABLE COMMAND
;#***********************************************************************
; Disable debug, logging, spear or trace
;#***********************************************************************

DISABL:	CMD	[CMDDB.(.CMKEY,,ENATAB)]

	HRRZ	AC1,(AC2)		;Set up to go to proper enable routine
	CMDCFM
	JRST	@$DIS(AC1)

$DIS:	Z
	DA.DBG				;1
	DA.LOG				;2
	DA.SPEAR			;3
	DA.TRACE			;4

DA.DBG:	SETZM	DBGFLG			;Disable debug
	RTN

DA.LOG:	MOVE	AC0,CONSW		;Get console switches
	TLZ	AC0,SW.LOG		;Clear the log switch
        MOVEM	AC0,CONSW		;Save the console switches
	SETZM	LOGFLG			;Clear enable logging word

	DROPDV				;Close the device
	RTN

DA.SPEAR:SETZM	SPRFLG			;Disable spear
	RTN

DA.TRACE:SETZM	TRCFLG			;Disable trace
	RTN
SUBTTL	REDEFINE COMMAND
;#***************************************************************************
;Redefine the "EXIT CHAR" to be any of those listed below.
;note, the entire word "CONTROL" must be entered.
;#***************************************************************************

REDEFINE:GUIDE	<TTY EXIT CHARACTER>

	CMD	[CMDDB.(.CMKEY,,.TSWC,,,CFM)],<NOT A VALID SWITCH CHARACTER>
	CAIN	AC3,CFM
	JRST	REDEF1			;Cr only

	HRRZ	AC6,(AC2)		;Get char

	CMDCFM

	MOVEM	AC6,TTEXIT		;Set it up
	RTN

	SCMTAB	.TSWC
	CMTAB	CONTROL-A,"A"-100
	CMTAB	CONTROL-D,"D"-100
	CMTAB	CONTROL-E,"E"-100
	CMTAB	CONTROL-F,"F"-100
	CMTAB	CONTROL-N,"N"-100
	CMTAB	CONTROL-P,"P"-100
	CMTAB	CONTROL-V,"V"-100
	CMTAB	CONTROL-W,"W"-100
	CMTAB	CONTROL-X,"X"-100
	CMTAB	CONTROL-Z,"Z"-100
	ECMTAB

REDEF1:	PMSG	<TTY E[XIT CHARACTER = CONTROL->
	MOVE	TTEXIT
	ADDI	100
	PNTCHR
	PCRLF
	RTN
SUBTTL	HELP COMMAND
;#***********************************************************************
; To assist user in the options available
;#***********************************************************************

HELP:	GUIDE	<ABOUT A COMMAND, (* FOR ALL)>

	CMD	[CMDDB.(.CMTXT)]

	MOVE	AC6,[POINT 7,HLPBUF]	;Get pointer to help buffer
	MOVEI	AC7,@$ATOM		;Get the address of the atom buffer
	MOVE	AC1,[POINT 7,(AC7)]	;Get pointer to atom buffer

	ILDB	AC0,AC1			;Get first character
	IDPB	AC0,AC6			;Put it in help buffer
	JUMPN	AC0,.-2			;Do till null

	CMDCFM

	MOVEI	AC0,HLPFIL		;Get pointer to help file
	MOVEI	AC1,HLPBUF		;Get pointer to help buffer
	FHELP				;Go provide requested help

	FRESET				;Reset the help file

	RTN

HLPFIL:	SIXBIT	/RMTCON/			;Name of help file
	SIXBIT	/HLP/			;Extension of help file

HLPBUF:	BLOCK	^D5			;Buffer for help request
SUBTTL	REQUEST ID COMMAND
;#***********************************************************************
;Enter via "IDENTIFY" (addr) Command.
;Node does not have to be selected (reserved).
;The req id will return info (status) on desired node.
;#***********************************************************************

REQU:	GUIDE	<NODE>

	CMD	[CMDDB.(.CMFLD,,,<12 DIGIT HEX ADDRESS>)]

	GO	HEX			;Input hex digits
	CAIE	AC4,^D12		;12 Digits ?
	CMDERR	<WRONG FORMAT>		; No,report error
	CMDCFM

	MOVE	AC0,TRCFLG		;See what flag is
	JUMPE	AC0,REQU1		;If zero, force a trace then clear it
	GO	RRID			;Do Req-ID for this node
	JRST	REQUX

REQU1:	SETOM	TRCFLG			;Force trace
	GO	RRID			;Do request id for this node
	SETZM	TRCFLG			;Clear trace
REQUX:	RTN
SUBTTL	SET PASSWORD
;#************************************************************************
;Enter via "SET-PASSWORD"  command.
;Take up to 16 hex digits & store in PWORDH/L.
;The Password is used in RCRBT & RCRSV
;#************************************************************************

SETPW:	CMD	[CMDDB.(.CMFLD,,,<UP TO 16 HEX DIGITS>)]

	SETOM	PWFLG			;Doing password flag
	GO	HEX			;Input hex digits
	CMDCFM
	MOVEM	AC10,PWORDH		;Hi = bytes 7,6,5,4,z
	MOVEM	AC11,PWORDL		;Lo = bytes 3,2,1,0,z
	SETZM	PWFLG			;Done
	RTN
SUBTTL	READ COUNTERS COMMAND
;#*************************************************************************
;Enter via "READ-COUNTERS" (addr) Command.
;Node does not have to be selected (reserved).
;The counter information will be returned on the desired node.
;#*************************************************************************

RDCTRS:	GUIDE	<NODE>

	CMD	[CMDDB.(.CMFLD,,,<12 DIGIT HEX ADDRESS>)]

	GO	HEX			;Input hex digits
	CAIE	AC4,^D12		;12 Digits ?
	CMDERR	<WRONG FORMAT>		; No,report error

	CMDCFM

	GO	RRCT			;Do read counters for this node
	RTN
SUBTTL	DISPLAY COMMAND
;#****************************************************************************
;Display state (enabled/disabled) of debug, logging, spear reporting & trace.
;#****************************************************************************

DISPLA:	GUIDE	<CURRENT STATE OF>	;Noise word for show command

	CMD	[CMDDB.(.CMKEY,,DISTAB)]

	HRRZ	AC1,(AC2)
	CMDCFM
	JRST	@$DISP(AC1)		;Go display it

$DISP:	.$ALL				;0
	.D$DBG				;1
	.D$LOG				;2
	.D$SPE				;3
	.D$TRC				;4

.$ALL:	GO	.D$DBG			;Display debug
	GO	.D$LOG			;Display logging
	GO	.D$SPE			;Display spear
	GO	.D$TRC			;Display trace
	RTN

.D$LOG:	SKIPN	LOGFLG			;Is logging enabled ?
	PMSG	<L[OGGING IS DISABLED^>
	SKIPE	LOGFLG
	PMSG	<L[OGGING IS ENABLED^>
	RTN

.D$DBG:	SKIPN	DBGFLG			;Is debug enabled ?
	PMSG	<P[ROGRAM [DEBUG[ IS DISABLED^>
	SKIPE	DBGFLG
	PMSG	<P[ROGRAM [DEBUG[ IS ENABLED^>
	RTN

.D$SPE:	SKIPN	SPRFLG			;Is spear enabled ?
	PMSG	<R[EPORTS TO [SPEAR [ARE DISABLED^>
	SKIPE	SPRFLG
	PMSG	<R[EPORTS TO [SPEAR [ARE ENABLED^>
	RTN

.D$TRC:	SKIPN	TRCFLG			;Is trace enabled ?
	PMSG	<P[ROGRAM [TRACE [IS DISABLED^>
	SKIPE	TRCFLG
	PMSG	<P[ROGRAM [TRACE [IS ENABLED^>
	RTN
SUBTTL	SHOW COMMAND
;#*****************************************************************************
; Show the LOCAL node & all remote node addresses on network.
;#*****************************************************************************

SHOW:	GUIDE	<NODE ADDRESSES ON NETWORK>
	CMDCFM
					; LOCAL node address
	MOVE	AC0,TRCFLG		;Save TRACE flag
	SETOM	TRCFLG			;Force TRACE
	GO	RCADR			;Do the LLMOP to read local node addr
	 NOP				; error return
	MOVEM	AC0,TRCFLG		;Restore TRACE

	GO	SALLAD			;All REMOTE NODE addresses on network
	RTN




;#**************************************************************************
;* QUIT command - Exit this program (NI SERVER) & return to system monitor.
;#**************************************************************************

.QUIT:	GUIDE	<TO MONITOR>		;Noise word for quit command
	CMDCFM				;Expect a carriage return here

	GO	CTRSTR			;Restore controlling terminal

	GO	SPR4			;Go make a spear entry for this
					; Diagnostic exit
	MOVE	AC0,CONSW		;Get console switches
	TLZ	AC0,SW.LOG		;Clear the log switch
        MOVEM	AC0,CONSW		;Save the console switches
	SETZM	LOGFLG			;Clear enable logging word
	DROPDV				;Close the device
	JRST	@C$QUIT			;Quit through kcsub

	END