User Tools

Site Tools


cdc:nos2.source:nam5871:np_gsm

NP$GSM

Table Of Contents

  • [00010] PROC NP$GSM
  • [00066] PROC NP$DBG
  • [00068] PROC NP$ERR
  • [00070] PROC NP$SN

Source Code

NP$GSM.txt
  1. *DECK NP$GSM
  2. USETEXT AIPDEF
  3. USETEXT NP$MODE
  4. USETEXT NP$NWL
  5. USETEXT NP$STAT
  6. USETEXT NP$TAA
  7. *IF,DEF,DEBUG
  8. USETEXT NP$DB
  9. *ENDIF
  10. PROC NP$GSM;
  11. *IF DEF,IMS
  12. #
  13. *1DC NP$GSM
  14. *
  15. * 1. PROC NAME AUTHOR DATE
  16. * NP$GSM S.KRULEVITCH 77/05/23
  17. *
  18. * 2. FUNCTIONAL DESCRIPTION
  19. * THIS ROUTINE IS CALLED FROM AIP. IT COPIES ONE SUPERVISORY
  20. * MESSAGE (IF ANY) TO THE TEXT AREA (TA) OF THE APPLICATION. IF
  21. * NO SUPERVISORY MESSAGES ARE LEFT, IT RETURNS A NULL BLOCK
  22. *
  23. * 3. METHOD USED
  24. * THE SUPERVISOR MESSAGE BUFFER STARTS AT FIRST AND ENDS AT
  25. * LAST. HEAD AND FOOT ARE INDICES WHICH POINT RESPECTIVELY
  26. * TO THE START OF THE LIST OF SUPERVISORY MESSAGES AND TO THE
  27. * WORD FOLLOWING THE LAST SUPERVISORY MESSAGE. THE MESSAGE LENGTH
  28. * IS GIVEN BY GSM$TLC IN THE HEADER. THIS INFORMATION ALLOWS
  29. * NP$GSM TO TRANSFER THE MESSAGE TO TA (TEXT AREA) AND UPDATE
  30. * HEAD FOR THE NEXT CALL TO NP$GSM.
  31. *
  32. * 4. ENTRY CONDITIONS
  33. * TLMX - MAXIMUM MESSAGE LENGTH
  34. * LOC$HA - LOCATION OF HEADER AREA
  35. * LOC$TA - LOCATION OF TEXT AREA
  36. * HEAD - INDEX IN SMB OF THE CURRENT SUPERVISORY MESSAGE.
  37. * HEAD = FOOT IF THERE ARE NO MESSAGES.
  38. *
  39. * 5. EXIT CONDITIONS
  40. * HA - HEADER AREA, CONTAINS THE HEADER
  41. * TA - TEXT AREA, CONTAINS THE SUPERVISORY BLOCK
  42. * HEAD - INDEX IN SMB OF NEXT SUPERVISORY MESSAGE
  43. *
  44. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  45. * AIPDEF NP$CRT NP$DB NP$MODE
  46. * NP$NWL NP$STAT NP$TAA
  47. *
  48. * 7. ROUTINES CALLED
  49. * NP$DBG - LOGS DEBUG MESSAGE TO ZZZZZDN
  50. * NP$ERR - PRINTS ERROR MESSAGES AND STOPS
  51. * NP$SN - INCREMENTS STATISTICS COUNTER
  52. *
  53. * 8. DAYFILE MESSAGES
  54. * NAM ERROR (UNDER E OPTION ONLY. INCORRECT CHARACTER TYPE)
  55. *
  56.  #
  57. *ENDIF
  58. BEGIN
  59.  
  60. *CALL NP$CRT
  61. # #
  62. # EXTERNAL ROUTINES: #
  63. # #
  64. XREF BEGIN
  65. *IF DEF,DEBUG
  66. PROC NP$DBG; #LOG MESSAGE TO FILE ZZZZZDN #
  67. *ENDIF
  68. PROC NP$ERR; #ERROR PROCESSOR #
  69. *IF DEF,STAT
  70. PROC NP$SN; #INCREMENTS STATISTICS COUNTER#
  71. *ENDIF
  72. END
  73. # #
  74. # LOCAL DECLARATIONS: #
  75. # #
  76. ITEM
  77. I I, #LOOP CONTROL VARIABLE #
  78. J I, #TEMPORARY INDEX #
  79. K I, #TEMPORARY INDEX #
  80. N I, #WORDS OF SM TRANSFERRED - 1 #
  81. *IF DEF,STAT
  82. ST$TEMP I, #TEMPORARY LOCATION #
  83. *ENDIF
  84. TLW I, #ACTUAL SIZE OF SM #
  85. TLWDIF I; #TLW - SUM OF TAASIZE[K] #
  86. ITEM NOWHEAD I ;
  87. BASED ARRAY MEM S(1);
  88. ITEM
  89. HA I (0), #HEADER AREA #
  90. WORD I (0); #TEXT ARRAY #
  91. #**********************************************************************#
  92. # #
  93. # NP$GSM EXECUTION BEGINS HERE #
  94. # #
  95. *IF DEF,DEBUG,1
  96. # #
  97. # IF NO SM"S, RETURN NULL BLOCK #
  98. # #
  99. P<MEM> = LOC$HA;
  100. IF HEAD EQ FOOT
  101. THEN
  102. BEGIN
  103. HA=0; #RETURN NULL BLOCK #
  104. *IF DEF,STAT
  105. # #
  106. # UPDATE STATISTICS IF STATISTIC GATHERING IS ON #
  107. # #
  108. NP$SN(TYPE"INB");
  109. *ENDIF
  110. END
  111. # #
  112. # COPY NEXT SUPERVISORY MESSAGE TO TEXT ARRAY #
  113. # #
  114. ELSE
  115. BEGIN
  116. IF GSM[HEAD] EQ 0
  117. THEN
  118. HEAD = FIRST; #WRAP AROUND HAS OCCURRED #
  119. NOWHEAD = HEAD ;
  120. IF GSM$ACT[HEAD] EQ CT60TRANS
  121. THEN
  122. TLW = GSM$TLC[HEAD];
  123. ELSE
  124. TLW = (2*GSM$TLC[HEAD] + 14)/15;
  125. IF TLW GR TLMX
  126. THEN
  127. BEGIN
  128. GSM$IBU[HEAD] = TRUE ; # INPUT BLOCK UNDELIVERAB #
  129. END
  130.  
  131. ELSE
  132. BEGIN
  133. GSM$IBU[HEAD] = FALSE ; # RESET IBU FROM PREVIOUS #
  134. N = TLW - 1;
  135. P<MEM> = LOC$TA;
  136. P<TAA> = LOC$TA;
  137. J = HEAD + 1;
  138. TLWDIF = TLW;
  139. CONTROL FASTLOOP;
  140. FOR K = 1 STEP 1 UNTIL LTAA DO
  141. BEGIN
  142. IF LTAA NQ 0
  143. THEN
  144. BEGIN
  145. P<MEM> = TAADDR[K];
  146. N = TAASIZE[K] - 1;
  147. IF N GR TLWDIF #MAKE SURE THAT AIP IS ONLY #
  148. THEN #COPYING THE SUPERVISORY #
  149. N = TLWDIF - 1; #MESSAGE TO THE FRAGMENTED #
  150. #BUFFERS - NO MATTER WHAT SIZE#
  151. #HAS BEEN SPECIFIED IN THE #
  152. #TEXT AREA ARRAY. #
  153. TLWDIF = TLWDIF - TAASIZE[K];
  154. END
  155.  
  156. CONTROL SLOWLOOP;
  157. FOR I = 0 STEP 1 UNTIL N DO
  158. BEGIN
  159. WORD[I] = GSM[I+J];
  160. END
  161.  
  162. J = J + TAASIZE[K];
  163. END
  164.  
  165. *IF DEF,STAT
  166. # #
  167. # UPDATE STATISTICS IF STATISTIC GATHERING IS TURNED ON #
  168. # #
  169. I = GSM$ABT[HEAD] + TYPE"INB";
  170. NP$SN(I);
  171. # INCREMENT ERROR COUNT IF THE LAST DELIVERED SUPERVISORY #
  172. # MESSAGE WAS AN ERR/LGL (X"8401") OR A FC/NAK (X"8303") #
  173. ST$TEMP = B<0,16>GSM[HEAD+1];
  174. IF ST$TEMP EQ ERRLGL
  175. THEN
  176. BEGIN
  177. NP$SN(TYPE"ERRS"); #INCREMENT COUNTER #
  178. END
  179. IF ST$TEMP EQ FCNAK
  180. THEN
  181. BEGIN
  182. NP$SN(TYPE"NAKS"); #INCREMENT COUNTER #
  183. END
  184. *ENDIF
  185. # #
  186. # UPDATE POINTERS IF MESSAGE WAS SENT TO APP (TLW LQ TLMX) #
  187. # #
  188. HEAD = HEAD + TLW + 1; #TLW DOES NOT INCLUDE HEADER #
  189. IF HEAD GR WLLEN
  190. THEN
  191. BEGIN
  192. HEAD = FIRST;
  193. END
  194.  
  195. END #SUPERVISORY MESSAGE DELIVERED#
  196.  
  197. P<MEM> = LOC$HA ;
  198. HA = GSM[NOWHEAD] ; # RETURN HEADER #
  199. *IF DEF,DEBUG
  200. NP$DBG; #WRITE MSG TO AIP DEBUG FILE #
  201. *ENDIF
  202. IF HEAD EQ FOOT
  203. THEN
  204. BEGIN
  205. HEAD = FIRST;
  206. FOOT = FIRST;
  207. END #EMPTY SMB#
  208.  
  209. END
  210. RETURN;
  211. END #NP$GSM#
  212. TERM
cdc/nos2.source/nam5871/np_gsm.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator