User Tools

Site Tools


cdc:nos2.source:nam5871:ns_slb

NS$SLB

Table Of Contents

  • [00012] PROC NS$SLB((RNAME),(RI),ERRCODE)
  • [00014] NS$SLB - SEND LOAD BATCH.
  • [00018] SEND LOAD BATCH.
  • [00070] PROC NS$DBG
  • [00076] PROC MOVEOK
  • [00077] PROC NETPUT
  • [00078] PROC NS$FBH
  • [00079] FUNC NS$FEC U
  • [00080] FUNC NS$XZFN C(10)
  • [00081] PROC READ
  • [00082] PROC READW
  • [00083] PROC RECALL
  • [00084] PROC TSBINFO

Source Code

NS$SLB.txt
  1. *DECK NS$SLB
  2. USETEXT COM$NS
  3. USETEXT DEF$NS
  4. USETEXT ERR$NS
  5. USETEXT LTSB$NS
  6. USETEXT NAT$NS
  7. USETEXT NPT$NS
  8. USETEXT PFC$NS
  9. USETEXT SMB$NS
  10. USETEXT SMD$NS
  11.  
  12. PROC NS$SLB((RNAME),(RI),ERRCODE); # SEND LOAD BATCH #
  13.  
  14. # TITLE NS$SLB - SEND LOAD BATCH. #
  15.  
  16. BEGIN # NS$SLB #
  17. #
  18. ** NS$SLB - SEND LOAD BATCH.
  19. *
  20. * J.C. LEE 1981
  21. *
  22. * THIS ROUTINE SENDS A LOAD BATCH.
  23. *
  24. * PROC NS$SLB((RNAME),(RI),ERRCODE)
  25. *
  26. * ENTRY:
  27. * RNAME - LOAD MODULE RECORD NAME.
  28. * RI - RANDOM INDEX OF RNAME.
  29. *
  30. * EXIT:
  31. * ERRCODE = "BAD NLF LOAD-PARTITION RECORD".
  32. *
  33. * METHOD:
  34. * ACCESS LOAD BUFFER IN LOAD-TSB.
  35. * CALL READW TO TRANSFER RECORD-HEADER OF
  36. * LOAD-PARTITION LOGICL RECORD TO SM-BUFFER.
  37. * IF TRANSFER COMPLETE:
  38. * VALIDATE RECORD NAME IN RECORD-HEADER
  39. * IF RECORD NAME MATCH LOAD-PARTITION NAME:
  40. * FOR EACH LOAD-PACKET IN LOGICAL RECORD WHILE
  41. * END-OF-LOAD-PARTITION FLAG FALSE AND
  42. * ERROR-CODE IS ZERO AND
  43. * READW COMPLETE:
  44. * SEND A LOAD-PACKET.
  45. * IF ERROR-CODE EQ 0:
  46. * IF LOAD-BATCH-COUNT NQ 0 AND
  47. * LOAD-BATCH-COUNT LQ LBC:
  48. * STORE END-OF-LOAD-PARTITION FLAG IN NAT.
  49. * STORE CURRENT-RANDOM-INDEX OF LOAD-FET IN NAT.
  50. * IF LOAD-FET COMPLETE-BIT SET:
  51. * ALLOW LOAD-TSB TO MOVE.
  52. * ELSE
  53. * SET ERRCODE.
  54. * ELSE
  55. * SET ERRCODE.
  56. * ELSE
  57. * SET ERRCODE.
  58. * ELSE
  59. * SET ERRCODE.
  60. *
  61. #
  62.  
  63. ITEM RNAME C(6); # LOAD MODULE RECORD NAME #
  64. ITEM RI U; # RANDOM INDEX OF RECORD RNAME ON LFN #
  65. ITEM ERRCODE U; # ERROR CODE #
  66.  
  67. $BEGIN
  68. XREF
  69. BEGIN
  70. PROC NS$DBG; # TRACE PROCEDURE CALL #
  71. END
  72. $END
  73.  
  74. XREF
  75. BEGIN
  76. PROC MOVEOK; # ALLOW TSB TO MOVE #
  77. PROC NETPUT; # SEND MESSAGE #
  78. PROC NS$FBH; # FORMAT ABH AND CLEAR SM BUFFER #
  79. FUNC NS$FEC U; # FORMAT ERROR CODE #
  80. FUNC NS$XZFN C(10); # ZERO-FILLED FILE NAME #
  81. PROC READ;
  82. PROC READW; # READW DATA TRANSFER #
  83. PROC RECALL; # RECALL #
  84. PROC TSBINFO; # LOCATE TSB #
  85. END
  86.  
  87. ITEM ERROR B; # ERROR FLAG #
  88. ITEM F$LAST B; # END OF LOAD MODULE FLAG #
  89. ITEM LBC I; # LOAD BATCH COUNT #
  90. ITEM LFN C(7); # FILE WHERE LOAD MODULE RESIDES #
  91. ITEM LTSBN U; # TSB NUMBER OF LOAD TSB #
  92. ITEM N U; # SM TEXT LENGTH IN CM WORDS #
  93. ITEM STAT U; # READW RETURN STATUS #
  94. ITEM TLC U; # SM TEXT LENGTH IN ASCII CHARACTERS #
  95. ITEM TSBFWA U; # FWA OF TSB #
  96. ITEM TSBSIZE U; # SIZE OF TSB #
  97.  
  98. DEF L$RHDR # 1 #; # LOAD MODULE RECORD HEADER LENGTH #
  99. BASED ARRAY LMR$RHDR [0:0] S(L$RHDR);
  100. BEGIN # LOAD MODULE RECORD HEADER #
  101. ITEM LMR$RNAME C(0,0,6); # CCP LOAD MODULE NAME #
  102. END
  103.  
  104. DEF L$LPHDR # 1 #; # LOAD PACKET HEADER LENGTH #
  105. BASED ARRAY LMR$LPHDR [0:0] S(L$LPHDR);
  106. BEGIN # LOAD PACKET HEADER #
  107. ITEM LPH$F$LAST B(0,0,1); # END OF MODULE FLAG #
  108. ITEM LPH$TLC U(0,24,18); # TEXT LENGTH IN ASCII CHARACTER#
  109. ITEM LPH$PS U(0,42,18); # LOAD PACKET SIZE IN CM WORDS #
  110. END
  111.  
  112. DEF MAX$LPSIZE # 30 #; # MAX LOAD PACKET SIZE ALLOWED #
  113. BASED ARRAY LMR$LPENT [1:MAX$LPSIZE] S(1);
  114. BEGIN # LOAD PACKET #
  115. ITEM LPE$WORD U(0,0,60);
  116. END
  117.  
  118. ARRAY NCBPBA [0:0] S(1);
  119. BEGIN # NCB LOAD PACKET BEGINNING ADDRESS #
  120. ITEM PBA1 U(0,36,4);
  121. ITEM PBA2 U(0,40,20);
  122. ITEM PBA U(0,36,24);
  123. END
  124.  
  125. CONTROL EJECT;
  126.  
  127. $BEGIN
  128. NS$DBG("SLB");
  129. $END
  130.  
  131. ERRCODE = 0;
  132. ERROR = FALSE;
  133. LTSBN = LTW$LTSBN[0]; # LOAD TSB NUMBER #
  134. TSBINFO(TSBSIZE,TSBFWA,LTSBN); # LOCATE LOAD TSB #
  135.  
  136. IF RNAME EQ "NCB "
  137. THEN # LOAD NETWORK CONFIGURATION BLK#
  138. LFN = LFN$NCF; # FROM NCF #
  139.  
  140. ELSE # LOAD MODULE FROM NLF #
  141. BEGIN
  142. IF NPT$ALFWD[NTORD] NQ 0
  143. THEN # ALTERNATE CCP LOAD FILE IN EFFECT #
  144. LFN = NPT$ALFPFN[NTORD];
  145. ELSE # DEFAULT CCP LOAD FILE #
  146. LFN = LFN$NLF;
  147. END
  148.  
  149. P<LTSB$FET> = TSBFWA + L$LTSBHDR; # FWA OF LOAD FET #
  150. LFET$LFN[0] = NS$XZFN(LFN); # SET LFN #
  151. P<LTSB$BUF> = P<LTSB$FET> + L$LFET; # FWA OF CIO BUFFER #
  152. LFET$FIRST[0] = P<LTSB$BUF>; # FIRST PTR #
  153. LFET$IN[0] = P<LTSB$BUF>; # IN PTR #
  154. LFET$OUT[0] = P<LTSB$BUF>; # OUT PTR #
  155. LFET$LIMIT[0] = P<LTSB$BUF> + L$LBUF; # LIMIT PTR #
  156. LFET$RR[0] = RI; # SET RANDOM INDEX #
  157. P<LMR$RHDR> = LOC(ABH$WORD); # FWA OF WORKING BUFFER #
  158.  
  159. READ(LTSB$FET); # INITIATE READ #
  160. RECALL(LTSB$FET); # WAIT TILL I/O COMPLETES #
  161.  
  162. READW(LTSB$FET,LMR$RHDR,L$RHDR,STAT); # READ RECORD HEADER #
  163.  
  164. IF STAT EQ READWOK # TRANSFER COMPLETE #
  165. AND LMR$RNAME[0] EQ RNAME # RECORD NAME MATCH #
  166. THEN
  167. BEGIN # SEND LOAD BATCH #
  168. F$LAST = FALSE;
  169.  
  170. FOR LBC = 0 WHILE NOT ERROR # LOAD RECORD FORMAT OK #
  171. AND STAT EQ READWOK # TRANSFER COMPLETE #
  172. DO # SEND LOAD PACKET(S) TILL EOR IS REACHED #
  173. BEGIN # SEND A LOAD PACKET #
  174. P<LMR$LPHDR> =LOC(ABH$WORD); # BUF FWA FOR PACKET HEADER #
  175.  
  176. READW(LTSB$FET,LMR$LPHDR,L$LPHDR,STAT); # READ PACKET HEADER #
  177.  
  178. IF STAT EQ READWOK
  179. THEN # TRANSFER COMPLETE #
  180. BEGIN
  181. F$LAST = LPH$F$LAST[0]; # SAVE END OF LOAD MODULE FLAG #
  182. P<LMR$LPENT> = LOC(SMB$BUFFER); # BUF FWA FOR LOAD PACKET #
  183. N = LPH$PS[0] - L$LPHDR; # LOAD PACKET LENGTH IN CM WORD #
  184.  
  185. IF N LQ MAX$SMSIZE # VALID LOAD PACKET LENGTH #
  186. AND LBC EQ 0 # NOT END OF BATCH #
  187. THEN
  188. BEGIN
  189. NS$FBH(LPH$TLC[0],FALSE); # FORMAT ABH FOR NETWORK SM #
  190.  
  191. READW(LTSB$FET,LMR$LPENT,N,STAT); # READ LOAD PACKET #
  192.  
  193. IF STAT EQ READWOK # TRANSFER COMPLETE #
  194. THEN # LOAD PACKET READ INTO SMB$BUFFER #
  195. BEGIN
  196. LBC = NPUBC[0]; # SAVE LOAD BATCH COUNT #
  197. NPUPO[0] = NAT$PN[0]; # STORE PORT NUMBER #
  198. NPUSP[0] = NAT$SPN[0]; # STORE SUBPORT NUMBER #
  199. NPULS[0] = NAT$LSN[0]; # STORE LOAD SEQUENCE NUMBER #
  200.  
  201. IF RNAME EQ "NCB "
  202. THEN # LOADING NCB FROM NCF #
  203. BEGIN # UPDATE BEGINNING ADDRESS #
  204. PBA[0] = NAT$NCBFWA[0] + NPUBA2[0];
  205. NPUBA2[0] = PBA2[0];
  206. NPUBA1[0] = NPUBA1[0] + PBA1[0];
  207. END
  208.  
  209. NETPUT(ABH$WORD,SMB$BUFFER); # SEND SM TO NPU #
  210.  
  211. END
  212.  
  213. ELSE # BAD LOAD RECORD #
  214. ERROR = TRUE;
  215.  
  216. END
  217.  
  218. ELSE # BAD LOAD PACKET LENGTH #
  219. ERROR = TRUE;
  220.  
  221. END
  222.  
  223. ELSE # END OF RECORD REACHED #
  224. BEGIN
  225. IF LBC EQ 0
  226. THEN # NOT END OF BATCH #
  227. ERROR = TRUE;
  228. END
  229.  
  230. END
  231. END
  232.  
  233. ELSE # BAD RECORD HEADER #
  234. ERROR = TRUE;
  235.  
  236. IF NOT ERROR
  237. THEN # WHOLE RECORD READ #
  238. BEGIN
  239. NAT$BC[0] = LBC; # STORE LOAD BATCH COUNT #
  240. NAT$F$DP[0] = F$LAST; # SET DIRECTIVE DONE FLAG #
  241. NAT$CRRI[0] = RI; # SAVE CURRENT RANDOM INDEX OF FILE #
  242. NAT$NRRI[0] = LFET$CRI[0]; # RANDOM INDEX OF NEXT RECORD #
  243. END
  244.  
  245. ELSE # LOAD RECORD ERROR #
  246. BEGIN
  247. ERRCODE = NS$FEC(EC"ERR$FILE",FEC"ERR$LM");
  248. END
  249.  
  250. RECALL(LTSB$FET); # WAIT TILL I/O COMPLETES #
  251.  
  252. MOVEOK(LTSBN); # ALLOW LOAD TSB TO MOVE #
  253.  
  254. RETURN;
  255. END # NS$SLB #
  256. TERM
cdc/nos2.source/nam5871/ns_slb.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator