User Tools

Site Tools


cdc:nos2.source:nam5871:npestof

NPESTOF

Table Of Contents

  • [00013] PRGM NPESTOF
  • [00069] PROC BLDKWL
  • [00070] PROC XTRACE
  • [00071] PROC MRELS

Source Code

NPESTOF.txt
  1. *DECK NPESTOF
  2. USETEXT NIPDEF
  3. USETEXT BACKBUF
  4. USETEXT CET
  5. USETEXT NBT
  6. USETEXT PIT
  7. USETEXT PT
  8. USETEXT PARAMP
  9. USETEXT KDIS
  10. USETEXT NHEADER
  11. USETEXT DRHDR
  12. USETEXT KSTTAB
  13. PRGM NPESTOF;
  14. STARTIMS;
  15. #
  16. *1DC NPESTOF
  17. *
  18. *
  19. * 1. PROC NAME AUTHOR DATE
  20. * NPESTOF C. BITTNER 82/06/18
  21. *
  22. * 2. FUNCTIONAL DESCRIPTION
  23. * PROCESS EST/OFF
  24. *
  25. * 3. METHOD USED
  26. * UPDATE NUMBER OF ON AND OFF ENTRIES IN CET
  27. * UPDATE NUMBER OF ACTIVE AND FREE ENTRIES IN NBT
  28. * CLEAR NBTE ENTRY IN PIT
  29. *
  30. * 4. ENTRY PARAMETERS
  31. * PARAMP1 - SM BUFFER (EST/OFF)
  32. *
  33. * 5. EXIT PARAMETERS
  34. * PARAMP2 - IF NON-ZERO THEN BAD BLOCK
  35. *
  36. * 6. SYMPL TEXTS USED
  37. * BACKBUF SPECIAL BUFFER FOR DOWNLINE BACKS
  38. * NIPDEF CET
  39. * NBT PIT
  40. * PT PARAMP
  41. * KDIS
  42. * NHEADER DRHDR
  43. *
  44. * 7. ROUTINES CALLED
  45. * KDEL - UPDATE K-DISPLAY
  46. * XTRACE - TRACE PROCEDURE CALL
  47. * MRELS - RELEASE BUFFER
  48. *
  49. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  50. * THIS PROGRAM IS CALLED BY NPNIPSM
  51. * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE PRIMARY
  52. *CALL OPSIZE
  53. *
  54.  #
  55. STOPIMS;
  56.  
  57. #
  58.  PARAMP1 - SM BUFFER (EST/OFF)
  59.  
  60. EXIT PARAMETER
  61.  PARAMP2 - IF NON-ZERO THEN BAD BLK
  62. #
  63.  
  64. #
  65.   EXTERNAL VARIABLES
  66. #
  67. XREF
  68. BEGIN
  69. PROC BLDKWL; # FORMAT KWL TO DELETE EST ENTRY FROM ST #
  70. PROC XTRACE; # TRACE PROCEDURE CALL #
  71. PROC MRELS ;
  72. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  73. END
  74.  
  75. #
  76.   INTERNAL VARIABLES
  77. #
  78.  
  79. ITEM NBTIND; # CURRENT INDEX INTO NBT INPUT FET #
  80. ITEM PITIND; # CURRENT INDEX INTO PIT #
  81. ITEM FOUND B; # CET ENTRY FOUND FLAG #
  82. ITEM IDXCET; # CET ENTRY INDEX #
  83. ITEM PIPNO; # PIP NUMBER TO MATCH #
  84. ITEM I; # LOOP VARIABLE #
  85. ITEM TEMP ; # LOOP VARIABLE #
  86.  
  87. BASED ARRAY PITNBTW S(1); # TEMPLATE FOR NBT ENTRY WD IN PIT #
  88. BEGIN
  89. ITEM PITNBTWH B(00,00,01); # HALT NPU FLAG #
  90. ITEM PITNBTWE U(00,30,06); # NBT TABLE ENTRY INDEX #
  91. ITEM PITNBTWA I(00,42,18); # NBT ENTRY ADDRESS #
  92. END
  93.  
  94.  
  95. #**********************************************************************#
  96.  
  97.  
  98. BEGIN
  99.  
  100. CONTROL IFEQ DEBUG,1;
  101. XTRACE("ESTOF");
  102. CONTROL FI;
  103.  
  104. P<NHEADER> = PARAMP1 + BLKHSIZE;
  105.  
  106. FOUND = FALSE;
  107. FOR I = 0 STEP NBTFETNO WHILE NOT FOUND AND
  108. I LQ NBTMAXID
  109. DO # SEARCH NBT FOR MATCHING COUPLER NODE #
  110. BEGIN
  111. IF NBTIUF[I] AND NBTHN[I] EQ DN[0]
  112. THEN
  113. BEGIN # FOUND NBT ENTRY #
  114. FOUND = TRUE;
  115. NBTIND = I; # SAVE NBT INDEX #
  116. END
  117. END
  118. IF FOUND
  119. THEN
  120. BEGIN # NBT FOUND #
  121. #
  122.   UPDATE CET
  123. #
  124. FOUND = FALSE;
  125. FOR IDXCET = CETHSIZE WHILE NOT FOUND AND
  126. IDXCET LS CETBS[0] DO
  127. BEGIN
  128. IF CETEST[IDXCET] EQ NBTEST[NBTIND]
  129. THEN
  130. FOUND = TRUE;
  131. ELSE
  132. IDXCET = IDXCET + 1;
  133. END
  134. IF FOUND AND NOT CETOFF[IDXCET]
  135. THEN
  136. BEGIN # CET ENTRY FOUND #
  137. CETNON[0] = CETNON[0] - 1; # DECREM NO. OF ON ENTRIES #
  138. CETNOFF[0] = CETNOFF[0] + 1; # INCREM NO. OF OFF ENTRIES #
  139. # CORRECT CET ENTRY WAS FOUND #
  140. CETOFF[IDXCET] = TRUE; # SET OFF COUPLER FLAG #
  141. PIPNO = CETPIP[IDXCET];
  142.  
  143. # UPDATE NBT #
  144. NBTNAE[0] = NBTNAE[0] - 1; # UPDATE NO. ACTIVE ENTRIES #
  145. NBTNFE[0] = NBTNFE[0] + 1; # UPDATE NO. FREE ENTRIES #
  146. #
  147.   RELEASE ACTIVE INBOUND BUFFER(S) ASSOCIATED WITH THE
  148.   OFF NPU ENTRY
  149. #
  150. FOR I=NBTIND STEP 1 UNTIL NBTIND+1
  151. DO
  152. BEGIN
  153. IF NBTBFS[I] # BUFFER AVAILABLE OR ACTIVE OR RELEASABLE #
  154. AND NBTOUT[I] NQ 0 # INBOUND BUFFER EXISTS #
  155. THEN # RELEASE THE INBOUND BUFFER #
  156. BEGIN
  157. P<DRHDRWD> = NBTOUT[I];
  158. NBTBFS[I] = FALSE; # CLEAR ACTIVE BUFFER FLAGS #
  159. IF P<DRHDRWD> EQ PARAMP1
  160. THEN # CURRENT INBOUND BUFFER, CANNOT RELEASE EST/OFF #
  161. BEGIN # FAKE IN=OUT TO TERMINATE NEIB PROCESSING #
  162. NBTIN[I] = P<DRHDRWD> + BLKBS[0];
  163. NBTBRF[I] = TRUE; # SET BUFFER RELEASE FLAG #
  164. END
  165. ELSE
  166. BEGIN # RELEASE INBOUND BUFFER #
  167. BLKBS[0] = NBTLIMIT[I] - P<DRHDRWD>; # BUFFER SIZE #
  168. MRELS(P<DRHDRWD>); # RELEASE BUFFER #
  169. NBTIN[I] = NBTLIMIT[I];
  170. NBTOUT[I] = NBTLIMIT[I];
  171. END
  172. END
  173. END
  174. #
  175.   RELEASE ALL DOWN LINE MESSAGES (ALWAYS AT LEAST ONE)
  176. #
  177. FOR I = NBTIND+2 STEP 1 UNTIL NBTIND+4 DO
  178. BEGIN
  179. P<DRHDRWD> = NBTFIRST[I];
  180. FOR TEMP = TEMP WHILE P<DRHDRWD> NQ 0 # WE DID NOT PASS #
  181. DO
  182. BEGIN
  183. TEMP = NEXTPTR[0] ; # NEXT DOWN-LINE MESSAGE #
  184. IF (P<DRHDRWD> LS BACKBLWA) AND
  185. (P<DRHDRWD> GQ BACKBFWA)
  186. THEN # THIS IS BACK ENTRY IN BACK BUFFER #
  187. BEGIN
  188. P<DRHDRWD> = P<DRHDRWD> - 1; # 1ST WD OF BCK BUF ENTRY#
  189. CMWORD[0] = BACKFFREE; # PTR TO NEXT FREE ENTRY #
  190. BACKFFREE = P<DRHDRWD>; # NEW FIRST FREE ENTRY #
  191. END
  192. ELSE # THIS IS REGULAR DYNAMIC BUFFER #
  193. BEGIN
  194. MRELS(P<DRHDRWD>); # RELEASE BUFFER #
  195. END
  196. P<DRHDRWD> = TEMP ;
  197. END
  198. NBTFIRST[I] = 0 ;
  199. NBTIN [I] = 0 ;
  200. NBTOUT [I] = 0 ;
  201. END
  202. #
  203.   RELEASE PIP TRACE BUFFER IF ONE EXISTS
  204. #
  205. I=NBTIND+5; # PIP TRACE FET INDEX #
  206. IF NBTFIRST[I] NQ 0
  207. THEN # PIP TRACE BUFFER EXISTS #
  208. BEGIN
  209. MRELS(NBTFIRST[I]-BLKHSIZE);
  210. NBTWD1[I] = 0; # CLEAR TRACE NBT BUFFER INCLUDING FLAGS #
  211. NBTWD2[I] = 0;
  212. NBTWD3[I] = 0;
  213. NBTWD4[I] = 0;
  214. END
  215.  
  216. IF KDST[0]
  217. THEN # STATUS DISPLAY ON, DELETE EST ENTRY FROM DISPLAY #
  218. BLDKWL(KST"EST",NBTKNDX[NBTIND],0,KDELIDVALUE);
  219.  
  220. #
  221.   UPDATE PIT ENTRY
  222. #
  223. P<PITNBTW> = LOC(PITNBTE1[PIPNO]); # ADR OF 1ST NBTE ENTRY #
  224. FOR I = 0 STEP 1 UNTIL MAXNPU-1
  225. DO # CHECK ALL NBTE SLOTS IN PIT ENTRY #
  226. BEGIN
  227. IF PITNBTWE[I] EQ (NBTINDX[NBTIND] + 1)
  228. THEN # FOUND NBTE ENTRY #
  229. BEGIN
  230. PITNBTWH[I] = FALSE; # CLEAR HALT NPU FLAG #
  231. PITNBTWE[I] = 0; # CLEAR NBT TABLE ENTRY INDEX #
  232. PITNBTWA[I] = 0; # CLEAR NBT TABLE ENTRY ADDRESS #
  233. END
  234. END
  235. END
  236. NBTIUF[NBTIND] = FALSE; # CLEAR NBT IN USE FLAG #
  237. END
  238. GOTO RJMAIN;
  239. END
  240. TERM
cdc/nos2.source/nam5871/npestof.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator