Table of Contents

SEND

Table Of Contents

  • [00005] SEND - SEND MESSAGE TO TERMINAL.
  • [00132] DOL - DETERMINE OPTIONS FROM LIST.
  • [00223] FEL - FORCE END OF LINE.
  • [00334] RST - RETURN STATUS TO TASK.

Source Code

SEND.txt
  1. IDENT SEND
  2. ENTRY SEND
  3. ENTRY ABH.
  4. SYSCOM B1
  5. TITLE SEND - SEND MESSAGE TO TERMINAL.
  6. *COMMENT SEND - SEND MESSAGE TO TERMINAL.
  7. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  8. SPACE 4,10
  9. ***** SEND - SEND MESSAGE TO TERMINAL.
  10. * W.E. MARTIN. 78/01/20.
  11. SPACE 4,10
  12. * COMMON DECK.
  13. *CALL COMKMAC
  14. *CALL COMSNCD
  15. *CALL COMSPRD
  16. VFD 42/0LSEND,18/SEND
  17. SPACE 4,55
  18. *** CALL FORMAT -
  19. *
  20. *
  21. * FORTRAN EXTENDED -
  22. *
  23. * CALL SEND(MESSAGE,LENGTH,TERMINAL,CEASE,OUTPUT,BLOCK,STATUS)
  24. *
  25. * COBOL -
  26. *
  27. * ENTER SEND USING MESSAGE,TERMINAL,CEASE,OUTPUT,BLOCK,STATUS,
  28. * LENGTH.
  29. *
  30. * WHERE - MESSAGE= LOCATION OF MESSAGE.
  31. *
  32. * LENGTH = LENGTH OF MESSAGE EXPRESSED IN CHARACTERS.
  33. *
  34. * TERMINAL = TERMINAL NAME. IF OMMITTED OR ZERO, SEND
  35. * TO TERMINAL THAT ORIGINATED TRANSACTION.
  36. * ONE TO SEVEN CHARACTERS, LEFT JUSTIFIED.
  37. *
  38. * CEASE = FLAG WHOSE NON-ZERO VALUE IMPLIES TASK IS
  39. * COMPLETE AT TERMINATION OF SEND. ZERO IS
  40. * ASSUMED.
  41. *
  42. * OUTPUT = 0 IF THIS IS THE LAST SEND TO BE DONE
  43. * FOR THIS TRANSACTION. NON-ZERO IMPLIES THAT
  44. * MORE SENDS WILL BE EXECUTED FROM THIS TASK.
  45. * DEFAULT = 0 (OPTIONAL PARAMETER).
  46. *
  47. * BLOCK = OPTIONAL PARAMETER WHICH IF SPECIFIED
  48. * TASK DESIRES NAM APPLICATION BLOCK NUMBER
  49. * FOR RECOVERY PURPOSES.
  50. *
  51. * STATUS = FLAG TO INDICATE A SEND WITH RECALL.
  52. * IF STATUS IS NON-ZERO,
  53. * CONTROL IS NOT RETURNED TO THE TASK UNTIL
  54. * THE NETWORK HAS ACKNOWLEDGED THE RECEIPT AND
  55. * DISPOSITION OF THE BLOCK. THE SUPERVISORY
  56. * MESSAGE IS THEN CONVERTED TO A *TAF*
  57. * MESSAGE NUMBER AND RETURNED TO (STATUS).
  58. *
  59. * PARAMETER FORMAT - NUMERIC DATA -
  60. * FORTRAN EXTENDED - INTEGER.
  61. * COBOL - COMPUTATIONAL-1.
  62. *
  63. * NOTE - THE NETWORK REQUIRES THAT *EOL* CHARACTERS BE
  64. * CONSIDERED MORE AS LINE SEPARATORS THAN LINE TERMINATORS.
  65. * THE *EOL* MUST BE ACCOUNTED FOR IN THE *TLC* FOR THE BLOCK
  66. * BEING SENT, AND THIS MUST BE DONE AT THE TASK LEVEL PRIOR
  67. * TO ACTUALLY ISSUING THE *SEND* REQUEST.
  68.  
  69.  
  70. SEND SUBR ENTRY/EXIT
  71. SX6 A0 SAVE (A0)
  72. BX7 X7-X7 CLEAR COBOL CALL FLAG
  73. SA6 SENG
  74.  
  75. * CLEAR STORAGE OF LOCAL VARIABLES.
  76.  
  77. SB1 1
  78. SA7 SENH
  79. SX6 X1 CHECK COBOL CALL
  80. MX4 3 (X4) = COBOL ARGUMENT MASK
  81. SA7 SENF STATUS
  82. SA6 SENJ
  83. SA7 SENK OUTPUT FLAG
  84. SX7 A1 SAVE FWA OF PARAMETER LIST
  85. BX0 X1
  86. SA7 SENE
  87. SB6 B1 SET ZERO CHECK FLAG TO INTEGER
  88. BX7 X1-X6
  89. SA3 A1+B1 READ LENGTH OR ADDRESS OF TERMINAL NAME
  90. LX4 20-59
  91. ZR X7,SEN1 IF NOT COBOL COMPUTATIONAL-1 ARGUMENT
  92.  
  93. * DETERMINE COBOL MESSAGE LENGTH FROM PARAMETER.
  94.  
  95. LX7 -36 GET MESSAGE LENGTH
  96. MX5 -12
  97. BX2 -X5*X7
  98. BX5 X4*X3 EXTRACT COBOL USAGE
  99. LX5 -18
  100. MX7 1 SET COBOL CALL FLAG
  101. SB6 X5-4 ZERO IF COMP-1 USAGE
  102. SA7 SENH
  103. BX7 X2 SAVE MESSAGE LENGTH
  104. SA7 SENI
  105.  
  106. * PROCESS PARAMETERS.
  107.  
  108. SEN1 RJ DOL DETERMINE OPTIONS FROM PARAMETER LIST
  109. SA7 SENB+1 STORE TERMINAL NAME
  110. BX3 X3+X4 INSERT ALTERNATE TERMINAL FLAG
  111. SB5 X5 (B5) = CEASE FLAG
  112. SA1 SENJ RESTORE FWA OF MESSAGE
  113. SA2 SENI RESTORE MESSAGE LENGTH
  114. RJ FEL FORCE END OF LINE
  115. SEND SENB
  116.  
  117. * RETURN STATUS TO TASK AND DETERMINE EXIT CONDITIONS.
  118.  
  119. RJ RST RETURN STATUS TO TASK
  120. PL X6,SENDX IF NO ERROR - RETURN
  121.  
  122. * ABORT TASK DUE TO FAULTY SUPERVISORY MESSAGE.
  123.  
  124. SA1 SEND READ TRACE-BACK WORD
  125. MX0 30
  126. LX1 30
  127. SA1 X1-1 SET TRACE-BACK WORD INTO BUFFER
  128. BX6 -X0*X1
  129. SA6 SENB
  130. ARGERR SENB EXIT TO EXECUTIVE
  131. DOL SPACE 4,25
  132. ** DOL - DETERMINE OPTIONS FROM LIST.
  133. *
  134. * DETERMINE OPTIONS FROM LIST PARSES THE PARAMETER LIST
  135. * OF THE USER TASK, DETERMINING WHAT OPTIONS THE USER
  136. * DESIRES. EACH OPTION IS DETERMINED BY THE EXISTENCE OF
  137. * THE PARAMETER AND ONCE THE LIST IS TRUNCATED, ALL
  138. * OPTIONS WHICH LIE TO THE RIGHT OF THAT PARAMETER ARE
  139. * GIVEN DEFAULT VALUES.
  140. *
  141. * ENTRY (X2) = MESSAGE LENGTH.
  142. * (X3) = ADDRESS OF CURRENT PARAMETER.
  143. * (X7) = NON-ZERO IF COBOL CALL.
  144. * (A3) = ADDRESS OF CURRENT LIST PARAMETER.
  145. *
  146. * EXIT (X3) = OPTIONS ARE FLAGGED IN UPPER SIX BITS.
  147. * (X6) = ALTERNATE TERMINAL FLAG - IF PRESENT.
  148. * (X7) = ALTERNATE TERMINAL NAME - ZERO IF NONE.
  149. * (SENF) = ADDRESS OF LOCATION REQUESTING NETWORK STATUS.
  150. *
  151. * USES A - ALL.
  152. * B - 4, 7.
  153. * X - ALL.
  154. *
  155. * CALLS ZFN.
  156.  
  157.  
  158. DOL SUBR ENTRY/EXIT
  159. NZ X7,DOL1 IF COBOL CALL
  160. SA2 X3 READ LENGTH
  161. SX6 X2 SAVE MESSAGE LENGTH
  162. SA3 A3+B1 READ ADDRESS OF TERMINAL NAME
  163. UX2 X2 ASSUME MIXED PARAMETERS
  164. SA6 SENI
  165. DOL1 BX5 X5-X5 ASSUME CEASE = 0
  166. SX4 B0
  167. ZR X3,DOL5 IF NO TERMINAL NAME, CEASE FLAG, OUTPUT
  168. SA4 X3 READ TERMINAL NAME
  169. UX1,B4 X4 COBOL COMPUTATIONAL-1 ARGUMENT
  170. ZR X1,DOL2 IF NO TERMINAL NAME
  171. MX0 42
  172. BX1 X0*X4
  173. RJ ZFN ZERO FILL NAME
  174. DOL2 BX4 X1 SAVE TERMINAL NAME
  175. SA3 A3+B1 READ CEASE FLAG PARAMETER
  176. ZR X3,DOL5 IF NO CEASE FLAG AND OUTPUT FLAG
  177. SA5 X3 READ CEASE FLAG
  178. SA3 A3+B1 OUTPUT FLAG ADDRESS
  179. ZR X3,DOL5 IF NO OUTPUT FLAG
  180. SB7 A3 SAVE ADDRESS OF CURRENT PARAMETER.
  181. MX7 1
  182. SA3 X3 OUTPUT FLAG
  183. UX3 X3
  184. ZR X3,DOL3 IF LAST SEND
  185. MX3 1 (X3) = STAGING REGISTER FOR *SEND* OPTIONS
  186. LX3 57-59 OUTPUT FLAG
  187. DOL3 SA1 B7+B1 NAM APPLICATION BLOCK FLAG
  188. ZR X1,DOL5 IF NO BLOCK FLAG
  189. LX7 56-59 SET *B* FIELD IN HEADER
  190. SX6 X1 SAVE BLOCK PARAMETER ADDRESS
  191. SA2 X6 READ BLOCK NUMBER
  192. SA6 SENK
  193. UX2 X2
  194. NZ X2,DOL4 IF (BLOCK) .NE. ZERO
  195. BX3 X7+X3
  196. DOL4 SA1 A1+B1 READ STATUS PARAMETER
  197. SA2 X1
  198. ZR X1,DOL5 IF STATUS NOT SPECIFIED
  199. UX2 X2
  200. ZR X2,DOL4.1 IF (STATUS) .EQ. ZERO
  201. LX7 55-56 SET *R* FIELD IN HEADER
  202. BX3 X3+X7
  203. SX7 X1 SAVE STATUS PARAMETER ADDRESS
  204. SA7 SENF
  205. DOL4.1 SA2 SENH COBOL CALL FLAG
  206. PL X2,DOL5 IF NOT COBOL CALL
  207. SA1 A1+1 READ LENGTH PARAMETER
  208. ZR X1,DOL5 IF PARAMETER NOT PRESENT
  209. SA1 X1 SAVE COBOL MESSAGE LENGTH
  210. UX6 X1
  211. SA6 SENI
  212. DOL5 BX7 X4
  213. MX4 1
  214. ZR X7,DOL6 IF NO ALTERNATE TERMINAL DECLARED
  215. BX3 X4+X3 SET ALTERNATE TERMINAL FLAG
  216. DOL6 LX4 54-59 SET APPLICATION BLOCK HEADER FLAG
  217. BX3 X4+X3
  218. ZR X5,DOLX IF NOT CEASE, RETURN
  219. LX4 58-59-54+59
  220. BX3 X4+X3 SET CEASE BIT IN SEND PARAMETER BLOCK
  221. EQ DOLX RETURN
  222. FEL SPACE 4,20
  223. ** FEL - FORCE END OF LINE.
  224. *
  225. * FORCE *EOL* FOR TELEX COMPATIBILITY. THIS CODE SEGMENT
  226. * IS UNNECESSARY FOR *NAM* TELE-COMMUNICATIONS, SINCE THE
  227. * EXACT CHARACTER COUNT IS REQUIRED IN THE *ABH*, TO INCLUDE
  228. * THE UNIT SEPARATOR, WILL ACCOMPANY ALL *SEND* REQUESTS TO
  229. * THE NETWORK.
  230. *
  231. * ENTRY (X1) = FWA OF MESSAGE.
  232. * (X2) = USER DECLARED CHARACTER COUNT AFTER TRUNCATION.
  233. * (X3) = HEADER OF WORD ONE OF *SEND* PARAMETER BLOCK.
  234. *
  235. * EXIT (B3) = CHARACTERS IN LAST WORD OF MESSAGE.
  236. * (SENB - SENB+4) UPDATED.
  237. * (ABH) UPDATED BY (TLC).
  238. *
  239. * USES A - 1, 2, 3, 6, 7.
  240. * B - 3, 4, 7.
  241. * X - ALL.
  242.  
  243.  
  244. FEL SUBR ENTRY/EXIT
  245. SX5 X2+9 COMPUTE NUMBER OF WORDS IN MESSAGE
  246. SX4 10
  247. BX6 X1 INSERT MESSAGE ADDRESS
  248. IX5 X5/X4 NUMBER OF WORDS
  249. LX6 30 INSERT NUMBER OF WORDS INTO BLOCK HEADER
  250. BX7 X6+X5
  251. BX7 X7+X3 INSERT SEQUENCE, BLOCK FLAG
  252. SA7 SENB STORE ARGUMENT WORD
  253. SA3 ABH.
  254. LX3 59-22
  255. PL X3,FEL2 IF *ACT* .NE. *DISPLAY*
  256. SX3 10
  257. IX0 X3*X5
  258. IX0 X0-X2
  259. IX7 X3-X0
  260. IX5 X1+X5 (X5) = LAST WORD ADDRESS OF MESSAGE
  261. SA3 X5-1 SAVE LWA OF MESSAGE
  262. BX6 X3
  263. SB4 B0 (B4) = 0 WHEN (X7) = 0
  264. SA6 SENC
  265. SA2 A3+B1
  266. BX6 X2
  267. SA6 A6+B1
  268. SX6 A3
  269. SA6 SENL LWA OF MESSAGE
  270. SA2 SENB
  271. ZR X0,FEL1 IF LAST WORD IS FULL
  272.  
  273. * REMOVE TRAILING CHARACTERS FROM LAST WORD.
  274.  
  275. SB4 X7-9 (B4) = NUMBER OF CHARACTERS IN WORD
  276. SB3 X0 (B3) = NUMBER OF TRAILING CHARACTERS
  277. LX7 X0,B1 TRAILING CHARACTERS*2
  278. LX0 2 MULTIPLY BY 4
  279. IX7 X0+X7 NUMBER OF TRAILING BITS
  280. SB7 X7-59
  281. MX4 1
  282. LX4 X4,B7
  283. BX7 X4*X3 STRIP TRAILING CHARACTER FIELDS
  284. SA7 A3
  285. SA3 SENI INCREMENT TLC TO INCLUDE UNIT SEPARATOR
  286. SX7 X3+B3
  287. SA7 A3
  288. FEL1 NZ B4,FEL2 IF FEWER THAN NINE CHARACTERS
  289.  
  290. * PROCESS CASE WHERE LAST WORD IS FULL - REQUIRING EXTRA WORD
  291. * FOR EOL.
  292.  
  293. SA2 SENB
  294. SX6 B1
  295. IX6 X2+X6 INCREMENT WORD COUNT
  296. SA6 A2
  297. BX6 X6-X6
  298. SA6 X5+
  299. SA3 SENI INCREMENT TLC TO INCLUDE UNIT SEPARATOR
  300. SB3 10
  301. SX6 X3+B3
  302. SA6 A3
  303.  
  304. * CONSTRUCT ABH FOR *SEND*.
  305.  
  306. FEL2 MX0 -12 (X0) = *ABN* AND *TLC* MASK
  307. BX7 X7-X7
  308. SA1 SENK READ BLOCK PARAMETER ADDRESS
  309. SB3 B4 (B3) = NUMBER OF CHARACTERS IN LAST WORD
  310. SA3 ABH. READ CURRENT *ABH*
  311. MX6 6
  312. ZR X1,FEL3 IF NO BLOCK OR STATUS PARAMETERS PRESENT
  313. SA1 X1
  314. SX7 X1 APPLICATION BLOCK NUMBER
  315. ZR X7,FEL3 IF NO BLOCK NUMBER
  316. LX0 41-11
  317. BX3 X0*X3 INSERT BLOCK NUMBER INTO *ABH*
  318. LX7 41-17
  319. LX0 11-41
  320. FEL3 BX7 X7+X3
  321. BX7 X0*X7 SET *TLC* INTO *ABH*
  322. BX7 -X6*X7 CLEAR APPLICATION BLOCK TYPE
  323. SX1 B1+B1 SET MSG ABT
  324. LX2 59-57
  325. PL X2,FEL4 IF NO OUTPUT TO FOLLOW
  326. SX1 B1 SET *BLK* *BLK* ABT
  327. FEL4 LX1 59-5
  328. BX7 X1+X7 SET APPLICATION BLOCK TYPE
  329. SA2 SENI SET TLC INTO ABH
  330. BX7 X7+X2
  331. SA7 SENB+2
  332. EQ FELX RETURN
  333. RST SPACE 4,20
  334. ** RST - RETURN STATUS TO TASK.
  335. *
  336. * RETURN NETWORK SUPERVISORY MESSAGE TO TASK IF RECALL
  337. * PARAMETER WERE SPECIFIED.
  338. *
  339. * ENTRY (B5) .NE. ZERO IF CEASE REQUESTED.
  340. * (B3) = NUMBER OF CHARACTERS IN LAST WORD OF MESSAGE.
  341. * (X5) = ADDRESS OF TEMPORARY STORAGE LOCATION.
  342. *
  343. * EXIT (X6) .LT. 0 - IF ILLEGAL SUPERVISORY MESSAGE.
  344. * (BLOCK) RETURNED TO TASK IF (BLOCK) .NE. ZERO
  345. * UPON ENTRY TO *SEND*.
  346. * (STATUS) = TAF STATUS MESSAGE, DERIVED FROM (SENB+3).
  347. *
  348. * USES A - 1, 2, 3, 4, 6, 7.
  349. * B - 3, 4.
  350. * X - 0, 1, 2, 3, 4, 6, 7.
  351.  
  352.  
  353. RST SUBR ENTRY/EXIT
  354. SB4 TSENL-1
  355. SA2 SENB
  356. LX2 59-56
  357. PL X2,RST1 IF APPLICATION BLOCK NOT TO BE RETURNED
  358. MX0 12
  359. SA3 SENB+1 BLOCK NUMBER
  360. SA2 SENK FWA OF BLOCK
  361. SX3 X3
  362. SA4 X2
  363. BX7 X0*X4 CLEAR OLD BLOCK NUMBER
  364. BX7 X7+X3 NEW BLOCK NUMBER
  365. SA7 A4+ RETURN BLOCK NUMBER
  366. RST1 SA1 SENF READ STATUS REQUEST
  367. SX4 X1+
  368. ZR X1,RST4 IF STATUS NOT REQUESTED
  369. SA1 SENM
  370. SA2 SENB+3 SUPERVISORY MESSAGE RETURNED FROM NETWORK
  371. BX0 X1*X2
  372.  
  373. * DETERMINE SUPERVISORY MESSAGE VIA TABLE LOOK-UP.
  374.  
  375. RST2 SA3 TSEN+B4 READ CURRENT TABLE ENTRY
  376. BX6 X1*X3
  377. IX6 X6-X0
  378. SB4 B4-B1
  379. ZR X6,RST3 IF ENTRY AND MESSAGE MATCH
  380. MX6 1
  381. GE B4,RST2 IF TABLE NOT EXHAUSTED
  382. EQ RSTX RETURN
  383.  
  384. RST3 SX6 X3 RETURN MESSAGE NUMBER TO (STATUS)
  385. PX6 X6
  386. SA6 X4+
  387. RST4 SA3 ABH. READ ABH
  388. SA1 SENC RESTORE LAST WORD
  389. LX3 59-22
  390. PL X3,RST5 IF NOT DISPLAY
  391. BX6 X1
  392. SA2 SENL RESTORE LAST TWO WORDS
  393. SA6 X2
  394. SA1 A1+B1
  395. BX6 X1
  396. SA6 A6+B1
  397. RST5 SA1 SENG RESTORE (A0)
  398. SA0 X1
  399. BX6 X6-X6 SET NON-ERROR CONDITION
  400. EQ RSTX RETURN
  401. SPACE 4,10
  402. * PROGRAM CONSTANTS AND TEMPORARY STORAGE.
  403.  
  404. ABH. VFD 6/2,12/0,18/0,4/4,1/0,3/0,1/1,3/0,12/0
  405. SENB BSSZ 4 PARAMETER BLOCK FOR *SEND*
  406. SENC BSSZ 4 ARGUMENT STORAGE FOR *SEND*
  407. SENE CON 0 STORAGE FOR FWA OF CALL PARAMETERS
  408. SENF CON 0 STORAGE FOR STATUS ADDRESS
  409. SENG CON 0 STORAGE FOR (A0)
  410. SENH CON 0 COBOL CALL FLAG
  411. SENI CON 0 STORAGE FOR MESSAGE CHARACTER COUNT
  412. SENJ CON 0 STORAGE FOR MESSAGE FWA
  413. SENK CON 0 STORAGE FOR *BLOCK* PARAMETER ADDRESS
  414. SENL CON 0 STORAGE FOR LWA MESSAGE
  415.  
  416. * MASK FOR EXTRACTING SUPERVISORY MESSAGES.
  417.  
  418. SENM VFD 8/377B,1/0,1/0,6/77B,8/377B,36/0
  419. SPACE 4,10
  420. * TABLE OF SUPERVISORY MESSAGES.
  421.  
  422. TSEN BSS 0
  423. VFD 8/PFFC,1/0,1/0,6/SFAK,8/0,36/1
  424. VFD 8/PFFC,1/0,1/0,6/SFAX,8/AXLB,36/2
  425. VFD 8/PFCN,1/0,1/0,6/SFEN,8/0,36/10
  426. VFD 8/PFCN,1/0,1/0,6/SFCB,8/CBLF,36/11
  427. TSENL EQU *-TSEN LENGTH ON MESSAGE TABLE
  428. * COMMON DECK.
  429. *CALL COMKZFN
  430. SPACE 4,10
  431. END