User Tools

Site Tools


cdc:nos2.source:nam5871:ns_msg

NS$MSG

Table Of Contents

  • [00012] PROC NS$MSG(MSG$TXT,(MSGSIZE),(MSGROUTING))
  • [00014] NS$MSG - DISPATCH MESSAGE.
  • [00018] DISPATCH MESSAGE.
  • [00077] PROC NS$DBG
  • [00083] PROC ABORT
  • [00084] PROC CLOCK
  • [00085] PROC EXINCSZ
  • [00086] PROC EXREDUC
  • [00087] PROC MESSAGE
  • [00088] PROC MOVEI
  • [00089] PROC MOVEOK
  • [00090] PROC NETCHEK
  • [00091] PROC NETPUT
  • [00092] PROC NS$TKD
  • [00093] PROC TSBINFO

Source Code

NS$MSG.txt
  1. *DECK NS$MSG
  2. USETEXT COM$NS
  3. USETEXT DEF$NS
  4. USETEXT HIS$NS
  5. USETEXT LIN$NS
  6. USETEXT NPT$NS
  7. USETEXT NST$NS
  8. USETEXT PFC$NS
  9. USETEXT SMD$NS
  10. USETEXT SMB$NS
  11.  
  12. PROC NS$MSG(MSG$TXT,(MSGSIZE),(MSGROUTING)); # DISPATCH MSG #
  13.  
  14. # TITLE NS$MSG - DISPATCH MESSAGE. #
  15.  
  16. BEGIN # NS$MSG #
  17. #
  18. ** NS$MSG - DISPATCH MESSAGE.
  19. *
  20. * J.C. LEE 1981
  21. *
  22. * THIS ROUTINE DISPATCHES MESSAGES.
  23. *
  24. * PROC NS$MSG(MSG$TXT,(MSGSIZE),(MSGROUTING))
  25. *
  26. * ENTRY:
  27. * MSG$TXT = A MESSAGE TEXT ARRAY OF UP TO 58
  28. * CHARACTERS AND LINE TERMINATOR.
  29. * (ZERO BYTE)
  30. * MSGSIZE = LENGTH OF MESSAGE TEXT IN CM WORDS.
  31. * MSGROUTING = MESSAGE ROUTING OPTIONS, CAN ONE OR
  32. * ANY COMBINATIONS OF THE FOLLOWING:
  33. * - HOP COMMAND INDICATOR.
  34. * - ABORT NS INDICATOR.
  35. * - NAM ERROR INDICATOR.
  36. * - NETWORK LOG FILE INDICATOR.
  37. * - SIGNIFICANT EVENT INDICATOR.
  38. * - DAYFILE MESSAGE INDICATOR.
  39. * - MACREL MESSAGE MACRO ROUTING OPTIONS.
  40. *
  41. * EXIT:
  42. * NONE.
  43. *
  44. * METHOD:
  45. * USE *MSGROUTING* TO DETERMINE ACTION TO TAKE.
  46. * IF MESSAGE MACRO OPTIONS:
  47. * USE MESSAGE MACRO TO ROUTE IT TO THE
  48. * SPECIFIED DAYFILES.
  49. * IF NETWORK LOG FILE OPTION:
  50. * ADD LINE HEADER.
  51. * TIME STAMP IT.
  52. * SEND IT TO HISTORY BUFFER.
  53. * IF K-DISPLAY ASSIGNED:
  54. * SEND IT TO *KDB*.
  55. * ELSE
  56. * IF SIGNIFICANT EVENT:
  57. * LOG IN NPU STATUS TABLE.
  58. * SET PROGRAM ID, SEND HOP/LG
  59. * IF NAM ERROR INDICATOR SET:
  60. * SEND DBG/STOP TO ABORT NIP.
  61. * IF ABORT NS INDICATOR SET:
  62. * NETCHECK
  63. * ABORT NS.
  64. *
  65. #
  66.  
  67. ARRAY MSG$TXT; # MESSAGE TEXT #
  68. BEGIN
  69. ITEM MSGTXTWORD U(0,0,60);
  70. END
  71. ITEM MSGSIZE U; # MESSAGE TEXT SIZE IN CM WORDS #
  72. ITEM MSGROUTING U; # MESSAGE ROUTING OPTIONS #
  73.  
  74. $BEGIN
  75. XREF
  76. BEGIN
  77. PROC NS$DBG; # TRACE CALL #
  78. END
  79. $END
  80.  
  81. XREF
  82. BEGIN
  83. PROC ABORT; # ABORT NS #
  84. PROC CLOCK; # GET DISPLAY-CODED CLOCK TIME #
  85. PROC EXINCSZ; # INCREASE TSB SIZE #
  86. PROC EXREDUC; # REDUCE TSB SIZE #
  87. PROC MESSAGE; # ISSUE DAYFILE MESSAGE #
  88. PROC MOVEI; # MOVE DATA #
  89. PROC MOVEOK; # ALLOW TSB TO MOVE #
  90. PROC NETCHEK; # FLUSH NWL BUFFER TO SEND ALL SM-S #
  91. PROC NETPUT; # NETPUT #
  92. PROC NS$TKD; # MOVE DATA TO K-DISPLAY TSB #
  93. PROC TSBINFO; # LOCATE TSB #
  94. END
  95.  
  96. DEF L$CLOCK # 1 #; # NUMBER OF WORDS FOR TIME STAMP #
  97. DEF L$MSGTEXT # 7 #; # SIZE OF MESSAGE TEXT #
  98.  
  99. ITEM ADDR U; # TEMPORARY VARIABLE #
  100. ITEM I I; # LOOP VARIABLE #
  101. ITEM LNSIZE U; # LINE SIZE #
  102. ITEM NSTTSBN U; # TSB NUMBER OF NPU STATUS TABLE #
  103. ITEM TIME U; # DISPLAY CODED TIME OF DAY #
  104. ITEM TSBFWA U; # TSB FWA #
  105. ITEM TSBSIZE U; # TSB SIZE #
  106.  
  107. ARRAY ROPTIONS [0:0] S(1);
  108. BEGIN # MESSAGE ROUTING OPTIONS #
  109. ITEM ROUTING U(00,00,60);
  110. ITEM F$HOPCMD B(00,50,01); # HOP COMMAND INDICATOR #
  111. ITEM F$ABORT B(00,51,01); # ABORT NS INDICATOR #
  112. ITEM F$NAMERR B(00,52,01); # NAM ERROR INDICATOR #
  113. ITEM F$NAMLOG B(00,53,01); # NETWORK LOG FILE INDICATOR #
  114. ITEM F$SIGEVENT B(00,54,01); # SIGNIFICANT EVENT INDICATOR #
  115. ITEM F$EVENT B(00,55,01); # EVENT MESSAGE INDICATOR #
  116. ITEM F$MESSAGE B(00,56,01); # DAYFILE MESSAGE INDICATOR #
  117. ITEM MSGOPTIONS U(00,57,03); # MESSAGE MACRO ROUTING OPTIONS #
  118. END
  119.  
  120. ARRAY ABH [0:0] S(1);
  121. BEGIN # APPLICATION BLOCK HEADER #
  122. ITEM ABH$ABT U(00,00,06) = [APPCMD];
  123. ITEM ABH$ADR U(00,06,12) = [0];
  124. ITEM ABH$ABN U(00,18,18) = [0];
  125. ITEM ABH$ACT U(00,36,04) = [CT60TRANS];
  126. ITEM ABH$DBC U(00,40,08) = [0];
  127. ITEM ABH$TLC U(00,48,12);
  128. END
  129.  
  130. ARRAY SMHDR[00:00] S(1);
  131. BEGIN
  132. ITEM SM$PFCSFC U(00,00,16); # SM PFC/SFC CODE #
  133. ITEM SM$HDRWORD U(00,00,60); # WHOLE WORD REFERENCE #
  134. END
  135.  
  136. DEF L$MSGLINE # 8 #; # SIZE OF MESSAGE LINE #
  137. ARRAY MSGLINE [0:0] S(L$MSGLINE);
  138. BEGIN # MESSAGE LINE FORMAT #
  139. ITEM MSG$LINHDR U(00,00,60); # LINE HEADER WORD #
  140. ITEM MSG$LINID U(00,00,24);
  141. ITEM MSG$LINSIZ U(00,42,18); # LINE SIZE IN WORDS #
  142. ITEM MSG$LINEND B(00,41,01); # END OF CMD RESPONSE FLAG #
  143. ITEM MSG$PROCID C(00,00,10); # NS ID #
  144. ITEM MSG$TIME U(01,00,60); # TIME STAMP #
  145. ITEM MSG$TXTWD U(02,00,60); # MESSAGE TEXT #
  146. END
  147.  
  148. CONTROL EJECT;
  149.  
  150. $BEGIN
  151. NS$DBG("MSG"); # TRACE CALL #
  152. $END
  153.  
  154. ROUTING[0] = MSGROUTING; # MESSAGE ROUTING OPTIONS #
  155.  
  156. IF F$MESSAGE[0]
  157. THEN # ISSUE DAYFILE MESSAGE #
  158. MESSAGE(MSG$TXT,MSGOPTIONS[0]);
  159.  
  160. IF F$NAMLOG[0]
  161. THEN # NETWORK LOG FILE MESSAGE #
  162. BEGIN
  163. CLOCK(TIME); # GET DISPLAY CODED TIME OF DAY #
  164. LNSIZE = LIN$HDRL + L$CLOCK + MSGSIZE; # SIZE OF NEW LINE #
  165. P<LIN$HEADER> = LOC(MSG$LINHDR);
  166. LIN$HDRWD[0] = 0;
  167. LIN$ID[0] = LIN$IDENT;
  168. LIN$LNSIZE[0] = LNSIZE;
  169. MSG$TIME[0] = TIME; # TIME STAMPED NEW LINE #
  170. MOVEI(MSGSIZE,LOC(MSG$TXT),LOC(MSG$TXTWD));
  171. #
  172.   ADD NEW MESSAGE LINE TO HISTORY BUFFER
  173. #
  174. IF HISTSBN NQ 0
  175. THEN # NS INITIALIZATION HAS COMPLETED #
  176. BEGIN
  177. TSBINFO(TSBSIZE,TSBFWA,HISTSBN); # LOCATE HISTORY BUFFER #
  178. P<HIS$BUFFER> = 0;
  179.  
  180. IF HIS$LC[TSBFWA] GQ HIS$MAX$LN
  181. THEN # MAX HISTORY BUFFER LINE COUNT REACHED #
  182. BEGIN # REMOVE FIRST LINE OF HISTORY BUFFER #
  183. P<LIN$HEADER> = TSBFWA + HIS$HDRL; # FWA OF FIRST LINE #
  184. I = LIN$LNSIZE[0]; # SIZE OF FIRST LINE #
  185. MOVEI(HIS$HDRL,TSBFWA,TSBFWA+I); # REMOVE FIRST LINE #
  186. EXREDUC(I,HISTSBN,TRUE,TSBFWA); # RETURN UNUSED SPACE #
  187. HIS$WC[TSBFWA] = HIS$WC[TSBFWA] - I; # UPDATE WORD COUNT #
  188. END
  189.  
  190. ELSE # UPDATE HISTORY BUFFER LINE COUNT #
  191. HIS$LC[TSBFWA] = HIS$LC[TSBFWA] + 1; # INCREMENT LINE COUNT#
  192.  
  193. EXINCSZ(LNSIZE,TSBFWA,HISTSBN); # INCREASE HISTORY BUFF SIZE #
  194. MSG$LINEND[0] = FALSE; # NOT COMMAND RESPONSE #
  195. MOVEI(LNSIZE,LOC(MSG$LINHDR),TSBFWA+HIS$WC[TSBFWA]);
  196. HIS$WC[TSBFWA] = HIS$WC[TSBFWA] + LNSIZE; # UPDATE WORD CNT #
  197. MOVEOK(HISTSBN); # ALLOW HISTORY BUFFER TO MOVE #
  198. END
  199.  
  200. #
  201.   IF K DISPLAY IS ASSIGNED, SEND LINE TO K DISPLAY
  202. #
  203. IF DCW$F$ASS[0]
  204. THEN # K-DISPLAY ASSIGNED #
  205. BEGIN
  206. IF NOT F$HOPCMD[0]
  207. THEN # NOT A HOP COMMAND #
  208. BEGIN # DRIBBLE LINE TO K DISPLAY #
  209. MSG$LINEND[0] = TRUE; # END OF RESPONSE #
  210. NS$TKD(MSGLINE,LNSIZE,1); # MOVE LINE TO K DISPLAY TSB #
  211. END
  212.  
  213. END
  214.  
  215. ELSE # K-DISPLAY NOT ASSIGNED #
  216. BEGIN
  217. IF F$SIGEVENT[0] # A SIGNIFICANT EVENT MESSAGE #
  218. AND NOT DCW$F$IG[0] # ALERT ALLOWED #
  219. THEN # SEND HOP/ALT TO ALERT HOP #
  220. BEGIN
  221. ABH$TLC[0] = LHOPALT; # SET TEXT LENGTH #
  222. SM$HDRWORD[0] = 0;
  223. SM$PFCSFC[0] = HOPALT; # SET PFC/SFC CODE #
  224. NETPUT(ABH,SMHDR); # SEND HOP/ALT/SM #
  225. END
  226. END
  227.  
  228. IF F$EVENT[0]
  229. THEN # AN EVENT MESSAGE #
  230. BEGIN # LOG IN NPU STATUS TABLE #
  231. NSTTSBN = NPT$NSTTSB[NTORD]; # TSB NUMBER OF NST #
  232. TSBINFO(TSBSIZE,TSBFWA,NSTTSBN); # LOCATE NST #
  233. P<NST> = TSBFWA; # FWA OF NST #
  234. ADDR = LOC(NST$EVMSG[0]); # FWA OF EVENT MESSAGE IN NST #
  235. MOVEI(MSGSIZE+L$CLOCK,LOC(MSG$TIME[0]),ADDR); # MOVE TO NST #
  236. MOVEOK(NSTTSBN); # ALLOW NST TO MOVE #
  237. END
  238.  
  239. #
  240.   SEND HOP/LG TO NIP TO ENTER MESSAGE IN NETWORK LOG FILE
  241. #
  242.  
  243. MSG$PROCID[0] = "NS/ "; # SET PROGRAM ID #
  244. ABH$TLC[0] = LNSIZE + 1;
  245. SM$HDRWORD[0] = 0;
  246. SM$PFCSFC[0] = HOPLG;
  247. NETPUT(ABH,SMHDR); # SEND HOP/LG TO NIP #
  248.  
  249. END
  250.  
  251. $BEGIN
  252. IF F$NAMERR[0]
  253. THEN # NAM ERROR DETECTED #
  254. BEGIN # SEND DBG/STP TO NIP #
  255. ABH$TLC[0] = LDBG; # SET TEXT LENGTH IN CHARACTERS #
  256. SM$HDRWORD[0] = 0;
  257. SM$PFCSFC[0] = DBGSTOP; # SET PFC/SFC CODE #
  258. NETPUT(ABH,SMHDR); # SEND DBG/STOP TO ABORT NIP #
  259. END
  260. $END
  261.  
  262. IF F$ABORT[0]
  263. THEN
  264. BEGIN # A FATAL NS ERROR MESSAGE #
  265. NETCHEK; # MAKE SURE ALL SM-S ARE SENT #
  266. ABORT; # ABORT NS #
  267. END
  268.  
  269. RETURN;
  270. END # NS$MSG #
  271. TERM
cdc/nos2.source/nam5871/ns_msg.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator