Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/debugging-tools/loop.mac
There are no other files named loop.mac in the archive.
TITLE LOOP 2020 LOOPBACK PORT CONTROL

	SEARCH MONSYM,MACSYM
	.REQUIRE SYS:MACREL
	T1=1
	T2=2
	T3=3
	T4=4

LOOP:	RESET
	MOVE 17,[IOWD PDLSIZ,PDL] ;SET UP THE STACK
	CALL SHOW		;DISPLAY STATE OF LOOPBACK
	HALTF
;
; HERE TO DISPLAY STATE OF LOOPBACK
;
SHOW:	MOVEI T1,.NDFLP		;FIND LOOPBACK PORT
	MOVEI T2,ARG		;ARG BLOCK ADDRESS
	NODE			;FIND THE PORT
	 ERJMP JSHLT0		;FAILURE
	SKIPN ARG		;ANY LOOPBACK PORT?
	JRST [TMSG <NO LOOPBACK PORT ENABLED
>
		RET]
	HRROI T1,STRING		;CHARACTER STRING
	MOVEM T1,ARG+.BTLID	;SAVE POINTER
	MOVEI T1,.BTCPN		;CONVERT TO STRING
	MOVEI T2,ARG		;ARG BLOCK
	BOOT			;CONVERT IT
	 ERJMP JSHLT0		;ERROR?
	HRROI T1,STRING		;POINT TO THE STRING
	PSOUT			;TYPE IT
	TMSG < IS ENABLED FOR LOOPBACK
>
	MOVE T1,ARG		;NSP PORT NUMBER
	TXNE T1,ND%LPR		;LOOPBACK RUNNING?
	JRST [TMSG <	AND A SUCCESSFUL NODE INITIALIZATION HAS OCCURED
>
		RET]
	RET
;
; HERE TO TURN OFF ANY LOOPBACK LINES
;
OFF:	MOVEI T1,.NDFLP		;FIND LOOPBACK PORT
	MOVEI T2,ARG		;ARG BLOCK
	NODE			;FIND THE LOOPBACK PORT
	 ERJMP JSHLT0		;ERROR?
	SKIPN ARG		;WAS ONE ENABLED?
	RET
	MOVEI T1,.NDCLP		;CLEAR LOOPBACK PORT
	MOVEI T2,ARG		;ARG BLOCK
	NODE			;CLEAR IT
	 ERJMP JSHLT0		;ERROR?
	MOVEI T1,.BTTPR		;TURN THE PORT OFF
	MOVEI T2,ARG		;ARG BLOCK ADDRESS
	BOOT			;TURN THE LINE OFF
	 ERJMP JSHLT0		;ERROR?
	RET
;
; HERE TO USE A LINE FOR LOOPBACK
;
SET:	CALL OFF		;TURN OFF CURRENT LOOPBACK
	HRROI T1,[ASCIZ/KDP_0_0/] ;LINE ID
	MOVEM T1,ARG+.BTLID	;SAVE IN ARG BLOCK
	MOVEI T1,.BTCLI		;CONVERT TO NSP PORT NUMBER
	MOVEI T2,ARG		;ARG BLOCK
	BOOT			;
	 ERJMP JSHLT0		;ERROR?
	MOVEI T1,.BTTPR		;TURN LINE OFF
	MOVEI T2,ARG		;ARG BLOCK ADDRESS
	BOOT			;
	 ERJMP JSHLT0		;ERROR?
	MOVEI T1,.NDSLP		;SET NSP LOOPBACK PORT
	MOVEI T2,ARG		;ARG BLOCK
	NODE			;
	 ERJMP JSHLT0		;ERROR?
	MOVEI T1,.VNCBL		;CABLE LOOPBACK
	MOVEM T1,ARG+1		;SAVE IN ARG BLOCK
	MOVEI T1,.BTIPR		;SET LINE IN CABLE LOOPBACK
	BOOT			;
	 ERJMP JSHLT0		;ERROR?
	RET


PDLSIZ==20
PDL:	BLOCK PDLSIZ
ARG:	BLOCK	20
STRING:	BLOCK	100

	END LOOP