User Tools

Site Tools


cdc:nos2.source:nam5871:cstscd

CSTSCD

Table Of Contents

  • [00005] PROC CSTSCD (LASTERM)
  • [00006] CSTSCD - SELECT CORRECT DEVICE.
  • [00010] SELECT CORRECT DEVICE.
  • [00059] PROC CSTITR
  • [00060] PROC SSBEBF
  • [00086] PROC CALLITR

Source Code

CSTSCD.txt
  1. *DECK CSTSCD
  2. USETEXT TEXTCS
  3. USETEXT TXTCTCS
  4. USETEXT TXTSMCS
  5. PROC CSTSCD (LASTERM);
  6. # TITLE CSTSCD - SELECT CORRECT DEVICE. #
  7.  
  8. BEGIN # CSTSCD #
  9. #
  10. ** CSTSCD - SELECT CORRECT DEVICE.
  11. *
  12. * D. G. DEPEW. 81/10/16.
  13. *
  14. * CSTSCD SELECTS APPROPRIATE DEVICE ENTRIES FOR A GIVEN TERMINAL
  15. * ENTRY WITHIN THE LINE RECORD OF A GIVEN NCF DATA QUEUE ENTRY, AND
  16. * FOR EACH DEVICE SELECTED CALLS PROC CSTITR TO ISSUE (PLACE IN THE
  17. * OUTGOING TRAFFIC QUEUE) THE CNF/TE/N RESPONSE SM.
  18. *
  19. * PROC CSTSCD (LASTERM)
  20. *
  21. * ENTRY BASED ARRAYS *LINEREC* AND *TRMINFO* POINT TO THE CORRECT
  22. * LINE RECORD AND TERMINAL ENTRY, RESPECTIVELY.
  23. * LASTERM = TRUE, IF THIS IS THE LAST TERMINAL ON THE LINE
  24. * FOR WHICH DEVICES ARE TO BE CONFIGURED.
  25. * LASTERM = FALSE, IF THERE ARE MORE TERMINALS ON THE LINE
  26. * FOR WHICH DEVICES ARE TO BE CONFIGURED.
  27. *
  28. * EXIT BASED ARRAYS *LINEREC* AND *TRMINFO* POINT TO THE SAME
  29. * RELATIVE POSITION WITHIN THE NCF DATA QUEUE ENTRY AS
  30. * UPON ENTRY.
  31. * ALL CONFIGURE TERMINAL NORMAL RESPONSE SMS APPROPRIATE TO
  32. * THE GIVEN TERMINAL ENTRY HAVE BEEN PLACED IN THE
  33. * OUTGOING TRAFFIC QUEUE.
  34. * ITEM *NRDEV* (IN TXTCTCS) IS INCREMENTED BY THE NUMBER OF
  35. * CNF/TE/N SMS ISSUED.
  36. *
  37. * METHOD THE LOGIC OF THIS ROUTINE IS BASED ON THE FACT THAT FOR
  38. * AUTORECOGNITION THERE IS NO WAY OF KNOWING IN ADVANCE HOW
  39. * MANY DEVICES WILL BE CONFIGURED AND THENCE NO WAY OF
  40. * KNOWING WHEN TO SET THE LAST RESPONSE FLAG IN THE CNF/TE/N
  41. * RESPONSE. THUS, WHEN A MATCHING DEVICE ENTRY IS FOUND,
  42. * ITS ORDINAL IS SAVED UNTIL A SUBSEQUENT MATCHING ENTRY IS
  43. * FOUND. AT THAT POINT THE DEVICE DEFINED BY THE PREVIOUS
  44. * ENTRY IS CONFIGURED AND THE SUBSEQUENT DEVICE ENTRY
  45. * ORDINAL IS SAVED UNTIL ANOTHER MATCHING DEVICE IS FOUND,
  46. * AND SO ON. AT THE END OF THIS PROCESS A SPECIAL CASE IS
  47. * MADE TO CONFIGURE THE LAST DEVICE. FOR REASONS OF
  48. * CONSISTENCY AND SIMPLICITY, SIMILIAR LOGIC IS USED FOR
  49. * FIXED CONFIGURATION LINES.
  50. #
  51.  
  52. ITEM LASTERM B; #LAST TERMINAL ON A LINE FLAG #
  53.  
  54. #
  55. **** PROC CSTSCD - XREF LIST.
  56. #
  57. XREF
  58. BEGIN
  59. PROC CSTITR; #ISSUE CONFIGURE TERMINAL NORMAL RESPONSE #
  60. PROC SSBEBF; #EXTRACT BITFIELD #
  61. END
  62. #
  63. ****
  64. #
  65.  
  66.  
  67. ITEM I, J; #LOOP INDUCTION VARIABLES #
  68. ITEM MATCH B; #INDICATES A DEVICE MATCH HAS BEEN FOUND #
  69. ITEM LASTDEV B; #LAST DEVICE ON A LINE FLAG #
  70. ITEM PREVDEV; #NDQ WORD ORDINAL OF PREVIOUS DEVICE ENTRY#
  71. ITEM A2DTORD; #WORD ORDINAL OF A2/DT PAIR IN CNF/TE/R SM#
  72. ITEM A2DTBIT; #START BIT POS OF A2/DT PAIR IN WORD #
  73. ITEM LDES; #LEN ALL DEV NTRYS IN A TERM NTRY (CM WDS)#
  74.  
  75. ARRAY A2DTPAIR [00:00] S(1); #STORAGE FOR EXTRACTED A2/DT PAIR #
  76. BEGIN
  77. ITEM PR$A2DT U(00,00,60); #A2/DT COMBINED #
  78. ITEM PR$A2 U(00,44,08); #ADDRESS TWO #
  79. ITEM PR$DT U(00,52,08); #DEVICE TYPE #
  80. END
  81.  
  82.  
  83.  
  84.  
  85.  
  86. PROC CALLITR;
  87.  
  88. BEGIN # CALLITR #
  89. #
  90. * CALLITR - CALL PROC CSTITR.
  91. *
  92. * THIS EMBEDDED PROC SAVES THE POINTERS FOR THE TERMINAL AND DEVICE
  93. * ENTRY (WITHIN A LINE RECORD) BASED ARRAYS, CALLS PROC CSTITR TO
  94. * CONFIGURE THE PREVIOUSLY SELECTED DEVICE, AND RESTORES ALL THREE
  95. * BASED ARRAYS (LINE, TERMINAL AND DEVICE) IN A MANNER THAT ALLOWS
  96. * FOR STORAGE MOVEMENT OF THE NCF DATA QUEUE.
  97. *
  98. * PROC CALLITR
  99. *
  100. * ENTRY PREVDEV = NCF DATA QUEUE ORDINAL OF THE DEVICE TO BE
  101. * CONFIGURED.
  102. * P<LINEREC> = ABSOLUTE ADDRESS OF THE CURRENT LINE RECORD.
  103. * P<TRMINFO> = ABSOLUTE ADDRESS OF THE CURRENT TERMINAL
  104. * ENTRY.
  105. * P<DEVNTRY> = ABSOLUTE ADDRESS OF THE ENTRY FOR THE NEXT
  106. * DEVICE TO BE CONFIGURED, OR IF *PREVDEV* IS
  107. * POINTING TO THE LAST DEVICE TO BE CONFIGURED
  108. * ON THE CURRENT TERMINAL, THE ABSOLUTE ADDRESS
  109. * OF THE WORD FOLLOWING THE TERMINAL ENTRY.
  110. *
  111. * EXIT A CNF/TE/N SM HAS BEEN PLACED IN THE OUTGOING TRAFFIC
  112. * QUEUE FOR THE DEVICE INDICATED BY *PREVDEV* UPON ENTRY.
  113. * PREVDEV = NCF DATA QUEUE ORDINAL OF THE NEXT DEVICE TO BE
  114. * CONFIGURED, OR IF THE LAST DEVICE ON THE CURRENT
  115. * TERMINAL WAS CONFIGURED (I.E., CNF/TE/N QUEUED
  116. * IN OTQ) THIS TIME, THE NCF DATA QUEUE ORDINAL OF
  117. * THE WORD FOLLOWING THE TERMINAL ENTRY.
  118. * P<LINEREC> = SAME AS ENTRY BUT REVISED FOR STORAGE MOVE.
  119. * P<TRMINFO> = SAME AS ENTRY BUT REVISED FOR STORAGE MOVE.
  120. * P<DEVNTRY> = SAME AS ENTRY BUT REVISED FOR STORAGE MOVE.
  121. *
  122. * NOTE PROC CSTITR CALLS PROC SSTAQE (TO QUEUE CNF/TE/N IN OTQ),
  123. * WHICH IN TURN CALLS PROC SSTATS (TO ALLOCATE CORE IN OTQ),
  124. * WHICH CAN CAUSE STORAGE TO MOVE.
  125. *
  126. * METHOD TO PROVIDE FOR STORAGE MOVING, WE SIMPLY CONVERT THE
  127. * VARIOUS BASED ARRAY POINTERS (WHICH CONTAIN ABSOLUTE
  128. * ADDRESSES) INTO THEIR RESPECTIVE NCF DATA QUEUE ORDINALS.
  129. #
  130.  
  131. ITEM CRNTERM; #NDQ WORD ORDINAL OF CURRENT TERMINAL NTRY#
  132. ITEM CRNTDEV; #NDQ WORD ORDINAL OF CURRENT DEVICE ENTRY #
  133.  
  134.  
  135. CRNTERM = P<TRMINFO> - P<NDQ>; # SAVE POINTERS #
  136. CRNTDEV = P<DEVNTRY> - P<NDQ>;
  137. P<DEVNTRY> = P<NDQ> + PREVDEV; # DEVICE TO CONFIGURE #
  138. CSTITR (LASTDEV);
  139. PREVDEV = CRNTDEV; # NEXT DEVICE TO CONFIGURE #
  140. P<LINEREC> = P<NDQ> + NDQ$TCSIZE[0]; # RESTORE POINTERS #
  141. P<TRMINFO> = P<NDQ> + CRNTERM;
  142. P<DEVNTRY> = P<NDQ> + CRNTDEV;
  143. NDQ$WORD[NDQL] = 1; # INSURE CORRECT LOOP TERMINATION #
  144.  
  145. END # CALLITR #
  146.  
  147.  
  148.  
  149.  
  150. # MAIN ROUTINE BEGINS HERE. #
  151.  
  152. LASTDEV = FALSE;
  153. LDES = TE$WC[0] - TEHDRL$; # WORD COUNT OF DEV NTRYS #
  154.  
  155. IF CNFTTA[0] NQ 0
  156.  
  157.  
  158. THEN # AUTORECOGNITION LINE #
  159. BEGIN
  160. PREVDEV = 0;
  161. A2DTORD = 1; # SET UP FOR A2/DT PAIR EXTRACTION #
  162. A2DTBIT = 20;
  163. FOR I=1 STEP 1 UNTIL CNFNT[0]
  164. DO # ATTEMPT TO CONFIG ALL REPORTED DEVICES #
  165. BEGIN
  166. MATCH = FALSE;
  167. SSBEBF (CSSM[0], A2DTORD, A2DTBIT, 16, A2DTPAIR);
  168. P<DEVNTRY> = P<TRMINFO> + TEHDRL$; # 1ST DEV IN TERM NTRY#
  169. FOR J=DE$WC[0] STEP DE$WC[0]
  170. WHILE J LQ LDES AND NOT MATCH
  171. DO # LOOP TIL END OF TRM NTRY OR DEVICE MATCH#
  172. IF NOT DE$CONFIG[0]
  173. AND (DE$A2[0] EQ PR$A2[0] OR DE$A2[0] EQ 0)
  174. AND (DE$DT[0] EQ PR$DT[0])
  175. THEN # THIS DEVICE OK #
  176. BEGIN
  177. MATCH = TRUE;
  178. DE$CONFIG[0] = TRUE; # DONT MATCH ON THIS DEV NTRY AGAIN#
  179.  
  180. # INSURE VALUES REQUIRED FOR CNF/TE/N ARE IN LINE RECORD FIELDS. #
  181.  
  182. DE$A2DT[0] = PR$A2DT[0];
  183. IF PREVDEV EQ 0
  184. THEN # THIS IS THE FIRST MATCHING DEVICE ENTRY #
  185. PREVDEV = P<DEVNTRY> - P<NDQ>;
  186. ELSE # THERE IS A PREVIOUS DEVICE MATCH #
  187. CALLITR; # JUGGLE POINTERS AND ISSUE CNF/TE/N #
  188. END
  189. ELSE # THIS DEVICE NO GOOD #
  190. P<DEVNTRY> = P<DEVNTRY> + DE$WC[0]; # NXT DEV NTRY #
  191. END
  192. END
  193.  
  194.  
  195. ELSE # FIXED CONFIGURATION LINE #
  196. BEGIN
  197. PREVDEV = P<TRMINFO> - P<NDQ> + TEHDRL$; # NDL INSURES ONE DEV#
  198. P<DEVNTRY> = P<TRMINFO> + TEHDRL$ + TE$WC[TEHDRL$]; # 2ND DEV #
  199. LDES = LDES - TE$WC[TEHDRL$]; # ADJUST, LOOP STARTS AT 2ND DEV#
  200. FOR J=DE$WC[0] STEP DE$WC[0]
  201. WHILE J LQ LDES
  202. DO # LOOP UNTIL END OF TERMINAL ENTRY #
  203. BEGIN
  204. CALLITR; # JUGGLE POINTERS AND ISSUE CNF/TE/N #
  205. P<DEVNTRY> = P<DEVNTRY> + DE$WC[0]; # NXT DEV NTRY #
  206. END
  207. END
  208.  
  209. IF PREVDEV NQ 0
  210. THEN
  211.  
  212. # THERE IS AT LEAST ONE DEVICE TO CONFIGURE ON THE TERMINAL, AND #
  213. # THIS IS THE LAST DEVICE TO CONFIGURE ON THE TERMINAL. #
  214.  
  215. BEGIN
  216. LASTDEV = LASTERM; # MAYBE LAST DEVICE ON LINE, MAYBE NOT #
  217. CALLITR; # JUGGLE POINTERS AND ISSUE CNF/TE/N #
  218. END
  219.  
  220. END # CSTSCD #
  221.  
  222. TERM
cdc/nos2.source/nam5871/cstscd.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator