User Tools

Site Tools


cdc:nos2.source:nam5871:nvfcpht

NVFCPHT

Table Of Contents

  • [00005] PROC NVFCPHT
  • [00006] NVFCPHT - PREPARE HOP TEXT.
  • [00010] PREPARE HOP TEXT.
  • [00045] PROC MOVE
  • [00046] PROC SSTAQE
  • [00047] PROC SSTETS
  • [00090] PROC SENDLINE

Source Code

NVFCPHT.txt
  1. *DECK NVFCPHT
  2. USETEXT TEXTNVF
  3. USETEXT TEXTSS
  4. USETEXT TXTAPSS
  5. PROC NVFCPHT;
  6. # TITLE NVFCPHT - PREPARE HOP TEXT. #
  7.  
  8. BEGIN # NVFCPHT #
  9. #
  10. ** NVFCPHT - PREPARE HOP TEXT.
  11. *
  12. * D. G. DEPEW. 82/02/25.
  13. *
  14. * THIS PROCEDURE PROCESSES TEXT LINES (TERMINAL TEXT) FROM THE
  15. * I-LAYER DESTINED FOR THE HOP. ITS FUNCTION IS TO FORMAT THE TEXT
  16. * INTO A HOP/DIS SM AND EITHER ISSUE IT, QUEUE IT OR DISCARD IT
  17. * AS APPROPRIATE.
  18. *
  19. * PROC NVFCPHT
  20. *
  21. * ENTRY WCBUF[0] = WORD COUNT WORD FROM ORIGINAL CONNECTION
  22. * TRAFFIC QUEUE (*CTQ*) ENTRY (CONTAINS THE
  23. * INPUT ALLOWED AND HOP ALERT FLAGS).
  24. * ABHBUF[0] = APPLICATION BLOCK (EVENT) HEADER FOR THE TEXT
  25. * (BASED ARRAY *ABH* IN *TXTAPSS* POINTS HERE).
  26. * MSGBUF[0] = DISPLAY CODED TEXT LINE (BASED ARRAY *APSM*
  27. * IN *TXTAPSS* POINTS HERE).
  28. *
  29. * EXIT ONE OR MORE OF THE FOLLOWING IN ACCORDANCE WITH THE STATE
  30. * OF THE HOP PSEUDO ACN AND WHETHER PAGE WAIT IS IN EFFECT:
  31. * - A HOP/DIS SM FOR THE TEXT HAS BEEN PLACED IN THE
  32. * OUTGOING TRAFFIC QUEUE (*OTQ*).
  33. * - THE TEXT HAS BEEN PLACED IN THE WAITING BLOCK QUEUE
  34. * (*WBQ*) IN HOP/DIS FORMAT PENDING PAGE TURN.
  35. * - THE TEXT HAS BEEN DISCARDED.
  36. * - A HOP/END SM HAS BEEN FORMATTED AND PLACED IN THE
  37. * PROTOCOL EVENT QUEUE (*PEQ*).
  38. #
  39.  
  40. #
  41. **** PROC NVFCPHT - XREF LIST.
  42. #
  43. XREF
  44. BEGIN
  45. PROC MOVE; # MOVE STORAGE DIRECT ADDRESSING (MACREL) #
  46. PROC SSTAQE; # ACCEPT QUEUE ENTRY #
  47. PROC SSTETS; # ENLARGE TABLE SPACE ANYWHERE IN TABLE #
  48. END
  49.  
  50. *CALL HMSGNVF
  51.  
  52. #
  53. ****
  54. #
  55.  
  56.  
  57. DEF ODWC$ #4#; # *OUTPUT DISCARDED* FAKE Q NTRY WD COUNT #
  58. DEF RWC$ #3#; # *READY..* FAKE QUEUE ENTRY WORD COUNT #
  59. DEF MTLW$ #2#; # *MORE DATA..* TEXT LENGTH IN WORDS #
  60.  
  61.  
  62. ARRAY READY [00:00] S(1);
  63. BEGIN
  64. ITEM R$WD0 U(00,00,60);
  65. ITEM R$TEXT C(00,00,07) = ["READY.."];
  66. ITEM R$ZERO U(00,42,18) = [0];
  67. END
  68.  
  69. ARRAY MORDATA [00:00] S(2);
  70. BEGIN
  71. ITEM M$WD0 U(00,00,60);
  72. ITEM M$WD1 U(01,00,60);
  73. ITEM M$TEXT C(00,00,11) = ["MORE DATA.."];
  74. ITEM M$ZERO U(01,06,54) = [0];
  75. END
  76.  
  77. ARRAY DISCARD [00:00] S(2);
  78. BEGIN
  79. ITEM D$WD0 U(00,00,60);
  80. ITEM D$WD1 U(01,00,60);
  81. ITEM D$TEXT C(00,00,16) = ["OUTPUT DISCARDED"];
  82. ITEM D$ZERO U(01,36,24) = [0];
  83. END
  84.  
  85.  
  86.  
  87.  
  88. CONTROL EJECT;
  89.  
  90. PROC SENDLINE;
  91.  
  92. BEGIN # SENDLINE #
  93. #
  94. * SENDLINE - SEND SINGLE LINE OF TEXT TO THE HOP.
  95. *
  96. * THIS EMBEDDED PROC EITHER OUTPUTS OR ENQUEUES A SINGLE LINE OF
  97. * HOP TEXT DEPENDING UPON WHETHER PAGE WAIT IS IN EFFECT.
  98. *
  99. * PROC SENDLINE
  100. *
  101. * ENTRY 1. THE TEXT IS DEFINED BY *WCBUF[0]*, *ABHBUF[0]* AND
  102. * *MSGBUF[0]* AS DESCRIBED ABOVE.
  103. * 2. THE STATE OF THE HOP PSEUDO ACN IS SUCH THAT IT IS OK
  104. * TO ISSUE HOP/DIS SM'S.
  105. * 3. THE TEXT LENGTH IS ALWAYS A MULTIPLE OF 10 CHARACTERS.
  106. *
  107. * EXIT 1. IF PAGE WAIT IS NOT IN EFFECT (PAGING TURNED OFF OR
  108. * LESS THAN 31 LINES ARE CURRENTLY BEING DISPLAYED), A
  109. * HOP/DIS SM HAS BEEN PLACED IN THE *OTQ*.
  110. * 2. IF PAGE WAIT IS IN EFFECT (PAGING TURNED ON AND EITHER
  111. * 31 OR 32 LINES ARE CURRENTLY BEING DISPLAYED), THE
  112. * TEXT HAS BEEN PLACED IN THE *WBQ* AS FOLLOWS:
  113. * - IF, UPON ENTRY, THERE WAS AN EXISTING *WBQ* ENTRY
  114. * FOR THE HOP AND THAT ENTRY CONTAINED FEWER THAN 31
  115. * LINES, THE TEXT WAS ADDED TO THE END OF THAT ENTRY.
  116. * - IF, UPON ENTRY, THERE WAS NO *WBQ* ENTRY FOR THE HOP
  117. * OR THAT ENTRY CONTAINED 31 OR 32 LINES, A NEW ENTRY
  118. * WAS CREATED.
  119. *
  120. * NOTES 1. HOP ENTRIES IN THE *WBQ* ARE IN HOP/DIS FORMAT AND MAY
  121. * BE MOVED TO THE *OTQ* WITHOUT MODIFICATION, EXCEPT FOR
  122. * THE ADDITION OF THE EXTRA WORD REQUIRED BY NIP.
  123. * 2. WHEN PAGING IS TURNED ON, THE 32ND LINE OF THE DISPLAY
  124. * IS RESERVED FOR THE *MORE DATA..* MESSAGE.
  125. #
  126.  
  127. ITEM I; # LOOP INDUCTION VARIABLE #
  128. ITEM TLW; # TEXT LENGTH IN WORDS #
  129. ITEM WBC; # WAITING BLOCK COUNT #
  130. ITEM TORD; # ORDINAL WHERE TEXT IS ADDED IN *WBQ* #
  131. ITEM WORD; # WAITING BLOCK QUEUE ENTRY ORDINAL #
  132.  
  133. BASED ARRAY TEXTLOC [00:00] S(1);
  134. ITEM TL$WORD U(00,00,60);
  135.  
  136.  
  137.  
  138. #
  139. * WE BEGIN BY INITIALIZING SOME ITEMS AND POINTERS PURSUANT TO
  140. * FORMATTING THE HOP/DIS SM.
  141. #
  142. PFCSFC[1] = HOPDIS;
  143. P<TEXTLOC> = LOC (SPMSG1[1]); # WHERE TEXT WILL BE MOVED TO #
  144. TLW = WCB$WC[0] - 2;
  145.  
  146.  
  147. #
  148. * IF PAGE WAIT IS NOT IN EFFECT, SIMPLY FORMAT THE HOP/DIS SM, SHIP
  149. * IT, INCREMENT THE COUNT OF LINES BEING DISPLAYED, AND GET OUT.
  150. * PROVIDE FOR THE EXTRA WORD IN THE HOP/DIS SM REQUIRED BY NIP.
  151. #
  152. IF NOT ACN$PWAIT[HOPORD$]
  153. OR ACN$BLCNT[HOPORD$] LS ACN$PL[HOPORD$]
  154. THEN # WE ARE NOT AT A PAGE BOUNDARY #
  155. BEGIN
  156. ABHTLC[1] = TLW + 2; # HOP/DIS TLC IN ABH #
  157. WCB$WORD[1] = TLW + 4; # HOP/DIS ENTRY SIZE IN *OTQ* #
  158. HOPI[1] = WCB$IAF[0]; # INPUT ALLOWED FLAG #
  159. MOVE (TLW, MSGBUF[0], TEXTLOC[0]); # TEXT #
  160. TL$WORD[TLW] = 0; # EXTRA WORD #
  161. SSTAQE (P<OTQ>, WCBUF[1], ABH[1], APSM[1]);
  162. ACN$BLCNT[HOPORD$] = ACN$BLCNT[HOPORD$] + 1; # LINE COUNT #
  163. RETURN;
  164. END
  165.  
  166.  
  167. #
  168. * PAGE WAIT IS IN EFFECT. IF THERE ARE CURRENTLY 31 LINES BEING
  169. * DISPLAYED, *MORE DATA..* IS SENT AS THE LAST LINE OF THE PAGE.
  170. #
  171. IF ACN$BLCNT[HOPORD$] EQ ACN$PL[HOPORD$]
  172. THEN # MUST SEND *MORE DATA..* #
  173. BEGIN
  174. ABHTLC[1] = 4; # *MORE DATA..* TLC IN ABH #
  175. WCB$WORD[1] = 6; # *MORE DATA..* ESIZE IN *OTQ* #
  176. HOPI[1] = FALSE; # INPUT NOT NECESSARILY ALLOWED #
  177. SPMSG1[1] = M$WD0[0]; # TEXT #
  178. SPMSG2[1] = M$WD1[0];
  179. SPMSG3[1] = 0; # EXTRA WORD #
  180. SSTAQE (P<OTQ>, WCBUF[1], ABH[1], APSM[1]);
  181. ACN$BLCNT[HOPORD$] = ACN$PL[HOPORD$] + 1; # LINE COUNT #
  182. END
  183.  
  184.  
  185. #
  186. * THE TEXT MUST BE ENQUEUED IN THE *WBQ*. THE FIRST TASK IS TO
  187. * LOCATE THE LAST HOP ENTRY IN THE *WBQ* (IF THERE IS ONE).
  188. * IF A HOP *WBQ* ENTRY IS EXTANT, ITS ORDINAL MUST, OF COURSE, BE
  189. * LESS THAN THE TOTAL LENGTH OF THE *WBQ*. THE SEARCH TECHNIQUE IS
  190. * SET UP SUCH THAT IF THERE IS NO HOP *WBQ* ENTRY, THE ORDINAL
  191. * RETURNED EQUALS THE *WBQ* LENGTH.
  192. #
  193. WBC = ACN$WBCNT[HOPORD$]; # NUMBER HOP ENTRIES IN *WBQ* #
  194. WORD = WBQLNGTH;
  195. FOR I=0 STEP WBQ$ESIZE[I]
  196. WHILE WBC NQ 0
  197. DO # FIND LAST ENTRY #
  198. IF WBQ$ABHACN[I] EQ 0
  199. AND WBQ$CRSACN[I] EQ 0
  200. THEN # MUST BE HOP/DIS ASYNCH SM #
  201. BEGIN
  202. WBC = WBC - 1;
  203. WORD = I; # SAVE ORDINAL #
  204. END
  205.  
  206.  
  207. #
  208. * IF THERE IS AN EXISTING *WBQ* ENTRY AND IT CONTAINS EXACTLY 31
  209. * LINES OF TEXT, THE *MORE DATA..* MESSAGE MUST BE ADDED TO THE END
  210. * OF THAT ENTRY. THIS WILL RESULT IN A NEW HOP *WBQ* ENTRY BEING
  211. * CREATED FOR THE NEW LINE OF TEXT FURTHER BELOW.
  212. #
  213. IF WORD LS WBQLNGTH
  214. AND WBQ$LICNT[WORD] EQ ACN$PL[HOPORD$]
  215. THEN # 31 LINE ENTRY EXISTS #
  216. BEGIN
  217. TORD = WORD + WBQ$ESIZE[WORD]; # WHERE MSG WILL BE ADDED #
  218. SSTETS (P<WBQ>, TORD, MTLW$); # MAKE ROOM #
  219. WBQ$WORD[TORD] = M$WD0[0]; # TEXT #
  220. WBQ$WORD[TORD+1] = M$WD1[0];
  221. WBQ$TLC[WORD] = WBQ$TLC[WORD] + MTLW$; # TLC IN ABH #
  222. WBQ$ESIZE[WORD] = WBQ$ESIZE[WORD] + MTLW$; # ENTRY SIZE #
  223. WBQ$LICNT[WORD] = HOPTPL$; # LINE COUNT #
  224. END
  225.  
  226.  
  227. #
  228. * FINALLY, THE NEW LINE OF TEXT CAN BE ENQUEUED. IF A HOP *WBQ*
  229. * ENTRY IS EXTANT AND IT CONTAINS FEWER THAN 31 LINES OF TEXT, THE
  230. * NEW LINE CAN (MUST) BE ADDED TO THE EXISTING ENTRY. OTHERWISE,
  231. * CREATE A NEW ENTRY.
  232. #
  233. IF WORD LS WBQLNGTH
  234. AND WBQ$LICNT[WORD] LS ACN$PL[HOPORD$]
  235. THEN # CAN ADD TEXT TO EXISTING NTRY #
  236. BEGIN
  237. TORD = WORD + WBQ$ESIZE[WORD]; # WHERE TEXT WILL BE ADDED #
  238. SSTETS (P<WBQ>, TORD, TLW); # MAKE ROOM #
  239. MOVE (TLW, MSGBUF[0], WBQ[TORD]); # TEXT #
  240. WBQ$TLC[WORD] = WBQ$TLC[WORD] + TLW; # TLC IN ABH #
  241. WBQ$ESIZE[WORD] = WBQ$ESIZE[WORD] + TLW; # ENTRY SIZE #
  242. WBQ$LICNT[WORD] = WBQ$LICNT[WORD] + 1; # LINE COUNT #
  243. IF WCB$IAF[0]
  244. THEN # INPUT IS ALLOWED WITH THIS LINE OF TEXT #
  245. WBQ$HIAF[WORD] = TRUE; # ENSURE SAME FOR ENTIRE Q'D HOP/DIS #
  246. END
  247.  
  248. ELSE # CREATE NEW *WBQ* ENTRY #
  249. BEGIN
  250. ABHTLC[1] = TLW + 1; # HOP/DIS TLC IN ABH #
  251. WCB$WORD[1] = TLW + 3; # HOP/DIS ENTRY SIZE IN *WBQ* #
  252. WCB$FLAGS[1] = 1; # INITIAL LINE COUNT #
  253. HOPI[1] = WCB$IAF[0]; # INPUT ALLOWED FLAG #
  254. MOVE (TLW, MSGBUF[0], TEXTLOC[0]); # TEXT #
  255. SSTAQE (P<WBQ>, WCBUF[1], ABH[1], APSM[1]);
  256. ACN$WBCNT[HOPORD$] = ACN$WBCNT[HOPORD$] + 1; # WAITING BLOCKS #
  257. END
  258.  
  259. END # SENDLINE #
  260.  
  261.  
  262.  
  263.  
  264.  
  265. CONTROL EJECT;
  266. #
  267. * MAIN ROUTINE BEGINS HERE.
  268. *
  269. * WE BEGIN BY INITIALIZING SOME FIELDS IN THE OUTGOING ABH AND SM
  270. * BODY AREAS. THEN WE TAKE A MAIN BRANCH DEPENDING ON WHETHER
  271. * INPUT IS ALLOWED AFTER THIS TEXT IS OUTPUT TO THE HOP.
  272. #
  273.  
  274. ABHWORD[1] = 0;
  275. ABHABT[1] = APPCMD;
  276. ABHACT[1] = CT60TRANS;
  277. SPMSG0[1] = 0;
  278.  
  279.  
  280.  
  281. IF WCB$IAF[0]
  282. THEN # COMMAND COMPLETE, INPUT ALLOWED #
  283. BEGIN
  284.  
  285.  
  286. #
  287. * IF THE HOP HAS A COMMAND IN PROGRESS, THE TEXT IS PROCESSED
  288. * NORMALLY. IF HE HAD ENTERED A BREAK, THE TEXT IS DISCARDED
  289. * AND THE MESSAGE *OUTPUT DISCARDED* IS SENT. THE STATE OF THE
  290. * HOP PSEUDO ACN IS RESET TO ALLOW SUBSEQUENT COMMANDS.
  291. #
  292. IF ACN$HOPST[HOPORD$] EQ S"COMMAND"
  293. OR ACN$HOPST[HOPORD$] EQ S"BREAK"
  294. THEN # COMMAND OR BREAK IN PROGRESS #
  295. BEGIN
  296. IF ACN$HOPST[HOPORD$] EQ S"BREAK"
  297. THEN # BREAK IN PROGRESS #
  298. BEGIN # SET TEXT = *OUTPUT DISCARDED* #
  299. SPMSG0[0] = D$WD0[0];
  300. SPMSG1[0] = D$WD1[0];
  301. WCB$WC[0] = ODWC$;
  302. END
  303. ACN$HOPST[HOPORD$] = S"ACTIVE";
  304.  
  305.  
  306. #
  307. * WE NOW DO THE ACTUAL PROCESSING OF THE TEXT. THE I-LAYER
  308. * NEVER GENERATES *READY..*. THIS IS GENERATED BY THE C-LAYER
  309. * (HEREIN) AS A RESULT OF THE INPUT ALLOWED FLAG BEING SET.
  310. * THE TEXT MUST BE OUTPUT FIRST WITH INPUT NOT ALLOWED FOLLOWED
  311. * BY *READY..* WITH INPUT ALLOWED. THE RESPONSE TO MANY
  312. * COMMANDS CONSISTS SOLELY OF *READY..* (NULL TEXT).
  313. #
  314. IF WCB$WC[0] GR 2
  315. THEN # THERE IS TEXT #
  316. BEGIN
  317. WCB$IAF[0] = FALSE;
  318. SENDLINE; # SO SHIP IT #
  319. WCB$IAF[0] = TRUE;
  320. END
  321. SPMSG0[0] = R$WD0[0]; # SET TEXT = *READY..* #
  322. WCB$WC[0] = RWC$;
  323. SENDLINE; # AND SHIP IT #
  324. #
  325. * SEND THE FIRST PAGE OF THE HELP TEXT TO THE RIGHT K-DISPLAY.
  326. #
  327. WCB$SMID[1] = HOPDIS;
  328. WCB$WC[1] = RKPAGESZ$ + 1;
  329. ABHWORD[1] = 0;
  330. ABHABT[1] = APPCMD;
  331. ABHACT[1] = CT60TRANS;
  332. ABHTLC[1] = RKPAGESZ$;
  333. CURPAGE = PAGE1$;
  334.  
  335. SSTAQE(P<OTQ>,WCBUF[1],ABH[1],RKPAGE[CURPAGE]);
  336. END
  337.  
  338. ELSE # NEITHER BREAK NOR COMMAND IN PROGRESS #
  339. BEGIN
  340.  
  341.  
  342. #
  343. * FOR ALL OTHER STATES OF THE HOP PSUEDO ACN WE DISCARD THE
  344. * TEXT AND SEND A HOP/END PROTOCOL EVENT TO THE INNER LAYER.
  345. #
  346. WCB$WORD[1] = 2; # MIN QUEUE ENTRY SIZE #
  347. WCB$SMID[1] = HPESTAT"HOPEND";
  348. SSTAQE (P<PEQ>, WCBUF[1], ABH[1], APSM[1]);
  349. END
  350.  
  351. END # INPUT ALLOWED = YES #
  352.  
  353.  
  354.  
  355. ELSE # INPUT NOT ALLOWED AS RESULT THIS TEXT #
  356. BEGIN
  357.  
  358.  
  359. #
  360. * IF THE HOP IS IDLE OR HAS A COMMAND IN PROGRESS, PROCESS THE
  361. * TEXT NORMALLY (TEXT COULD BE THE RESULT OF AN UNSOLICITED EVENT
  362. * REPORT OR A COMMAND). IF THE K-DISPLAY IS NOT CURRENTLY
  363. * ASSIGNED TO NVF, AND THE HOP HAS NOT ENTERED AN *IG=NVF*
  364. * COMMAND, AND THIS MESSAGE WARRANTS AN ALERT, SEND A HOP/ALT SM
  365. * TO NAM. FOR ALL OTHER CONDITIONS, SIMPLY DISCARD THE TEXT.
  366. #
  367. IF ACN$HOPST[HOPORD$] EQ S"ACTIVE"
  368. OR ACN$HOPST[HOPORD$] EQ S"COMMAND"
  369. THEN # ALL IS WELL, FORWARD THE TEXT #
  370. SENDLINE;
  371.  
  372. ELSE IF ACN$HOPST[HOPORD$] EQ S"INACT"
  373. OR ACN$HOPST[HOPORD$] EQ S"ENDED"
  374. OR ACN$HOPST[HOPORD$] EQ S"STARTEND"
  375. THEN # K-DIS NOT NOW ASSIGNED TO NVF #
  376. IF WCB$HAF[0]
  377. AND NOT ACN$IGNOR[HOPORD$]
  378. THEN # MUST SEND HOP/ALT SM TO NIP #
  379. BEGIN
  380. WCB$WORD[1] = 3;
  381. ABHTLC[1] = LHOPALT;
  382. PFCSFC[1] = HOPALT;
  383. SSTAQE (P<OTQ>, WCBUF[1], ABH[1],APSM[1]);
  384. END
  385.  
  386. END # INPUT ALLOWED = NO #
  387.  
  388. END # NVFCPHT #
  389.  
  390. TERM
cdc/nos2.source/nam5871/nvfcpht.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator