User Tools

Site Tools


cdc:nos2.source:nam5871:xsttp

Table of Contents

XSTTP

Table Of Contents

Source Code

XSTTP.txt
  1. *DECK XSTTP
  2. IDENT XSTTP
  3. SST
  4. EXT ABORT
  5. EXT XTRACE
  6. ENTRY XSTTP
  7. *#
  8. *1DC XSTTP
  9. * 1. PROC NAME AUTHOR DATE
  10. * XSTTP Y.J.POLAK 81/03/03
  11. * 2. FUNCTIONAL DESCRIPTION
  12. * THIS ROUTINE IS RESPONSIBLE FOR ACCESSING THE VARIOUS STATE
  13. * TABLES.IT IS CALLED BY EACH OF THE FOUR STATE TABLE
  14. * PROCESSORS (NCSTTP,NBSTTP,HCSTTP,HBSTTP).EACH ONE OF THESE
  15. * SPECIFIES THE STATE TABLE TO BE PROCESSED BY PASSING THE
  16. * PROPER ORDINAL.
  17. * 3. METHOD USED
  18. * THE STATE TABLES ARE DEFINED BY USING THE FOLLOWING MACROES
  19. * (DEFINED IN COMDECK STBLMAC):INITBL,STATE,TRIG,ENDTBL.
  20. * INITIALLY INITBL IS INVOKED WITH THE STATE TABLE NAME OF 2
  21. * CHARACTERS,THE MAXIMUM STATE NUMBER AND THE MAXIMUM TRIGGER
  22. * TRIGGER NUMBER.
  23. * NEXT FOR EACH STATE ALL LEGAL TRIGGERS ARE DEFINED,BY
  24. * INVOKING A STATE MACRO WITH THE STATE NUMBER FOLLOWED BY
  25. * THE TRIG MACRO FOR EACH LEGAL TRIGGER IN THAT STATE.THE TRIG
  26. * MACRO HAS THE FOLLOWING PARAMETERS (IN THIS ORDER):
  27. * TRIGN - TRIGGER NUMBER
  28. * NEWST - NEW STATE AS A RESULT OF THIS TRIGGER
  29. * ACTION- ACTION ORDINAL OF CODE TO BE PERFORMED IN THIS CASE
  30. * TRIGC - TRIGGER NO, TO BE SENT TO CORRESP. CONNECTION STATE
  31. * TABLE
  32. * TRIGB - TRIGGER NO. TO BE SENT TO CORREP. BLOCK PROTOCOL
  33. * STATE TABLE.
  34. * EXCEPT TRIGN ALL PARAMETERS MAY BE LEFT BLANK BY ADJACENT
  35. * COMMAS,IN WHICH A NO CHANGE VALUE (NOCHG) WILL BE FILLED IN.
  36. * ALL STATES MUST BE DEFINED IN ORDER STARTING FROM THE SPECIAL
  37. * NO CONNECTION STATE (STATX),THEN STATE 0,STATE 1 AND SO ON.
  38. * ALL STATES MUST HAVE AT LEAST ONE LEGAL TRIGGER.FINALLY THE
  39. * MACRO ENDTBL MUST BE INVOKED WITH THE 2-CHAR NAME OF THE
  40. * STATE TABLE.
  41. * THE STATE TABLES MACROES ARE DEVISED SUCH THAT ONLY LEGAL
  42. * TRIGGERS NEED TO BE SPECIFIED.ONLY IN THESE CASES ARE ANY
  43. * PARAMETERS STORED IN THE STATE TABLE.AT THE SAME TIME A
  44. * BITMAP IS CONSTRUCTED WITH ONE BIT PER POSSIBLE CASE (BOTH
  45. * LEGAL AND ILLEGAL).IF THE TRIGGER IS DEFINED THAT MEANS THAT
  46. * THE CASE IS LEGAL AND THE APPROPRIATE BIT IS SET.IF TRIGGER
  47. * NUMBERS ARE SKIPPED THIS MEANS THAT THOSE CASES ARE ILLEGAL
  48. * AND THE APPROPRIATE BITS ARE CLEARED.
  49. * WHEN ROUTINE XSTTP IS CALLED IT CALCULATES THE FOLLOWING
  50. * BASED ON THE CALL PARAMETERS:
  51. * (CURRENT STATE NO.*(MAX TRIGGER VALUE+1))+CURRENT TRIGGER NO
  52. * THIS IS THE APPROPRIATE BIT-NUMBER IN THE BITMAP FOR THIS
  53. * CASE.IF IT IS CLEAR THE CASE IS ILLEGAL AND ZEROES ARE
  54. * RETURNED IN THE RESPONSE.IF IT IS SET THEN THE CASE IS
  55. * LEGAL AND THE RESPONSE PARAMETERS ARE TO BE LOCATED IN THE
  56. * STATE TABLE.THIS IS DONE BY COUNTING THE ONE BITS PRECEDING
  57. * THIS CASE IN THE BITMAP,USING THE POPULATION COUNT
  58. * MACHINE INSTRUCTION.BASED ON THE NUMBER OF PRECEDING LEGAL
  59. * CASES THE PARAMETER-LOCATION IN THE ACTUAL STATE TABLE IS
  60. * CALCULATED (EACH LEGAL CASE OCCUPIES 30 BITS,CURRENTLY).
  61. * FINALLY THAT INFO IS PASSED IN THE RESPONSE PARAMETER.
  62. * 4. ENTRY PARAMETERS
  63. * ORD STATE TABLE ORDINAL (0-3)
  64. * CURST CURRENT STATE OF CONNECTION OR 76B IF NO
  65. * CONNECTION EXISTS
  66. * TRIGNO CURRENT TRIGGER NUMBER
  67. * 5. EXIT PARAMETER.
  68. * STATRSP RESPONSE WORD CONTAINING THE FOLLOWING FIELDS
  69. *
  70. * LEGALB BOOLEAN(LEFTMOST BIT)
  71. * IF FALSE THEN THE TRIGGER WAS NOT LEGAL
  72. * THE CURRENT STATE
  73. * IF TRUE THEN THE TRIGGER WAS LEGAL FOR THE
  74. * CURRENT STATE AND THE FOLLOWING FIELDS (6-
  75. * BITS EACH) ARE CONTAINED IN THE RIGHMOST
  76. * 30 BITS OF STATRSP:
  77. *
  78. * NEWST NEW STATE OF CONNECTION
  79. * ACTION ACTION INDICATOR OF CODE TO BE PERFORMED
  80. * TRIGC TRIGGER TO CORRESPONDING CONNECTION
  81. * STATE TABLE
  82. * TRIGB TRIGGER TO CORRESPONDING BLOCK PROTOCOL
  83. * STATE TABLE
  84. * RES RESERVED (77B)
  85. *
  86. *
  87. * A VALUE OF NOCHG(77B) INDICATES THAT NO STATE CHANGE,
  88. * ACTION OR TRIGGER IS NEEDED
  89. * A SPECIAL VALUE OF STATX (76B) FOR THE NEW STATE IMPLIES
  90. * THERE IS NO CONNECTION ANYMORE
  91. *
  92. * 6. COMDECKS CALLED.
  93. * MACDEF CYBERDEFS STBLDEF INPARU STBLMAC
  94. * 7. ROUTINES CALLED.
  95. * ABORT
  96. * 8. DAYFILE MESSAGES
  97. * NONE DIRECTLY
  98. * VIA ABORT: ERR IN STATE TABLE PROCESSOR CALL (XSTTP)
  99. *
  100. *#
  101. *CALL MACDEF
  102. *CALL CYBERDEFS
  103. *CALL INPARU
  104. *CALL STBLDEF
  105. *CALL STBLMAC
  106. *CALL STATTBL
  107. XSTTP SUBR =
  108. IFEQ DEBUG,1,6
  109. SX6 A1
  110. SA6 TEMP
  111. SX1 XNAME
  112. RJ XTRACE
  113. SA1 TEMP
  114. SA1 X1
  115. SB7 WL
  116. SB1 1
  117. SA2 X1 PAR LIST,PICK UP STTBL ORDINAL
  118. SA2 X2+TBLPNTR POINTER TABLE INDEXED BY ORDINAL
  119. SB2 X2 SAVE LEGBM ADDRESS
  120. MX7 48
  121. LX2 12 SHIFT POINTER TABLE ENTRY
  122. BX1 -X7*X2 MAXIMUM TRIGGER VALUE
  123. SX1 X1+B1 ADD ONE
  124. LX2 12 SHIFT AGAIN AND PICK UP
  125. BX3 -X7*X2 LENGTH OF LEGAL CASE BITMAP IN WORDS
  126. SB3 X3 SAVE IN B3
  127. SA3 A1+B1 NEXT PAR:CURRENT STATE
  128. SA5 X3
  129. SX4 X5-STATX
  130. ZR X4,NOCONN IF STATE OF NO CONNECTION SKIP
  131. SX3 X5+B1 ADD ONE FOR NO CONN STATE
  132. IX4 X1*X3 CALCULATE CUR STATE*MAX TRIGVAL+1
  133. NOCONN SA3 A3+B1 NEXT PAR:TRIGNO
  134. SA5 X3
  135. IX3 X5+X4 ADD IT TO X4
  136. SB4 X3 SAVE IN B4 (CURST*(MAXTR+1))+TRIGNO
  137. SB6 B0
  138. LT B4,B7,FNDWD IF VALUE LESS THAN 60 THEN FOUND WORD
  139. LOOP SB4 B4-B7 OTHERWISE SUBTRACT 60 AND
  140. SB6 B6+B1 KEEP WORD COUNT IN B6
  141. GE B4,B7,LOOP MORE TO GO
  142. FNDWD GE B6,B3,ERR ILLEGAL VALUE IN B4
  143. SA1 B2+B6 FETCH PROPER LEGBM WORD
  144. LX5 X1,B4 SHIFT TO PROPER BIT
  145. NG X5,LEGVAL LEGAL TRIGGER,JUMP
  146. MX6 0 ILLEGAL TRIGGER
  147. SA3 A3+B1 SET EXIT PAR TO 0
  148. SA6 X3 STORE AND EXIT
  149. EQ XSTTPX
  150. LEGVAL MX6 1 COUNT NO OF PRECEDING ENTRIES
  151. AX7 B4,X6 BUILD MASK FOR ALL PRECEDING BITS
  152. BX5 X7*X1 X1 CONTAINS LEGBM WORD
  153. CX3 X5 NUMBER OF ONES IN WORD
  154. EQ B6,NOMORE JUMP IF NO PRECEDING WORDS
  155. MORE SB6 B6-B1 CHECK PRECEDING WORDS IN LEGBM
  156. SA1 B2+B6 PREVIOUS WORD
  157. CX5 X1 COUNT ONES
  158. IX3 X3+X5 ADD TO RESULT
  159. GT B6,MORE MORE TO GO
  160. NOMORE SX3 X3-1 SUBTRACT ONE FOR ORIG ENTRY
  161. * X3 NOW HOLDS THE NUMBER OF PRECEDING LEGAL ENTRIES IN STTBL
  162. * BASED ON 30 BIT ENTRY LENGTH WE DIVIDE BY 2 IN ORDER TO
  163. * CALCULATE THE PROPER ADDRESS
  164. AX4 B1,X3
  165. SB3 X4
  166. LX5 B1,X4 MULT BACK BY 2AND CALCULATE LOGICAL
  167. BX4 X5-X3 DIFFERENCE TO KNOW SIDE OF ENTRY
  168. * X2 STILL HOLDS POINTER TABLE WORD FOR PROPER ORDINAL
  169. LX2 18 SHIFT TO POSITION
  170. SA1 X2+B3 FETCH PROPER STTBL WORD
  171. NZ X4,RIGHTSD TAKE PROPER SIDE
  172. LX1 30 LEFT OR
  173. RIGHTSD MX7 30 RIGHT
  174. BX5 -X7*X1 MASK THE 30 BITS AND ADD
  175. BX7 X5+X6 HIGH ORDER BIT TO INDICATE
  176. SA3 A3+B1 LEGAL VALUE
  177. SA7 X3 STORE IN EXIT PARAMETER
  178. EQ XSTTPX
  179. ERR SX1 ERRMSG
  180. RJ ABORT ABORT WITH PROPER ERROR MESSAGE IN DAYFILE
  181. ERRMSG DIS ,* ERROR IN XSTTP CALL*
  182. XNAME DATA L*XSTTP*
  183. TEMP BSS 1
  184. END
cdc/nos2.source/nam5871/xsttp.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator