Trailing-Edge
-
PDP-10 Archives
-
BB-H348C-RM_1982
-
swskit-v21/debugging-tools/nip.mac
There are 8 other files named nip.mac in the archive. Click here to see a list.
TITLE NIP - INFORMATION (ABOUT) DECNET COMMAND
SEARCH MONSYM,MACSYM
F=0
T1=1
T2=2
T3=3
T4=4
CNT=5
PNT=6
JFN=7
WID=10
P=17
START: RESET
SETZ F,
MOVE P,[IOWD PDLL,PDL]
MOVEI T1,.PRIOU
MOVEI T2,.MORLW
MTOPR%
MOVE WID,T3 ;THE TTY WIDTH
MOVEI T1,.RSINI ;
RSCAN%
ERJMP NONOD
MOVX T1,.RSCNT
RSCAN%
ERJMP NONOD
JUMPE T1,NONOD ;NO NODE INFO
MOVE T1,[RD%JFN+RD%RAI+RD%BEL] ;TEXTI FLAGS
MOVEM T1,TEXTIB+.RDFLG
MOVE T1,[.PRIIN,,.PRIOU]
MOVEM T1,TEXTIB+.RDIOJ
MOVE T1,[POINT 7,BUFF]
MOVEM T1,TEXTIB+.RDDBP
MOVEI T1,^D20
MOVEM T1,TEXTIB+.RDDBC
MOVEI T1,TEXTIB
TEXTI%
JRST [TMSG <?Fatal error from TEXTI JSYS
>
HALTF%]
MOVE T1,[POINT 7,BUFF]
TEXT1: ILDB T2,T1
JUMPE T2,NONOD
CAIE T2," "
JRST TEXT1
TEXT2: ILDB T2,T1
JUMPE T2,NONOD
CAIN T2," "
JRST TEXT2
HRREI T2,-1
ADJBP T2,T1
MOVEM T2,WILD
TEXT3: ILDB T1,T2
JUMPE T1,NONOD
CAIE T1,12
JRST TEXT3
SETZ T1,
DPB T1,T2
JRST GOTNOD
NONOD: MOVE T1,[ASCIZ /*/]
MOVEM T1,BUFF
MOVE T1,[POINT 7,BUFF]
MOVEM T1,WILD
GOTNOD: MOVEI T1,.PRIIN
CFIBF%
MOVEI T2,T3 ;READ THE LOCAL NODE NAME INTO
HRROI T3,LOCAL
MOVEI T1,.NDGLN ;GET THE LOCAL NODE NAME
NODE%
ERCAL DNTOPE
MOVEI T1,^D1000-1
MOVEM T1,ARGB+.NDNND ;SAVE NUMBER OF WORDS AVAILABLE FOR THE TABLE
MOVEI T1,.NDGNT ;READ THE NODE TABLE
MOVEI T2,ARGB
NODE%
ERCAL DNTOPE
HLRZ T2,ARGB+.NDNND
CAIN T2,0
JRST [TMSG <No DECnet nodes are available on >
hrroi t1,local
psout%
tmsg <
>
jrst morinf]
TMSG < The >
HLRZ T2,ARGB+.NDNND
MOVEI T1,.PRIOU
MOVEI T3,^D10
NOUT
JFCL
TMSG < available DECnet nodes on >
HRROI T1,LOCAL
PSOUT%
TMSG < are: >
MOVN T1,ARGB+.NDNND ;MAKE AN AOBJN POINTER TO THE LIST
HRRI T1,ARGB+.NDBK1
ADD T1,[1,,0]
PUSH P,T1
;MOVE ALL THE STRING POINTERS INTO THE TABLE; SKIP THOSE WHICH ARE OFF-LINE
MOVEI T3,.NDSON ;GET NODE ON-LINE FLAG
DNTOP0: MOVE T2,(T1) ;GET POINTER TO NODE BLOCK
CAME T3,.NDSTA(T2) ;IS THE NODE ON-LINE?
JRST DNTOP1 ;NO - SKIP IT
MOVE T2,.NDNAM(T2) ;YES - GET NODE NAME POINTER
MOVEM T2,(T1) ;SAVE IT IN NODE TABLE
AOBJN T1,DNTOP0 ;LOOP THROUGH TABLE
;NOW LOOP THROUGH THE STRINGS - OUTPUT THE LOWEST ALPHABETICALLY,
;ELIMINATE IT, AND LOOP
DNTOP2:
POP P,T1
DNTOP3: PUSH P,T1 ;SAVE AOBJN POINTER
MOVE T4,(T1)
JRST DNTOP5 ;SET UP THE FIRST STRING
DNTOP4: SKIPE T4,(T1) ;GET A STRING POINTER - ANY?
CAMG T2,(T4) ;YES - IS THIS STRING SMALLER?
JRST DNTOP6 ;NO - SKIP IT
DNTOP5: MOVE T2,(T4) ;YES - SET IT UP INSTEAD
MOVE T3,T1 ;GET ITS INDEX, TOO
DNTOP6: AOBJN T1,DNTOP4 ;LOOP THROUGH ALL STRINGS
PUSH P,T3
MOVE T3,(T3) ;OUTPUT THE WINNING STRING
MOVE T2,WILD
MOVEI T1,.WLSTR
WILD%
JUMPN T1,NOMAT
MOVEI T1," "
TROE F,1
PBOUT%
MOVEI T1,.PRIOU
RFPOS%
HRRZ T2,T2
MOVE T1,WID
SUB T1,T2
CAIGE T1,^D8
JRST [TMSG <
>
JRST .+1]
MOVE T1,T3
PSOUT%
NOMAT: POP P,T3
POP P,T1 ;GET THE AOBJN POINTER BACK
MOVE T2,(T1) ;STORE THE FIRST ITEM WHERE THIS ONE WAS
MOVEM T2,(T3)
AOBJN T1,DNTOP3 ;DO THE OUTER LOOP
TMSG <
>
JRST MORINF
DNTOP1: SETZM (T1) ;OFF-LINE - CLEAR POINTER
AOBJN T1,DNTOP0 ;LOOP THROUGH TABLE
JRST DNTOP2 ;THEN JOIN THE AFTER-LOOP FLOW
DNTOPE: CAIN T1,ARGX04 ;NOT ENOUGH SPACE?
JRST DNTPE1 ;YES, PRINT WARNING
TMSG <?Fatal error from NODE JSYS
>
HALTF%
DNTPE1: TMSG <%Not enough storage, incomplete data will de displayed
>
RET
MORINF: MOVEI T1,^D1000-1 ;WORDS AVAILABLE FOR LINE TABLE
MOVEM T1,ARGB+.NDNLN ;TO COUNT WORD
MOVEI T1,.NDGLI ;FUNCTION
MOVEI T2,ARGB
NODE%
ERJMP MORIN2
TMSG <
Line State Adjacent node
>
HLRZ T1,ARGB+.NDNLN ;GET COUNT OF RETURNED NODES
MOVN T1,T1
HRLZ T1,T1
HRRI T1,ARGB+.NDNLN+1 ;WE NOW HAVE AOBJN POINTER
DNSTS3: MOVE T2,(T1) ;GET POINTER TO NODE BLOCK
MOVE T3,.NDLST(T2) ;GET LINE STATE
HRROI T4,[ASCIZ /unknown /]
CAIN T3,.NDLON
HRROI T4,[ASCIZ /on line /]
CAIN T3,.NDLOF
HRROI T4,[ASCIZ /off line/]
CAIN T3,.NDLCN
HRROI T4,[ASCIZ /controller loopback/]
CAIN T3,.NDLCB
HRROI T4,[ASCIZ /cable loopback/]
MOVE T3,.NDLNM(T2) ;GET PORT NUMBER
MOVE T2,.NDLND(T2) ;POINTER TO NODE NAME
PUSH P,T1
PUSH P,T2
PUSH P,T4
MOVEI T1,.BTCPN
MOVEI T2,T3
HRROI T4,LINE
BOOT
HRROI T1,LINE
PSOUT%
MOVEI T1," "
PBOUT%
POP P,T1
PSOUT%
MOVEI T1," "
PBOUT%
POP P,T1
PSOUT%
TMSG <
>
POP P,T1
AOBJN T1,DNSTS3
TMSG <
>
MORIN2: MOVX T1,<GJ%SHT+GJ%OLD>
HRROI T2,[ASCIZ /SYSTEM:DECNET.STATUS/]
GTJFN
HALTF%
MOVX T2,<OF%RD+7B5>
OPENF
HALTF%
HRRZM T1,JFN
TMSG <
Network status as of >
MOVE T1,JFN
MOVE T2,[1,,.FBWRT]
MOVEI T3,T4
GTFDB
MOVEI T1,.PRIOU
MOVE T2,T4
SETZ T3,
ODTIM
TMSG <
>
MOVEI T1,.PRIOU
EXCH T1,JFN
OUTL: BIN
ERJMP EOF
EXCH T1,JFN
BOUT
EXCH T1,JFN
JRST OUTL
EOF: HALTF%
JRST .-1
;DATA
LOCAL: BLOCK 2
WILD: BLOCK 1
TEXTIB: 4
BLOCK 4
ARGB: BLOCK ^D1000
BUFF: BLOCK ^D5
PDLL=^D20
PDL: BLOCK PDLL
LINE: BLOCK 5
END START