User Tools

Site Tools


cdc:nos2.source:opl871:smsg

Table of Contents

SMSG

Table Of Contents

  • [00002] SMSG - SEND MESSAGE TO M860.
  • [00009] SEMD MESSAGE AND ASSOCIATED DATA TO M860.
  • [00034] LOCAL MACROS.
  • [00035] PACK - PACK AND STORE ONE MESSAGE WORD
  • [00055] MAIN ROUTINE.
  • [00161] SUBROUTINES.
  • [00163] WTW - WRITE WORDS FROM WORKING BUFFER.
  • [00348] WORKING STORAGE.

Source Code

SMSG.txt
  1. IDENT SMSG
  2. TITLE SMSG - SEND MESSAGE TO M860.
  3. ENTRY SMSG
  4. SST
  5. *COMMENT PACK AND CHECKSUM M860 MESSAGE.
  6. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  7. SYSCOM B1
  8. SMSG SPACE 4
  9. *** SMSG - SEMD MESSAGE AND ASSOCIATED DATA TO M860.
  10. *
  11. * W. J. STURGIS. 82/09/14.
  12. *
  13. * SMSG CHECKSUMS AND PACKS THE MESSAGE AND MOVES
  14. * IT TO THE MESSAGE BUFFER. ASSOCIATED DATA(IF ANY)
  15. * IS ALSO MOVED TO THE MESSAGE BUFFER. THE IN POINTER
  16. * IS UPDATED IN THE FET ONLY AFTER ALL DATA IS IN THE
  17. * BUFFER.
  18. *
  19. * SYMPL CALL.
  20. * SMSG(FET,MSG,ADATA,ADATAL,STS);
  21. *
  22. * WHERE
  23. * FET = FET ADDRESS.
  24. * MSG = MESSAGE(UPPER 48 BITS OF 11 WORDS).
  25. * ADATA = ASSOCIATED DATA BLOCK(0 IF NO DATA).
  26. * ADATAL = LENGTH OF ASSOCIATED DATA BLOCK(0 IF NONE).
  27. * STS = RETURN STATUS.
  28. * 0 = MESSAGE AND DATA IN BUFFER.
  29. * 1 = NOT ENOUGH ROOM IN BUFFER FOR MESSAGE(AND DATA).
  30. SPACE 4,10
  31. * COMMON DECKS.
  32.  
  33. *CALL,COMCMAC
  34. TITLE LOCAL MACROS.
  35. ** PACK - PACK AND STORE ONE MESSAGE WORD
  36. *
  37. * PACK SC
  38. *
  39. * WHERE SC = MASK AND SHIFT COUNT.
  40.  
  41.  
  42. PURGMAC PACK
  43.  
  44. PACK MACRO S
  45. SA1 A1+B1 LOAD MESSAGE WORD
  46. MX0 -S
  47. BX1 X7*X1 USE ONLY 48 BITS
  48. LX1 S
  49. BX2 -X0*X1
  50. BX6 X6+X2 FINISH PACKED WORD
  51. SA6 B3 STORE PACKED WORD
  52. SB3 B3+B1 UPDATE BUFFER ADDRESS
  53. BX6 X0*X1 UPPER BITS OF NEXT WORD
  54. ENDM
  55. TITLE MAIN ROUTINE.
  56. SMSG SUBR ENTRY/EXIT
  57. SB1 1
  58. SX7 A1
  59. SA7 PARL SAVE PARAMETER LIST ADDRESS
  60. SA0 X1 FET ADDRESS
  61. SA2 A1+3
  62. SA2 X2 ASSOC. DATA LENGTH
  63. SA1 A0+2 IN
  64. BX7 X1
  65. SA7 IN SAVE IN POINTER FOR WTW
  66. SA3 A1+B1 OUT
  67. IX6 X3-X1 OUT-IN
  68. ZR X6,SMS0 IF IN = OUT
  69. PL X6,SMS1 IF OUT GT IN
  70. SMS0 SA1 A0+B1 FIRST
  71. SA3 A3+B1 LIMIT
  72. SX1 X1
  73. SX3 X3
  74. IX6 X6+X3 +LIMIT
  75. IX6 X6-X1 -FIRST = ROOM IN BUFFER
  76. SMS1 SX2 X2+9+1 ASSOC. DATA + PACKED MSG + 1
  77. IX6 X6-X2
  78. PL X6,SMS3 IF ROOM IN BUFFER
  79. SMS1.0 SX6 1 SET RETURN CODE
  80. SMS2 SA1 PARL
  81. SA2 X1+4 RESPONSE ADDRESS
  82. SA6 X2 STORE RETURN STATUS
  83. EQ SMSGX RETURN
  84.  
  85. * COMPUTE CHECKSUM.
  86.  
  87. SMS3 SA1 PARL
  88. SA2 X1+B1
  89. SB2 X2 MESSAGE
  90. SB5 B2
  91. MX0 16
  92. SA2 B2+10
  93. BX6 X0*X2 CLEAR CHECKSUM
  94. SA6 A2
  95. SB3 B2+11
  96. LX0 16
  97. BX6 X6-X6 INITIAL SUM
  98. SMS4 SA1 B2
  99. LX1 16
  100. BX2 X0*X1
  101. LX1 16
  102. IX6 X6+X2
  103. BX3 X0*X1
  104. LX1 16
  105. IX6 X6+X3
  106. BX2 X0*X1
  107. IX6 X6+X2
  108. SB2 B2+B1
  109. LT B2,B3,SMS4
  110. BX6 X0*X6 ONLY 16 BIT SUM
  111. SX1 0#10000
  112. IX6 X1-X6 2S COMPL.
  113. BX6 X0*X6 ONLY 16 BITS
  114. SA1 A1 LOAD LAST WORD OF MESSAGE
  115. LX6 16+12
  116. BX6 X6+X1
  117. SA6 A1 STORE CHECKSUM
  118.  
  119. * PACK MESSAGE.
  120.  
  121. SA1 B5-B1 MESSAGE - 1
  122. MX7 48
  123. SB2 0
  124. SB3 MBUF
  125. SMS5 SA1 A1+B1
  126. BX6 X7*X1
  127. PACK 12
  128. PACK 24
  129. PACK 36
  130. SA1 A1+B1
  131. BX1 X7*X1
  132. LX1 48
  133. BX6 X6+X1
  134. SA6 B3 STORE LAST WORD
  135. SB3 B3+B1
  136. SB2 B2+B1
  137. LE B2,B1,SMS5 IF NOT 8 WORDS PACKED
  138. SA1 A1+B1
  139. BX6 X1
  140. SA6 B3 STORE NINTH WORD
  141. SA2 PARL (X2) = FET ADDRESS
  142. SB6 MBUF
  143. SB7 9
  144. RJ WTW MOVE DATA TO BUFFER
  145. SA1 PARL
  146. SA2 X1+2 ASSOC DATA BLOCK
  147. SA3 X1+3 LENGTH
  148. SA3 X3
  149. NZ X3,SMS7 IF ASSOC DATA
  150. SMS6 SA1 IN
  151. BX6 X1
  152. SA6 A0+2 STORE IN POINTER IN FET
  153. JP SMSGX RETURN
  154.  
  155. * MOVE ASSOCIATED DATA TO BUFFER
  156.  
  157. SMS7 SB6 X2 WORKING BUFFER
  158. SB7 X3 LENGTH
  159. RJ WTW MOVE DATA
  160. EQ SMS6 UPDATE IN AND RETURN
  161. TITLE SUBROUTINES.
  162. WTW SPACE 4
  163. ** WTW - WRITE WORDS FROM WORKING BUFFER.
  164. *
  165. * WTW TRANSFERS DATA FROM A WORKING BUFFER TO A
  166. * CIRCULAR BUFFER.
  167. * WTW IS ADAPTED FROM WTW= (COMCWTW).
  168. *
  169. * ENTRY (A0) = ADDRESS OF FET FOR FILE.
  170. * (B6) = FWA WORKING BUFFER.
  171. * (B7) = WORD COUNT OF WORKING BUFFER.
  172. * IF (B7) = 0, NO TRANSFER WILL BE PERFORMED.
  173. * (IN) = IN POINTER TO USE.
  174. *
  175. * EXIT (IN) = UPDATED IN POINTER FOR FET.
  176. *
  177. * USES X - 1, 2, 3, 4, 6, 7.
  178. * B - 1, 2, 3, 4, 5, 6, 7.
  179. * A - 1, 2, 3, 4, 6, 7.
  180. *
  181. * CALLS NONE.
  182.  
  183.  
  184. WTW18 SX6 B3+B4 ADVANCE IN
  185. SB3 B3+B4
  186. SB6 B6+B4
  187. SB7 B7-B4
  188. NE B3,B5,WTW19 IF IN " LIMIT
  189. SA1 A0+B1 IN = FIRST
  190. SX6 X1
  191. WTW19 SA6 IN UPDATE IN
  192. NZ B7,WTW1 IF NOT END OF TRANSFER
  193.  
  194. WTW SUBR ENTRY/EXIT
  195. WTW1 SA1 A0+3 (B4) = OUT
  196. SA3 IN (B3) = IN
  197. SA4 A1+B1 (B5) = LIMIT
  198. ZR B7,WTWX IF WORKING BUFFER EMPTY
  199. SB4 X1
  200. SA1 A0+B1 (B2) = FIRST
  201. SB3 X3
  202. SB5 X4
  203. SB2 X1
  204. SA1 B6 READ FIRST WORD
  205. NE B2,B4,WTW2 IF OUT " FIRST
  206. SB4 B5
  207. WTW2 LT B3,B4,WTW3 IF NO END AROUND
  208. SB4 B5+1
  209. WTW3 SB4 B4-B1
  210. SB4 B4-B3
  211. ZR B4,SMS1.0 IF NO ROOM
  212. BX7 X1
  213. LE B4,B7,WTW4 IF NOT ENOUGH ROOM TO LIMIT
  214. SB4 B7 NO WRAPAOOUND
  215.  
  216. * INITIALIZE REGISTERS FOR TRANSFER.
  217.  
  218. WTWA BSS 0
  219. WTW4 SA3 WTWC PRESET CMU CODE AND VOID STACK
  220. RJ WTW16
  221. * SA1 A1+B1 (NO CMU)
  222. * SX4 B4-B1 (NO CMU)
  223. * MX6 -3 (NO CMU)
  224. * SA7 B3 (NO CMU)
  225. *
  226. * GT B4,B1,WTW14 IF MORE THAN 1 WORD (CMU)
  227. * BX4 X4-X4 (CMU)
  228. * SA7 B3 (CMU)
  229.  
  230. WTW5 BX3 -X6*X4 NUMBER OF ODD WORDS
  231. AX4 3 NUMBER OF BLOCKS
  232. ZR X3,WTW7 IF NO ODD WORDS
  233.  
  234. * TRANSFER UP TO 7 WORDS.
  235.  
  236. WTW6 SX3 X3-1
  237. BX7 X1
  238. SA1 A1+B1
  239. SA7 A7+B1
  240. NZ X3,WTW6 LOOP
  241.  
  242. * PRE-READ REGISTERS.
  243.  
  244. WTW7 ZR X4,WTW18 IF NO BLOCKS
  245. SA2 A1+B1
  246. SB2 B1+B1 (B2) = 2
  247. SA3 A2+B1
  248. SB3 X4 (B3) = BLOCK COUNT
  249. SA4 A3+B1
  250.  
  251. * TRANSFER 8 WORD BLOCKS.
  252.  
  253. WTW8 BX6 X1
  254. LX7 X2
  255. SA1 A3+B2
  256. SA2 A4+B2
  257. SA6 A7+B1
  258. SB3 B3-B1
  259. SA7 A6+B1
  260. BX6 X3
  261. LX7 X4
  262. SA3 A1+B2
  263. SA4 A2+B2
  264. SA6 A6+B2
  265. SA7 A7+B2
  266. BX6 X1
  267. LX7 X2
  268. SA1 A3+B2
  269. SA2 A4+B2
  270. SA6 A6+B2
  271. SA7 A7+B2
  272. BX6 X3
  273. LX7 X4
  274. SA3 A1+B2
  275. SA4 A2+B2
  276. SA6 A6+B2
  277. SA7 A7+B2
  278. NZ B3,WTW8 LOOP
  279.  
  280. * WRITE EXIT.
  281.  
  282. SA3 IN READ IN
  283. SA1 A0+4 (B5) = LIMIT
  284. SB5 X1
  285. WTW9 SB6 B6+B4
  286. SB7 B7-B4
  287. SB3 X3+B4 ADVANCE IN
  288. SX6 X3+B4
  289. SA3 A0+B1 READ FIRST
  290. NE B3,B5,WTW19 IF IN " LIMIT
  291. SX6 X3+ IN = FIRST
  292. WTW10 EQ WTW19 CLEAN UP AND RETURN
  293.  
  294. * MOVE DATA WITH CMU.
  295.  
  296. WTW14 SX4 B4-819
  297. PL X4,WTW15 IF TOO BIG FOR CMU
  298. SX4 B4 10 * WORDS = CHARACTERS
  299. LX6 X4,B1
  300. BX1 X0 SAVE X0
  301. LX4 3
  302. IX6 X4+X6
  303. SX7 B6 SET SOURCE ADDRESS
  304. SX4 B3 SET DESTINATION ADDRESS
  305. LX7 30
  306. BX4 X4+X7
  307. MX7 -4
  308. BX3 X7*X6 EXTRACT UPPER PORTION
  309. BX6 -X7*X6 EXTRACT LOWER PORTION
  310. LX3 48-4
  311. BX4 X4+X3
  312. LX6 26
  313. BX6 X4+X6
  314. AX3 51
  315. SA6 WTWC STORE DESCRIPTOR WORD
  316. IM WTWC MOVE DATA
  317. BX0 X1 RESTORE X0
  318. ZR X3,WTW18 IF NO WRITE EXIT
  319. SX3 B3 RESET IN
  320. JP WTW9
  321.  
  322. WTWB BSS 0
  323. WTW15 SA1 A1+B1 MOVE DATA WITHOUT CMU
  324. SX4 B4-B1
  325. MX6 -3
  326. SA7 B3
  327. JP WTW5
  328.  
  329. * CMU PRESET CODE.
  330. * WWTC IS READ UP AND THEN RETURN JUMPED TO IN ORDER TO VOID
  331. * STACK. WWTC IS ALSO USED AS THE CMU DESCRIPTOR WORD
  332.  
  333. WTWC GT B4,B1,WTW14 IF MORE THAN 1 WORD TO MOVE (CMU)
  334. BX4 X4-X4
  335. SA7 B3
  336. WTW16 EQU WTWC USED TO VOID STACK
  337.  
  338. * PRESET FOR CMU CODE.
  339.  
  340. SA4 CMUR CHECK IF CMU AVAIALABLE
  341. SB4 WTWA
  342. NG X4,WTW17 IF CMU
  343. SA3 WTWB
  344. WTW17 BX6 X3
  345. SA6 B4
  346. JP WTW1
  347.  
  348. TITLE WORKING STORAGE.
  349. * WORKING STORAGE.
  350.  
  351.  
  352. PARL BSS 1 PARAMETER LIST POINTER
  353. IN BSS 1 IN POINTER FOR FET
  354. MBUF BSS 9 PACKED MESSAGE BUFFER
  355. SPACE 4
  356. END
cdc/nos2.source/opl871/smsg.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator