User Tools

Site Tools


cdc:nos2.source:nam5871:cscpnt

CSCPNT

Table Of Contents

  • [00005] PROC CSCPNT
  • [00006] CSCPNT - PREPARE NOP TEXT.
  • [00010] PREPARE NOP TEXT.
  • [00061] PROC MOVE
  • [00062] PROC SSBSBF
  • [00063] PROC SSTAQE
  • [00064] PROC SSTETS
  • [00110] PROC SENDATA

Source Code

CSCPNT.txt
  1. *DECK CSCPNT
  2. USETEXT TEXTCS
  3. USETEXT TEXTSS
  4. USETEXT TXTAPSS
  5. PROC CSCPNT;
  6. # TITLE CSCPNT - PREPARE NOP TEXT. #
  7.  
  8. BEGIN # CSCPNT #
  9. #
  10. ** CSCPNT - PREPARE NOP TEXT.
  11. *
  12. * D. G. DEPEW. 82/05/18.
  13. *
  14. * THIS PROCEDURE PROCESSES TEXT LINES (TERMINAL TEXT) FROM THE
  15. * I-LAYER DESTINED FOR A NOP. ITS FUNCTION IS TO FORMAT THE TEXT
  16. * INTO A NETWORK BLOCK AND EITHER ISSUE IT, QUEUE IT OR DISCARD IT
  17. * AS APPROPRIATE.
  18. *
  19. * PROC CSCPNT
  20. *
  21. * ENTRY WCBUF[0] = WORD COUNT WORD FROM ORIGINAL CONNECTION
  22. * TRAFFIC QUEUE (*CNQ*) ENTRY (CONTAINS THE
  23. * INPUT ALLOWED FLAG).
  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 DEPENDING UPON THE STATE OF
  30. * THE CONNECTION, WHETHER APPLICATION BLOCK LIMIT HAS BEEN
  31. * REACHED, AND WHETHER THE CONNECTION HAS BEEN INITIALIZED:
  32. * - A NETWORK DATA BLOCK FOR THE TEXT HAS BEEN PLACED IN
  33. * THE OUTGOING TRAFFIC QUEUE (*OTQ*).
  34. * - THE TEXT HAS BEEN PLACED IN THE WAITING BLOCK QUEUE
  35. * (*WBQ*) PENDING RECEIPT OF A BLOCK ACKNOWLEDGEMENT OR
  36. * A FLOW CONTROL INITIALIZED SM FOR THE CONNECTION.
  37. * - THE TEXT HAS BEEN DISCARDED.
  38. * - AN FC/RST/SM HAS BEEN PLACED IN THE *OTQ* FOLLOWED BY
  39. * A NETWORK *MSG* DATA BLOCK CONSISTING OF THE MESSAGES
  40. * *OUTPUT DISCARDED* FOLLOWED BY *READY..*.
  41. * - A CON/CB SM HAS BEEN FORMATTED AND PLACED IN THE
  42. * PROTOCOL EVENT QUEUE (*PEQ*).
  43. *
  44. * NOTES 1. TO INSURE PROPER CURSOR POSITIONING AT A NOP TERMINAL
  45. * UNDER ALL CIRCUMSTANCES, CS USES THE POST PRINT FORMAT
  46. * EFFECTOR *.* (PERIOD). HOWEVER, THE I-LAYER GENERATES
  47. * TEXT IN ONE FORMAT, IRRESPECTIVE OF FOR WHOM THE TEXT
  48. * IS DESTINED (HOP OR A NOP), AND THIS EXCLUDES FORMAT
  49. * EFFECTORS. HENCE, THIS ROUTINE MUST RIGHT SHIFT EACH
  50. * TEXT MESSAGE ONE CHARACTER AND INSERT THE FORMAT
  51. * EFFECTOR IN THE LEADING CHARACTER POSITION.
  52. * 2. PROCESSING IS IN ACCORDANCE WITH THE CS/NOP C-LAYER
  53. * STATE DIAGRAM.
  54. #
  55.  
  56. #
  57. **** PROC CSCPNT - XREF LIST.
  58. #
  59. XREF
  60. BEGIN
  61. PROC MOVE; # MOVE STORAGE DIRECT ADDRESSING #
  62. PROC SSBSBF; # STORE BITFIELD #
  63. PROC SSTAQE; # ACCEPT QUEUE ENTRY #
  64. PROC SSTETS; # ENLARGE TABLE SPACE (ANYWHERE IN TABLE) #
  65. END
  66. #
  67. ****
  68. #
  69.  
  70.  
  71. DEF ODTLW$ #2#; # *OUTPUT DISCARDED* TEXT LENGTH IN WORDS #
  72. DEF RTLW$ #1#; # *READY..* TEXT LENGTH IN WORDS #
  73.  
  74.  
  75. ITEM I; # LOOP INDUCTION VARIABLE #
  76. ITEM NACN; # NOP ACN = ORDINAL OF ACN LIST ENTRY #
  77. ITEM TLW; # LENGTH OF TEXT IN CM WORDS #
  78.  
  79. # ITEMS BELOW ARE USED TO SHIFT TEXT RT ONE CHAR FOR FE INSERTION. #
  80.  
  81. ITEM SWP; # STORE WORD POSITION #
  82. ITEM SBP; # STORE BIT POSITION (WITHIN *SWP*) #
  83.  
  84.  
  85.  
  86. #
  87. * MESSAGE ARRAYS WITH LEADING ZEROES AS FORMAT EFFECTORS.
  88. #
  89. ARRAY DISCARD [00:00] S(ODTLW$);
  90. BEGIN
  91. ITEM D$WD0 U(00,00,60);
  92. ITEM D$WD1 U(01,00,60);
  93. ITEM D$TEXT C(00,00,17) = [".OUTPUT DISCARDED"];
  94. ITEM D$LT U(01,42,18) = [0];
  95. END
  96.  
  97. ARRAY READY [00:00] S(RTLW$);
  98. BEGIN
  99. ITEM R$WD0 U(00,00,60);
  100. ITEM R$TEXT C(00,00,08) = [".READY.."];
  101. ITEM R$LT U(00,48,12) = [0];
  102. END
  103.  
  104.  
  105.  
  106.  
  107.  
  108. CONTROL EJECT;
  109.  
  110. PROC SENDATA;
  111.  
  112. BEGIN # SENDATA #
  113. #
  114. * SENDATA - SEND NETWORK DATA BLOCK TO A NOP.
  115. *
  116. * THIS EMBEDDED PROC EITHER OUTPUTS OR ENQUEUES A SINGLE BLOCK OF
  117. * NOP TEXT DEPENDING UPON WHETHER THE NOP'S CONNECTION IS CURRENTLY
  118. * AT APPLICATION BLOCK LIMIT, AND WHETHER THE CONNECTION HAS BEEN
  119. * INITIALIZED.
  120. *
  121. * PROC SENDATA
  122. *
  123. * ENTRY TLW = LENGTH OF TEXT IN CM WORDS.
  124. * WCBUF[0] = AS ABOVE IN MAIN PROC DESCRIPTION.
  125. * ABHBUF[1] = PARTIALLY COMPLETED APPLICATION BLOCK HEADER
  126. * FOR THE TEXT. THE APPLICATION BLOCK TYPE HAS
  127. * BEEN FILLED IN.
  128. * APSM[1] = THE TEXT IN NETWORK BLOCK FORMAT WITH FORMAT
  129. * EFFECTORS IN PLACE (2ND HALF OF *MSGBUF*).
  130. * THE STATE OF THE NOP'S CONNECTION IS SUCH THAT IT IS OK
  131. * TO ISSUE NETWORK DATA BLOCKS.
  132. *
  133. * EXIT 1. IF THE NOP"S CONNECTION HAS BEEN INITIALIZED (FC/INIT
  134. * RECEIVED) AND IT IS NOT AT APPLICATION BLOCK LIMIT,
  135. * THE BLOCK HAS BEEN PLACED IN THE OUTGOING TRAFFIC
  136. * QUEUE (*OTQ*).
  137. * 2. IF THE NOP"S CONNECTION HAS NOT BEEN INITIALIZED OR IT
  138. * IS AT APPLICATION BLOCK LIMIT, THE BLOCK HAS BEEN
  139. * PLACED IN THE WAITING BLOCK QUEUE (*WBQ*) AS FOLLOWS:
  140. * - IF, UPON ENTRY, THERE WAS AN EXISTING *WBQ* ENTRY
  141. * FOR THIS NOP AND IF THE TEXT LENGTH OF THAT ENTRY
  142. * PLUS THE TEXT LENGTH OF THE NEW BLOCK DID NOT EXCEED
  143. * THE RECOMMENDED BLOCK SIZE FOR THE CONNECTION (*DBZ*
  144. * IN CON/REQ/SM), THE NEW BLOCK WAS ADDED TO THE END
  145. * OF THAT EXISTING *WBQ* ENTRY.
  146. * - IF, UPON ENTRY, THERE WAS NO *WBQ* ENTRY FOR THIS
  147. * NOP OR IF THE TEXT LENGTH OF THAT ENTRY PLUS THE
  148. * TEXT LENGTH OF THE NEW BLOCK EXCEEDED THE
  149. * RECOMMENDED BLOCK SIZE, A NEW *WBQ* ENTRY FOR THIS
  150. * NOP WAS CREATED.
  151. *
  152. * NOTE NOP ENTRIES IN THE *WBQ* ARE IN NETWORK DATA BLOCK FORMAT
  153. * AND MAY BE MOVED TO THE *OTQ* WITHOUT MODIFICATION.
  154. #
  155.  
  156. ITEM AORD; # ORDINAL WHERE BLOCK IS INSERTED IN *WBQ*#
  157. ITEM WBC; # WAITING BLOCK COUNT #
  158. ITEM WORD; # WAITING BLOCK QUEUE ENTRY ORDINAL #
  159.  
  160.  
  161.  
  162. #
  163. * FIRST COMPLETE THE APPLICATION BLOCK HEADER FOR THE OUTGOING TEXT,
  164. * EXCEPT FOR THE BLOCK NUMBER. ALSO, SET THE QUEUE ENTRY SIZE.
  165. #
  166. ABHADR[1] = NACN;
  167. ABHACT[1] = CT6DISPLAY;
  168. ABHTLC[1] = TLW * 10;
  169. WCB$WORD[1] = TLW + 2;
  170.  
  171.  
  172. #
  173. * CHECK FOR CONNECTION INITIALIZED AND APPLICATION BLOCK LIMIT AND
  174. * TAKE THE APPROPRIATE ACTION (AS HAS BEEN DESCRIBED).
  175. #
  176. IF ACN$INIT[NACN]
  177. AND ACN$BLCNT[NACN] LS ACN$ABL[NACN]
  178. THEN # CAN SEND BLOCK IMMEDIATELY #
  179. BEGIN
  180. ABHABN[1] = ACN$ABN[NACN]; # ABH COMPLETE #
  181. ACN$ABN[NACN] = ACN$ABN[NACN] + 1; # NEXT BLOCK NUMBER #
  182. ACN$BLCNT[NACN] = ACN$BLCNT[NACN] + 1; # OUTSTANDING BLOCKS #
  183. SSTAQE (P<OTQ>, WCBUF[1], ABHBUF[1], MSGBUF[MSBFAPL]);
  184. END
  185.  
  186.  
  187. ELSE # MUST ENQUEUE BLOCK IN *WBQ* #
  188. BEGIN
  189.  
  190. #
  191. * THE FIRST TASK IS TO LOCATE THE LAST *WBQ* ENTRY FOR THIS NOP
  192. * (IF THERE IS ONE). THE SEARCH TECHNIQUE EMPLOYED RESULTS IN
  193. * *AORD* POINTING TO THE NEXT *WBQ* ENTRY AFTER THE DESIRED ENTRY.
  194. * THIS IS THE CORRECT ORDINAL AT WHICH TO ADD THE NEW BLOCK TO
  195. * THE EXISTING *WBQ* ENTRY, IF THAT IS APPROPRIATE.
  196. #
  197. WBC = 0;
  198. WORD = 0;
  199. FOR AORD=0 STEP WBQ$ESIZE[AORD]
  200. WHILE WBC LS ACN$WBCNT[NACN]
  201. DO # FIND LAST ENTRY FOR THIS NOP #
  202. IF WBQ$ABHACN[AORD] EQ NACN
  203. THEN # THIS ENTRY FOR THIS NOP #
  204. BEGIN
  205. WBC = WBC + 1;
  206. WORD = AORD; # SAVE ORDINAL #
  207. END
  208.  
  209. #
  210. * IF A *WBQ* ENTRY EXISTS FOR THIS NOP AND IF THE NEW BLOCK CAN
  211. * BE APPENDED TO THIS ENTRY WITHOUT EXCEEDING THE RECOMMENDED
  212. * BLOCK SIZE, THEN ADD THE NEW BLOCK TO THE EXISTING *WBQ* ENTRY.
  213. * OTHERWISE, CREATE A NEW *WBQ* ENTRY.
  214. #
  215. IF WBC NQ 0
  216. AND (WBQ$TLC[WORD] + ABHTLC[1]) LQ ACN$DBZ[NACN]
  217. AND WBQ$ABT[WORD] EQ APPBLK
  218. THEN # CAN APPEND TO EXISTING ENTRY #
  219. BEGIN
  220. SSTETS (P<WBQ>, AORD, TLW); # MAKE ROOM #
  221. MOVE (TLW, MSGBUF[MSBFAPL], WBQ[AORD]); # TEXT #
  222. WBQ$ESIZE[WORD] = WBQ$ESIZE[WORD] + TLW; # ENTRY SIZE #
  223. WBQ$TLC[WORD] = WBQ$TLC[WORD] + ABHTLC[1]; # TEXT LENGTH #
  224. IF WCB$IAF[0]
  225. THEN # INPUT ALLOWED AFTER THIS TEXT #
  226. WBQ$ABT[WORD] = APMSG; # ENSURE SAME FOR QUEUED BLOCK #
  227. END
  228.  
  229. ELSE # MUST CREATE NEW *WBQ* ENTRY #
  230. BEGIN
  231. ABHABN[1] = ACN$ABN[NACN]; # ABH COMPLETE #
  232. ACN$ABN[NACN] = ACN$ABN[NACN] + 1; # NEXT BLOCK NUMBER #
  233. ACN$WBCNT[NACN] = WBC + 1; # WAITING BLOCKS #
  234. SSTAQE (P<WBQ> , WCBUF[1], ABHBUF[1], MSGBUF[MSBFAPL]);
  235. END
  236.  
  237. END # ENQUEUING IN *WBQ* #
  238.  
  239. END # SENDATA #
  240.  
  241.  
  242.  
  243.  
  244.  
  245. CONTROL EJECT;
  246.  
  247. #
  248. * MAIN ROUTINE BEGINS HERE.
  249. *
  250. * WE BEGIN BY INITIALIZING IMPORTANT LOCAL VARIABLES AS WELL AS THE
  251. * APPLICATION BLOCK HEADER FOR THE OUTBOUND TEXT. NEXT, THE TEXT
  252. * IS RIGHT SHIFTED ONE CHARACTER POSITION AND THE POST PRINT FORMAT
  253. * EFFECTOR (*.*) IS INSERTED. AFTER THE SHIFT, WE INSURE THERE ARE
  254. * SUFFICIENT ZERO BITS PRESENT TO CONSTITUTE A VALID LINE
  255. * TERMINATOR.
  256. #
  257. NACN = ABHADR[0];
  258. TLW = WCB$WC[0] - 2;
  259. ABHWORD[1] = 0;
  260.  
  261. IF TLW NQ 0
  262. THEN # THERE IS TEXT - INSERT FORMAT EFFECTOR #
  263. BEGIN
  264. MSG$WORD[MSBFAPL] = O"57" *2**54; # POST PRINT FORMAT EFFECT #
  265. SWP = MSBFAPL; # SECOND HALF OF *MSGBUF* #
  266. SBP = 6; # ONE CHARACTER TO THE RIGHT #
  267. FOR I=0 STEP 1 UNTIL TLW-1
  268. DO # RT SHIFT TEXT STRING ONE CHAR #
  269. SSBSBF (MSGBUF[0], SWP, SBP, 60, MSG$WORD[I]);
  270.  
  271. IF MSG$ZERO[SWP-1] NQ 0
  272. THEN # TOO FEW ZERO BITS FOR SHIFTED ZERO BYTE #
  273. BEGIN
  274. MSG$WORD[SWP] = 0; # MAKE 66 BIT LINE TERMINATOR #
  275. TLW = TLW + 1;
  276. END
  277. END # FORMAT EFFECTOR INSERTION #
  278.  
  279.  
  280.  
  281. #
  282. * NOW TAKE A MAIN BRANCH DEPENDING UPON WHETHER INPUT IS ALLOWED ON
  283. * THIS CONNECTION AFTER THIS TEXT HAS BEEN OUTPUT.
  284. #
  285. IF WCB$IAF[0]
  286. THEN # COMMAND COMPLETE, INPUT ALLOWED #
  287. BEGIN
  288. ABHABT[1] = APMSG;
  289.  
  290.  
  291. #
  292. * IF THIS NOP HAS A COMMAND IN PROGRESS, THE TEXT IS PROCESSED
  293. * NORMALLY. IF HE HAD ENTERED A USER BREAK, THE TEXT IS IGNORED
  294. * AND AN FC/RST/SM IS SENT FOLLOWED BY THE *OUTPUT DISCARDED*
  295. * MESSAGE. THE STATE OF THE ACN IS RESET TO ALLOW SUBSEQUENT
  296. * COMMANDS.
  297. #
  298. IF ACN$NOPST[NACN] EQ S"COMMAND"
  299. OR ACN$NOPST[NACN] EQ S"BREAK"
  300. THEN # COMMAND OR BREAK IN PROGRESS #
  301. BEGIN
  302.  
  303. IF ACN$NOPST[NACN] EQ S"BREAK"
  304. THEN # BREAK IN PROGRESS #
  305. BEGIN
  306. SPMSG0[1] = D$WD0[0]; # SET TEXT = *OUTPUT DISCARDED* #
  307. SPMSG1[1] = D$WD1[0];
  308. TLW = ODTLW$;
  309. ACN$NOPST[NACN] = S"CLEARI";
  310. END
  311. ELSE
  312. BEGIN
  313. ACN$NOPST[NACN] = S"ACTIVE";
  314. END
  315.  
  316. #
  317. * NOW PROCESS THE TEXT. THE I-LAYER NEVER GENERATES *READY..*.
  318. * THIS IS GENERATED BY THE C-LAYER (HEREIN) AS A RESULT OF THE
  319. * INPUT ALLOWED FLAG BEING SET. THE RESPONSE TO MANY COMMANDS
  320. * CONSISTS SOLELY OF *READY..* (NULL TEXT).
  321. #
  322. MSG$WORD[MSBFAPL + TLW] = R$WD0[0]; # APPEND *READY..* #
  323. TLW = TLW + 1;
  324. SENDATA;
  325. END
  326.  
  327.  
  328. ELSE IF ACN$NOPST[NACN] EQ S"BROKEN"
  329. THEN
  330. BEGIN # CONECTION BROKEN IN PROGRESS #
  331.  
  332. #
  333. * WITH THIS TEXT THE I-LAYER HAS INDICATED ITS QUIESCENCE FOR
  334. * THIS NOP. HENCE, IT IS NOW APPROPRIATE TO SEND THE CON/CB TO
  335. * THE I-LAYER FOR FINAL CLEANUP. THE TEXT GETS DISCARDED.
  336. #
  337. WCB$WORD[0] = 2; # MIN QUEUE ENTRY SIZE #
  338. WCB$SMID[0] = SMID"CONCB";
  339. SSTAQE (P<PEQ>, WCBUF[0], ABHBUF[0], MSGBUF[0]);
  340. END
  341.  
  342. END # INPUT ALLOWED = YES #
  343.  
  344.  
  345.  
  346. ELSE # INPUT NOT ALLOWED AS RESULT THIS TEXT #
  347. BEGIN
  348. ABHABT[1] = APPBLK;
  349.  
  350.  
  351. #
  352. * IF THE STATE OF THE NOP"S CONNECTION IS APPROPRIATE, PROCESS
  353. * THE TEXT NORMALLY. OTHERWISE, DISCARD IT.
  354. #
  355. IF ACN$NOPST[NACN] EQ S"ACTIVE"
  356. OR ACN$NOPST[NACN] EQ S"COMMAND"
  357. OR ABHBRK[0] EQ 1
  358. THEN # OK TO SEND TEXT #
  359. BEGIN
  360. ABHBRK[0] = 0;
  361.  
  362. SENDATA;
  363. END
  364.  
  365. END # INPUT ALLOWED = NO #
  366.  
  367. END # CSCPNT #
  368.  
  369. TERM
cdc/nos2.source/nam5871/cscpnt.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator