User Tools

Site Tools


cdc:nos2.source:nam5871:cscpht

CSCPHT

Table Of Contents

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

Source Code

CSCPHT.txt
  1. *DECK CSCPHT
  2. USETEXT TEXTCS
  3. USETEXT TEXTSS
  4. USETEXT TXTAPSS
  5. PROC CSCPHT;
  6. # TITLE CSCPHT - PREPARE HOP TEXT. #
  7.  
  8. BEGIN # CSCPHT #
  9. #
  10. ** CSCPHT - 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 CSCPHT
  20. *
  21. * ENTRY WCBUF[0] = WORD COUNT WORD FROM ORIGINAL CONNECTION
  22. * TRAFFIC QUEUE (*CNQ*) 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 CON/CB SM HAS BEEN FORMATTED AND PLACED IN THE
  37. * PROTOCOL EVENT QUEUE (*PEQ*).
  38. #
  39.  
  40. #
  41. **** PROC CSCPHT - 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. ****
  51. #
  52.  
  53.  
  54. DEF ODWC$ #4#; # *OUTPUT DISCARDED* FAKE Q NTRY WD COUNT #
  55. DEF RWC$ #3#; # *READY..* FAKE QUEUE ENTRY WORD COUNT #
  56. DEF MTLW$ #2#; # *MORE DATA..* TEXT LENGTH IN WORDS #
  57.  
  58.  
  59. ARRAY READY [00:00] S(1);
  60. BEGIN
  61. ITEM R$WD0 U(00,00,60);
  62. ITEM R$TEXT C(00,00,07) = ["READY.."];
  63. ITEM R$ZERO U(00,42,18) = [0];
  64. END
  65. ARRAY RKPAGE [PAGE1:NPG] S(116); # HOP/DIS FOR HELP DISPLAY #
  66.  
  67. BEGIN
  68. ITEM RK$PAGEPS U(000,00,16) = [NPG(X"D009")]; # PFC/SFC VALUE #
  69. ITEM RK$PAGEZ1 U(000,16,42) = [NPG(0)];
  70. ITEM RK$PAGERS B(000,58,01) = [NPG(TRUE)]; # RIGHT SCREEN #
  71. ITEM RK$PAGEIA B(000,59,01) = [NPG(FALSE)]; # INPUT ALLOWED #
  72.  
  73. # HEADER DISPLAY #
  74. ITEM RK$PAGEL01 C(01,00,20) = [NPG(" *** ")] ;
  75. ITEM RK$PAGEM01 C(03,00,20) = [NPG("CS COMMAND LIST *** ")];
  76. ITEM RK$PAGEN01 C(05,00,18) = [NPG(" ")] ; # DIS HEADER LINE#
  77. ITEM RK$PAGEE01 U(06,48,12) = [NPG(0)]; # LINE TERMINATOR#
  78.  
  79. ITEM RK$PAGEM02 C(07,00,40) = [NPG(" ")]; # BLANK LINE #
  80. ITEM RK$PAGEN02 C(11,00,18) = [NPG(" (PAGE OF 3) ")];
  81. ITEM RK$PAGEO02 C(11,48,01) = ["1","2","3"];
  82. ITEM RK$PAGEE02 U(12,48,12) = [NPG(0)]; # LINE TERMINATOR#
  83.  
  84. ITEM RK$PAGEL03 C(13,00,30)= ["CO,NP=NPUNAME(,ON/OFF) ",
  85. # PAGE2 # "EN,TR/LL/LI/TE=NAME. ",
  86. # PAGE3 # "IN. "];
  87.  
  88. ITEM RK$PAGEM03 C(16,00,28)= ["GAIN (ON) OR GIVE UP CONTROL",
  89. # PAGE2 # "ENABLE NAMED NETWORK ELEMENT",
  90. # PAGE3 # "DISPLAY CURRENT INFORMATION "];
  91.  
  92. ITEM RK$PAGEE03 U(18,48,12)= [NPG(0)] ;
  93.  
  94. ITEM RK$PAGEL04 C(19,00,30)= [" ",
  95. # PAGE2 # "EN,LIS/TRS/LLS,NP=NPUNAME. ",
  96. # PAGE3 # " "];
  97.  
  98. ITEM RK$PAGEM04 C(22,00,28)= [" OF NAMED NPU. ",
  99. # PAGE2 # "ENABLE ALL LINES/TERMINALS/ ",
  100. # PAGE3 # " ABOUT NOPS CONNECTED TO "];
  101.  
  102. ITEM RK$PAGEE04 U(24,48,12)= [NPG(0)] ;
  103.  
  104. ITEM RK$PAGEL05 C(25,00,30)= ["CO,NPS(,ON/OFF) ",
  105. # PAGE2 # " ",
  106. # PAGE3 # " "];
  107.  
  108. ITEM RK$PAGEM05 C(28,00,28)= ["GAIN OR GIVE UP CONTROL OF ",
  109. # PAGE2 # " OR LLINKS ON NAMED NPU. ",
  110. # PAGE3 # " AND NPUS SUPERVISED BY "];
  111.  
  112. ITEM RK$PAGEE05 U(30,48,12)= [NPG(0)] ;
  113.  
  114. ITEM RK$PAGEL06 C(31,00,30)= [" ",
  115. # PAGE2 # "EN,LIS/TRS/LLS,NPS. ",
  116. # PAGE3 # " "];
  117.  
  118. ITEM RK$PAGEM06 C(34,00,28)= [" ALL NPUS CURRENTLY SUPER- ",
  119. # PAGE2 # "ENABLE ALL LINES, TERMINALS ",
  120. # PAGE3 # " THIS CS. "];
  121.  
  122. ITEM RK$PAGEE06 U(36,48,12)= [NPG(0)] ;
  123.  
  124. ITEM RK$PAGEL07 C(37,00,30)= [" ",
  125. # PAGE2 # " ",
  126. # PAGE3 # "LO,NP=NPUNAME(,DU/ND). "];
  127.  
  128. ITEM RK$PAGEM07 C(40,00,28)= [" VISED BY THIS CS. ",
  129. # PAGE2 # " OR LLINKS ON ALL NPUS YOU ",
  130. # PAGE3 # "STOP AND RELOAD NAMED NPU. "];
  131.  
  132. ITEM RK$PAGEE07 U(42,48,12)= [NPG(0)] ;
  133.  
  134. ITEM RK$PAGEL08 C(43,00,30)= ["CO,AU(,ON) ",
  135. # PAGE2 # " ",
  136. # PAGE3 # " "];
  137.  
  138. ITEM RK$PAGEM08 C(46,00,28)= ["AUTOMATICALLY GAIN CONTROL ",
  139. # PAGE2 # " CONTROL AS A NOP. ",
  140. # PAGE3 # " USE THE DUMP (DU) OR NO- "];
  141.  
  142. ITEM RK$PAGEE08 U(48,48,12)= [NPG(0)] ;
  143.  
  144. ITEM RK$PAGEL09 C(49,00,30)= [" ",
  145. # PAGE2 # "EN,TES,(NPU=NNAME/LINE=LNAME. ",
  146. # PAGE3 # " "];
  147.  
  148. ITEM RK$PAGEM09 C(52,00,28)= [" OF ANY NPU THAT COMES ",
  149. # PAGE2 # "ENABLE ALL TERMINALS ON ",
  150. # PAGE3 # " DUMP (ND) OPTION TO OVER- "];
  151.  
  152. ITEM RK$PAGEE09 U(54,48,12)= [NPG(0)] ;
  153.  
  154. ITEM RK$PAGEL10 C(55,00,30)= [" ",
  155. # PAGE2 # " ",
  156. # PAGE3 # " "];
  157.  
  158. ITEM RK$PAGEM10 C(58,00,28)= [" UNDER SUPERVISION OF THIS ",
  159. # PAGE2 # " NAMED NPU OR LINE. ",
  160. # PAGE3 # " WRITE THE LONGTERM DMP FLG"];
  161.  
  162. ITEM RK$PAGEE10 U(60,48,12)= [NPG(0)] ;
  163.  
  164. ITEM RK$PAGEL11 C(61,00,30)= [" ",
  165. # PAGE2 # "EN,TES,NPS. ",
  166. # PAGE3 # "LO,NPS(,DU,ND). "];
  167.  
  168. ITEM RK$PAGEM11 C(64,00,28)= [" CS OR IF ITS CONTROL IS ",
  169. # PAGE2 # "ENABLE ALL TERMINALS ON ALL ",
  170. # PAGE3 # "STOP AND RELOAD ALL NPUS "];
  171.  
  172. ITEM RK$PAGEE11 U(66,48,12)= [NPG(0)] ;
  173.  
  174. ITEM RK$PAGEL12 C(67,00,30)= [" ",
  175. # PAGE2 # " ",
  176. # PAGE3 # " "];
  177.  
  178. ITEM RK$PAGEM12 C(70,00,28)= [" GIVEN UP BY ANOTHER NOP. ",
  179. # PAGE2 # " NPUS YOU CONTROL AS A NOP.",
  180. # PAGE3 # " UNDER YOUR CONTROL. "];
  181.  
  182. ITEM RK$PAGEE12 U(72,48,12)= [NPG(0)] ;
  183.  
  184. ITEM RK$PAGEL13 C(73,00,30)= ["CO,AU,OFF. ",
  185. # PAGE2 # "GO,NP=NPUNAME. ",
  186. # PAGE3 # "RE/REPORT,(NPU/NP=NNN/NPUS/ "];
  187.  
  188. ITEM RK$PAGEM13 C(76,00,28)= ["CANCEL EFFECT OF CO,AU,ON. ",
  189. # PAGE2 # "START THE NAMED NPU. ",
  190. # PAGE3 # "REQUEST TO/TO NOT RECEIVE "];
  191.  
  192. ITEM RK$PAGEE13 U(78,48,12)= [NPG(0)] ;
  193.  
  194. ITEM RK$PAGEL14 C(79,00,30)= ["DI,TR/LL/LI/TE=NAME. ",
  195. # PAGE2 # "GO,NPS. ",
  196. # PAGE3 # "NPS),ON/OFF. "];
  197.  
  198. ITEM RK$PAGEM14 C(82,00,30)= ["DISABLE TRUNK, LLINK,LINE OR",
  199. # PAGE2 # "START ALL THE NPUS YOU ",
  200. # PAGE3 # " UNSOLICITED STATUS REPORT. "];
  201.  
  202. ITEM RK$PAGEE14 U(84,48,12)= [NPG(0)] ;
  203.  
  204. ITEM RK$PAGEL15 C(85,00,30)= [" ",
  205. # PAGE2 # " ",
  206. # PAGE3 # "ST/STATUS(,NPU/NP=/NPUS/NPS). "];
  207.  
  208. ITEM RK$PAGEM15 C(88,00,28)= [" NAMED TERMINAL. ",
  209. # PAGE2 # " CONTROL AS A NOP. ",
  210. # PAGE3 # "STATUS OF NAMED NPU. "];
  211.  
  212. ITEM RK$PAGEE15 U(90,48,12)= [NPG(0)];
  213.  
  214. ITEM RK$PAGEL16 C(91,00,30)= ["DU,NP=NPUNAME(,ON/OFF) ",
  215. # PAGE2 # "HI. ",
  216. # PAGE3 # "TS(,NPU/NP=NNN)(,RE/MS=MESAGE "];
  217. ITEM RK$PAGEM16 C(94,00,28)= ["SET LONG TERM DUMP FLAG ON ",
  218. # PAGE2 # "DISPLAY LAST PAGE OF RECENT ",
  219. # PAGE3 # "DIAGNOSTIC TEST COMMAND. "];
  220. ITEM RK$PAGEE16 U(96,48,12)= [0] ;
  221.  
  222. ITEM RK$PAGEL17 C(97,00,30)= [" ",
  223. # PAGE2 # " ",
  224. # PAGE3 # "/SEND/SE/DROP/DR). "];
  225.  
  226. ITEM RK$PAGEM17 C(100,00,28)=[" OR OFF FOR NAMED NPU. ",
  227. # PAGE2 # " ACTIVITY HISTORY BUFFER. ",
  228. # PAGE3 # " "];
  229.  
  230. ITEM RK$PAGEE17 U(102,48,12)=[0] ;
  231.  
  232. ITEM RK$PAGEL18 C(103,00,30)=["DU,NPS(,ON/OFF) ",
  233. # PAGE2 # "HI,ALL. ",
  234. # PAGE3 # "SE(,TE/LI/LL/NP=ELEMENT,MSG/MS"];
  235.  
  236. ITEM RK$PAGEM18 C(106,00,28)=["SET DUMP FLAG ON ALL NPUS ",
  237. # PAGE2 # "DISP ALL PAGES OF HISTORY. ",
  238. # PAGE3 # "SEND TO NAMED ELEMENT THE "];
  239.  
  240. ITEM RK$PAGEE18 U(108,48,12)=[NPG(0)];
  241.  
  242. ITEM RK$PAGEL19 C(109,00,20)=[" ",
  243. # PAGE2 # " ",
  244. # PAGE3 # "=MESSAGE STRING). "];
  245.  
  246. ITEM RK$PAGEM19 C(111,00,20)=["TYPE ( TO FORWARD. ",
  247. # PAGE2 # "TYPE ( TO FORWARD. ",
  248. # PAGE3 # "MESSAGE. "];
  249.  
  250. ITEM RK$PAGEN19 C(113,00,18)=["TYPE ) TO BACKWARD",
  251. # PAGE2 # "TYPE ) TO BACKWARD",
  252. # PAGE3 # "* FOR BACK TO NAM "];
  253.  
  254. ITEM RK$PAGEE19 U(114,48,12)=[NPG(0)] ;
  255.  
  256. ITEM RK$PAGEZW U(115,00,60)=[NPG(0)] ; # END BY ZEROED WORD #
  257.  
  258. END # NINETEEN LINES PER PAGE FOR RIGHT K-DIS #
  259.  
  260.  
  261.  
  262. ARRAY MORDATA [00:00] S(2);
  263. BEGIN
  264. ITEM M$WD0 U(00,00,60);
  265. ITEM M$WD1 U(01,00,60);
  266. ITEM M$TEXT C(00,00,11) = ["MORE DATA.."];
  267. ITEM M$ZERO U(01,06,54) = [0];
  268. END
  269.  
  270. ARRAY DISCARD [00:00] S(2);
  271. BEGIN
  272. ITEM D$WD0 U(00,00,60);
  273. ITEM D$WD1 U(01,00,60);
  274. ITEM D$TEXT C(00,00,16) = ["OUTPUT DISCARDED"];
  275. ITEM D$ZERO U(01,36,24) = [0];
  276. END
  277.  
  278.  
  279.  
  280.  
  281. CONTROL EJECT;
  282.  
  283. PROC SENDLINE;
  284.  
  285. BEGIN # SENDLINE #
  286. #
  287. * SENDLINE - SEND SINGLE LINE OF TEXT TO THE HOP.
  288. *
  289. * THIS EMBEDDED PROC EITHER OUTPUTS OR ENQUEUES A SINGLE LINE OF
  290. * HOP TEXT DEPENDING UPON WHETHER PAGE WAIT IS IN EFFECT.
  291. *
  292. * PROC SENDLINE
  293. *
  294. * ENTRY 1. THE TEXT IS DEFINED BY *WCBUF[0]*, *ABHBUF[0]* AND
  295. * *MSGBUF[0]* AS DESCRIBED ABOVE.
  296. * 2. THE STATE OF THE HOP PSEUDO ACN IS SUCH THAT IT IS OK
  297. * TO ISSUE HOP/DIS SM'S.
  298. * 3. THE TEXT LENGTH IS ALWAYS A MULTIPLE OF 10 CHARACTERS.
  299. *
  300. * EXIT 1. IF PAGE WAIT IS NOT IN EFFECT (PAGING TURNED OFF OR
  301. * LESS THAN 31 LINES ARE CURRENTLY BEING DISPLAYED), A
  302. * HOP/DIS SM HAS BEEN PLACED IN THE *OTQ*.
  303. * 2. IF PAGE WAIT IS IN EFFECT (PAGING TURNED ON AND EITHER
  304. * 31 OR 32 LINES ARE CURRENTLY BEING DISPLAYED), THE
  305. * TEXT HAS BEEN PLACED IN THE *WBQ* AS FOLLOWS:
  306. * - IF, UPON ENTRY, THERE WAS AN EXISTING *WBQ* ENTRY
  307. * FOR THE HOP AND THAT ENTRY CONTAINED FEWER THAN 31
  308. * LINES, THE TEXT WAS ADDED TO THE END OF THAT ENTRY.
  309. * - IF, UPON ENTRY, THERE WAS NO *WBQ* ENTRY FOR THE HOP
  310. * OR THAT ENTRY CONTAINED 31 OR 32 LINES, A NEW ENTRY
  311. * WAS CREATED.
  312. *
  313. * NOTES 1. HOP ENTRIES IN THE *WBQ* ARE IN HOP/DIS FORMAT AND MAY
  314. * BE MOVED TO THE *OTQ* WITHOUT MODIFICATION, EXCEPT FOR
  315. * THE ADDITION OF THE EXTRA WORD REQUIRED BY NIP.
  316. * 2. WHEN PAGING IS TURNED ON, THE 32ND LINE OF THE DISPLAY
  317. * IS RESERVED FOR THE *MORE DATA..* MESSAGE.
  318. #
  319.  
  320. ITEM I; # LOOP INDUCTION VARIABLE #
  321. ITEM TLW; # TEXT LENGTH IN WORDS #
  322. ITEM WBC; # WAITING BLOCK COUNT #
  323. ITEM TORD; # ORDINAL WHERE TEXT IS ADDED IN *WBQ* #
  324. ITEM WORD; # WAITING BLOCK QUEUE ENTRY ORDINAL #
  325.  
  326. BASED ARRAY TEXTLOC [00:00] S(1);
  327. ITEM TL$WORD U(00,00,60);
  328.  
  329.  
  330.  
  331. #
  332. * WE BEGIN BY INITIALIZING SOME ITEMS AND POINTERS PURSUANT TO
  333. * FORMATTING THE HOP/DIS SM.
  334. #
  335. PFCSFC[1] = HOPDIS;
  336. P<TEXTLOC> = LOC (SPMSG1[1]); # WHERE TEXT WILL BE MOVED TO #
  337. TLW = WCB$WC[0] - 2;
  338.  
  339.  
  340. #
  341. * IF PAGE WAIT IS NOT IN EFFECT, SIMPLY FORMAT THE HOP/DIS SM, SHIP
  342. * IT, INCREMENT THE COUNT OF LINES BEING DISPLAYED, AND GET OUT.
  343. * PROVIDE FOR THE EXTRA WORD IN THE HOP/DIS SM REQUIRED BY NIP.
  344. #
  345. IF NOT ACN$PWAIT[HOPORD$]
  346. OR ACN$BLCNT[HOPORD$] LS ACN$PL[HOPORD$]
  347. THEN # WE ARE NOT AT A PAGE BOUNDARY #
  348. BEGIN
  349. ABHTLC[1] = TLW + 2; # HOP/DIS TLC IN ABH #
  350. WCB$WORD[1] = TLW + 4; # HOP/DIS ENTRY SIZE IN *OTQ* #
  351. HOPI[1] = WCB$IAF[0]; # INPUT ALLOWED FLAG #
  352. MOVE (TLW, MSGBUF[0], TEXTLOC[0]); # TEXT #
  353. TL$WORD[TLW] = 0; # EXTRA WORD #
  354. SSTAQE (P<OTQ>, WCBUF[1], ABH[1], APSM[1]);
  355. ACN$BLCNT[HOPORD$] = ACN$BLCNT[HOPORD$] + 1; # LINE COUNT #
  356. RETURN;
  357. END
  358.  
  359.  
  360. #
  361. * PAGE WAIT IS IN EFFECT. IF THERE ARE CURRENTLY 31 LINES BEING
  362. * DISPLAYED, *MORE DATA..* IS SENT AS THE LAST LINE OF THE PAGE.
  363. #
  364. IF ACN$BLCNT[HOPORD$] EQ ACN$PL[HOPORD$]
  365. THEN # MUST SEND *MORE DATA..* #
  366. BEGIN
  367. ABHTLC[1] = 4; # *MORE DATA..* TLC IN ABH #
  368. WCB$WORD[1] = 6; # *MORE DATA..* ESIZE IN *OTQ* #
  369. HOPI[1] = FALSE; # INPUT NOT NECESSARILY ALLOWED #
  370. SPMSG1[1] = M$WD0[0]; # TEXT #
  371. SPMSG2[1] = M$WD1[0];
  372. SPMSG3[1] = 0; # EXTRA WORD #
  373. SSTAQE (P<OTQ>, WCBUF[1], ABH[1], APSM[1]);
  374. ACN$BLCNT[HOPORD$] = HOPTPL$; # LINE COUNT #
  375. END
  376.  
  377.  
  378. #
  379. * THE TEXT MUST BE ENQUEUED IN THE *WBQ*. THE FIRST TASK IS TO
  380. * LOCATE THE LAST HOP ENTRY IN THE *WBQ* (IF THERE IS ONE).
  381. * IF A HOP *WBQ* ENTRY IS EXTANT, ITS ORDINAL MUST, OF COURSE, BE
  382. * LESS THAN THE TOTAL LENGTH OF THE *WBQ*. THE SEARCH TECHNIQUE IS
  383. * SET UP SUCH THAT IF THERE IS NO HOP *WBQ* ENTRY, THE ORDINAL
  384. * RETURNED EQUALS THE *WBQ* LENGTH.
  385. #
  386. WBC = ACN$WBCNT[HOPORD$]; # NUMBER HOP ENTRIES IN *WBQ* #
  387. WORD = WBQL;
  388. FOR I=0 STEP WBQ$ESIZE[I]
  389. WHILE WBC NQ 0
  390. DO # FIND LAST ENTRY #
  391. IF WBQ$ABHACN[I] EQ 0
  392. AND WBQ$SMACN[I] EQ 0
  393. THEN # MUST BE HOP/DIS ASYNCH SM #
  394. BEGIN
  395. WBC = WBC - 1;
  396. WORD = I; # SAVE ORDINAL #
  397. END
  398.  
  399.  
  400. #
  401. * IF THERE IS AN EXISTING *WBQ* ENTRY AND IT CONTAINS EXACTLY 31
  402. * LINES OF TEXT, THE *MORE DATA..* MESSAGE MUST BE ADDED TO THE END
  403. * OF THAT ENTRY. THIS WILL RESULT IN A NEW HOP *WBQ* ENTRY BEING
  404. * CREATED FOR THE NEW LINE OF TEXT FURTHER BELOW.
  405. #
  406. IF WORD LS WBQL
  407. AND WBQ$LICNT[WORD] EQ ACN$PL[HOPORD$]
  408. THEN # 31 LINE ENTRY EXISTS #
  409. BEGIN
  410. TORD = WORD + WBQ$ESIZE[WORD]; # WHERE MSG WILL BE ADDED #
  411. SSTETS (P<WBQ>, TORD, MTLW$); # MAKE ROOM #
  412. WBQ$WORD[TORD] = M$WD0[0]; # TEXT #
  413. WBQ$WORD[TORD+1] = M$WD1[0];
  414. WBQ$TLC[WORD] = WBQ$TLC[WORD] + MTLW$; # TLC IN ABH #
  415. WBQ$ESIZE[WORD] = WBQ$ESIZE[WORD] + MTLW$; # ENTRY SIZE #
  416. WBQ$LICNT[WORD] = HOPTPL$; # LINE COUNT #
  417. END
  418.  
  419.  
  420. #
  421. * FINALLY, THE NEW LINE OF TEXT CAN BE ENQUEUED. IF A HOP *WBQ*
  422. * ENTRY IS EXTANT AND IT CONTAINS FEWER THAN 31 LINES OF TEXT, THE
  423. * NEW LINE CAN (MUST) BE ADDED TO THE EXISTING ENTRY. OTHERWISE,
  424. * CREATE A NEW ENTRY.
  425. #
  426. IF WORD LS WBQL
  427. AND WBQ$LICNT[WORD] LS ACN$PL[HOPORD$]
  428. THEN # CAN ADD TEXT TO EXISTING NTRY #
  429. BEGIN
  430. TORD = WORD + WBQ$ESIZE[WORD]; # WHERE TEXT WILL BE ADDED #
  431. SSTETS (P<WBQ>, TORD, TLW); # MAKE ROOM #
  432. MOVE (TLW, MSGBUF[0], WBQ[TORD]); # TEXT #
  433. WBQ$TLC[WORD] = WBQ$TLC[WORD] + TLW; # TLC IN ABH #
  434. WBQ$ESIZE[WORD] = WBQ$ESIZE[WORD] + TLW; # ENTRY SIZE #
  435. WBQ$LICNT[WORD] = WBQ$LICNT[WORD] + 1; # LINE COUNT #
  436. IF WCB$IAF[0]
  437. THEN # INPUT IS ALLOWED WITH THIS LINE OF TEXT #
  438. WBQ$HIAF[WORD] = TRUE; # ENSURE SAME FOR ENTIRE Q'D HOP/DIS #
  439. END
  440.  
  441. ELSE # CREATE NEW *WBQ* ENTRY #
  442. BEGIN
  443. ABHTLC[1] = TLW + 1; # HOP/DIS TLC IN ABH #
  444. WCB$WORD[1] = TLW + 3; # HOP/DIS ENTRY SIZE IN *WBQ* #
  445. WCB$FLAGS[1] = 1; # INITIAL LINE COUNT #
  446. HOPI[1] = WCB$IAF[0]; # INPUT ALLOWED FLAG #
  447. MOVE (TLW, MSGBUF[0], TEXTLOC[0]); # TEXT #
  448. SSTAQE (P<WBQ>, WCBUF[1], ABH[1], APSM[1]);
  449. ACN$WBCNT[HOPORD$] = ACN$WBCNT[HOPORD$] + 1; # WAITING BLOCKS #
  450. END
  451.  
  452. END # SENDLINE #
  453.  
  454.  
  455.  
  456.  
  457.  
  458. CONTROL EJECT;
  459. #
  460. * MAIN ROUTINE BEGINS HERE.
  461. *
  462. * WE BEGIN BY INITIALIZING SOME FIELDS IN THE OUTGOING ABH AND SM
  463. * BODY AREAS. THEN WE TAKE A MAIN BRANCH DEPENDING ON WHETHER
  464. * INPUT IS ALLOWED AFTER THIS TEXT IS OUTPUT TO THE HOP.
  465. #
  466.  
  467. ABHWORD[1] = 0;
  468. ABHABT[1] = APPCMD;
  469. ABHACT[1] = CT60TRANS;
  470. SPMSG0[1] = 0;
  471.  
  472.  
  473.  
  474. IF WCB$IAF[0]
  475. THEN # COMMAND COMPLETE, INPUT ALLOWED #
  476. BEGIN
  477.  
  478.  
  479. #
  480. * IF THE HOP HAS A COMMAND IN PROGRESS, THE TEXT IS PROCESSED
  481. * NORMALLY. IF HE HAD ENTERED A BREAK, THE TEXT IS DISCARDED
  482. * AND THE MESSAGE *OUTPUT DISCARDED* IS SENT. THE STATE OF THE
  483. * HOP PSEUDO ACN IS RESET TO ALLOW SUBSEQUENT COMMANDS.
  484. #
  485. IF ACN$HOPST[HOPORD$] EQ S"COMMAND"
  486. OR ACN$HOPST[HOPORD$] EQ S"BREAK"
  487. THEN # COMMAND OR BREAK IN PROGRESS #
  488. BEGIN
  489. IF ACN$HOPST[HOPORD$] EQ S"BREAK"
  490. THEN # BREAK IN PROGRESS #
  491. BEGIN # SET TEXT = *OUTPUT DISCARDED* #
  492. SPMSG0[0] = D$WD0[0];
  493. SPMSG1[0] = D$WD1[0];
  494. WCB$WC[0] = ODWC$;
  495. END
  496. ACN$HOPST[HOPORD$] = S"ACTIVE";
  497.  
  498.  
  499. #
  500. * WE NOW DO THE ACTUAL PROCESSING OF THE TEXT. THE I-LAYER
  501. * NEVER GENERATES *READY..*. THIS IS GENERATED BY THE C-LAYER
  502. * (HEREIN) AS A RESULT OF THE INPUT ALLOWED FLAG BEING SET.
  503. * THE TEXT MUST BE OUTPUT FIRST WITH INPUT NOT ALLOWED FOLLOWED
  504. * BY *READY..* WITH INPUT ALLOWED. THE RESPONSE TO MANY
  505. * COMMANDS CONSISTS SOLELY OF *READY..* (NULL TEXT).
  506. #
  507. IF WCB$WC[0] GR 2
  508. THEN # THERE IS TEXT #
  509. BEGIN
  510. WCB$IAF[0] = FALSE;
  511. SENDLINE; # SO SHIP IT #
  512. WCB$IAF[0] = TRUE;
  513. END
  514. SPMSG0[0] = R$WD0[0]; # SET TEXT = *READY..* #
  515. WCB$WC[0] = RWC$;
  516. SENDLINE; # AND SHIP IT #
  517. WCB$SMID[1] = SMID"HOPDIS" ; # SEND HOP/DIS FOR RIGHT K-DIS#
  518. WCB$WC[1] = RKPAGESZ + 1 ;
  519. ABHWORD[1] = 0 ;
  520. ABHABT[1] = 3 ;
  521. ABHACT[1] = 1 ;
  522. ABHTLC[1] = RKPAGESZ ;
  523.  
  524. SSTAQE(P<OTQ>,WCBUF[1],ABH[1],RKPAGE[PAGE1]) ;
  525. OC$PAGEC[HOPORD$] = PAGE1; # CURRENT PAGE IS 1 #
  526.  
  527. END
  528.  
  529. ELSE # NEITHER BREAK NOR COMMAND IN PROGRESS #
  530. BEGIN
  531.  
  532.  
  533. #
  534. * FOR ALL OTHER STATES OF THE HOP PSUEDO ACN WE DISCARD THE
  535. * TEXT AND SEND A CON/CB PROTOCOL EVENT TO THE INNER LAYER.
  536. #
  537. WCB$WORD[1] = 2; # MIN QUEUE ENTRY SIZE #
  538. WCB$SMID[1] = SMID"CONCB";
  539. ABHADR[1] = HOPORD$;
  540. SSTAQE (P<PEQ>, WCBUF[1], ABH[1], APSM[1]);
  541. END
  542.  
  543. END # INPUT ALLOWED = YES #
  544.  
  545.  
  546.  
  547. ELSE # INPUT NOT ALLOWED AS RESULT THIS TEXT #
  548. BEGIN
  549.  
  550.  
  551. #
  552. * IF THE HOP IS IDLE OR HAS A COMMAND IN PROGRESS, PROCESS THE
  553. * TEXT NORMALLY (TEXT COULD BE THE RESULT OF AN UNSOLICITED EVENT
  554. * REPORT OR A COMMAND). IF THE K-DISPLAY IS NOT CURRENTLY
  555. * ASSIGNED TO CS, AND THE HOP HAS NOT ENTERED AN *IG=CS* COMMAND,
  556. * AND THIS MESSAGE WARRANTS AN ALERT, SEND A HOP/ALT SM TO NAM.
  557. * FOR ALL OTHER CONDITIONS, SIMPLY DISCARD THE TEXT.
  558. #
  559. IF ACN$HOPST[HOPORD$] EQ S"ACTIVE"
  560. OR ACN$HOPST[HOPORD$] EQ S"COMMAND"
  561. THEN # ALL IS WELL, FORWARD THE TEXT #
  562. SENDLINE;
  563.  
  564. ELSE IF ACN$HOPST[HOPORD$] EQ S"INACT"
  565. OR ACN$HOPST[HOPORD$] EQ S"ENDED"
  566. OR ACN$HOPST[HOPORD$] EQ S"STARTEND"
  567. THEN # K-DIS NOT NOW ASSIGNED TO CS #
  568. IF WCB$HAF[0]
  569. AND NOT ACN$IGNOR[HOPORD$]
  570. THEN # MUST SEND HOP/ALT SM TO NIP #
  571. BEGIN
  572. WCB$WORD[1] = 3;
  573. ABHTLC[1] = LHOPALT;
  574. PFCSFC[1] = HOPALT;
  575. SSTAQE (P<OTQ>, WCBUF[1], ABH[1],APSM[1]);
  576. END
  577.  
  578. END # INPUT ALLOWED = NO #
  579.  
  580. END # CSCPHT #
  581.  
  582. TERM
cdc/nos2.source/nam5871/cscpht.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator