User Tools

Site Tools


cdc:nos2.source:nam5871:np_put

NP$PUT

Table Of Contents

  • [00015] PROC NP$PUT
  • [00088] PROC NP$DBG
  • [00090] PROC NP$ERR
  • [00091] PROC NP$SEND
  • [00092] PROC NP$UCV
  • [00093] PROC NP$USI
  • [00095] PROC NP$SN

Source Code

NP$PUT.txt
  1. *DECK NP$PUT
  2. USETEXT AIPDEF
  3. USETEXT NP$GETS
  4. USETEXT NP$MODE
  5. USETEXT NP$NWL
  6. USETEXT NP$NWNC
  7. USETEXT NP$PUTS
  8. *IF,DEF,DEBUG
  9. USETEXT NP$DB
  10. *ENDIF
  11. *IF,DEF,STAT
  12. USETEXT NP$STAT
  13. USETEXT NP$ONAM
  14. *ENDIF
  15. PROC NP$PUT;
  16. *IF DEF,IMS
  17. #
  18. *1DC NP$PUT
  19. *
  20. * 1. PROC NAME AUTHOR DATE
  21. * NP$PUT J.C. LEE 78/10/10
  22. *
  23. * 2. FUNCTIONAL DESCRIPTION
  24. * THIS ROUTINE IS CALLED BY NETPUT AND NETPUTF TO BUILD A PUT
  25. * REQUEST IN THE NWL WORKLIST AND SEND THE WORKLIST TO NIP
  26. * WHEN APPROPRIATE.
  27. *
  28. * 3. METHOD USED
  29. * FORMATS A NETPUT ENTRY IN THE WORKLIST. THE MESSAGE TEXT
  30. * LENGTH IS COMPUTED FROM THE APPLICATION CHARACTER TYPE AND
  31. * THE TEXT LENGTH IN CHARACTERS IN THE APPLICATION BLOCK
  32. * HEADER WORD. IF THERE IS ROOM IN THE WORKLIST, THE TEXT IS
  33. * COPIED FROM THE TEXT AREA TO THE NWL. IF THERE IS NOT ENOUGH
  34. * ROOM FOR THE MESSAGE IN THE WORKLIST, PUT THE ADDRESS WHERE
  35. * THE TEXT CAN BE FOUND IN THE WORKLIST, AND SEND IT TO NIP.
  36. *
  37. * IF THE DOWNLINE MESSAGE BUFFERING FEATURE IS IN USE AND THERE
  38. * IS NOT ENOUGH ROOM FOR THE MESSAGE IN THE WORKLIST, SEND THE
  39. * EXISTING WORKLIST TO NIP AND THEN ATTEMPT TO STORE THE MESSAGE
  40. * IN THE WORKLIST. IF THERE IS STILL NOT ENOUGH ROOM FOR THE
  41. * MESSAGE, PUT THE ADDRESS OF THE TEXT IN THE WORKLIST AND SEND
  42. * IT TO NIP.
  43. *
  44. * 4. ENTRY CONDITIONS
  45. * ACLN - NUMBER OF FRAGMENTED BUFFERS
  46. * IAM - ROUTINE CURRENTLY EXECUTING
  47. * LOC$HA - ADDRESS OF HEADER AREA
  48. * LOC$TA - ADDRESS OF TEXT AREA
  49. * OPCODE - OPCODE VALUE
  50. * NEXT - NEXT AVAILABLE SPACE POINTER IN WORKLIST
  51. * SPACE$LEFT - NUMBER OF CELLS AVAILABLE IN WORKLIST
  52. *
  53. * 5. EXIT CONDITIONS
  54. * NEXT - UPDATE TO NEXT AVAILABLE SPACE POINTER IN WORKLIST
  55. * SPACE$LEFT - UPDATE TO NUMBER OF AVAILABLE CELLS IN WORKLIST
  56. * I$FLAG - TRUE IF INPUT DATA QUEUED IN NIP
  57. * S$FLAG - TRUE IF A NON-EMPTY SMB OR SM QUEUED IN NIP
  58. *
  59. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  60. * AIPDEF NP$CRT NP$DB NP$GETS
  61. * NP$MODE NP$NWL NP$PUTS NP$STAT
  62. *
  63. * 7. ROUTINES CALLED
  64. * NP$DBG - FORMAT AND LOG DEBUG MESSAGES IN ZZZZZDN
  65. * NP$ERR - ERROR PROCESSOR
  66. * NP$SEND - SEND WORKLIST TO NIP
  67. * NP$SN - INCREMENT STATISTICS COUNTERS
  68. * NP$UCV - UPDATE CONTROL VARIABLES
  69. * NP$USI - UPDATE S AND I BITS IN NSUP
  70. *
  71. * 8. DAYFILE MESSAGES
  72. * NETWORK APPLICATION ABORTED, RC = 32.
  73. * NP$PUT: REQUEST INVALID BEFORE NETON.
  74. *
  75. * NETWORK APPLICATION ABORTED, RC = 43.
  76. * NP$PUT: PREVIOUS REQUEST INCOMPLETE.
  77. *
  78. *
  79.  #
  80. *ENDIF
  81.  
  82. BEGIN
  83.  
  84. *CALL NP$CRT
  85. XREF
  86. BEGIN
  87. *IF DEF,DEBUG
  88. PROC NP$DBG; # LOGS MESSAGES TO ZZZZZDN #
  89. *ENDIF
  90. PROC NP$ERR; # ERROR PROCESSOR #
  91. PROC NP$SEND; # SEND NWL TO NIP #
  92. PROC NP$UCV; # UPDATE CONTROL VARIABLES #
  93. PROC NP$USI; # UPDATE S AND I BITS IN NSUP #
  94. *IF DEF,STAT
  95. PROC NP$SN; # INCREMENT STATISTICS COUNTERS#
  96. *ENDIF
  97. END
  98. #
  99.   LOCAL VARIABLES
  100. #
  101. BASED ARRAY MEM P(1);
  102. BEGIN
  103. ITEM MEMWORD I;
  104. END
  105.  
  106. ITEM SAVEMODE B; # SAVE VALUE OF PARALLEL MODE #
  107.  
  108.  
  109. #**********************************************************************#
  110. #
  111.   NP$PUT EXECUTION BEGINS HERE
  112. #
  113. IF NOT ACCEPTED
  114. THEN
  115. NP$ERR("32"); # REQUEST INVALID BEFORE NETON. #
  116. IF DEFER$PRO
  117. THEN
  118. NP$ERR("43"); # PREVIOUS REQUEST INCOMPLETE. #
  119. *IF DEF,STAT
  120. #
  121.   UPDATE STATISTICS COUNTERS
  122. #
  123. NP$SN(IAM); # INCREMENT STATISTICS COUNTER #
  124. *ENDIF
  125. *IF DEF,DEBUG
  126. #
  127.   LOG MESSAGE ON DEBUG FILE ZZZZZDN
  128. #
  129. DB$OP = OPCODE;
  130.  
  131. NP$DBG;
  132.  
  133. *ENDIF
  134. NWL[NEXT] = 0; # CLEAR NWL OPCODE WORD #
  135. NWL$ID[NEXT] = AWLID;
  136. NWL$OP[NEXT] = OP$PUT;
  137. P<MEM> = LOC$HA; # HEADER AREA #
  138. ABH[NEXT+1] = MEMWORD;
  139. *IF DEF,STAT
  140.  
  141. IF ABH[NEXT+1] GR 0
  142. THEN
  143. BEGIN
  144. J = TYPE"ODB" + ABH$ABT[NEXT+1] - 1;
  145. NP$SN(J);
  146. END
  147.  
  148. *ENDIF
  149. #
  150.   COMPUTE TEXT LENGTH IN WORDS
  151. #
  152. ACT = ABH$ACT[NEXT+1];
  153. IF (ACT EQ 0) OR # ACT VALUE = 0 #
  154. (ACT GR CT6DISPLAY) # ACT VALUE TOO LARGE #
  155. THEN # INVALID ACT VALUE SPECIFIED #
  156. BEGIN
  157. TLW = ABH$TLC[NEXT+1]; # FAKE TLW VALUE #
  158. END
  159. ELSE # VALID CHAR TYPE SPECIFIED #
  160. BEGIN
  161. TLW = (2 * ABH$TLC[NEXT+1] + NW$ROUND[ACT]) / NW$FACT[ACT];
  162. END
  163. #
  164.   SET UP THE NWL ENTRY
  165. #
  166. BS = OPABHSIZ; # INITIALIZE NWL ENTRY SIZE #
  167. ISSUE = TRUE; # INITIALIZE FLAG TO SEND NWL #
  168. IF OPCODE EQ OP$PUTF
  169. THEN
  170. RETURN ;
  171. IF TLW LQ (SPACE$LEFT - GMMESIZE - NXTSIZE)
  172. THEN
  173.  
  174. BEGIN # ROOM FOR OP,ABH,TEXT AND GSM #
  175. J = NEXT + OPABHSIZ; # BEGINNING ADDR FOR TEXT IN WL#
  176. P<MEM> = LOC$TA; # TEXT AREA ADDRESS IN APP FL #
  177. FOR I=0 STEP 1 UNTIL (TLW-1) DO
  178. NWL[I+J] = MEMWORD[I]; # COPY TEXT TO NWL #
  179. BS = TLW + OPABHSIZ; # RESET NWL ENTRY SIZE #
  180. #
  181.   WORKLIST IS SENT TO NIP IF THERE IS NOT ENOUGH ROOM FOR ANOTHER
  182.   PUT ENTRY PLUS A GSM EBTRY OR IF IT IS A PUT FROM SUPERVISOR.
  183. #
  184. ISSUE = (SPACE$LEFT - BS) LS (NXTSIZE + GMMESIZE);
  185. END
  186.  
  187. ELSE # NOT ENOUGH ROOM FOR MSG IN #
  188. BEGIN # WORKLIST #
  189. IF DOWNUSE
  190. THEN # DOWNLINE MSG BUFFERING IN USE#
  191. BEGIN
  192. SAVEMODE = PARALLEL; # SAVE CURRENT MODE #
  193. PARALLEL = FALSE; # TEMP. TURN OFF PARALLEL MODE #
  194. NP$SEND; # SEND CURRENT WORKLIST TO NIP #
  195. PARALLEL = SAVEMODE; # RESTORE MODE #
  196.  
  197. NWL[NEXT] = 0; # RESTORE OP CODE AND ABH IN #
  198. NWL$ID[NEXT] = AWLID; # WORKLIST, AS THESE WERE NOT #
  199. NWL$OP[NEXT] = OP$PUT; # SENT TO NIP. #
  200. ABH[NEXT+1] = MEMWORD;
  201.  
  202. IF TLW LQ (SPACE$LEFT - GMMESIZE - NXTSIZE)
  203. THEN # NOW ROOM FOR MSG + HDR + GSM #
  204. BEGIN
  205. J = NEXT + OPABHSIZ; # BEGINNING ADDR FOR TEXT IN WL#
  206. P<MEM> = LOC$TA; # TEXT AREA IN APP FL #
  207. FOR I = 0 STEP 1 UNTIL (TLW-1)
  208. DO
  209. BEGIN
  210. NWL[I+J] = MEMWORD[I]; # COPY TEXT TO NWL #
  211. END
  212. BS = TLW + OPABHSIZ; # RESET NWL ENTRY SIZE #
  213. # DECIDE IF WL GOES TO NIP NOW #
  214. ISSUE = (SPACE$LEFT - BS) LS (NXTSIZE + GMMESIZE);
  215. END
  216. ELSE # MSG IS LARGER THAN BUFFER #
  217. BEGIN
  218. NWL$TA[NEXT] = LOC$TA; # SET TO TEXT AREA ADDRESS #
  219. END
  220. END
  221. ELSE # DOWNLINE BUFFERING NOT IN USE#
  222. BEGIN
  223. NWL$TA[NEXT] = LOC$TA; # SET TO TEXT AREA ADDRESS #
  224. END
  225. END
  226.  
  227. #
  228.   UPDATE HEADER AND CONTROL VARIABLES
  229. #
  230. NP$UCV;
  231.  
  232. IF ISSUE
  233. THEN
  234. NP$SEND; # SEND WORKLIST TO NIP #
  235.  
  236. #
  237.   UPDATE THE S AND I BITS IN THE NSUP WORD
  238. #
  239. NP$USI;
  240. RETURN; # RTN TO CALLER FOR COMPLETION #
  241. END # NP$PUT #
  242. TERM
cdc/nos2.source/nam5871/np_put.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator