User Tools

Site Tools


cdc:nos2.source:nam5871:ndlnftm

NDLNFTM

Table Of Contents

  • [00008] PROC NDLNFTM
  • [00012] NCF TERMINATION ROUTINE.
  • [00051] PROC SSTATS
  • [00052] PROC NDLEM2
  • [00053] PROC MOVEI
  • [00054] PROC NDLSST
  • [00055] PROC NDLWNCF
  • [00056] FUNC XCDD C(10)
  • [00070] PROC CHKTRUNK
  • [00103] PROC NDLEM2
  • [00104] FUNC XCDD C(10)
  • [00119] PROC MAXPORT(NODENO,PORTNO)
  • [00186] PROC SETPTR(NODENO)
  • [00218] PROC CHECKPORT(ERRORV,PORTNO,NODENO)
  • [00291] PROC CHECKERR (NODENO)
  • [00321] PROC NDLEM2
  • [00322] FUNC XCDD C(10)
  • [00378] PROC BLDNCB
  • [00382] BLDNCB - BUILD NPU CONFIGURE BLOCKS.
  • [00414] PROC SSTATS
  • [00453] PROC BLDCNFG(BC$BPOS,BC$WC)
  • [00457] BLDCNFG - BUILD LINE CONFIGURATION TABLE(C-TABLE).
  • [00496] PROC SSTATS
  • [00497] PROC READ
  • [00498] PROC READW
  • [00499] PROC RECALL
  • [00580] PROC LINK$INFO
  • [00584] LINK$INFO - MAKE ENTRIES FOR TRUNKS AND COUPLERS.
  • [00625] PROC SSTATS
  • [00765] PROC NCBINIT
  • [00769] NCBINIT - NCB INITIALIZATION.
  • [00802] PROC SSTATS
  • [00908] PROC NCBTERM
  • [00912] NCBTERM - NCB TERMINATION
  • [00942] PROC ABORT
  • [00943] PROC LFGCKSM
  • [00944] PROC LFGHDRW
  • [00945] PROC LFGMOVW
  • [00946] PROC MESSAGE
  • [01103] PROC NPUINFO
  • [01107] NPUINFO - NPU INFORMATION.
  • [01144] PROC SSTATS
  • [01279] PROC PACKWDS(TABLE,BIT,WC,TOTALWC)
  • [01283] PACKWDS - PACK WORDS INTO NCB BUFFER.

Source Code

NDLNFTM.txt
  1. *DECK NDLNFTM
  2. USETEXT NDLDATT
  3. USETEXT NDLER2T
  4. USETEXT NDLFETT
  5. USETEXT NDLNCFT
  6. USETEXT NDLPS2T
  7. USETEXT NDLTBLT
  8. PROC NDLNFTM;
  9. BEGIN
  10. *IF,DEF,IMS
  11. #
  12. ** NDLNFTM - NCF TERMINATION ROUTINE.
  13. *
  14. * D.K. ENDO 81/10/12
  15. *
  16. * THIS PROCEDURE DOES ALL THE FINAL PROCESSING IN THE CREATION OF
  17. * AN NCF.
  18. *
  19. * PROC NDLNFTM
  20. *
  21. * ENTRY NONE.
  22. *
  23. * EXIT NONE.
  24. *
  25. * METHOD
  26. *
  27. * CALL PROC THAT BUILDS NCB-S.
  28. * FOR EACH CROSS REFERENCE TABLE,
  29. * SORT THE TABLE.
  30. * WRITE TABLE TO NCF.
  31. * SORT THE LINE RECORD INDEX.
  32. * WRITE LINE RECORD INDEX TO NCF.
  33. * IF NO ERRORS,
  34. * THEN,
  35. * SET GOOD NCF FLAG.
  36. * OTHERWISE,
  37. * CLEAR GOOD NCF FLAG.
  38. * PUT ERROR MESSAGE IN PREFIX TABLE.
  39. * SORT NCF INDEX.
  40. * PUT PREFIX TABLE IN FRONT OF NCF INDEX.
  41. * WRITE INDEX TO NCF.
  42. * DE-ALLOCATE TABLE SPACE.
  43. *
  44. #
  45. *ENDIF
  46. #
  47. **** PROC NDLNFTM - XREF LIST BEGINS.
  48. #
  49. XREF
  50. BEGIN
  51. PROC SSTATS; # ALLOC SPECIFIED NUM OF WORDS TO TABLE #
  52. PROC NDLEM2; # MAKES ENTRIES IN PASS2 ERROR FILE #
  53. PROC MOVEI; # MOVES BLOCKS OF MEMORY IN FL #
  54. PROC NDLSST; # DOES A SORT OF TBL USING SHELL-S METHOD #
  55. PROC NDLWNCF; # WRITES RECORD/TABLE TO NCF #
  56. FUNC XCDD C(10); #CONVERTS INTEGER TO DISPALY CODE #
  57. END
  58. #
  59. ****
  60. #
  61. DEF NCF$EMSG #"ERRORS DETECTED IN THE CREATION OF THIS NCF."#;
  62. DEF PT$SIZE # 15 #; # TOTAL SIZE OF PRFX TABLE #
  63. ITEM BBP; # BEGINNING BIT POSITION #
  64. ITEM ENT$CNT; # ENTRY COUNT #
  65. ITEM FRST$WRD; # FIRST WORD TO BEGIN SORT ON #
  66. ITEM ITEMP; # INTEGER TEMPORARY #
  67. ITEM LENGTH; # LENGTH OF TABLE TO BE WRITTEN TO NCF #
  68. ITEM MASK; # MASK OF KEY TO BE SORTED ON #
  69. CONTROL EJECT;
  70. PROC CHKTRUNK;
  71. BEGIN
  72. *IF,DEF,IMS
  73. #
  74. **
  75. *
  76. * CHKTRUNK - CHECKS PORT NUMBER ALLOCATION OF TRUNK STATEMENTS.
  77. *
  78. * Y. C. YIP 82/09/09
  79. *
  80. * THIS PROC SEARCHES PHYSICAL LINK TABLE FOR TRUNK LINKS
  81. * AND CHECK IF PORTS ASSIGNED ARE VALID.
  82. *
  83. * Y.C. YIP 82/09/09
  84. *
  85. * ENTRY - NONE
  86. *
  87. * EXIT - NONE
  88. *
  89. * METHOD
  90. *
  91. * FOR EVERY NODE ASSOCIATED WITH A TRUNK, GET ITS
  92. * MAXIMUM PORT NUMBER USED BY CALLING A LOCAL PROCEDURE
  93. * MAXPORT AND STORE THE MAXIMUM PORT NUMBER USED BY
  94. * BY THAT NODE IN MAXPORT. THEN IT CHECKS IF ALL PORT
  95. * NUMBERS 1 THROUGH MAXPORT ARE USED ELSE AN ERROR
  96. * MESSAGE IS GENERATED.
  97. *
  98. #
  99. *ENDIF
  100. # DATA DEFINITION #
  101. XREF
  102. BEGIN
  103. PROC NDLEM2; #PASS 2 ERROR MESSAGE GENERATOR#
  104. FUNC XCDD C(10); #CONVERTS INTEGER TO DISPLAY CODE #
  105. END
  106. ARRAY USEMAP[0:4] S(1); # FOR NODE MAP #
  107. BEGIN
  108. ITEM NMAP(0,0,60) = [5(0)] ; # CLEAR MAP #
  109. END
  110. ITEM INDIX1; # LOOP INDEX #
  111. DEF OVCH # -1 #; #LINE NUMBER FOR OVERALL ERROR CHECK#
  112. ITEM MPTNO; # MAXIMUM PORT NUMBER #
  113. ITEM WRDPTR ; # WORD POINTER #
  114. ITEM BITPTR ; # BIT POINTER #
  115. CONTROL EJECT;
  116. # FIRST LOCAL PROCEDURE #
  117. # #
  118. # #
  119. PROC MAXPORT(NODENO,PORTNO);
  120. *IF,DEF,IMS
  121. #
  122. **
  123. *
  124. * MAXPORT - OBTAINS MAXIMUM PORT NUMBER AT A NPU NODE.
  125. *
  126. * Y.C. YIP 82/09/09
  127. *
  128. * THIS PROCEDURE OBTAINS THE MAXIMUM PORT NUMBER USED BY A
  129. * NPU NODE AT EITHER END OF A TRUNK.
  130. *
  131. * PROC MAXPORT(NODENO,PORTNO)
  132. *
  133. * ENTRY - NODENO = NODE NUMBER TO BE CHECKED
  134. *
  135. * PORTNO = RETURN PARAMETER TO STORE THE MAXIMUM PORT
  136. * NUMBER SPECIFIED FOR THAT NODE
  137. *
  138. * EXIT - NODENO = UNCHANGED.
  139. * PORTNO = VALUE OF THE MAXIMUM PORT NUMBER.
  140. *
  141. * METHOD
  142. *
  143. * THE PHYSICAL LINK TABLE IS LOOPED TO FIND A MATCH OF THE
  144. * NODE NUMBER WITH THE NODE NUMBER AT EITHER END OF THE TRUNK.
  145. * IF A MATCH IS FOUND A MAXIMUM PORT NUMBER IS STORED AND
  146. * BE USED TO COMPARE WITH SUBSEQUENT PORT NUMBERS FOUND.
  147. * THE SEARCH STOPS AT THE END OF THE PHYSICAL LINK TABLE AND
  148. * PORTNO CONTAINS THE VALUE OF THE MAXIMUM PORT NUMBER.
  149. *
  150. #
  151. *ENDIF
  152. BEGIN
  153. ITEM PORTNO; # PORT NUMBER #
  154. ITEM NODENO; #NODE NUMBER #
  155. ITEM INDIX; # LOOP VARIABLE #
  156. # *
  157.   *
  158.   #
  159. FOR INDIX=1 STEP 1 UNTIL PLWC[0] # GO THROUGH PLLINK TABLE #
  160. DO
  161. BEGIN
  162. IF PLTYPE[INDIX] EQ 1 # A TRUNK LINK ? #
  163. THEN
  164. BEGIN
  165. IF PLNID1[INDIX] EQ NODENO # MATCH IN NODE NO #
  166. THEN
  167. BEGIN
  168. IF PLP1[INDIX] GR PORTNO THEN # GET HIGHER PORTNO #
  169. PORTNO=PLP1[INDIX]; # GET BIGGER OF PORTNO #
  170. END
  171. ELSE
  172. BEGIN
  173. IF PLNID2[INDIX] EQ NODENO # SAME FOR OTHER SIDE #
  174. THEN
  175. BEGIN
  176. IF PLP2[INDIX] GR PORTNO # GET HIGHER PORTNO #
  177. THEN PORTNO = PLP2[INDIX] ;
  178. END
  179. END
  180. END
  181. END
  182. RETURN; # RETURN TO CALLING PROCEDURE #
  183. END # END OF MAXPORT #
  184. CONTROL EJECT;
  185. # LOCAL PROCEDURE #
  186. PROC SETPTR(NODENO);
  187. *IF,DEF,IMS
  188. #
  189. **
  190. * PROC SETPTR
  191. *
  192. * Y.C. YIP 82/09/09
  193. *
  194. * THIS PROCEDURE SETS THE WORD AND BIT POINTER IN THE NODE MAP.
  195. *
  196. * PROC SETPTR(NODENO)
  197. *
  198. * ENTRY - NODENO = NODE NUMBER.
  199. *
  200. * EXIT - WRDPTR SET TO THE WORD NUMBER WITHIN THE NODE MAP
  201. * BITPTR SET TO THE BIT OF THAT SPECIFIC WORD INDICATED
  202. * BY WRDPTR.
  203. *
  204. * METHOD
  205. *
  206. * WORD NUMBER COMPUTED BY (NODENO - 1)/60
  207. * BITPTR COMPUTED BY (NODENO - 1) - 60*WRDPTR
  208. #
  209. *ENDIF
  210. BEGIN
  211. ITEM NODENO; # NODE NUMBER#
  212. WRDPTR = (NODENO -1)/60; # SET WORD POINTER #
  213. BITPTR = (NODENO -1) -60*WRDPTR; # SETS BIT POINTER #
  214. RETURN;
  215. END # END OF SETPTR #
  216. CONTROL EJECT;
  217. # LOCAL PROCEDURE #
  218. PROC CHECKPORT(ERRORV,PORTNO,NODENO);
  219. BEGIN
  220. *IF,DEF,IMS
  221. #
  222. **
  223. *
  224. * CHECKPORT - CHECKS IF A PORT NUMBER IS DEFINED IN THE
  225. * PHYSICAL LINK TABLE.
  226. *
  227. * Y.C. YIP 82/09/09
  228. *
  229. * THIS PROCEDURE CHECKS FOR VALID PORT NUMBER
  230. *
  231. * PROC CHECKPORT(ERRORV,PORTNO,NODENO)
  232. *
  233. * ENTRY - ERRORV = ERROR FLAG
  234. * PORTNO = PORT NUMBER BEING CHECKED
  235. * NODENO = NODE NUMBER OF THE TRUNK
  236. *
  237. * EXIT - ERRORV SET TO TRUE IF THERE IS NO MATCH ELSE FALSE
  238. * PORTNO = UNCHANGED
  239. * NODENO = UNCHANGED
  240. *
  241. * METHOD
  242. *
  243. * ERRORV IS SET TO FALSE
  244. * THE PHYSICAL LINK TABLE IS SCANNED TO
  245. * FIND A MATCH FOR THE NODE NUMBER AND PORT NUMBER GIVEN AS
  246. * PARAMETERS. IF A MATCH IS FOUND ERRORV IS SET TO TRUE.
  247. *
  248. *
  249. #
  250. *ENDIF
  251. ITEM ERRORV B; # BOOLEAN FOR ERROR SIGNAL #
  252. ITEM PORTNO ; # PORTNO #
  253. ITEM NODENO ; # NODE NUMBER BEING CHECKED #
  254. ITEM INDIX; # LOOP VARIABLE #
  255. FOR INDIX=1 STEP 1 UNTIL PLWC[0] # SCAN PLLINK TABLE #
  256. DO
  257. BEGIN
  258. IF PLTYPE[INDIX] EQ 1 #LINK IS A TRUNK #
  259. THEN
  260. BEGIN
  261. IF PLNID1[INDIX] EQ NODENO # TRY TO MATCH NODE NO#
  262. THEN
  263. BEGIN
  264. IF PLP1[INDIX] EQ PORTNO # IF MATCH FOUND #
  265. THEN
  266. BEGIN
  267. ERRORV=FALSE; #NO ERROR #
  268. RETURN;
  269. END
  270. END
  271. ELSE
  272. BEGIN
  273. IF PLNID2[INDIX] EQ NODENO # IF MATCH FOUND #
  274. THEN
  275. BEGIN
  276. IF PLP2[INDIX] EQ PORTNO # IF PORTNO MATCH #
  277. THEN
  278. BEGIN
  279. ERRORV= FALSE ; # NO ERRROR #
  280. RETURN ; # RETURN CONTROL TO CALLING PROGRAM #
  281. END
  282. END
  283. END
  284. END
  285. END # END FOR LOOP #
  286. ERRORV=TRUE ; # NO MATCH FOUND #
  287. RETURN;
  288. END # END OF CHECKPORT #
  289.  
  290. CONTROL EJECT;
  291. PROC CHECKERR (NODENO) ;
  292. *IF,DEF,IMS
  293. #
  294. **
  295. *
  296. * CHECKERR - CHECKS FOR PORT NUMBER SPECIFICATION ERROR.
  297. *
  298. * Y.C. YIP 82/09/09
  299. *
  300. * THIS PROC CHECKS VALIDITY OF ALL PORTS USED AT A NODE NUMBER
  301. *
  302. * PROC CHECKERR(NODENO)
  303. *
  304. * ENTRY - NODENO = NODE NUMBER BEING CHECKED
  305. *
  306. * EXIT - NODENO = UNCHANGED.
  307. *
  308. * METHOD
  309. *
  310. * CHECKERR CALLS MAXPORT TO FIND OUT THE MAXIMUM
  311. * PORT NUMBER FOR THAT NODE. IT THEN CALLS
  312. * CHECKPORT TO DETECT INVALID PORT NUMBERS USED
  313. * IN THE RANGE 1 THROUGH MAXPORT, IF SO, IT GENERATES
  314. * ERROR 157 WITH PORT NUMBER AS THE CLARIFIER WORD.
  315. *
  316. #
  317. *ENDIF
  318. BEGIN
  319. XREF
  320. BEGIN
  321. PROC NDLEM2; #REFERENCE TO PASS 2 ERROR ROUTINE #
  322. FUNC XCDD C(10); # CONVERSION FROM INTEGER TO DISPLAY CODE#
  323. END
  324. ITEM ERRORC B ; #BOOLEAN FOR ERROR CONDITION #
  325. ITEM CTEMP C(10) ; # TEMP FOR DISPLAY CODE #
  326. ITEM MPTNO ; #MAXIMUM PORT NUMBER #
  327. ITEM INDIX2 ; # LOOP VCARIABLE INDEX #
  328. ITEM CONT B; # BOOLEAN TO SKIP DUPLICATE ERROR MESSAGES #
  329.  
  330. SETPTR(NODENO) ; # SETS BIT MAP #
  331. IF B<BITPTR,1>NMAP[WRDPTR] EQ 0
  332. THEN # NO CHECKED BEFORE #
  333. BEGIN
  334. B<BITPTR,1>NMAP[WRDPTR]=1; # SET MASK #
  335. MPTNO=0; #CLEAR MAX PORT NUMBER FOR COMPARISON #
  336. MAXPORT(NODENO,MPTNO);
  337. # FIND OUT MAXIMUM PORT NUMBER #
  338. ERRORC=FALSE; #PRESET ERROR#
  339. CONT = TRUE; # SETTING CONTINUE FLAG TO TRUE #
  340. FOR INDIX2=MPTNO STEP -1 WHILE CONT
  341. DO
  342. BEGIN
  343. IF INDIX2 EQ 1 # IF LAST ENTRY #
  344. THEN
  345. BEGIN
  346. CONT = FALSE; # DISCONTINUE THE LOOP #
  347. END
  348. CHECKPORT(ERRORC,INDIX2,NODENO);
  349. IF ERRORC
  350. THEN #CALLS ERROR MESSAGE DISPLAY #
  351. BEGIN
  352. CTEMP=XCDD(NODENO); #CONVERTS TO DISPLAY CODE #
  353. NDLEM2(ERR157,OVCH,CTEMP); #ERROR MESSAGE#
  354. CONT = FALSE; # AVOID DUPLICATE ERROR MESSAGES#
  355. END
  356. END
  357. END
  358. RETURN;
  359. END # END OF CHECKERR#
  360. CONTROL EJECT;
  361. #*
  362.  * CHKTRUNK CODE BEGINS HERE
  363.  *
  364.  *
  365. #
  366. FOR INDIX1=1 STEP 1 UNTIL PLWC[0] # SCAN PL TABLE #
  367. DO
  368. BEGIN
  369. IF PLTYPE[INDIX1] EQ 1 # IF LINK IS A TRUNK #
  370. THEN
  371. BEGIN
  372. CHECKERR(PLNID1[INDIX1]) ; #CHECKS NODE 1 #
  373. CHECKERR(PLNID2[INDIX1]) ; #CHECKS NODE 2 ON THE TRUNK #
  374. END
  375. END
  376. END # END OF CHKTRUNK #
  377. CONTROL EJECT;
  378. PROC BLDNCB;
  379. BEGIN
  380. *IF,DEF,IMS
  381. #
  382. ** BLDNCB - BUILD NPU CONFIGURE BLOCKS.
  383. *
  384. * D.K. ENDO 81/10/13
  385. *
  386. * THIS PROCEDURE BUILDS AN NCB FOR EACH NPU DEFINED AND WRITES IT
  387. * TO THE NCF.
  388. *
  389. * PROC BLDNCB
  390. *
  391. * ENTRY NONE.
  392. *
  393. * EXIT NONE.
  394. *
  395. * METHOD
  396. *
  397. * IF NO FATAL ERRORS,
  398. * INITIALIZE TABLES AND TABLE HEADERS.
  399. * FOR EACH ENTRY IN THE NPU TABLE,
  400. * CLEAR TABLES.
  401. * ENTER NPU INFORMATION.
  402. * ENTER PHYSICAL LINK AND LOGICAL LINK INFORMATION.
  403. * ENTER SUPERVISOR INFORMATION.
  404. * DO FINAL STEP TO COMPLETE NCB.
  405. * DE-ALLOCATE TABLES.
  406. *
  407. #
  408. *ENDIF
  409. #
  410. **** PROC BLDNCB - XREF LIST BEGINS.
  411. #
  412. XREF
  413. BEGIN
  414. PROC SSTATS; # ALLOCATES SPACE FOR TABLES ON REQUEST #
  415. END
  416. #
  417. ****
  418. #
  419. DEF CKSM$ENT # 0 #; # INITIAL CHECK SUM ENTRY -- ZERO #
  420. DEF RT$RS$ONE # 1 #; # ROUTING TABLE STATUS -- DISABLED #
  421. DEF RT$RS$TWO # 2 #; # ROUTING TABLE STATUS -- ROUTE TO OWN DN #
  422. DEF RT$RS$ZERO # 0 #; # ROUTING TABLE STATUS -- ENABLED #
  423. ITEM CRNT$NPU; # POINTER TO CRNT NPU IN NPU XREF TABLE #
  424. ITEM CRNT$SUP; # POINTER TO CRNT SUPLINK ENTRY #
  425. ITEM SUP$INDX; # CURRENT INDEX INTO SUPLINK TABLE #
  426. ARRAY END$IND [0:0] S(1);
  427. BEGIN # END OF NCB INDICATOR #
  428. ITEM END$IDENT U(0,44,8) = [O"105"];
  429. ITEM END$ZBYT U(0,52,8) = [0];
  430. END
  431. DEF MXNDT # 3 #;
  432. DEF NFBFLNGTH # O"1000" #;
  433. ARRAY NCF$BUFFER [0:NFBFLNGTH] S(1);
  434. BEGIN
  435. ITEM NCFWB (0,0,60); # CIO BUFFER FOR WRITING NCB-S #
  436. END
  437. ARRAY NODE$TABLE [0:MXNDT] S(1);
  438. BEGIN
  439. ITEM NDTNAME U(0,44,8);
  440. ITEM NDT$ENT U(0,52,8);
  441. ITEM NDT$TYP U(0,44,2);
  442. ITEM NDT$NID U(0,52,8);
  443. ITEM NDT$WRD U(0,44,16);
  444. END
  445. DEF MXNIT # 0 #;
  446. ARRAY NPU$INFO [0:MXNIT] S(1);
  447. BEGIN
  448. ITEM NIT$DP B(0,46,1);
  449. ITEM NIT$OP B(0,47,1);
  450. ITEM NIT$WRD U(0,44,16);
  451. END
  452. CONTROL EJECT;
  453. PROC BLDCNFG(BC$BPOS,BC$WC);
  454. BEGIN
  455. *IF,DEF,IMS
  456. #
  457. ** BLDCNFG - BUILD LINE CONFIGURATION TABLE(C-TABLE).
  458. *
  459. * D.K. ENDO 81/10/13
  460. *
  461. * THIS PROCEDURE BUILDS THE LINE CONFIGURE TABLE AND
  462. * PACKS IT INTO THE NCB.
  463. *
  464. * PROC BLDCNFG(BC$BPOS,BC$WPOS)
  465. *
  466. * ENTRY BC$BPOS = CURRENT BIT POSITION IN THE NCB BUFFER.
  467. * BC$WPOS = CURRENT NPU WORD COUNT.
  468. *
  469. * EXIT BC$WPOS = UPDATED WORD COUNT WITH C-TABLE.
  470. *
  471. * METHOD
  472. *
  473. * SEARCH LINE CONFIG FILE INDEX FOR ENTRY FOR CURRENT NPU.
  474. * IF ENTRY WAS FOUND,
  475. * READ IN RECORD WITH CURRENT NPU-S LINE CONFIGURE INFO.
  476. * PUT THE ENTRY COUNT IN C-TABLE HEADER.
  477. * PUT C-TABLE IN THE NCB.
  478. * IF ENTRY WAS FOUND,
  479. * FOR ENTRY IN THE RECORD,
  480. * IF -NI- VALUE IS ZERO,
  481. * THEN,
  482. * PUT ENTRY IN THE NCB.
  483. * OTHERWISE,
  484. * FOR EACH ITERATION OF THE PORT NUMBER UNTIL -NI- VALUE
  485. * PUT ENTRY IN THE NCB.
  486. *
  487. #
  488. *ENDIF
  489. ITEM BC$BPOS; # CURRENT BIT POSITION IN NCB BUFFER #
  490. ITEM BC$WC; # TOTAL SIZE OF NCB IN NPU WORDS #
  491. #
  492. **** PROC BLDCNFG - XREF LIST BEGINS HERE.
  493. #
  494. XREF
  495. BEGIN
  496. PROC SSTATS; # ALLOCATES MORE TABLE SPACE ON REQUEST #
  497. PROC READ; # READS RECORD INTO BUFFER #
  498. PROC READW; # READS SPECIFIED NUMBER OF WORDS #
  499. PROC RECALL; # RETURNS CONTROL WHEN RECALL BIT IS SET #
  500. END
  501. #
  502. ****
  503. #
  504. ITEM CRNT$ENT; # POINTER TO CRNT ENTRY IN LINE CONF REC #
  505. ITEM ENTRY$LENG; # LENGTH OF CURRENT LINE ENTRY #
  506. ITEM FOUND B; # SET WHEN ENTRY IN INDEX IS FOUND #
  507. ITEM I; # SCRATCH ITEM #
  508. ITEM ITEMP; # INTEGER TEMPORARY #
  509. ITEM ITEMP2; # SECOND INTEGER TEMPORARY #
  510. ITEM NI$VALUE; # -NI- VALUE OF CURRENT LINE ENTRY #
  511. ITEM STATIS; # STATUS RETURNED BY READ #
  512. ARRAY C$TABLE$HDR [0:0] S(1);
  513. BEGIN
  514. ITEM CTAB$ID U(0,44,8) = [O"103"];
  515. ITEM CTAB$ENT U(0,52,8);
  516. ITEM CTABWORD (0,0,60);
  517. END
  518. CONTROL EJECT;
  519. # #
  520. # BLDCNFG CODE BEGINS HERE #
  521. # #
  522. FOUND = FALSE;
  523. CTAB$ENT[0] = 0; # CLEAR CONFIG TABLE ENTRY COUNT #
  524. FOR I=2 STEP LCRENTSZ WHILE NOT FOUND AND I LS LCRWC[1]
  525. DO # SEARCH FOR ENTRY IN INDEX #
  526. BEGIN
  527. IF LCRNAME[I] EQ NPNAME[CRNT$NPU]
  528. THEN # IF ENTRY IS FOUND #
  529. BEGIN
  530. FOUND = TRUE; # SET FOUND FLAG #
  531. LR$RR[0] = LCRRANINDX[I+1]; # INITIALIZE FET TO READ #
  532. LRFIRST[0] = LOC(LCRWB); # THE RECORD #
  533. LRIN[0] = LOC(LCRWB);
  534. LROUT[0] = LOC(LCRWB);
  535. LRLIMIT[0] = LOC(LCRWB) + PRULNGTH + 1;
  536. LRCODE[0] = 3;
  537. LRILNG[0] = LCRWC[1] + 1;
  538. LRIFWA[0] = LOC(LIN$CON$INDX);
  539. READ(LRFET); # READ THE RECORD #
  540. RECALL(LRFET);
  541. CTAB$ENT[0] = LCRENT[I]; # PUT ENTRY COUNT IN C-TABL#
  542. END # HEADER #
  543. END
  544. PACKWDS(LOC(C$TABLE$HDR),BC$BPOS,1,BC$WC); # HEADER -> NCB BUFFR #
  545. IF FOUND # IF THERE WERE LINES DEFINED ON THIS NPU #
  546. THEN
  547. BEGIN
  548. STATIS = TRNS$OK; # INITIALIZE STATUS #
  549. FOR CRNT$ENT=0 WHILE STATIS EQ TRNS$OK
  550. DO # FOR EACH ENTRY #
  551. BEGIN # MOVE TEMPLET TO ENTRY #
  552. READW(LRFET,LIN$CON$REC,1,STATIS); # READ HEADER OF ENTRY #
  553. IF STATIS EQ TRNS$OK # IF NOT END OF RECORD #
  554. THEN
  555. BEGIN
  556. ENTRY$LENG = LCWC[0]; # SAVE LENGTH OF ENTRY #
  557. NI$VALUE = LCNI[0]; # SAVE -NI- VALUE FOR ENTRY #
  558. READW(LRFET,LIN$CON$REC,ENTRY$LENG,STATIS);
  559. IF NI$VALUE EQ 0 # IF NOT A GROUP DEFINITION #
  560. THEN
  561. BEGIN # PUT ENTRY IN NCB BUFFER #
  562. PACKWDS(P<LIN$CON$REC>,BC$BPOS,ENTRY$LENG,BC$WC);
  563. END
  564. ELSE # THIS ENTRY IS A GROUP #
  565. BEGIN
  566. ITEMP2 = LCPORT[0] + NI$VALUE - 1;
  567. FOR ITEMP=LCPORT[0] STEP 1 UNTIL ITEMP2
  568. DO # FOR EACH ITERATION #
  569. BEGIN # PUT ENTRY IN NCB BUFFER #
  570. LCPORT[0] = ITEMP; # SET PORT FIELD #
  571. PACKWDS(P<LIN$CON$REC>,BC$BPOS,ENTRY$LENG,BC$WC);
  572. END
  573. END
  574. END
  575. END
  576. END
  577. RETURN; # **** RETURN **** #
  578. END # BLDCNFG #
  579. CONTROL EJECT;
  580. PROC LINK$INFO;
  581. BEGIN
  582. *IF,DEF,IMS
  583. #
  584. ** LINK$INFO - MAKE ENTRIES FOR TRUNKS AND COUPLERS.
  585. *
  586. * D.K. ENDO 81/10/21
  587. *
  588. * THIS PROCEDURE ENTERS COUPLER AND TRUNK INFORMATION INTO THE
  589. * NODE, LINK, AND ROUTING TABLES.
  590. *
  591. * PROC LINK$INFO
  592. *
  593. * ENTRY NONE.
  594. *
  595. * EXIT NONE.
  596. *
  597. * METHOD
  598. *
  599. * FOR EACH ENTRY IN THE PHYSICAL LINK XREF TABLE:
  600. * SELECT CASE THAT APPLIES:
  601. * CASE 1(COUPLER):
  602. * IF THIS COUPLER BELONGS TO CURRENT NPU,
  603. * MAKE ENTRY IN N-TABLE FOR THIS COUPLER.
  604. * MAKE ENTRY IN L-TABLE FOR THIS COUPLER.
  605. * ENTER THE LINK ORDINAL FOR THIS COUPLER INTO R-TABLE.
  606. * DETERMINE ROUTING STATUS FOR THIS COUPLER.
  607. * CASE 2(TRUNK):
  608. * IF CURRENT NPU IS REFERENCED BY THIS TRUNK,
  609. * MAKE ENTRY IN L-TABLE FOR THIS TRUNK.
  610. * FOR EACH ENTRY IN THE LOGLINK XREF TABLE:
  611. * IF BOTH LOGLINK NPU NODE ID = BOTH TRUNK NODE ID,
  612. * IF ORIGIN NODE ID OF NPU = CURRENT NPU NODE ID,
  613. * THEN,
  614. * ENTER LINK ORDINAL IN R-TABLE ENTRY FOR TERM NODE.
  615. * OTHERWISE,
  616. * ENTER LINK ORDINAL IN R-TABLE ENTRY FOR HOST NODE.
  617. *
  618. #
  619. *ENDIF
  620. #
  621. **** PROC LINK$INFO - XREF LIST BEGINS.
  622. #
  623. XREF
  624. BEGIN
  625. PROC SSTATS; # ALLOCATES TABLE SPACE ON REQUEST #
  626. END
  627. #
  628. ****
  629. #
  630. DEF LKT$ST$ONE # 1 #; # LINK TABLE STATUS -- DISABLED #
  631. DEF LKT$ST$TWO # 2 #; # LINK TABLE STATUS -- ENABLED, NO LOAD #
  632. DEF LKT$TYP$TRNK # 1 #;# LINK TABLE TYPE -- INDICATES A TRUNK #
  633. ITEM I; # SCRATCH ITEM #
  634. ITEM J; # SCRATCH ITEM #
  635. ITEM RS$POS; # POINTER TO CURRENT ROUTING STAT POSITION#
  636. SWITCH LINKJUMP COUPLER,
  637. TRUNK;
  638. # LINK$INFO CODE BEGINS HERE #
  639. # #
  640. RS$POS = 2; # POINT TO 2ND ROUTING STATUS POSITION #
  641. FOR I=1 STEP 1 UNTIL PLWC[0]
  642. DO # FOR EACH ENTRY IN THE PHYSICAL LINK TAB #
  643. BEGIN
  644. IF LKT$LENG LQ LKT$ENT[0] + 1
  645. THEN # NEED TO ALLOCATE MORE TABLE SPACE #
  646. BEGIN
  647. SSTATS(P<LINK$TABLE>,5);
  648. END
  649. GOTO LINKJUMP[PLTYPE[I]]; # JUMP TO APPROPRIATE PARAGRAPH #
  650. COUPLER:
  651. IF PLNID1[I] EQ NPNID[CRNT$NPU]
  652. THEN # IF CRNT NPU SUPPORTS THIS COUP#
  653. BEGIN
  654. NDT$ENT[0] = NDT$ENT[0] + 1; # MAKE ENTRY IN L-TABL#
  655. NDT$NID[NDT$ENT[0]] = PLHNID[I];
  656. LKT$ENT[0] = LKT$ENT[0] + 1; # MAKE ENTRY IN N-TABL#
  657. LKT$ADD[LKT$ENT[0]] = PLLOC[I] + 1;
  658. RT$LO[PLHNID[I]] = LKT$ENT[0]; # ENTER LO IN R-TABLE #
  659. B<RS$POS,2>RT$RS[PLHNID[I]] = RT$RS$TWO;
  660. FOR J=1 STEP 1 UNTIL LLWC[0]
  661. DO # DETERMINE ROUTING STATUS BY #
  662. BEGIN # GOING THRU LOGLINK XREF #
  663. IF LLHNID1[J] EQ PLHNID[I]
  664. THEN # HOST NODE 1 MATCHES CRNT COUP #
  665. BEGIN
  666. IF LLST[J] # IF LOGLINK IS DISABLE #
  667. THEN
  668. BEGIN # SET CORRESPONDING ROUTING STAT#
  669. B<RS$POS,2>RT$RS[LLHNID2[J]] = RT$RS$ONE;
  670. END
  671. ELSE # LOGLINK IS ENABLED #
  672. BEGIN # SET CORRESPONDING ROUTING STAT#
  673. B<RS$POS,2>RT$RS[LLHNID2[J]] = RT$RS$ZERO;
  674. END
  675. END
  676. ELSE # HOST NODE 1 DOES NOT MATCH CRNT COUPLER #
  677. BEGIN
  678. IF LLHNID2[J] EQ PLHNID[I]
  679. THEN # HOST NODE 2 MATCHES CRNT COUP #
  680. BEGIN
  681. IF LLST[J] # IF LOGLINK IS DISABLED #
  682. THEN
  683. BEGIN # SET CORRESPONDING ROUTING STAT#
  684. B<RS$POS,2>RT$RS[LLHNID1[J]] = RT$RS$ONE;
  685. END
  686. ELSE # LOGLINK IS ENABLED #
  687. BEGIN # SET CORRESPONDING ROUTING STAT#
  688. B<RS$POS,2>RT$RS[LLHNID1[J]] = RT$RS$ZERO;
  689. END
  690. END
  691. END
  692. END
  693. RS$POS = RS$POS + 2; # POINT TO NEXT ROUTING STATUS #
  694. END # POSITION #
  695. TEST I;
  696. TRUNK:
  697. IF PLNID1[I] EQ NPNID[CRNT$NPU] OR
  698. PLNID2[I] EQ NPNID[CRNT$NPU]
  699. THEN # IF CRNT NPU SUPPORTS THIS TRNK#
  700. BEGIN # MAKE TRUNK ENTRY IN L-TABLE #
  701. LKT$ENT[0] = LKT$ENT[0] + 1;
  702. LKT$FRAME[LKT$ENT[0]] = PLFRAME[I] ; # ASSIGN FRAME CODE #
  703. LKT$TYP[LKT$ENT[0]] = LKT$TYP$TRNK;
  704. IF PLNID1[I] EQ NPNID[CRNT$NPU]
  705. THEN # IF CRNT NPU IS NODE ID 1 #
  706. BEGIN
  707. LKT$ADD[LKT$ENT[0]] = PLP1[I]; # PUT PORT NUM IN ENTRY #
  708. RT$LO[PLNID2[I]] = LKT$ENT[0]; # PUT LINK ORD IN ROUT TBL#
  709. IF PLST[I] # IF TRUNK IS DISABLED #
  710. THEN
  711. BEGIN
  712. LKT$ST[LKT$ENT[0]] = LKT$ST$ONE; # ENTER STATUS #
  713. END
  714. ELSE # TRUNK IS ENABLED #
  715. BEGIN
  716. IF PLNLD2[I] # IF NOLOAD2 IS SET #
  717. THEN
  718. BEGIN
  719. LKT$ST[LKT$ENT[0]] = LKT$ST$TWO; # ENTER STATUS #
  720. END
  721. END
  722. END
  723. ELSE # CRNT NPU IS NODE ID 2 #
  724. BEGIN
  725. LKT$ADD[LKT$ENT[0]] = PLP2[I]; # PUT PORT NUM IN ENTRY #
  726. RT$LO[PLNID1[I]] = LKT$ENT[0]; # PUT LINK ORD IN ROUT TBL#
  727. IF PLST[I] # IF TRUNK IS DISABLED #
  728. THEN
  729. BEGIN
  730. LKT$ST[LKT$ENT[0]] = LKT$ST$ONE; # ENTER STATUS #
  731. END
  732. ELSE # TRUNK IS ENABLED #
  733. BEGIN
  734. IF PLNLD1[I] # IF NOLOAD1 IS SET #
  735. THEN
  736. BEGIN
  737. LKT$ST[LKT$ENT[0]] = LKT$ST$TWO; # ENTER STATUS #
  738.  
  739. END
  740. END
  741. END
  742. FOR J=1 STEP 1 UNTIL LLWC[0]
  743. DO # ENTER LINK ORDINAL IN R-TABLE #
  744. BEGIN # BY GOING THRU LOGLINK XREF #
  745. IF (LLNID1[J] EQ PLNID1[I] AND LLNID2[J] EQ PLNID2[I]) OR
  746. (LLNID2[J] EQ PLNID1[I] AND LLNID1[J] EQ PLNID2[I])
  747. THEN
  748. BEGIN
  749. IF LLNID1[J] EQ NPNID[CRNT$NPU]
  750. THEN # IF ORIGIN NODE ID OF NPU #
  751. BEGIN # MATCHES CRNT NPU NODE ID #
  752. RT$LO[LLHNID2[J]] = LKT$ENT[0];
  753. END # ENTER LO IN T-NODE ID ENTRY #
  754. ELSE # ORIGIN AND CRNT NPU NODE ID DO NOT MATCH#
  755. BEGIN # ENTER LO IN HOST NODE ID ENTRY#
  756. RT$LO[LLHNID1[J]] = LKT$ENT[0];
  757. END
  758. END
  759. END
  760. END
  761. END
  762. RETURN; # **** RETURN **** #
  763. END # LINK$INFO #
  764. CONTROL EJECT;
  765. PROC NCBINIT;
  766. BEGIN
  767. *IF,DEF,IMS
  768. #
  769. ** NCBINIT - NCB INITIALIZATION.
  770. *
  771. * D.K. ENDO 81/10/22
  772. *
  773. * THIS PROCEDURE ALLOCATES AND INITIALIZES TABLES FOR BUILDING NCB.
  774. *
  775. * PROC NCBINIT
  776. *
  777. * ENTRY NONE.
  778. *
  779. * EXIT NONE.
  780. *
  781. * METHOD
  782. *
  783. * POINT NCF FET TO CIO BUFFER.
  784. * INITIALIZE VERSION TABLE.
  785. * CLEAR NPU INFO ENTRY.
  786. * INITIALIZE NODE TABLE.
  787. * ALLOCATE AND INITIALIZE LINK TABLE.
  788. * SORT THE PHYSICAL LINK TABLE.
  789. * DETERMINE THE MAXIMUM NODE I.D. USED.
  790. * ALLOCATE AND INITIALIZE ROUTING TABLE (SIZE = MAX NODE I.D.).
  791. * ALLOCATE AND INITIALIZE SUPERVISOR TABLE.
  792. * ALLOCATE AND INITIALIZE HOST TABLE.
  793. * ALLOCATE BUFFER FOR PACKING NCB IN.
  794. *
  795. #
  796. *ENDIF
  797. #
  798. **** PROC NCBINIT - XREF LIST BEGINS.
  799. #
  800. XREF
  801. BEGIN
  802. PROC SSTATS; # ALLOCATES TABLE SPACE ON REQUEST #
  803. END
  804. #
  805. ****
  806. #
  807. ITEM I; # SCRATCH ITEM #
  808. ITEM MAX$NID; # HIGHEST NODE I.D. USED #
  809. DEF COUP$TYPE # 0 #; # VALUE IN PLINK TBL INDICATING A COUPLER #
  810. DEF HT$ID # O"110" #; # HOST TABLE IDENTIFIER -- ASCII -H- #
  811. DEF LKT$ID # O"114" #; # LINK TABLE IDENTIFIER -- ASCII -L- #
  812. DEF NDT$ID # O"116" #; # NODE TABLE IDENTIFIER -- ASCII -N- #
  813. DEF RT$ID # O"122" #; # ROUTING TABLE IDENTIFIER -- ASCII -R- #
  814. DEF ST$ID # O"123" #; # SUPERVISORY TABLE IDENT -- ASCII -S- #
  815. DEF RT$TYP$TNODE # 1 #;# ROUTING TABLE TYPE FOR TERMINAL NODE #
  816. # NCBINIT CODE BEGINS HERE #
  817. # #
  818. NCFFIRST[0] = LOC(NCFWB[0]); # POINT NCF FET TO BUFFER #
  819. NCFIN[0] = LOC(NCFWB[0]);
  820. NCFOUT[0] = LOC(NCFWB[0]);
  821. NCFLIMIT[0] = LOC(NCFWB[0]) + NFBFLNGTH + 1;
  822. # INITIALIZE NPU INFORMATION ENTRY #
  823. NIT$WRD[0] = 0; # CLEAR ENTRY #
  824. # INITIALIZE NODE TABLE #
  825. FOR I=0 STEP 1 UNTIL MXNDT
  826. DO
  827. BEGIN
  828. NDT$WRD[I] = 0; # CLEAR NODE TABLE #
  829. END
  830. NDTNAME[0] = NDT$ID; # ENTER TABLE IDENTIFIER #
  831. # INITIALIZE LINK TABLE #
  832. SSTATS(P<LINK$TABLE>,MXLKT); # ALLOCATE SPACE FOR LINK TABLE#
  833. FOR I=0 STEP 1 UNTIL MXLKT
  834. DO
  835. BEGIN
  836. LKTWORD[I] = 0; # CLEAR TABLE #
  837. END
  838. LKTNAME[0] = LKT$ID; # ENTER TABLE IDENTIFIER #
  839. # INITIALIZE ROUTING TABLE #
  840. MAX$NID = 0; # CLEAR MAXIMUM NODE I.D. #
  841. FOR I=1 STEP 1 UNTIL NPWC[0]
  842. DO # CHECK NPU XREF FOR MAX NODE I.D. #
  843. BEGIN
  844. IF NPNID[I] GR MAX$NID
  845. THEN
  846. BEGIN
  847. MAX$NID = NPNID[I];
  848. END
  849. END
  850. # SORT PHYSICAL LINK XREF TABLE #
  851. NDLSST(PLINK$XREF,2,0,42,2,PLWC[0]/2);
  852.  
  853. FOR I=1 STEP 1 UNTIL PLWC[0]
  854. DO # CHECK PHYSICAL LINK XREF FOR MAX NODE ID#
  855. BEGIN
  856. IF PLTYPE[I] EQ COUP$TYPE
  857. THEN
  858. BEGIN
  859. IF PLHNID[I] GR MAX$NID
  860. THEN
  861. BEGIN
  862. MAX$NID = PLHNID[I];
  863. END
  864. END
  865. END # ALLOC SPACE FOR ROUTING TABLE #
  866. SSTATS(P<ROUTING$TABL>,MAX$NID + 1);
  867. FOR I=0 STEP 1 UNTIL MAX$NID
  868. DO
  869. BEGIN
  870. RTWORD[I] = 0; # CLEAR TABLE #
  871. END
  872. RTNAME[0] = RT$ID; # ENTER ROUTING TABLE IDENTIFIER #
  873. RT$ENT[0] = MAX$NID; # SET ENTRY COUNT #
  874. FOR I=1 STEP 1 UNTIL NPWC[0]
  875. DO # IDENTIFY TERMINAL NODES IN TABLE #
  876. BEGIN
  877. RT$TYP[NPNID[I]] = RT$TYP$TNODE;
  878. END
  879. # INITIALIZE SUPERVISOR TABLE #
  880. SSTATS(P<SUP$TABLE>,MXSUPT); # ALLOCATE SPACE FOR TABLE #
  881. FOR I=0 STEP 1 UNTIL MXSUPT
  882. DO
  883. BEGIN
  884. ST$WRD[0] = 0; # CLEAR TABLE #
  885. END
  886. ST$NAM[0] = ST$ID; # ENTER TABLE IDENTIFIER #
  887. # INITIALIZE HOST TABLE #
  888. SSTATS(P<HOST$TABLE>,MXHT); # ALLOCATE SPACE FOR TABLE #
  889. FOR I=0 STEP 1 UNTIL MXHT
  890. DO
  891. BEGIN
  892. HTWORD[I] = 0; # CLEAR TABLE #
  893. END
  894. HTNAME[0] = HT$ID; # ENTER TABLE IDENTIFIER #
  895. # ALLOC SPACE FOR LINE CONFIG REC BUFFER #
  896. IF LC$LENG LS MXLC
  897. THEN # IF NOT ENOUGH SPACE FOR ONE ENTRY #
  898. BEGIN
  899. SSTATS(P<LIN$CON$REC>,MXLC - LC$LENG);
  900. END
  901. # INITIALIZE NCB BUFFER #
  902. SSTATS(P<NCB$BUFFER>,MXNCB); # ALLOCATE SPACE FOR BUFFER #
  903. # OTHER INITIALIZATION #
  904. CRNT$SUP = 1; # INITIALIZE POINTER INTO SUPERVISOR TABLE#
  905. RETURN; # **** RETURN **** #
  906. END # NCBINIT #
  907. CONTROL EJECT;
  908. PROC NCBTERM;
  909. BEGIN
  910. *IF,DEF,IMS
  911. #
  912. ** NCBTERM - NCB TERMINATION
  913. *
  914. * D.K. ENDO 81/10/22
  915. *
  916. * THIS PROCEDURE PACKS THE NCB AND CALLS LFG PROCEDURES TO FORMAT
  917. * IT INTO NPU DATA SERVICE MESSAGES.
  918. *
  919. * PROC NCBTERM
  920. *
  921. * ENTRY NONE.
  922. *
  923. * EXIT NONE.
  924. *
  925. * METHOD
  926. *
  927. * SORT HOST TABLE.
  928. * PACK TABLES INTO NCB BUFFER.
  929. * CALCULATE THE NUMBER OF PACKETS THE NCB IS.(PACKET = 105 NPU WRDS)
  930. * FOR EACH PACKET:
  931. * CALCULATE THE CHECK SUM.
  932. * MOVE WORDS INTO SM BUFFER.
  933. * CREATE SM HEADER AND WRITE TO NCF.
  934. *
  935. #
  936. *ENDIF
  937. #
  938. **** PROC NCBTERM - XREF LIST BEGINS.
  939. #
  940. XREF
  941. BEGIN
  942. PROC ABORT; # CAUSES NDLP TO ABORT #
  943. PROC LFGCKSM; # CALCULATE CHECK SUM #
  944. PROC LFGHDRW; # CREATES HEADER AND WRITES SM TO FILE #
  945. PROC LFGMOVW; # MOVES WORD INTO SM BUFFER #
  946. PROC MESSAGE; # SENDS MESSAGE TO DAYFILE #
  947. END
  948. #
  949. ****
  950. #
  951. XDEF
  952. BEGIN
  953. BASED ARRAY WFET [0:0] S(5);
  954. BEGIN # BASED ARRAY USED TO POINT TO NCF FET #
  955. ITEM WFET$WRD (0,0,60);
  956. END
  957. BASED ARRAY OUTPUT [0:0] S(5);
  958. BEGIN # BASED ARRAY USED TO POINT TO OUTPUT FET #
  959. ITEM OUTPUT$WRD (0,0,60);
  960. END
  961. END
  962. DEF DEFBC$ # 64 #; # DEFAULT BATCH COUNT VALUE #
  963. DEF BPOS # 36 #; # BIT POSITION COUNTED FROM LEFT FOR SHIFT#
  964. DEF NCF$MEMINC # 20 #; # NCF$INDEX DYNMC MEMORY ALLOC INCREMENTS #
  965. DEF PSIZE16 # 105 #; # PACKET SIZE IN 16 BIT WORDS #
  966. DEF PSIZE60 # 28 #; # PACKET SIZE IN 60 BIT WORDS #
  967. DEF WPOS # 2 #; # WORD POSITION FOR SHIFTING #
  968. ITEM BIT$POS; # CURRENT BIT POSITION FOR PACKING NCB #
  969. ITEM CKSUM; # CHECK SUM VALUE #
  970. ITEM CRNT$WORD; # POINTER TO NEXT PACKET IN NCB BUFFER #
  971. ITEM DUMMY; # SCRATCH ITEM #
  972. ITEM EOP B; # END OF PARTITION FLAG #
  973. ITEM I; # SCRATCH ITEM #
  974. ITEM IW60; # NUMBER OF 60 BIT WORDS MOVED #
  975. ITEM J; # SCRATCH ITEM #
  976. ITEM LPAK; # NUMBER OF 16 BIT WORDS IN LAST PACKET #
  977. ITEM NEW$P B; # NEW PARTITION FLAG #
  978. ITEM NPAK; # NUMBER OF PACKETS #
  979. ITEM NWDS16; # NUMBER OF 16 BIT WORDS #
  980. ITEM SUCCESS B; # STATUS FLAG RETURNED BY LFGHDRW #
  981. ITEM WC16; # NUMBER OF 16 BIT WORDS IN NCB #
  982. ARRAY INDEX$ENTRY [0:0] S(1);
  983. BEGIN
  984. ITEM IE$TYPE U(0,0,12) = [O"1603"]; # RECORD TYPE #
  985. ITEM IENID U(0,12,8); # NPU NODE I.D. #
  986. ITEM IEWC U(0,20,16); # NCB 16-BIT WORD CNT #
  987. ITEM IEZFIL U(0,36,24) = [0]; # ZERO FILL WORD #
  988. ITEM IEWORD (0,0,60);
  989. END
  990. ARRAY NCBERR [0:0] S(3);
  991. BEGIN
  992. ITEM NCBMSG C(0,0,20) = [" NCB CREATION ERROR."];
  993. ITEM NCBZBYT (2,0,60) = [0];
  994. END
  995. ARRAY RECORD$HDR [0:0] S(1);
  996. BEGIN
  997. ITEM RHNAME C(0,0,7) = ["NCB"]; # RECORD NAME #
  998. ITEM RHZFIL U(0,42,18) = [0]; # ZERO FILL WORD #
  999. ITEM RHWORD (0,0,60);
  1000. END
  1001. # #
  1002. # NCBTERM CODE BEGINS HERE #
  1003. # #
  1004. WC16 = 0;
  1005. BIT$POS = 0;
  1006. NCBWC[0] = 1;
  1007. # PACK CHECK SUM ENTRY INTO NCB BUFFER #
  1008. I = 0; # SAME AS CKSM$ENT #
  1009. PACKWDS(LOC(I),BIT$POS,1,WC16);
  1010. # PACK NPU INFORMATION INTO NCB BUFFER #
  1011. PACKWDS(LOC(NPU$INFO),BIT$POS,1,WC16);
  1012. # PACK NODE TABLE INTO NCB BUFFER #
  1013. PACKWDS(LOC(NODE$TABLE),BIT$POS,NDT$ENT[0]+1,WC16);
  1014. # PACK LINK TABLE INTO NCB BUFFER #
  1015. PACKWDS(P<LINK$TABLE>,BIT$POS,LKT$ENT[0] + 1,WC16);
  1016. # PACK ROUTING TABLE INTO NCB BUFFER #
  1017. PACKWDS(P<ROUTING$TABL>,BIT$POS,RT$ENT[0]+1,WC16);
  1018. # SORT HOST TABLE #
  1019. FRST$WRD = 1; # OFFSET OF FIRST WORD TO BE SORTED #
  1020. BBP = 0; # BEGINNING BIT POSITION OF KEY #
  1021. MASK = 42; # LENGTH IN BITS OF KEY #
  1022. NDLSST(HOST$TABLE,FRST$WRD,BBP,MASK,HTENTSZ,HT$ENT[0]);
  1023. # SORT HOST TABLE #
  1024. # PACK HOST TABLE INTO NCB BUFFER #
  1025. NWDS16 = (HT$ENT[0] * HTENTSZ) + 1;
  1026. PACKWDS(P<HOST$TABLE>,BIT$POS,NWDS16,WC16);
  1027. # PACK SUPERVISOR TABLE INTO NCB BUFFER #
  1028. PACKWDS(P<SUP$TABLE>,BIT$POS,ST$ENT[0] + 1,WC16);
  1029. # BUILD LINE CONFIG TABLE AND PACK INTO BUFF#
  1030. BLDCNFG(BIT$POS,WC16);
  1031. # PACK END INDICATOR INTO NCB BUFFER #
  1032. PACKWDS(LOC(END$IND),BIT$POS,1,WC16);
  1033. # CALCULATE REST OF CHECK SUM AND PUT IN NCB#
  1034.  
  1035. # CHECK SUM NCB AND ADD TO TOTAL #
  1036. LFGCKSM(LOC(NCBWORD[1]),43,WC16-1,CKSUM);
  1037. NPCKSM[CRNT$NPU] = NPCKSM[CRNT$NPU] + CKSUM;
  1038.  
  1039. # CHECK SUM NPU XREF ENTRY AND ADD TO TOTAL #
  1040. LFGCKSM(LOC(NPWORD[CRNT$NPU]),59,7,CKSUM);
  1041. NPCKSM[CRNT$NPU] = NPCKSM[CRNT$NPU] + CKSUM;
  1042.  
  1043. # CHECK SUM VERSION/LEVEL AND ADD TO TOTAL #
  1044. LFGCKSM(LOC(PT$PVER[0]),15,1,CKSUM);
  1045. NPCKSM[CRNT$NPU] = NPCKSM[CRNT$NPU] + CKSUM;
  1046.  
  1047. NPCSSB[CRNT$NPU] = TRUE; # SET CHECK SUM SIGN BIT #
  1048. B<0,16>NCBWORD[1] = NPCKSM[CRNT$NPU]; # PUT CHECK SUM IN NCB #
  1049.  
  1050. # FORMAT NCB INTO SM AND WRITE TO NCF #
  1051. NPAK = WC16 / PSIZE16; # CALCULATE NUMBER OF PACKETS #
  1052. LPAK = WC16 - (NPAK * PSIZE16); # CALCULATE REMAINDER #
  1053. IF LPAK NQ 0 # IF REMAINDER IS NOT ZERO #
  1054. THEN
  1055. BEGIN
  1056. NPAK = NPAK + 1; # INCREMENT NUMBER OF PACKETS #
  1057. END
  1058. CRNT$WORD = 1; # SET POINTER TO 1ST WORD OF BUF#
  1059. NEW$P = TRUE; # SET NEW PARTITION FLAG #
  1060. NWDS16 = PSIZE16; # SET NUMBER OF WORDS IN PACKET #
  1061. IENID[0] = NPNID[CRNT$NPU]; # PUT NPU NODE ID IN INDEX WORD #
  1062. IEWC[0] = WC16; # PUT WORD COUNT IN INDEX WORD #
  1063. J = 0; # CLEAR SCRATCH ITEM FOR BEGINNING ADDR #
  1064. P<WFET> = LOC(NCFFET); # POINT ARRAY TO NCF FET #
  1065. P<OUTPUT> = LOC(OUTFET); # POINT ARRAY TO OUTPUT FET #
  1066. EOP = FALSE; # CLEAR END OF PARTITION FLAG #
  1067. IF NCF$LENG LQ (NCFWC[0]+1)*NCFENTSZ
  1068. THEN # ALLOCATE MORE MEMORY FOR NCF #
  1069. BEGIN # INDEX IF NEEDED #
  1070. SSTATS(P<NCF$INDEX>,NCF$MEMINC);
  1071. END
  1072. FOR I=1 STEP 1 UNTIL NPAK
  1073. DO # FOR EACH PACKET #
  1074. BEGIN
  1075. IF I EQ NPAK # IF THIS IS LAST PACKET #
  1076. THEN
  1077. BEGIN
  1078. EOP = TRUE; # SET END OF PARTITION FLAG #
  1079. IF LPAK NQ 0 # IF LAST PACKET IS SMALLER THAN OTHER #
  1080. THEN # PACKETS #
  1081. BEGIN
  1082. NWDS16 = LPAK; # SET NUMBER OF WORDS TO PACKET SIZE #
  1083. END
  1084. END
  1085. # CALCULATE CHECK SUM #
  1086. LFGCKSM(LOC(NCBWORD[CRNT$WORD]),59,NWDS16,CKSUM);
  1087. # MOVE WORDS INTO SM BUFFER #
  1088. LFGMOVW(CRNT$WORD,WPOS,BPOS,NWDS16,IW60,CKSUM,NCB$BUFFER);
  1089. # CREATE HEADER AND WRITE TO NCF #
  1090. LFGHDRW(IEWORD[0],RHWORD[0],IW60,NWDS16,NEW$P,TRUE,EOP,J,DUMMY,
  1091. SUCCESS,0,0,0,DEFBC$,NCF$INDEX);
  1092. IF NOT SUCCESS
  1093. THEN # IF NCB WRITE WAS NOT SUCCESSFUL #
  1094. BEGIN
  1095. MESSAGE(NCBERR,0); # PUT MESSAGE INTO DAYFILE #
  1096. ABORT; # ABORT JOB #
  1097. END
  1098. CRNT$WORD = CRNT$WORD + PSIZE60; # MOVE POINTER TO NEXT PACKET #
  1099. END
  1100. RETURN; # **** RETURN **** #
  1101. END # NCBTERM #
  1102. CONTROL EJECT;
  1103. PROC NPUINFO;
  1104. BEGIN
  1105. *IF,DEF,IMS
  1106. #
  1107. ** NPUINFO - NPU INFORMATION.
  1108. *
  1109. * D.K. ENDO 81/10/22
  1110. *
  1111. * THIS PROCEDURE ENTERS NPU INFORMATION INTO THE NODE TABLE AND NPU
  1112. * INFORMATION ENTRY. IT ALSO SETS THE ROUTING STATUS AND BUILDS THE
  1113. * HOST TABLE.
  1114. *
  1115. * PROC NPUINFO
  1116. *
  1117. * ENTRY NONE.
  1118. *
  1119. * EXIT NONE.
  1120. *
  1121. * METHOD
  1122. *
  1123. * CLEAR THE NODE, LINK, HOST AND SUPERVISOR TABLES.
  1124. * SET ALL THE ROUTING STATUS FIELDS TO -LOCKED-.
  1125. * MAKE OP ENTRY IN NPU INFORMATION ENTRY.
  1126. * MAKE ENTRY IN NODE TABLE FOR CRNT NPU.
  1127. * SET ROUTING STATUS FOR CRNT NPU TO -ROUTING TO SELF-.
  1128. * FOR EACH ENTRY IN THE LOGLINK XREF TABLE:
  1129. * IF CURRENT NPU NODE ID = TERMINAL NODE ID OF THIS LOGLINK,
  1130. * IF LOGLINK IS DISABLED,
  1131. * THEN,
  1132. * SET THE STATUS CORRESPONDING TO THE HOST NODE TO -DISABLED-.
  1133. * OTHERWISE,
  1134. * SET THE STATUS CORRESPONDING TO THE HOST NODE TO -ENABLED-.
  1135. * MAKE ENTRY IN HOST TABLE FOR THIS HOST.
  1136. *
  1137. #
  1138. *ENDIF
  1139. #
  1140. **** PROC NPUINFO - XREF LIST BEGINS.
  1141. #
  1142. XREF
  1143. BEGIN
  1144. PROC SSTATS; # ALLOCATES MORE TABLE SPACE ON REQUEST #
  1145. END
  1146. #
  1147. ****
  1148. #
  1149. DEF NDT$TNODE # 1 #; # VALUE INDICATING TERMINAL NODE #
  1150. ITEM HT$PNTR; # POINTER INTO HOST TABLE #
  1151. ITEM I; # SCRATCH ITEM #
  1152. ITEM J; # SCRATCH ITEM #
  1153. DEF MXAT # 45 #;
  1154. ARRAY ASCII$TABLE [0:MXAT] S(1); # TABLE TO CONVERT DISPLAY CODE #
  1155. BEGIN # TO ASCII #
  1156. ITEM A$CHAR (0,0,60) = [O"72", # COLON #
  1157. O"101", # A #
  1158. O"102", # B #
  1159. O"103", # C #
  1160. O"104", # D #
  1161. O"105", # E #
  1162. O"106", # F #
  1163. O"107", # G #
  1164. O"110", # H #
  1165. O"111", # I #
  1166. O"112", # J #
  1167. O"113", # K #
  1168. O"114", # L #
  1169. O"115", # M #
  1170. O"116", # N #
  1171. O"117", # O #
  1172. O"120", # P #
  1173. O"121", # Q #
  1174. O"122", # R #
  1175. O"123", # S #
  1176. O"124", # T #
  1177. O"125", # U #
  1178. O"126", # V #
  1179. O"127", # W #
  1180. O"130", # X #
  1181. O"131", # Y #
  1182. O"132", # Z #
  1183. O"060", # 0 #
  1184. O"061", # 1 #
  1185. O"062", # 2 #
  1186. O"063", # 3 #
  1187. O"064", # 4 #
  1188. O"065", # 5 #
  1189. O"066", # 6 #
  1190. O"067", # 7 #
  1191. O"070", # 8 #
  1192. O"071", # 9 #
  1193. ,,,,,,,, # +,-,*,/,(,>,$,= #
  1194. O"040" # BLANK #
  1195. ];
  1196. END
  1197. CONTROL EJECT;
  1198. # #
  1199. # NPUINFO CODE BEGINS HERE #
  1200. # #
  1201. # CLEAR AND INITIALIZE TABLES #
  1202. NIT$WRD[0] = 0; # CLEAR NPU INFO ENTRY #
  1203. NDT$ENT[0] = 0; # CLEAR NODE TABLE ENTRY COUNT #
  1204. FOR I=1 STEP 1 UNTIL MXNDT
  1205. DO
  1206. BEGIN
  1207. NDT$WRD[I] = 0; # CLEAR NODE TABLE #
  1208. END
  1209. LKT$ENT[0] = 0; # CLEAR LINK TABLE ENTRY COUNT #
  1210. FOR I=1 STEP 1 UNTIL LKT$LENG-1
  1211. DO
  1212. BEGIN
  1213. LKTWORD[I] = 0; # CLEAR ENTRY COUNT #
  1214. END
  1215. FOR I=1 STEP 1 UNTIL RT$ENT[0]
  1216. DO
  1217. BEGIN
  1218. RT$RS[I] = O"77"; # SET ROUTING STATUS TO LOCKED #
  1219. RT$LO[I] = 0; # CLEAR POINTERS TO LINK TABLE #
  1220. END
  1221. HT$ENT[0] = 0; # CLEAR HOST TABLE ENTRY COUNT #
  1222. FOR I=1 STEP 1 UNTIL HT$LENG - 1
  1223. DO
  1224. BEGIN
  1225. HTWORD[I] = 0; # CLEAR HOST TABLE #
  1226. END
  1227. HT$PNTR = 1; # INITIALIZE CRNT POINTER INTO TABLE #
  1228. ST$ENT[0] = 0; # CLEAR SUPERVISOR TABLE ENTRY COUNT #
  1229. FOR I=1 STEP 1 UNTIL ST$LENG - 1
  1230. DO
  1231. BEGIN
  1232. ST$WRD[I] = 0; # CLEAR SUPERVISOR TABLE #
  1233. END
  1234. # ENTER NPU INFORMATION #
  1235. NIT$DP[0] = NPDMP[CRNT$NPU]; # SET DUMP FLAG #
  1236. NIT$OP[0] = NPOPGO[CRNT$NPU]; # SET OPERATOR GO STATUS #
  1237. NDT$ENT[0] = 1; # SET NODE TABLE ENTRY COUNT #
  1238. NDT$TYP[NDT$ENT[0]] = NDT$TNODE; # SET 1ST ENTRY TO TERMINAL NODE#
  1239. NDT$NID[NDT$ENT[0]] = NPNID[CRNT$NPU]; # SET NODE I.D. #
  1240. B<0,2>RT$RS[NPNID[CRNT$NPU]] = RT$RS$TWO; # SET STATUS #
  1241. FOR I=1 STEP 1 UNTIL LLWC[0]
  1242. DO # FOR EACH ENTRY IN THE LOGLINK #
  1243. BEGIN # XREF TABLE #
  1244. IF LLHNID2[I] EQ NPNID[CRNT$NPU]
  1245. THEN # IF LOGLINK IS TO CRNT NPU #
  1246. BEGIN # SET ROUTING STATUS #
  1247. IF LLST[I]
  1248. THEN
  1249. BEGIN # SET STATUS TO DISABLED #
  1250. B<0,2>RT$RS[LLHNID1[I]] = 1;
  1251. END
  1252. ELSE
  1253. BEGIN # SET STATUS TO ENABLED #
  1254. B<0,2>RT$RS[LLHNID1[I]] = 0;
  1255. END
  1256. HT$ENT[0] = HT$ENT[0] + 1; # INCREMENT HOST TABLE ENTRY CNT#
  1257. IF HT$ENT[0] * HTENTSZ GQ HT$LENG
  1258. THEN # IF NEED MORE TABLE SPACE #
  1259. BEGIN
  1260. SSTATS(P<HOST$TABLE>,HTENTSZ); # ALLOCATE MORE SPACE #
  1261. END
  1262. HT$SORT[HT$PNTR] = LLHNAME[I]; # ENTER HOST NAME TO BE #
  1263. # SORTED #
  1264. HT$RO[HT$PNTR] = LLHNID1[I]; # ENTER ROUTING ORDINAL #
  1265. HT$CH2[HT$PNTR] = A$CHAR[C<0,1>LLHNAME[I]];
  1266. HT$PNTR = HT$PNTR + 1;
  1267. FOR J=1 STEP 2 UNTIL 5
  1268. DO # CONVERT HOST NAME TO ASCII AND PUT IN #
  1269. BEGIN # TABLE #
  1270. HT$CH1[HT$PNTR] = A$CHAR[C<J,1>LLHNAME[I]];
  1271. HT$CH2[HT$PNTR] = A$CHAR[C<J+1,1>LLHNAME[I]];
  1272. HT$PNTR = HT$PNTR + 1;
  1273. END
  1274. END
  1275. END
  1276. RETURN; # **** RETURN **** #
  1277. END # NPUINFO #
  1278. CONTROL EJECT;
  1279. PROC PACKWDS(TABLE,BIT,WC,TOTALWC);
  1280. BEGIN
  1281. *IF,DEF,IMS
  1282. #
  1283. ** PACKWDS - PACK WORDS INTO NCB BUFFER.
  1284. *
  1285. * D.K. ENDO 81/10/22
  1286. *
  1287. * THIS PROCEDURE, GIVEN A TABLE, PACKS THE TABLE INTO THE NCB
  1288. * BUFFER.
  1289. *
  1290. * PROC PACKWDS(TABLE,BIT,WC,TOTALWC)
  1291. *
  1292. * ENTRY TABLE = NCB TABLE TO BE PACKED.
  1293. * BIT = CURRENT BIT TO BEGIN PACKING WORDS.
  1294. * WC = TOTAL NUMBER OF NPU WORDS IN TABLE.
  1295. * TOTALWC = TOTAL NUMBER OF NPU WORDS PACKED SO FAR.
  1296. *
  1297. * EXIT TOTALWC = TOTAL NUMBER OF NPU WORDS INCLUDING TABLE
  1298. * JUST PACKED.
  1299. *
  1300. * METHOD
  1301. *
  1302. * FOR EACH NPU WORD:
  1303. * IT CAN FIT AT LEAST ONE MORE NPU INTO CRNT CP WORD,
  1304. * THEN,
  1305. * PACK NPU WORD.
  1306. * INCREMENT BIT POSITION.
  1307. * OTHERWISE,
  1308. * IF BIT POSITION POINTS TO END OF CP WORD,
  1309. * THEN,
  1310. * INCREMENT CP WORD COUNT.
  1311. * POINT BIT POSITION TO BEGINNING OF NEW WORD.
  1312. * PACK NPU WORD
  1313. * INCREMENT BIT POSITION
  1314. * OTHERWISE,
  1315. * CALCULATE REMAINING SPACE IN CP WORD
  1316. * PACK WHAT CAN FIT OF NPU WORD
  1317. * INCREMENT CP WORD COUNT
  1318. * POINT BIT POSITION TO BEGINNING OF NEW WORD.
  1319. * PACK REMAINDER OF NPU WORD
  1320. * RE-SET BIT POSITION.
  1321. *
  1322. #
  1323. *ENDIF
  1324. BASED ARRAY TABLE [1:1] S(1);
  1325. BEGIN
  1326. ITEM T$ENT U(0,44,16);
  1327. END
  1328. ITEM BIT; # CURRENT BIT POSITION #
  1329. ITEM WC; # WORD COUNT OF TABLE #
  1330. ITEM TOTALWC; # TOTAL WORD COUNT IN NCB #
  1331. # #
  1332. ITEM INDX; # INDEX FOR TABLE #
  1333. ITEM J; # SCRATCH ITEM #
  1334. ITEM K; # SCRATCH ITEM #
  1335. CONTROL EJECT;
  1336. # #
  1337. # PACKWDS CODE BEGINS HERE #
  1338. # #
  1339. FOR INDX=1 STEP 1 UNTIL WC
  1340. DO # FOR EACH ENTRY IN TABLE #
  1341. BEGIN
  1342. IF BIT LQ 44 # IF CAN FIT AT LEAST ONE MORE ENTRY #
  1343. THEN
  1344. BEGIN # PACK INTO NCB BUFFER #
  1345. B<BIT,16>NCBWORD[NCBWC[0]] = T$ENT[INDX];
  1346. BIT = BIT + 16; # INCREMENT BIT POSITION #
  1347. END
  1348. ELSE # CAN NOT FIT ONE ENTRY #
  1349. BEGIN
  1350. IF BIT EQ 60 # IF POINTER IS AT VERY END OF WORD #
  1351. THEN
  1352. BEGIN
  1353. BIT = 0; # RESET BIT POSITION TO BEGIN #
  1354. NCBWC[0] = NCBWC[0] + 1; # INCREMENT BUFFER WORD COUNT #
  1355. IF NCBWC[0] GQ NCB$LENG # IF LENGTH REACHES TABLE SPACE #
  1356. THEN
  1357. BEGIN
  1358. SSTATS(P<NCB$BUFFER>,50);
  1359. END
  1360. B<BIT,16>NCBWORD[NCBWC[0]] = T$ENT[INDX]; # PACK ENTRY #
  1361. BIT = 16; # RESET BIT POSITION #
  1362. END
  1363. ELSE # MUST DIVIDE ENTRY OVER TWO WORDS #
  1364. BEGIN
  1365. J = 60 - BIT; # CALCULATE REMAINDER OF WORD #
  1366. B<BIT,J>NCBWORD[NCBWC[0]] = B<0,J>T$ENT[INDX]; # PACK ENTRY#
  1367. NCBWC[0] = NCBWC[0] + 1; # INCREMENT NCB WORD COUNT #
  1368. IF NCBWC[0] GQ NCB$LENG # IF LENGTH REACHES TABLE SPACE #
  1369. THEN
  1370. BEGIN
  1371. SSTATS(P<NCB$BUFFER>,50);
  1372. END
  1373. BIT = 0; # RESET BIT POSITION #
  1374. K = 16 - J; # CALCULATE REMAINDER OF ENTRY #
  1375. B<BIT,K>NCBWORD[NCBWC[0]] = B<J,K>T$ENT[INDX]; # PACK ENTRY#
  1376. BIT = K; # RESET BIT POSITION #
  1377. END
  1378. END
  1379. END
  1380. TOTALWC = TOTALWC + WC; # INCREMENT TOTAL WORD COUNT #
  1381. RETURN; # **** RETURN **** #
  1382. END # PACKWDS #
  1383. CONTROL EJECT;
  1384. # #
  1385. # BLDNCB CODE BEGINS HERE #
  1386. # #
  1387. IF ERRCNT EQ 0 # IF NO FATAL ERRORS WERE DETECTED #
  1388. THEN
  1389. BEGIN # INITIALIZE TABLES AND TABLE HEADERS #
  1390. NCBINIT;
  1391. FOR CRNT$NPU=1 STEP 1 UNTIL NPWC[0]
  1392. DO
  1393. BEGIN
  1394. NPUINFO; # CLEAR TABLES AND ENTER NPU INFORMATION #
  1395. LINK$INFO; # ENTER PHYSICAL LINK INFORMATION #
  1396. FOR SUP$INDX=CRNT$SUP STEP 1 WHILE (SLTNID[SUP$INDX] EQ
  1397. NPNID[CRNT$NPU]) AND NOT
  1398. (SUP$INDX GR SLTWC[0])
  1399. DO # FOR EACH SUPERVISORY LINK FOR THIS NPU #
  1400. BEGIN
  1401. ST$ENT[0] = ST$ENT[0] + 1; # INCREMENT ENTRY COUNT #
  1402. IF ST$ENT[0] GR ST$LENG # IF NEED MORE TABLE SPACE, #
  1403. THEN # REQUEST FOR MORE #
  1404. BEGIN
  1405. SSTATS(P<SUP$TABLE>,5);
  1406. END
  1407. ST$TYP[ST$ENT] = SLTTYPE[SUP$INDX]; # ENTER TYPE #
  1408. ST$RO[ST$ENT] = SLTHNID[SUP$INDX]; # ENTER ROUTING ORD #
  1409. END
  1410. CRNT$SUP = SUP$INDX;
  1411. NCBTERM; # PACK TABLE, BUILD C-TABLE, FORMAT SM, #
  1412. END # WRITE TO NCF #
  1413. # RETURN TABLE SPACE #
  1414. SSTATS(P<LINK$TABLE>,-LKT$LENG);
  1415. SSTATS(P<ROUTING$TABL>,-RT$LENG);
  1416. SSTATS(P<SUP$TABLE>,-ST$LENG);
  1417. SSTATS(P<HOST$TABLE>,-HT$LENG);
  1418. SSTATS(P<NCB$BUFFER>,-NCB$LENG);
  1419. SSTATS(P<LIN$CON$REC>,-LC$LENG);
  1420. END
  1421. RETURN; # **** RETURN **** #
  1422. END # BLDNCB #
  1423. CONTROL EJECT;
  1424. # #
  1425. # NDLNFTM CODE BEGINS HERE #
  1426. # #
  1427. CHKTRUNK ; #CALLS PROC THAT CHECKS PORTS #
  1428. BLDNCB; # CALL PROC THAT BUILDS NCB-S #
  1429. # #
  1430. FRST$WRD = 2; # SET POINTER TO 1ST WORD TO BE SORTED #
  1431. BBP = 0; # SET BEGINNING BIT POSITION POINTER #
  1432. MASK = 42; # SET NUMBER OF BITS TO BE USED AS KEY #
  1433. # SORT NPU XREF TABLE AND WRITE TO NCF #
  1434. NDLSST(NPU$XREF,FRST$WRD,BBP,MASK,NPENTSZ,NPWC[0]); # SORT TABLE #
  1435. NPWC[0] = (NPWC[0] * NPENTSZ) + 1; # CALCULATE WORD COUNT #
  1436. LENGTH = NPWC[0]+1; # SAVE LENGTH OF TABLE #
  1437. NDLWNCF(TABLE"NX",P<NPU$XREF>,LENGTH); # WRITE NPU XREF TO NCF #
  1438. # SORT PHYS LINK XREF TBL AND WRITE TO NCF #
  1439. NDLSST(PLINK$XREF,FRST$WRD,BBP,MASK,PLENTSZ,PLWC[0]); #SORT TABLE#
  1440. PLWC[0] = (PLWC[0] * PLENTSZ) + 1; # CALCULATE WORD COUNT #
  1441. LENGTH = PLWC[0] + 1; # SAVE LENGTH OF TABLE #
  1442. NDLWNCF(TABLE"PH",P<PLINK$XREF>,LENGTH); #WRT PHYS LNK TBL TO NCF#
  1443. # SORT LOGLINK XREF TABLE AND WRITE TO NCF #
  1444. NDLSST(LOGLINK$XREF,FRST$WRD,BBP,MASK,LLENTSZ,LLWC[0]);
  1445. LLWC[0] = (LLWC[0] * LLENTSZ) + 1; # CALCULATE WORD COUNT #
  1446. LENGTH = LLWC[0] + 1; # SAVE LENGTH OF TABLE #
  1447. NDLWNCF(TABLE"LL",P<LOGLINK$XREF>,LENGTH); #WRITE LL XREF TO NCF#
  1448. # SORT LINE XREF TABLE AND WRITE TO NCF #
  1449. ENT$CNT = LCTWC[1] - 1; # CALCULATE ENTRY SIZE #
  1450. NDLSST(LINE$XREF,FRST$WRD,BBP,MASK,LCTENTSZ,ENT$CNT);
  1451. LENGTH = LCTWC[1] + 1; # SAVE LENGTH OF TABLE #
  1452. NDLWNCF(TABLE"LX",P<LINE$XREF>,LENGTH); # WRITE LINE XREF TO NCF#
  1453. # SORT DEVICE XREF TABLE AND WRITE TO NCF #
  1454. ENT$CNT = DCWC[1] - 1; # CALCULATE ENTRY COUNT #
  1455. NDLSST(DEVICE$XREF,FRST$WRD,BBP,MASK,DCENTSZ,ENT$CNT);
  1456. LENGTH = DCWC[1] + 1; # SAVE LENGTH OF TABLE #
  1457. NDLWNCF(TABLE"DX",P<DEVICE$XREF>,LENGTH); #WRITE DEV XREF TO NCF#
  1458. # SORT LINE RECORD INDEX AND WRITE TO NCF #
  1459. MASK = 24; #CHANGE MASK, FRST$WRD AND BBP REMAIN SAME#
  1460. ENT$CNT = LIWC[1] - 1; # CALCULATE ENTRY COUNT #
  1461. NDLSST(LIN$REC$INDX,FRST$WRD,BBP,MASK,LIENTSZ,ENT$CNT);
  1462. LENGTH = LIWC[1] + 1; # SAVE LENGTH OF TABLE #
  1463. NDLWNCF(TABLE"LI",P<LIN$REC$INDX>,LENGTH); #WRTE LREC INDX TO NCF#
  1464. # #
  1465. IF ERRCNT EQ 0 # NO FATAL ERRORS HAVE BEEN DETECTED #
  1466. THEN
  1467. BEGIN
  1468. NCFGOOD[0] = TRUE; # SET FLAG INDICATING NCF IS GOOD #
  1469. END
  1470. ELSE # FATAL ERRORS DETECTED #
  1471. BEGIN
  1472. NCFGOOD[0] = FALSE; # CLEAR GOOD NCF FLAG #
  1473. PT$TITLE[0] = NCF$EMSG; # PUT ERROR MSG IN RECORD HEADER#
  1474. END
  1475. MASK = 20; # SET MASK FOR SORT ON NCF INDEX #
  1476. NDLSST(NCF$INDEX,FRST$WRD,BBP,MASK,NCFENTSZ,NCFWC[0]);
  1477. NCFWC[0] = (NCFWC[0] * NCFENTSZ) + 1; # CONVERT TO WORD COUNT #
  1478. ITEMP = NCFWC[0]; # SAVE INDEX WORD COUNT IN TEMPORARY #
  1479. MOVEI(NCFWC[0]+1,LOC(NCF$INDEX),LOC(NCF$INDEX)+PT$SIZE);
  1480. MOVEI(PT$SIZE,LOC(PRFX$TABLE),LOC(NCF$INDEX));
  1481. NDLWNCF(TABLE"NI",P<NCF$INDEX>,PT$SIZE + ITEMP + 1);
  1482. NDLEM2(0,0,0); # FLUSH OUT PASS 2 ERROR FILE BUFFER #
  1483. # RETURN TABLE SPACE NOT NEEDED #
  1484. SSTATS(P<CONSOLE$MAP>,-CM$LENG);
  1485. SSTATS(P<COUP$TABLE>,-CT$LENG);
  1486. SSTATS(P<DEVICE$XREF>,-DC$LENG);
  1487. SSTATS(P<LIN$CON$INDX>,-LCR$LENG);
  1488. SSTATS(P<LIN$CON$REC>,-LC$LENG);
  1489. SSTATS(P<LIN$REC$INDX>,-LI$LENG);
  1490. SSTATS(P<LINE$RECORD>,-LR$LENG);
  1491. SSTATS(P<LINE$XREF>,-LCT$LENG);
  1492. SSTATS(P<LLINK$TABLE>,-LLT$LENG);
  1493. SSTATS(P<LOGLINK$XREF>,-LL$LENG);
  1494. SSTATS(P<NCF$INDEX>,-NCF$LENG);
  1495. SSTATS(P<NPU$TABLE>,-NT$LENG);
  1496. SSTATS(P<NPU$XREF>,-NP$LENG);
  1497. SSTATS(P<PLINK$XREF>,-PL$LENG);
  1498. SSTATS(P<SUPLINK$TABL>,-SLT$LENG);
  1499. SSTATS(P<TNI$TABLE>,-TNI$LENG);
  1500. RETURN; # **** RETURN **** #
  1501. END # NDLNFTM #
  1502. TERM
cdc/nos2.source/nam5871/ndlnftm.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator