User Tools

Site Tools


cdc:nos2.source:nam5871:lfghdrw

LFGHDRW

Table Of Contents

  • [00008] ADD SM HEADER AND WRITE TO NLF.

Source Code

LFGHDRW.txt
  1. *DECK LFGHDRW
  2. USETEXT LFGFET,LFGIOD,LFGWKBS,LFGFN
  3. PROC LFGHDRW(PN,RN,IW60,NWDS16,NEWP,MRES,EOP,BEGADDR,PRC,SUCCESS,
  4. OVNAME,BN,LB,BC,DIRBUF);
  5. BEGIN
  6. *IF DEF,IMS
  7. #
  8. ** LFGHDRW - ADD SM HEADER AND WRITE TO NLF.
  9. *
  10. * M. E. VATCHER 81/02/20
  11. *
  12. * LFGHDRW ADDS A SM HEADER TO A MESSAGE AND WRITES IT TO THE NLF.
  13. *
  14. * PROC LFGHDRW(PN,RN,IW60,NWDS16,NEWP,MRES,EOP,BEGADDR,PRC,SUCCESS,
  15. * OVNAME,BN,LB,DIRBUF)
  16. *
  17. * ENTRY PN PARTITION NAME FOR DIRECTORY
  18. * RN RECORD NAME FOR FIRST WORD OF RECORD
  19. * IW60 NUMBER OF 60 BIT WORDS IN THIS MESSAGE
  20. * NWDS16 NUMBER OF 16 BIT WORDS IN THIS MESSAGE
  21. * NEWP NEW PARTITION FLAG
  22. * MRES MEMORY RESIDENT FLAG
  23. * EOP END OF PARTITION FLAG
  24. * BEGADDR BEGINNING ADDRESS IN NPU FOR LOAD DATA
  25. * PRC PARTITION RECORD COUNT
  26. * OVNAME OVERLAY NAME IN ASCII
  27. * BN BLOCK NUMBER FOR OVERLAYS
  28. * LB LAST BLOCK NUMBER FOR OVERLAYS
  29. * BC BATCH COUNT
  30. * DIRBUF DIRECTORY BUFFER ADDRESS
  31. *
  32. * EXIT PRC PARTITION RECORD COUNT
  33. * SUCCESS SUCCESSFUL COMPLETION INDICATOR
  34. *
  35. * METHOD
  36. *
  37. * IF ITS A NEW PARTITION
  38. * THEN
  39. * SAVE CURRENT RANDOM INDEX FROM FET
  40. * WRITE RECORD NAME TO CIO BUFFER
  41. * PUT NUMBER OF 60 BIT AND NUMBER OF 16 BIT WORDS IN HEADER
  42. * IF END OF PARTITION
  43. * THEN
  44. * SET EOP BIT IN MESSAGE HEADER
  45. * PUT IN SM HEADER, EITHER OVL/DT OR OVL/PB
  46. * WRITEW MESSAGE TO CIO BUFFER
  47. * IF MESSAGES IN RECORD SO FAR < 64 AND NOT END OF PARTITION
  48. * THEN
  49. * RETURN
  50. * WRITE REST OF RECORD TO NLF
  51. * IF ITS THE FIRST RECORD OF THE PARTITION
  52. * THEN
  53. * MAKE A DIRECTORY ENTRY
  54. * END
  55. *
  56. #
  57. *ENDIF
  58.  
  59. #
  60. **** PROC LFGHDRW - XREF LIST BEGIN.
  61. #
  62.  
  63. XREF
  64. BEGIN
  65. PROC LFGMDE; # MAKE DIRECTORY ENTRY #
  66. PROC RECALL; # CHECK COMPLETION BIT #
  67. ITEM WFET U; # FWA OF NLF FET #
  68. PROC WRITER; # WRITE RECORD #
  69. PROC WRITEW; # WRITE WORDS TO CIO BUFFER #
  70. END
  71.  
  72. #
  73. ****
  74. #
  75. CONTROL NOLIST; # SMPFC, SMDEF #
  76. *CALL SMPFC
  77. *CALL SMDEF
  78. CONTROL LIST;
  79.  
  80. DEF OVLPB # 0 #; # TEMP FIX UNTIL OVERLAY CODE IS REMOVED #
  81.  
  82.  
  83.  
  84. COMMON HDRWRTCOM;
  85. BEGIN
  86. ITEM CRI U; # CURRENT RANDOM INDEX #
  87. ITEM FIRSTREC B; # FIRST RECORD OF PARTITION FLAG #
  88. ITEM MINRSF U; # MESSAGES IN RECORD SO FAR #
  89. ITEM RECL U; # RECORD LENGTH #
  90. END
  91.  
  92. ITEM BC; # BATCH COUNT #
  93. ITEM BEGADDR U; # BEGINNING ADDRESS #
  94. ITEM BN U; # BLOCK NUMBER #
  95. ITEM EOP B; #END OF PARTITION FLAG #
  96. ITEM IW60 U; # NUMBER OF 60 BIT WORDS IN MESSAGE #
  97. ITEM LB U; # LAST BLOCK NUMBER #
  98. ITEM MRES B; # MEMORY RESIDENT FLAG #
  99. ITEM NEWP B; # NEW PARTITION FLAG #
  100. ITEM NWDS16 U; # NUMBER OF 16 BIT WORDS OF MESSAGE DATA #
  101. ITEM OVNAME U; # OVERLAY NAME IN ASCII #
  102. ITEM PN C(6); # PARTITION NAME #
  103. ITEM PRC U; # PARTITION RECORD COUNT #
  104. ITEM RN C(6); # RECORD NAME #
  105. ITEM SUCCESS B;
  106.  
  107. ARRAY DIRBUF [0:0] S(1);
  108. BEGIN # ADDRESS OF DIRECTORY BUFFER PASSED TO LFGMDE #
  109. ITEM DIRBUFWORD U(0,0,60);
  110. END
  111.  
  112. P&lt;SM$NS> = LOC(PBUF[1]); # POINT SM HEADER BASED ARRAY #
  113. SUCCESS = TRUE;
  114. P&lt;SIOFET> = WFET;
  115. IF NEWP
  116. THEN # STARTING A NEW PARTITION #
  117. BEGIN
  118. NEWP = FALSE; # NO LONGER A NEW PARTITION #
  119. FIRSTREC = TRUE; # FIRST RECORD OF PARTITION #
  120. CRI = FETCRI[0]; # SAVE CURRENT RANDOM INDEX #
  121. WRITEW(SIOFET,RN,1); # PUT RECORD NAME IN CIO BUFFER #
  122. RECL = 1; # INITIALIZE RECORD LENGTH #
  123. MINRSF = 0; # NO MESSAGES IN RECORD YET #
  124. PRC = 0; # NO RECORDS WRITTEN YET #
  125. END
  126. B&lt;42,18>PBUF[0] = IW60;
  127. IF EOP
  128. THEN #END OF PARTITION #
  129. B&lt;0,1>PBUF[0] = 1; # THIS IS THE LAST MESSAGE #
  130. IF MRES
  131. THEN # MEMORY RESIDENT PARTITION #
  132. BEGIN
  133. B&lt;24,18>PBUF[0] = NWDS16*2 + LNPUDTLR; # SET TLC #
  134. PFCSFC[0] = NPUDT; # SET PFC/SFC = NPU/DT #
  135. NPUCC[0] = CMDCODE"CC$LOAD"; # SET COMMAND CODE = LOAD #
  136. NPUBA1[0] = B&lt;36,4>BEGADDR; # SET BEGINNING ADDRESS #
  137. NPUBA2[0] = B&lt;40,20>BEGADDR;
  138. BEGADDR = BEGADDR + 105;
  139. END
  140. ELSE
  141. BEGIN
  142. B&lt;24,18>PBUF[0] = NWDS16*2 + LOVLPBR; # SET TLC #
  143. PFCSFC[0] = OVLPB; # SET PFC/SFC = OVL/PB #
  144. OVLON[0] = B&lt;36,24>OVNAME; # SET OVERLAY NAME #
  145. OVLBN[0] = BN; # SET BLOCK NUMBER #
  146. OVLBC[0] = LB; # SET BATCH COUNT = LAST BLOCK NUMBER #
  147. END
  148. MINRSF = MINRSF + 1; # MESSAGES IN THIS RECORD SO FAR #
  149. IF MRES AND (MINRSF EQ BC OR EOP)
  150. THEN # FILL IN BATCH COUNT #
  151. BEGIN
  152. NPUBC[0] = MINRSF;
  153. END
  154. WRITEW(SIOFET,PDATA,IW60); # WRITE MESSAGE TO CIO BUFFER #
  155. RECL = RECL + IW60; # UPDATE RECORD LENGTH #
  156. IF MINRSF LS BC AND NOT EOP
  157. THEN # RECORD NOT YET FULL #
  158. BEGIN
  159. RETURN; # ***** EXIT ***** #
  160.  
  161. END
  162. RECALL(SIOFET); #WAIT FOR POSSIBLE WRITE AHEAD #
  163. WRITER(SIOFET,"R"); # FINISH WRITING DATA IN CIO BUFFER #
  164. IF FIRSTREC
  165. THEN # FIRST RECORD OF LOAD PARTITION #
  166. BEGIN
  167. FIRSTREC = FALSE;
  168. LFGMDE(PN,CRI,RECL,SUCCESS,DIRBUF);
  169. IF NOT SUCCESS
  170. THEN
  171. RETURN; # ***** EXIT ***** #
  172. END
  173. MINRSF = 0; # RESET MESSAGE COUNT #
  174. PRC = PRC + 1; # INCREMENT PARTITION RECORD COUNT #
  175. IF NOT EOP
  176. THEN
  177. BEGIN
  178. WRITEW(SIOFET,RN,1); # WRITE RECORD NAME TO CIO BUFFER #
  179. RECL = 1; # INITIALIZE RECORD LENGTH #
  180. END
  181. END TERM
cdc/nos2.source/nam5871/lfghdrw.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator