User Tools

Site Tools


cdc:nos2.source:nam5871:np_recv

NP$RECV

Table Of Contents

  • [00012] PROC NP$RECV(NBACKTRIG)
  • [00077] PROC NP$CIO
  • [00079] PROC NP$N2D
  • [00080] PROC NP$UPRU
  • [00093] PROC PUTDISK(PUTBTRIG)

Source Code

NP$RECV.txt
  1. *DECK,NP$RECV
  2. *IF,DEF,XFR
  3. USETEXT NX$ACBF
  4. USETEXT AIPDEF
  5. USETEXT HEADER
  6. USETEXT NP$STAT
  7. USETEXT NP$DB
  8. USETEXT NP$NWL
  9. USETEXT NP$MODE
  10. USETEXT NP$GETS
  11. USETEXT NX$ACBX
  12. PROC NP$RECV(NBACKTRIG);
  13. BEGIN
  14. #
  15. *1DC NP$RECV
  16. *
  17. * 1. PROC NAME AUTHOR DATE
  18. * NP$RECV Y. C. YIP 02/19/1985
  19. *
  20. * 2. FUNCTIONAL DESCRIPTION
  21. * THIS PROCEDURE ACTS AS THE RECEIVER OF A CHARACTER MODE
  22. * FILE TRANSFER OR OF AN INTRAHOST FILE TRANSFER.
  23. *
  24. * 3. METHOD USED
  25. * SET BASED ARRAY OF CHARACTER MODE BUFFER, DISKFET,
  26. * AND NETWORK FET TO THEIR CORRESPONDING LOCATIONS
  27. * RESPECTIVELY.
  28. * CHECK TBN FROM TBH TO SEE IF THERE IS ANY BLOCK SEQUENCE
  29. * ERROR.
  30. * IF THERE IS A BSN ERROR
  31. * SET NBACKTRIG TO BAD-DATA-TRIGGER
  32. * ELSE
  33. * INCREMENT TBN IN FTT
  34. * LOOP UNTIL NETBUF IS EMPTY
  35. * IF TRANSLATION IS NEEDED
  36. * CALL NP$N2D
  37. * IF MFACIL SPECIFIED
  38. * UPDATE PRU NUMBER BY CALLING NP$UPRU
  39. * ENDIF
  40. * ELSE
  41. * INTRAHOST FILE XFR (NO TRANSLATION IS NEEDED)
  42. * SET NETBUF EMPTY FLAG SINCE CIO BUFFER IS FILLED
  43. * BY THE PROCESS NP$DATA
  44. * ENDIF
  45. * CALL PUTDISK TO FLUSH THE CIO BUFFER
  46. * END - LOOP
  47. * CLEAR NETBUF EMPTY FLAG
  48. * RESET NETBUF FET POINTERS
  49. * RETURN
  50. *
  51. * 4. ENTRY CONDITIONS
  52. * FTTINDEX SET TO THE CURRENT FILE TRANSFER INDEX
  53. * IN FTT
  54. * NETBUF CONTAINS FILE TRANSFER DATA FILLED
  55. * BY A NEGETL
  56. *
  57. * 5. EXIT CONDITONS
  58. * DISKBUFF ARE FLUSHED
  59. *
  60. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  61. * NX$ACBX, NP$NWL
  62. *
  63. * 7. ROUTINES CALLED
  64. * NP$CIO - PERFORMS CIO ACTIONS
  65. * NP$UPRU - UPDATES PRU NUMBER DURING FILE TRANSFER
  66. * NP$N2D - TRANSLATION SERVICE
  67. *
  68. * 8. DAYFILE MESSAGES
  69. * NONE
  70. *
  71. #
  72. #
  73. ****
  74. #
  75. XREF
  76. BEGIN
  77. PROC NP$CIO; # ROUTINE THAT MAKES CIO FUNCTION #
  78. # CALLS #
  79. PROC NP$N2D; # TRANSLATION SERVICE FROM NETWORK #
  80. PROC NP$UPRU; # PROC TO UPDATE PRU,WORD AND DBIT #
  81. # IN FTT #
  82. # DATA TO DISK DATA #
  83. END
  84. #
  85. ****
  86. #
  87. ITEM NBACKTRIG; # BACK TRIGGER #
  88. ITEM INDEX; # LOOP INDEX #
  89. ITEM OLDDISKIN; # OLD VALUE OF DISK IN POINTER #
  90. ITEM ITEMP; # INTEGER TEMPORARY #
  91.  
  92. CONTROL EJECT;
  93. PROC PUTDISK(PUTBTRIG);
  94. BEGIN
  95. #
  96. *
  97. * 1. PROC NAME AUTHOR DATE
  98. * PUTDISK Y. C. YIP 02/19/1985
  99. *
  100. * 2. FUNCTIONAL DESCRIPTION
  101. * THIS PROCEDURE PERFORMS WRITE ACTION ON THE DISK
  102. *
  103. * 3. METHOD USED
  104. * PROC PUTDISK FIRST CALLS NP$CIO TO PERFORM A WRITE CIO
  105. * OPERATION WITH RECALL. IT THEN CHECKS FOR EOR AND EOI
  106. * FLAGS IN THE FILE TRANSFER TABLE AND CALLS NP$CIO WITH
  107. * WRITER AND WRITEF RESPECTIVELY IF THOSE TWO FLAGS ARE
  108. * SET TO TRUE. ALL CIO CALLS ARE ALSO CHECKED FOR INTERNAL
  109. * PROCESSING ERROR AND THE PUTBTRIG IS SET TO INTERNAL ERROR
  110. * TRIGGER IF THE FIELD FETEC IS NON-ZERO AFTER THE CIO CALL
  111. * IS MADE.
  112. *
  113. * 4. ENTRY CONDITIONS
  114. *
  115. * PUTDISK IS ONLY CALLED AFTER THE TRANSLATION SERVICE
  116. * IS CALLED TO MOVE DATA FROM NETBUF TO DISKBUF ACCORDING
  117. * TO THE DD INDICATED IN THE FTT
  118. * PUTBTRIG - RETURN PARAMETER
  119. *
  120. * 5. EXIT CONDITONS
  121. * DATA FLUSHED FROM DISKBUF TO DISK STORAGE
  122. * PUTBTRIG - SET TO INTERNAL ERROR TRIGGER IF THERE
  123. * IS ERROR ENCOUNTERED DURING THE CIO ACTIONS
  124. *
  125. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  126. * NX$ACBX,NP$NWL
  127. *
  128. * 7. ROUTINES CALLED
  129. * NP$CIO - PERFORMS CIO ACTIONS
  130. *
  131. * 8. DAYFILE MESSAGES
  132. * NONE
  133. *
  134. #
  135.  
  136. ITEM PUTBTRIG; # RETURN TRIGGER #
  137. BASED ARRAY COPYAREA[0:0] S(1);
  138. BEGIN
  139. ITEM WORD U(00,00,60);
  140. END
  141.  
  142. CONTROL EJECT;
  143. # #
  144. # CODE OF PUTDISK BEGINS HERE #
  145. # #
  146. NP$CIO(CIO$WRITE); # CALLS NP$CIO WITH RECALL TO #
  147. # PERFORM A WRITE OPERATION #
  148. IF FETEC[0] NQ 0 # IF ERROR CODE PRODUCED DURING #
  149. THEN # PROCESSING THE CIO CALL #
  150. BEGIN
  151. PUTBTRIG = NRCTITR; # SET RETURN TRIGGER TO INTERNAL #
  152. END # TRIGGER #
  153. ELSE
  154. BEGIN
  155. IF CMB$NBUF[0] NQ 0 AND TBH$EORI[0] GR 0 #IF NETBUF EMPTY FLAG#
  156. THEN # SET AND EOR OR EOI FLAG SET #
  157. BEGIN
  158. FETLEVEL[0] = TBH$LEV[0]; # SET LEVEL NUMBER IN DISK FET #
  159. # TO BE THAT IN TBC #
  160. IF NOT FTTNOTRAN[FTTINDEX] # IF TRANSLATION NEEDED #
  161. THEN
  162. BEGIN
  163. IF CMB$DBIT[0] NQ (WORDLENGTH - CMB$STEP[0])
  164. THEN
  165. BEGIN
  166. FETIN[0] = FETIN[0] + 1; # BUMP IN POINTER OF FET #
  167. IF FETIN[0] EQ FETLIM[0] # IF IN POINTER EQ LIMIT #
  168. THEN
  169. BEGIN
  170. FETIN[0] = FETFIR[0]; # SET IN POINTER EQ FIRST PTR #
  171. END
  172. END
  173. END # END OF TRANSLATION NEEDED #
  174. IF TBH$EOI[0] # IF EOI BIT SET #
  175. THEN
  176. BEGIN
  177. IF (FETIN[0] NQ FETOUT[0]) OR # STUFF LEFT IN DISKFET #
  178. ( CMB$DBIT[0] NQ (WORDLENGTH - CMB$STEP[0]))
  179. THEN
  180. BEGIN
  181. FETLEVEL[0] = 0; # CLEAR FET LEVEL #
  182. NP$CIO(CIO$WRITER); # FLUSH BUFFER #
  183. END
  184. END
  185. ELSE
  186. BEGIN
  187. NP$CIO(CIO$WRITER); # CALLS NP$CIO WITH WRITER #
  188. END
  189. IF FETEC[0] NQ 0 # IF ERROR CODE EXISTS #
  190. THEN
  191. BEGIN
  192. PUTBTRIG = NRCTITR; # SET RETURN TRIGGER TO INTERNAL #
  193. # ERROR #
  194. END
  195. FETIN[0] = FETFIR[0]; # RESET IN POINTER OF DISK FET #
  196. FETOUT[0] = FETFIR[0]; # RESET OUT POINTER OF DISK FET #
  197. P<COPYAREA> = 0;
  198. WORD[FETIN[0]] = 0; # ZERO OUT WORD POINTED TO BY IN PTR#
  199. IF NOT FTTNOTRAN[FTTINDEX] # IF TRANSLATION NEEDED #
  200. THEN
  201. BEGIN
  202. CMB$DBIT[0] = WORDLENGTH - CMB$STEP[0]; # RESET DBIT #
  203. CMB$STATE[0] = 0; # CLEAR STATE #
  204. END
  205. END
  206. END
  207. RETURN; # RETURN TO CALLER #
  208. END # END OF PROC PUTDISK #
  209. CONTROL EJECT;
  210. # #
  211. # CODE OF NP$RECV BEGINS HERE #
  212. # #
  213. P<CMB> = FTTCMV$BLK[FTTINDEX]; # USING CHARACTER MODE BUFFER #
  214. P<FET$CIO> = FTTFETADR[FTTINDEX]; # USING DISK FET #
  215. P<FET$WORK> = FTTFETW[FTTINDEX]; # USING NETWORK FET #
  216. IF NOT FTTNOTRAN[FTTINDEX] # IF TRANSLATION NEEDED #
  217. THEN
  218. BEGIN
  219. P<TBH$HDR> = FETWFIRST[0]+1; # PUT TBH TEMPLATE TO SECOND WORD #
  220. END # ADDRESS OF DATA #
  221. ELSE
  222. BEGIN # INTRAHOST BINARY #
  223. P<TBH$HDR> = LOC(DATA$WORD[1]);
  224. END
  225. IF TBH$TBN[0] NQ FTTTBN[FTTINDEX] # IF SERIAL NUMBERS DO NOT#
  226. THEN # MATCH #
  227. BEGIN
  228. NBACKTRIG = NRCTBDA; # SET NACK TRIG TO BAD DATA TRIGGER #
  229. END
  230. ELSE
  231. BEGIN
  232. FTTTBN[FTTINDEX] = FTTTBN[FTTINDEX] + 1; # BUMP BLOCK COUNTER #
  233. # IN THE FTT #
  234. FOR INDEX = 0 WHILE CMB$NBUF[0] EQ 0
  235. DO # LOOP UNTIL NETBUF-EMPTY FLAG IS #
  236. BEGIN # FOR CMB #
  237. IF FTTMFACIL[FTTINDEX] # IF MFACIL SPECIFIED #
  238. THEN
  239. BEGIN
  240. OLDDISKIN = FETIN[0]; # SAVE OLD IN POINTER OF DISK FET #
  241. END
  242. IF NOT FTTNOTRAN[FTTINDEX] # IF TRANSLATION NEEDED #
  243. THEN
  244. BEGIN
  245. NP$N2D(LOC(FETWFIRST[0]),LOC(FETFIR[0]),P<CMB>);
  246.  
  247. # CALLS TRANSLATION SERVICE #
  248. # ROUTINE TO TRANSLATE NETWORK8 CHAR#
  249. # INTO FORMAT INDICATED BY THE DD #
  250. IF FTTMFACIL[FTTINDEX] # IF MFACIL SPECIFIED #
  251. THEN
  252. BEGIN
  253. ITEMP = FETIN[0]; # REGISTER LAST VALUE OF FETIN #
  254. IF CMB$NBUF[0] NQ 0 AND TBH$EORI[0] GR 0
  255. THEN
  256. BEGIN # IF NETBUF EMPTY AND EOR OR EOI #
  257. IF CMB$DBIT[0] NQ (WORDLENGTH - CMB$STEP[0])
  258. THEN
  259. BEGIN # NO MORE ROOM FOR ONE BYTE #
  260. ITEMP = FETIN[0] + 1;
  261. END
  262. END
  263. NP$UPRU(OLDDISKIN,ITEMP); # UPDATE PRU NUMBER IN FTT #
  264. END
  265. END # END OF TRANSLATION NEEDED #
  266. ELSE
  267. BEGIN # NO TRANSLATION #
  268. CMB$NBUF[0] = 1; # SET NETBUF EMPTY FLAG SINCE #
  269. END # CIO BUFFER FILLED IN NP$DATA #
  270. PUTDISK(NBACKTRIG); # CALLS PUTDISK TO WRITE INFO INTO #
  271. # DISK #
  272. END
  273. END # END OF CORRECT TBN #
  274. CMB$NBUF[0] = 0; # CLEAR NETBUF EMPTY FLAG #
  275. FETWIN[0] = FETWFIRST[0]; # RESET IN POINTER OF NETBUF #
  276. FETWOUT[0] = FETWFIRST[0]; # RESET OUT POINTER OF NETBUF #
  277. RETURN; # RETURN TO CALLER #
  278. END # END OF PROC NP$RECV #
  279. TERM
  280. *ENDIF
cdc/nos2.source/nam5871/np_recv.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator