Table of Contents

CIPHER

Table Of Contents

  • [00005] CIPHER - ENCRYPT/DECRYPT A FILE.
  • [00012] ENCRYPT/DECRYPT A FILE.
  • [00033] ASSEMBLY CONSTANTS.
  • [00066] FETS.
  • [00102] DATA STORAGE.
  • [00140] TECA - TABLE OF ERROR COUNT ADDRESSES.
  • [00159] ABT - ABORT ROUTINE.
  • [00208] DRN - DISPLAY RECORD NAME.
  • [00257] END - END ROUTINE.
  • [00316] IES - ISSUE ERROR SUMMARY MESSAGES.
  • [00350] INM - INSERT NUMBER IN MESSAGE.
  • [00375] PDE - PROCESS DATA BLOCK ERROR.
  • [00459] PEF - PROCESS END OF FILE.
  • [00578] CIPHER - MAIN LOOP.
  • [00580] MAIN LOOP - COPY ALL RECORDS FROM ONE
  • [00620] RECORD COPY ROUTINES.
  • [00622] CPR - COPY RECORD.
  • [00672] CRYPT - ENCRYPT/DECRYPT A BUFFER.
  • [00779] PRESET.
  • [00780] PRS - PRESET FOR EXECUTION.
  • [00938] CDT - CHECK DEVICE TYPE.
  • [01041] CFN - CHECK FILE NAMES.
  • [01087] CIC - CHECK FOR INDETERMINATE COPY.
  • [01133] GPS - GET PRU SIZES.
  • [01156] PER - PRESET ERROR PROCESSOR.
  • [01192] SFM - SET FILE MODE.

Source Code

CIPHER.txt
  1. CIPHER
  2. * /--- FILE TYPE = E
  3. * /--- BLOCK ENTRY 00 000 85/08/08 17.36
  4. IDENT CIPHER,FETS
  5. TITLE CIPHER - ENCRYPT/DECRYPT A FILE.
  6. ABS
  7. ENTRY CIPHER
  8. ENTRY SSM=
  9. ENTRY SDM=
  10. ENTRY RFL=
  11. SYSCOM B1 DEFINE (B1) = 1
  12. ** CIPHER - ENCRYPT/DECRYPT A FILE.
  13. *
  14. * THIS PROGRAM ENCRYPTS/DECRYPTS A FILE ACCORDING
  15. * TO A LINEAR CONGRUENTIAL CIPHER (PSEUDO-RANDOM
  16. * SEQUENCE).
  17. *
  18. * THIS PROGRAM IS ESSENTIALY THE SAME AS =COPYBR=
  19. * FROM THE NOS DECK =COPYB=. SEE THAT DECK FOR
  20. * MUCH MORE DOCUMENTATION.
  21. *
  22. * THIS PROGRAM MUST HAVE FOUR CALLING PARAMETERS,
  23. * INPUT FILE NAME, OUTPUT FILE NAME, ENCRYPT/DECRYPT
  24. * FLAG AND CIPHERING KEY. NONE OF THE OTHER =COPYB=
  25. * PARAMETERS ARE RECOGNIZED.
  26. *
  27. * THE ENCRYPT/DECRYPT PARAMETER IS EITHER THE STRING
  28. * *ENCRYPT* OR *DECRYPT* (OTHER VALUES ARE REJECTED)
  29. * EITHER CAN BE USED TO ENCRYPT THE FILE, BUT THE
  30. * OTHER MUST BE USED TO DECRYPT IT.
  31. *
  32. * /--- BLOCK CONSTANTS 00 000 85/07/29 12.36
  33. TITLE ASSEMBLY CONSTANTS.
  34. **** ASSEMBLY CONSTANTS.
  35.  
  36.  
  37. DPRS EQU 1003B DEFAULT PRU SIZE WITH CONTROL WORDS
  38. BUFL EQU DPRS DEFAULT WORKING STORAGE BUFFER LENGTH
  39. FBUFL EQU DPRS*4 DEFAULT CIO BUFFER LENGTH
  40. LBUFL EQU 102B ALTERNATE OUTPUT CIO BUFFER LENGTH
  41. RBFL EQU 100B RECORD COPY WORKING BUFFER LENGTH
  42. SBUFL EQU DPRS*8 SINGLE BUFFER COPY DEFAULT BUFFER LENGTH
  43.  
  44. FETL EQU 9 FET LENGTH
  45.  
  46. DSPS EQU 1000B DEFAULT S TAPE PRU SIZE FOR *COPY*
  47. DLPS EQU 2000B DEFAULT L TAPE PRU SIZE FOR *COPY*
  48. MCBS EQU 5120 MAXIMUM BLOCK SIZE (IN CHARACTERS)
  49.  
  50. MFLF EQU 45000B-2 MAXIMUM FIELD LENGTH FACTOR
  51. LOFL EQU 20000B-2 LOWER OPTIMUM FL FOR L AND F TAPE COPIES
  52. ****
  53. SPACE 4,10
  54. * SPECIAL ENTRY POINTS.
  55.  
  56. SSM= EQU 0 SUPPRESS DUMPS OF FIELD LENGTH
  57. SDM= EQU 0 SUPPRESS INITIAL DAYFILE MSG
  58. * /--- BLOCK COMMONS 00 000 83/04/18 15.17
  59. SPACE 4,10
  60. *CALL COMCMAC
  61. *CALL COMSLFM
  62. QUAL MTX
  63. *CALL COMSMTX
  64. QUAL *
  65. * /--- BLOCK FETS 00 000 83/03/30 19.11
  66. TITLE FETS.
  67. ORG 120B
  68. FETS BSS 0
  69.  
  70.  
  71. I BSS 0 INPUT FILE
  72. INPUT FILEB IBUF,FBUFL,FET=FETL
  73. CWF EQU *-I CONTROL WORD FLAG
  74. CON 0 NONZERO IF CONTROL WORDS ENABLED ON INPUT
  75. SLF EQU *-I FORMAT FLAG
  76. CON 0 1= S TAPE, 2= L TAPE, -1= F TAPE, 0= OTHER
  77. TCF EQU *-I TCOPY CONVERSION FORMAT
  78. CON 0 -2=SI, -1=X, 1=E, 2=B, 0=NO CONVERSION
  79. PRU EQU *-I PRU SIZE (IN CM WORDS)
  80. CON -1
  81. NSZ EQU *-I NOISE SIZE (24/BITS, 18/UBC, 18/LENGTH)
  82. CON 0
  83. TRK EQU *-I TAPE TRACK AND LABEL TYPE
  84. CON 0 1/9-TRACK, 1/7-TRACK, 52/0, 6/LABEL TYPE
  85.  
  86.  
  87. O BSS 0 OUTPUT FILE
  88. OUTPUT FILEB OBUF,FBUFL,FET=FETL
  89. CON 0 NONZERO IF CONTROL WORDS ENABLED ON OUTPUT
  90. CON 0 1= S TAPE, 2= L TAPE, -1= F TAPE, 0= OTHER
  91. CON 0 1=E, 2=B, 0=NO CONVERSION
  92. CON -1 PRU SIZE (IN CM WORDS)
  93. CON 0 NOISE SIZE (24/BITS, 18/UBC, 18/LENGTH)
  94. CON 0 TAPE TRACK AND LABEL TYPE
  95.  
  96.  
  97. L FILEB LBUF,LBUFL ALTERNATE OUTPUT FILE
  98. ORG L
  99. VFD 42/0LOUTPUT,17/1,1/1
  100. ORG L+FETL
  101. * /--- BLOCK STORAGE 00 000 83/03/30 19.10
  102. TITLE DATA STORAGE.
  103. ** DATA STORAGE.
  104.  
  105.  
  106. BTSK CON 0 BLOCK TERMINATOR/SKIP WORD INDICATOR
  107. CRI CON -2 CALLING ROUTINE INDICATOR
  108. CT CON 1 COPY COUNT
  109. EL CON 0 ERROR LIMIT
  110. EORF CON 1 CURRENT BLOCK EOR FLAG
  111. ERRF CON 0 CURRENT BLOCK ERROR FLAG
  112. FUBC CON 0 FULL BLOCK UNUSED BIT COUNT (S, L TAPES)
  113. FWWB CON BUF1+1 FWA WORKING BUFFER
  114. LVL CON 0 EOR LEVEL NUMBER
  115. LWDB CON 0 LWA+1 DATA TRANSFERRED TO WORKING BUFFER
  116. RWCB VFD 1/1,59/0 REMAINING WORDS IN CURRENT BLOCK
  117. RWTT CON 0 REMAINING WORDS TO TRANSFER
  118. SBT CON -1 SINGLE BUFFER READ/WRITE THRESHOLD
  119. SK CON 0 SKIP FLAG
  120. TC CON 1 TERMINATION CONDITION (-1=EOI,0=EOD,1=EOF)
  121. UBC CON 0 UNUSED BIT COUNT FOR CURRENT WRITE
  122. UBCB CON 0 UNUSED BIT COUNT FOR CURRENT BLOCK
  123. VF CON 0 VERIFY FLAG
  124.  
  125. BC CON -1 BLOCK COUNT
  126. RC CON 0 RECORD COUNT
  127.  
  128. ESPI CON 0 ERROR BLOCKS SKIPPED/PROCESSED INDICATOR
  129. NPDI CON 0 NOISE BLOCKS PADDED/DELETED INDICATOR
  130. RSAI CON 0 RECORD SPLIT ALLOWED INDICATOR
  131. SEWI CON 0 SKIP EOF WRITE INDICATOR
  132. TLLI CON 0 TRUNCATE LONG LINES INDICATOR
  133.  
  134. BFCT CON 0 BAD FORMAT BLOCK COUNT
  135. NZCT CON 0 NOISE BLOCK COUNT
  136. PBCT CON 0 PARITY/BLOCK TOO LARGE ERROR COUNT
  137. RSCT CON 0 RECORD SPLIT COUNT
  138. * /--- BLOCK TECA 00 000 83/03/30 19.11
  139. SPACE 4,10
  140. ** TECA - TABLE OF ERROR COUNT ADDRESSES.
  141. *
  142. *T 6/ EF, 18/ DMSA, 18/ OMSA, 18/ ERCA
  143. *
  144. * EF ERROR FLAG VALUE.
  145. * DMSA DAYFILE ERROR SUMMARY MESSAGE ADDRESS.
  146. * OMSA ALTERNATE OUTPUT FILE ERROR MESSAGE ADDRESS.
  147. * ERCA ERROR COUNT ADDRESS.
  148.  
  149.  
  150. TECA BSS 0
  151. VFD 6/-1,18/IESA,18/PDED,18/PBCT PARITY/BLOCK TOO LARGE
  152. VFD 6/1,18/IESC,18/PDEF,18/BFCT BAD FORMAT BLOCK ERROR
  153. TECAL1 EQU *-TECA
  154. VFD 6/0,18/IESD,18/0,18/NZCT NOISE BLOCKS PROCESSED
  155. VFD 6/0,18/IESE,18/0,18/RSCT RECORD SPLITS PROCESSED
  156. TECAL2 EQU *-TECA
  157. * /--- BLOCK ABT 00 000 83/04/18 15.21
  158. ABT SPACE 4,15
  159. ** ABT - ABORT ROUTINE.
  160. *
  161. * FLUSHES OUTPUT FILE BUFFER. FLUSHES ALTERNATE OUTPUT FILE
  162. * BUFFER, IF NECESSARY. ISSUES DAYFILE MESSAGES.
  163. *
  164. * ENTRY (B5) = FWA MESSAGE, IF ENTRY AT *ABT4*.
  165. *
  166. * USES A - 1, 2, 6.
  167. * B - 2.
  168. * X - 1, 2, 6.
  169. *
  170. * CALLS CIO=, IES, MSG=, SNM, SYS=.
  171.  
  172.  
  173. ABT4 SX6 B5+ SAVE ABORT MESSAGE ADDRESS
  174. SA1 I SET NAME IN MESSAGE
  175. MX2 42
  176. SA6 ABTA
  177. BX1 X2*X1
  178. SB2 1RX
  179. RJ SNM
  180. * EQ ABT
  181.  
  182. ABT SA1 SK
  183. NZ X1,ABT2 IF SKIP SET
  184. SA1 O+CWF
  185. ZR X1,ABT1 IF CONTROL WORDS DISABLED ON OUTPUT
  186. WRITECW O FLUSH OUTPUT BUFFER
  187. EQ ABT2 ABORT
  188.  
  189. ABT1 WRITER O FLUSH OUTPUT BUFFER
  190.  
  191. ABT2 SA1 EL
  192. ZR X1,ABT3 IF EXTENDED ERROR PROCESSING NOT IN EFFECT
  193. WRITER L FLUSH ALTERNATE OUTPUT FILE BUFFER
  194. ABT3 RECALL I FORCE 1MT ERROR MESSAGES TO DAYFILE FIRST
  195. RJ IES ISSUE ERROR SUMMARY MESSAGES
  196. SA2 ABTA ISSUE ABORT MESSAGE
  197. MESSAGE X2,0
  198. ABORT
  199.  
  200.  
  201. ABTA CON ABTB ABORT MESSAGE ADDRESS
  202.  
  203. ABTB DATA C* ERROR LIMIT EXCEEDED.*
  204. ABTC DATA C* RECORD TOO LARGE ON XXXXXXX.*
  205. ABTD DATA C* UNRECOVERABLE ERROR ON XXXXXXX.*
  206. * /--- BLOCK DRN 00 000 83/03/30 20.17
  207. DRN SPACE 4,15
  208. ** DRN - DISPLAY RECORD NAME.
  209. *
  210. * ENTRY (X2) = FWA RECORD. IF (X2) .LT. 0, IT IS THE
  211. * COMPLEMENT OF FWA RECORD IN INPUT CIO BUFFER.
  212. * (X1) = FWA RECORD, IF ZERO LENGTH RECORD.
  213. *
  214. * EXIT (RC) = UPDATED RECORD COUNT.
  215. *
  216. * USES A - 1, 2, 3, 6, 7.
  217. * X - 1, 2, 3, 6, 7.
  218. *
  219. * CALLS MSG=.
  220.  
  221.  
  222. DRN SUBR ENTRY/EXIT
  223. SA3 RC INCREMENT RECORD COUNT
  224. SX7 B1
  225. IX6 X3+X7
  226. PL X2,DRN1 IF NOT DISPLAY FROM CIO BUFFER
  227. IX7 X2-X7
  228. BX2 -X2
  229. DRN1 IX1 X1-X2
  230. SA6 A3
  231. ZR X1,DRN2 IF ZERO LENGTH RECORD
  232. SA1 X2 GET RECORD NAME
  233. MX6 12
  234. BX6 X6*X1
  235. LX6 12
  236. SX6 X6-7700B
  237. NZ X6,DRN2 IF NOT 77 TABLE
  238. SA3 I+4
  239. SA1 A1+B1
  240. SX3 X3
  241. PL X7,DRN2 IF NOT DISPLAY FROM CIO BUFFER
  242. SA2 I+1
  243. IX6 X3+X7 CHECK FOR WRAP AROUND
  244. NZ X6,DRN2 IF NO WRAP AROUND
  245. SA1 X2
  246. DRN2 MX7 42
  247. BX7 X7*X1
  248. SA7 DRNA+1 ENTER NAME IN MESSAGE
  249. MESSAGE A7-B1,1 DISPLAY RECORD NAME
  250. EQ DRNX RETURN
  251.  
  252.  
  253. DRNA DATA 10H COPYING
  254. CON 0,0
  255. * /--- BLOCK END 00 000 85/07/25 15.39
  256. END SPACE 4,15
  257. ** END - END ROUTINE.
  258. *
  259. * FLUSHES OUTPUT BUFFER, IF NECESSARY. FLUSHES ALTERNATE
  260. * OUTPUT FILE BUFFER, IF NECESSARY. ISSUES DAYFILE MESSAGES.
  261. *
  262. * ENTRY AT *END5*, IF EOI ENCOUNTERED BEFORE COPY COMPLETE.
  263. *
  264. * EXIT TO *VFY*, IF VERIFY REQUESTED.
  265. *
  266. * USES A - 1, 2, 6.
  267. * X - 1, 2, 6.
  268. *
  269. * CALLS CIO=, IES, MSG=, SYS=.
  270.  
  271.  
  272. END5 SX6 ENDC *EOI ENCOUNTERED* OR *FILE NOT FOUND*
  273. SA6 ENDA
  274. * EQ END
  275.  
  276. END SA1 SK
  277. NZ X1,END2 IF SKIP SET
  278. RECALL O
  279. SA1 O+2 CHECK *IN* = *OUT*
  280. SA2 A1+B1
  281. IX1 X1-X2
  282. ZR X1,END2 IF OUTPUT BUFFER EMPTY
  283. SA2 O+CWF
  284. ZR X2,END1 IF CONTROL WORD WRITE DISABLED
  285. WRITECW O FLUSH OUTPUT BUFFER
  286. EQ END2 ISSUE COMPLETION MESSAGE
  287.  
  288. END1 WRITE O FLUSH OUTPUT BUFFER
  289. END2 SA1 EL
  290. ZR X1,END3 IF EXTENDED ERROR PROCESSING NOT IN EFFECT
  291. WRITER L FLUSH ALTERNATE OUTPUT FILE BUFFER
  292. END3 RECALL I FORCE 1MT ERROR MESSAGES TO DAYFILE FIRST
  293. RECALL O
  294. RECALL L
  295. RJ IES ISSUE ERROR SUMMARY MESSAGES
  296. SA2 ENDA ISSUE ENDING MESSAGE
  297. MESSAGE X2,0
  298. * SA1 VF
  299. * NZ X1,VFY IF VERIFY REQUESTED
  300. ZR X0,END4 IF NO WARNING MESSAGES ISSUED
  301. MESSAGE ENDE,3 * CHECK DAYFILE FOR ERRORS.*
  302. END4 ENDRUN
  303.  
  304.  
  305. ENDA CON ENDB ENDING MESSAGE ADDRESS
  306.  
  307. ENDB DATA C* COPY COMPLETE.*
  308. ENDC DATA C* EOI ENCOUNTERED.*
  309. * DATA C* FILE NOT FOUND - LFN.*
  310. BSS 1 ALLOW ROOM FOR *FILE NOT FOUND* MESSAGE
  311. ENDD DATA C* EOF ENCOUNTERED.*
  312. ENDE DATA C* CHECK DAYFILE FOR ERRORS.*
  313.  
  314. * /--- BLOCK IES 00 000 83/03/30 20.18
  315. IES SPACE 4,10
  316. ** IES - ISSUE ERROR SUMMARY MESSAGES.
  317. *
  318. * EXIT (X0) = NUMBER OF ERROR SUMMARY MESSAGES ISSUED.
  319. *
  320. * USES A - 1, 2, 6.
  321. * B - 5, 6, 7.
  322. * X - 0, 1, 2, 6.
  323. *
  324. * CALLS INM, MSG=.
  325.  
  326.  
  327. IES SUBR ENTRY/EXIT
  328. SB6 B0
  329. BX0 X0-X0
  330. SB7 TECAL2
  331. IES1 GE B6,B7,IESX IF END OF ERROR COUNTS
  332. SA2 TECA+B6
  333. SB6 B6+B1
  334. SA1 X2
  335. ZR X1,IES1 IF NO ERRORS OF THIS TYPE OCCURRED
  336. AX2 36
  337. SX0 X0+B1
  338. SB5 X2+
  339. RJ INM INSERT NUMBER IN MESSAGE
  340. MESSAGE B5,3 ISSUE MESSAGE TO USERS DAYFILE
  341. EQ IES1 CONTINUE ERROR SUMMARY PROCESSING
  342.  
  343.  
  344. IESA DATA C* XXXXXXXXXX PARITY/BLOCK TOO LARGE ERRORS.*
  345. IESC DATA C* XXXXXXXXXX BAD FORMAT BLOCKS.*
  346. IESD DATA C* XXXXXXXXXXXXXXX NOISE BLOCKS PADDED.*
  347. IESE DATA C* XXXXXXXXXX RECORD SPLITS OCCURRED.*
  348. * /--- BLOCK INM 00 000 83/03/30 20.19
  349. INM SPACE 4,15
  350. ** INM - INSERT NUMBER IN MESSAGE.
  351. *
  352. * ENTRY (B5) = FWA MESSAGE TO BE ISSUED.
  353. * (X1) = NUMBER TO BE CONVERTED FOR MESSAGE.
  354. *
  355. * EXIT NUMBER CONVERTED TO DECIMAL DISPLAY AND ENTERED INTO
  356. * MESSAGE.
  357. *
  358. * USES B - 2.
  359. * X - 1.
  360. *
  361. * CALLS CDD, SNM.
  362.  
  363.  
  364. INM SUBR ENTRY/EXIT
  365. RJ CDD CONVERT NUMBER TO DECIMAL DISPLAY
  366. SB2 B2-B1 CLEAR BLANK FILL
  367. MX1 1
  368. AX1 B2
  369. BX1 X1*X4
  370. SB2 1RX
  371. RJ SNM ENTER NUMBER IN MESSAGE
  372. EQ INMX RETURN
  373. * /--- BLOCK PDE 00 000 83/03/30 20.19
  374. PDE SPACE 4,15
  375. ** PDE - PROCESS DATA BLOCK ERROR.
  376. *
  377. * ENTRY (B3) = 0, IF PARITY OR BLOCK TOO LARGE ERROR.
  378. * = 1, IF DATA ERROR.
  379. *
  380. * EXIT IF BLOCK ERROR FLAG NOT ALREADY SET, PARITY/BLOCK
  381. * TOO LARGE, OR DATA ERROR COUNT INCREMENTED, AND
  382. * IF ERROR LIMIT NONZERO, ERROR MESSAGE ISSUED TO
  383. * ALTERNATE OUTPUT FILE.
  384. * TO *ABT*, IF ERROR LIMIT EXCEEDED.
  385. *
  386. * USES A - 1, 2, 3, 4, 6, 7.
  387. * B - 2, 3, 5, 7.
  388. * X - 1, 2, 3, 4, 6, 7.
  389. *
  390. * CALLS INM, SNM, SYS=, WTC=, WTW=.
  391.  
  392.  
  393. PDE SUBR ENTRY/EXIT
  394. SA1 ERRF
  395. SA2 TECA+B3
  396. NZ X1,PDEX IF BLOCK ERROR FLAG ALREADY SET
  397. SA3 X2 INCREMENT CORRESPONDING ERROR COUNT
  398. SX6 B1
  399. IX7 X3+X6
  400. SA4 EL
  401. AX2 18
  402. SA7 A3
  403. ZR X4,ABT IF ZERO ERROR LIMIT
  404. SX7 X2 SAVE ERROR MESSAGE ADDRESS
  405. AX2 36
  406. SA7 PDEA
  407. BX6 X2
  408. SA6 A1 SET BLOCK ERROR FLAG
  409. SB2 TECAL1-1
  410. SX6 -B1
  411. * /--- BLOCK PDE 00 000 83/03/30 20.19
  412. PDE1 SA1 TECA+B2 CALCULATE TOTAL ERROR COUNT
  413. SA2 X1
  414. SB2 B2-B1
  415. IX6 X6+X2
  416. GE B2,PDE1 IF MORE ERROR COUNTS
  417. BX7 X4
  418. NG X4,PDE2 IF UNLIMITED ERROR PROCESSING
  419. IX7 X6-X4
  420. PDE2 SA7 A7+B1 SAVE ABORT INDICATOR
  421. NZ X6,PDE3 IF NOT FIRST ERROR
  422. WRITE L,* PRESET STANDARD WRITE
  423. WRITEW L,PDEC,B1+B1 WRITE HEADER LINE
  424. WRITEW X2,CCDR,8
  425. DATE PDEC
  426. CLOCK PDEC+1
  427. WRITEW X2,PDEC,5
  428. PDE3 SA2 PDEA GET ERROR MESSAGE ADDRESS
  429. SB3 B0
  430. SB2 X2
  431. SB7 PDECL
  432. SB5 PDEC
  433. PDE4 SA2 B2+B3 MOVE MESSAGE TO BUFFER
  434. BX6 X2
  435. SA6 B5+B3
  436. SB3 B3+B1
  437. LT B3,B7,PDE4 IF MORE WORDS IN MESSAGE
  438. SA1 BC BLOCK COUNT
  439. RJ INM INSERT NUMBER IN MESSAGE
  440. WRITEC L,B5
  441. SA1 PDEB GET ABORT INDICATOR
  442. NG X1,PDEX IF ERROR LIMIT NOT REACHED
  443. EQ ABT ABORT
  444.  
  445.  
  446. PDEA CON 0 ERROR MESSAGE ADDRESS
  447. PDEB CON 0 ABORT INDICATOR
  448.  
  449. PDECL EQU 6
  450. PDEC BSS 0 HEADER LINE AND MESSAGE BUFFER
  451. CON 10H1- ERROR S
  452. CON 10HUMMARY -
  453. BSSZ PDECL-2
  454.  
  455. PDED DATA C* PARITY/BLOCK TOO LARGE ERROR IN BLOCK XXXXXXXXXX.*
  456. PDEF DATA C* ILLEGAL FORMAT IN BLOCK XXXXXXXXXX.*
  457. * /--- BLOCK PEF 00 000 83/03/30 20.19
  458. PEF SPACE 4,20
  459. ** PEF - PROCESS END OF FILE.
  460. *
  461. * GENERATES AN EOF ON OUTPUT WITH OR WITHOUT CONTROL WORDS
  462. * UNLESS ONE OF THE FOLLOWING CONDITIONS EXIST -
  463. * 1. SKIP FLAG IS SET.
  464. * 2. PO=M OPTION (SKIP EOF WRITE) IS SELECTED.
  465. * 3. LAST DOUBLE EOF (FOR TC=EOD COPY) IS ENCOUNTERED.
  466. * 4. FOR A COPY WITH A FILE COUNT SPECIFIED (COPYBF
  467. * OR COPY/TCOPY WITH TC=EOF PARAMETER), WHEN EOI
  468. * IS ENCOUNTERED ON INPUT AND NO DATA TRANSFER HAS
  469. * OCCURRED SINCE PREVIOUS EOF.
  470. * THE COPY COUNT IS DECREMENTED WHEN APPLICABLE.
  471. *
  472. * ENTRY (X0) .LT. 0, IF EOI ENCOUNTERED.
  473. * (X5) = 0, IF EMPTY FILE ENCOUNTERED.
  474. *
  475. * EXIT (X0) .LT. 0, IF EOI ENCOUNTERED.
  476. * (CT) = 0, IF COPY COMPLETE.
  477. *
  478. * USES A - 1, 2, 3, 4, 6.
  479. * B - 2.
  480. * X - 0, 1, 2, 3, 4, 6.
  481. *
  482. * CALLS CIO=, MSG=, WTW=.
  483.  
  484.  
  485. PEF3 WRITEF O GENERATE EOF AND FLUSH BUFFER
  486. PEF4 SA1 TC GET TERMINATION CONDITION
  487. NG X0,PEFX IF EOI ENCOUNTERED
  488. * /--- BLOCK PEF 00 000 83/03/30 20.19
  489. NG X1,PEFX IF COPY TO EOI
  490. SB2 X0+
  491. NZ X1,PEF5 IF COPY TO FILE COUNT
  492. EQ B2,B1,PEFX IF EMPTY FILE NOT ENCOUNTERED
  493. PEF5 SX1 B1 DECREMENT COPY COUNT
  494. SA2 CT
  495. IX6 X2-X1
  496. SA6 A2+
  497.  
  498. PEF SUBR ENTRY/EXIT
  499. SA2 TC
  500. SA4 SK
  501. SA1 BC INCREMENT BLOCK COUNT
  502. SA3 CT
  503. SB2 X2
  504. NG X0,PEF2 IF EOI ENCOUNTERED
  505. SX0 B1
  506. IX6 X1+X0
  507. SA6 A1
  508. NZ X5,PEF1 IF DATA TRANSFERRED
  509. NZ B2,PEF1 IF NOT COPY TO DOUBLE EOF
  510. SA2 RC
  511. IX1 X3-X0
  512. ZR X2,PEF1 IF NO RECORDS COPIED
  513. SX0 B1+B1
  514. NZ X1,PEF1 IF NOT LAST DOUBLE EOF
  515. SA1 =10H SKIPPING SKIP LAST EOF
  516. BX0 X0-X0
  517. LX6 X1
  518. SA6 PEFB
  519. PEF1 SA1 RC ADVANCE RECORD COUNT
  520. SX6 B1
  521. IX6 X1+X6
  522. SA6 A1+
  523. MESSAGE PEFB,1 DISPLAY EOF MESSAGE
  524. ZR X0,PEF5 IF LAST DOUBLE EOF ENCOUNTERED
  525. SA3 SEWI SKIP EOF WRITE INDICATOR
  526. NZ X3,PEF4 IF PO=M OPTION SELECTED
  527. SA2 O+CWF
  528. NZ X4,PEF4 IF SKIP SET
  529. ZR X2,PEF3 IF CONTROL WORD WRITE DISABLED
  530. WRITEW O,PEFA,B1+B1 WRITE CONTROL WORD EOF
  531. EQ PEF4 DECREMENT COPY COUNT
  532.  
  533. PEF2 NZ X4,PEFX IF SKIP SET
  534. LE B2,PEFX IF NOT COPY TO FILE COUNT
  535. ZR X5,PEFX IF NO DATA TRANSFERRED
  536. EQ PEF1 WRITE EOF
  537.  
  538.  
  539. PEFA VFD 60/0 CONTROL WORD EOF
  540. VFD 12/17B,48/0
  541.  
  542. PEFB DATA C* COPYING EOF.*
  543. * /--- BLOCK COMMONS 00 000 83/04/20 09.43
  544. SPACE 4,10
  545. ** COMMON DECKS.
  546.  
  547.  
  548. *CALL COMCCDD
  549. WRIF$ EQU 1 SELECT *RE-ISSUE CURRENT WRITE*
  550. *CALL COMCCIO
  551. *CALL COMCRDW
  552. *CALL COMCSFN
  553. *CALL COMCSNM
  554. *CALL COMCSYS
  555. *CALL COMCWTC
  556. *CALL COMCWTW
  557. * /--- BLOCK BUFFERS 00 000 83/04/20 11.38
  558. SPACE 4,10
  559. ** COPY/COPYBF/COPYEI BUFFERS.
  560.  
  561.  
  562. USE BUFFERS
  563. LBUF BSS 0 ALTERNATE OUTPUT FILE CIO BUFFER
  564.  
  565. * SINGLE BUFFER COPY ALLOCATIONS.
  566.  
  567. SBUF EQU LBUF+LBUFL SINGLE CIO BUFFER
  568. SRFL EQU SBUF+SBUFL FL FOR SINGLE BUFFER COPY
  569.  
  570. * DOUBLE BUFFER COPY ALLOCATIONS.
  571.  
  572. BUF1 EQU LBUF+LBUFL WORKING STORAGE BUFFER
  573. IBUF1 EQU BUF1+BUFL INPUT FILE CIO BUFFER
  574. OBUF1 EQU IBUF1+FBUFL OUTPUT FILE CIO BUFFER
  575. RFL1 EQU OBUF1+FBUFL FL FOR DOUBLE BUFFER COPY
  576. * ERRNG TCOPY-BUF1 IF LBUF OVERFLOWS INTO TCOPY
  577. * /--- BLOCK CIPHER 00 000 85/07/30 16.41
  578. TITLE CIPHER - MAIN LOOP.
  579. CIPHER SPACE 4,15
  580. ** CIPHER - MAIN LOOP - COPY ALL RECORDS FROM ONE
  581. * FILE TO ANOTHER AND ENCRYPT/DECRYPT.
  582. *
  583. * EXIT TO *END*, IF COPY COMPLETE.
  584. * TO *END5*, IF EOI ENCOUNTERED.
  585.  
  586.  
  587. CIPHER BSS 0
  588. RJ PRS PRESET PROGRAM
  589.  
  590. CBR1 BSS 0
  591. * INITIALIZE LINEAR CONGRUENTIAL CIPHER (PSEUDO-
  592. * RANDOM SEQUENCE) FOR EACH RECORD, SO THEY CAN BE
  593. * READ IN ANY ORDER. ALSO, ADVANCE ONE OF THE
  594. * SEEDS TO PREVENT THEM FROM MOVING IN LOCKSTEP.
  595. SA1 KEY
  596. SX2 65539
  597. BX6 X1
  598. DX7 X1*X2
  599. SA6 S1TAB
  600. SA7 S2TAB
  601. SA2 =31167285
  602. SX3 69069
  603. SB6 STABLTH
  604. CBR2 BSS 0
  605. DX6 X6*X2
  606. SA6 A6+B1
  607. DX7 X7*X3
  608. SA7 A7+B1
  609. SB6 B6-B1
  610. GT B6,B0,CBR2
  611.  
  612. READ I BEGIN READ
  613. RECALL O
  614. WRITE O,* PRESET WRITE FUNCTION
  615. READW I,BUF,RBFL
  616. RJ CPR COPY RECORD
  617. NG X0,END5 IF EOI ENCOUNTERED
  618. EQ CBR1 -- KEEP COPYING UNTIL EOI
  619. * /--- BLOCK CPR 00 000 85/07/29 13.07
  620. TITLE RECORD COPY ROUTINES.
  621. CPR SPACE 4,15
  622. ** CPR - COPY RECORD.
  623. *
  624. * ENTRY (X1) = FIRST BLOCK READ STATUS.
  625. * (B6) = LWA+1 DATA TRANSFERRED TO WORKING BUFFER.
  626. *
  627. * EXIT (X0) .LT. 0, IF EOI.
  628. * (X0) = 0, IF EOR.
  629. * (X0) .GT. 0, IF EOF.
  630. *
  631. * USES A - 1, 2.
  632. * X - 0, 1, 2, 5.
  633. *
  634. * CALLS CIO=, DRN, MSG=, RDW=, WTW=.
  635.  
  636.  
  637. CPR4 MESSAGE PEFB,1 DISPLAY EOF MESSAGE
  638. SA1 RC ADVANCE RECORD COUNT
  639. SX0 B1+ SET EOF STATUS
  640. SA2 SK
  641. IX6 X1+X0
  642. SA6 A1
  643. NZ X2,CPRX IF SKIP SET
  644. WRITEF O GENERATE EOF
  645.  
  646. CPR SUBR ENTRY/EXIT
  647. SX0 X1+B1
  648. BX5 X1
  649. NG X0,CPRX IF EOI ENCOUNTERED
  650. ZR X0,CPR4 IF EOF ENCOUNTERED
  651. SX2 BUF
  652. RJ DRN DISPLAY RECORD NAME
  653. CPR1 SA2 SK
  654. NZ X2,CPR2 IF SKIP SET
  655. SB7 BUF
  656. RJ CRYPT *** ENCRYPT/DECRYPT BUFFER ***
  657. SB7 B6-BUF
  658. WRITEW O,BUF,B7
  659. CPR2 SX0 B0+ SET EOR STATUS
  660. NZ X5,CPR3 IF EOR
  661. READW I,BUF,RBFL READ NEXT CHUNK OF INPUT
  662. BX5 X1
  663. PL X1,CPR1 IF NOT EOF OR EOI
  664. SX0 X1+B1 CHECK FOR EOI
  665. PL X0,CPR4 IF EOF
  666. CPR3 SA2 SK
  667. NZ X2,CPRX IF SKIP SET
  668. WRITER O END RECORD
  669. EQ CPRX RETURN WITH EOR OR EOI STATUS
  670. * /--- BLOCK CRYPT 00 000 85/08/30 15.25
  671. CRYPT TITLE CRYPT - ENCRYPT/DECRYPT A BUFFER.
  672. ** CRYPT - ENCRYPT/DECRYPT A BUFFER.
  673. *
  674. * USES A LINEAR CONGRUENTIAL CIPHER (PSEUDO-RANDOM
  675. * SEQUENCE) WHERE THE KEY IS THE INITIAL SEED VALUE.
  676. * THE RESULT IS 'X'O'RED INTO THE PLAINTEXT. SINCE
  677. * THE RESULT OF THE DOUBLE-PRECISION MULTIPLY IS
  678. * ONLY 48 BITS, TWO SUCH OPERATIONS ARE DONE IN
  679. * PARALLEL TO COVER THE ENTIRE 60 BIT WORD.
  680. *
  681. * BACKGROUND'; 'KNUTH, 'VOL. 2, PP 1-33. THIS IS
  682. * ALGORITHM 'M BY 'MAC'LAREN AND 'MARSAGLIA ['J'A'C'M 12
  683. * (1965), 83-89; 'C'A'C'M 11 (1968), 759]. 'I CHOSE IT
  684. * OVER ALGORITHM 'B BY 'BAYS AND 'DURHAM BECAUSE 'I
  685. * HAVE TO PRODUCE TWO 48-BIT QUANTITIES TO COVER THE
  686. * THE ENTIRE WORD AND 'I FELT THAT USING ONE AS THE
  687. * INDEX INTO THE SHUFFLE TABLE OF THE OTHER PREVENTS
  688. * THE TOP BITS OF THE WORD FROM BEING RELATED TO THE
  689. * SLOT INDEX.
  690. *
  691. * THE TWO MULTIPLIERS'; ONE WAS THE ONE SUGGESTED
  692. * IN 'KNUTH AS IDEAL FOR 48-BITS OF PRECISION, THE
  693. * OTHER WAS THE ',BEST OF ALL POSSIBLE MULTIPLIERS.',
  694. * THE TWO MULTIPLIERS ARE RELATIVELY PRIME';
  695. * 69069 = 3*7*11*13*23
  696. * 31167285 = 3*3*3*5*19*29*419
  697. *
  698. * A PSEUDO-RANDOM SEQUENCE ALONE IS VULNERABLE TO
  699. * ATTACK BY KNOWN/CHOSEN PLAINTEXT, SO 'I HAVE ALSO
  700. * MODIFIED THIS ALGORITHM TO RUN AS A STREAM CIPHER
  701. * BY 'X'O'RING SOME OF THE DATA INTO THE NEXT SEED.
  702. *
  703. * ENTRY (B6) = LWA+1 OF THE DATA TO BE CIPHERED.
  704. * (B7) = FWA OF DATA TO BE CIPHERED.
  705. *
  706. * USES A - 2, 3, 4, 6, 7.
  707. * X - 0, 2, 3, 4, 6, 7.
  708. * B - 2, 3, 7.
  709. *
  710. * /--- BLOCK CRYPT 00 000 85/08/13 11.05
  711. CRYPT PS
  712. LE B6,B7,CRYPT -- NOTHING WAS READ IN
  713. SB3 42D
  714. SA3 SEED1 X3 = 'X(N)
  715. SA4 SEED2 X4 = 'X(N)'7
  716. SA2 =31167285
  717. BX0 X2 X0 = A
  718.  
  719. CRYPT1 BSS 0
  720. DX3 X3*X0 'X(N+1) _ ('X(N) * A) MOD 2**48
  721. SX6 69069 X6 = A'7
  722. DX4 X4*X6 'X(N+1)'7 _('X(N)'7 * A'7) MOD 2**48
  723. AX2 X3,B3 J'7 _ 'X(N+1) DIV (2**42)
  724. SA2 S2TAB+X2 'Y'7 _ 'V[J'7]'7 <READ MEMORY>
  725. BX7 X4 'X(N+1)'7 <TO STORAGE REGISTER>
  726. SA7 A2 'V[J'7]'7 _ 'X(N+1)'7 <STORE IN MEM>
  727. BX6 X2 X6 = 'Y'7 <FOR USE LATER>
  728. AX2 X4,B3 J _ 'X(N+1)'7 DIV (2**42)
  729. BX7 X3 'X(N+1) <TO STORAGE REGISTER>
  730. SA2 S1TAB+X2 'Y _ 'V[J] <READ MEMORY>
  731. SA7 A2 'V[J] _ 'X(N+1) <STORE IN MEM>
  732. BX7 X4 X7 _ COPY OF 'X(N+1)'7
  733. AX7 44D X7 _ 'X(N+1)'7 DIV (2**44)
  734. SB2 X7+19 B2 NOW PSEUDO-RANDOM (19..34)
  735. LX2 B2 LEFT SHIFT (END-AROUND) 'Y BY B2
  736. BX6 X2-X6 X6 = 'Y XOR 'Y'7
  737. SA2 B7 READ NEXT WORD FROM BUFFER
  738. BX7 X2-X6 X7 = WORD XOR ('Y XOR 'Y'7)
  739. SB7 B7+B1 INCREMENT BUFFER ADDRESS
  740. SA7 A2 STORE ENCRYPTED WORD IN BUFFER
  741. * CODE FOR STREAM CIPHER
  742. CRYPTA EQU *O ADDRESS OF MXI JK INSTRUCTION
  743. CRYPTAS EQU *P-15D SHIFT FOR JK PORTION OF INSTR
  744. MX6 52B MASK FOR LOW-ORDER BITS
  745. CRYPTB EQU *O ADDRESS CONTAINING AND INSTR
  746. CRYPTBS EQU *P-12D SHIFT TO 'XJ IN BXI -XK*XJ
  747. BX6 -X6*X0 X2 OR X7 REPLACES X0 IN *PRS*
  748. BX3 X3-X6 DEFLECT A FEW BITS IN 'X(N+1)
  749. BX4 X4-X6 DEFLECT A FEW BITS IN 'X(N+1)'7
  750. *
  751. LT B7,B6,CRYPT1 -- IF NOT END OF BUFFER, LOOP
  752. BX6 X3
  753. SA6 A3 STORE CURRENT 'X(N) IN MEMORY
  754. BX6 X4
  755. SA6 A4 STORE CURRENT 'X(N)'7 IN MEMORY
  756. EQ CRYPT
  757.  
  758.  
  759. KEY EQU ARGR+3 PLAY IT WHERE IT LIES
  760. STABLTH EQU 100B K
  761. S1TAB BSS STABLTH 'V[0..K-1]
  762. SEED1 DATA 0 'X (INITIALLY SET TO 'V[K])
  763. S2TAB BSS STABLTH 'V'7[0..K-1]
  764. SEED2 DATA 0 'X'7 (INITIALLY SET TO 'V[K]'7)
  765. * /--- BLOCK BUFFERS 00 000 83/03/30 19.21
  766. ** COMMON DECKS.
  767.  
  768.  
  769. *CALL COMCSRT
  770. SPACE 4,10
  771. ** COPYBR/COPYX BUFFERS.
  772.  
  773.  
  774. BUF BSS 0 WORKING STORAGE BUFFER
  775. IBUF EQU BUF+RBFL INPUT FILE CIO BUFFER
  776. OBUF EQU IBUF+FBUFL OUTPUT FILE CIO BUFFER
  777. RFL= EQU OBUF+FBUFL FIELD LENGTH FOR COPYBR AND COPYX
  778. * /--- BLOCK NEW PRS 00 000 85/08/13 10.49
  779. TITLE PRESET.
  780. ** PRS - PRESET FOR EXECUTION.
  781. *
  782.  
  783. PRS SUBR ENTRY/EXIT
  784. SB1 1 (B1) = 1, THROUGHOUT PROGRAM
  785. MX0 42D MASK FOR FILE NAMES
  786. SA1 ACTR ARGUMENT COUNT
  787. SB7 X1
  788. ZR B7,PRS9 -- NO ARGUMENTS
  789.  
  790. * PROCESS INPUT FILE NAME.
  791.  
  792. R= A5,ARGR FIRST PARAM = INPUT FILE NAME
  793. SA2 I
  794. BX7 X0*X5
  795. SX3 X2
  796. ZR X7,PRS1 -- NO INPUT FILE
  797. BX7 X7+X3
  798. SA7 A2 STORE NEW INPUT FILE NAME
  799.  
  800. * PROCESS OUTPUT FILE NAME.
  801.  
  802. PRS1 BSS 0
  803. SB7 B7-B1 DECR ARG CNT
  804. ZR B7,PRS9 -- NO ARGS REMAINING, NO KEY
  805. SA5 A5+B1 NEXT ARG = OUTPUT FILE NAME
  806. SA2 O
  807. BX7 X0*X5
  808. SX3 X2
  809. ZR X7,PRS2 -- NO OUTPUT FILE
  810. BX7 X7+X3
  811. SA7 A2 STORE NEW OUTPUT FILE NAME
  812.  
  813. * PROCESS ENCRYPT/DECRYPT FLAG
  814.  
  815. PRS2 BSS 0
  816. SB7 B7-B1 DECR ARG CNT
  817. ZR B7,PRS9 -- NO ARGS LEFT, NO KEY
  818. SA5 A5+B1 NEXT ARG = ENCRYPT/DECRYPT
  819. BX5 X0*X5 HOLD IT TO 7 CHARS
  820. SA2 =7LENCRYPT
  821. SA3 =7LDECRYPT
  822. BX2 X2-X5
  823. BX3 X3-X5
  824. SX6 7 'XJ = 7 IF ENCRYPTING
  825. ZR X2,PRS2.1 -- IF ARG WAS *ENCRYPT*
  826. SX6 2 'XJ = 2 IF DECRYPTING
  827. NZ X3,PRS9.1 -- IF ARG WAS NOT *DECRYPT*
  828. PRS2.1 BSS 0
  829. LX6 CRYPTBS SHIFT TO 'XJ IN BXI -XK*XJ
  830. SA2 CRYPTB READ WORD TO BE PLANTED
  831. BX6 X2+X6 UNION
  832. SA6 A2 STORE MODIFIED INSTRUCTION WD
  833.  
  834. * /--- BLOCK NEW PRS 00 000 85/08/13 11.02
  835. * PROCESS CIPHERING KEY.
  836.  
  837. SB7 B7-B1 DECR ARG CNT
  838. ZR B7,PRS9 -- NO MORE ARGS, NO KEY
  839. SA5 A5+B1 NEXT ARG = CIPHERING KEY
  840. MX3 48 MASK FOR 8 CHARS
  841. BX1 X5*X3
  842. ZR X7,PRS9 -- THE KEY IS ZERO
  843. MX0 6 MASK FOR CHARACTER
  844. PRS3 BX6 X1 X6 = LAST GOOD VALUE
  845. LX1 54D SHIFT NEXT CHAR
  846. BX2 X0*X1 MASK OFF TOP CHAR
  847. ZR X2,PRS3 -- KEEP LOOPING IF NOT TOO FAR
  848. CX7 X6 COUNT NUMBER OF BITS IN KEY
  849. SX3 32771D INITIAL SCRAMBLE FOR LUCK
  850. DX6 X6*X3
  851. SA6 A5 SHOULD BE *KEY*
  852. SB7 A5-KEY CHECK TO BE SURE A5=KEY
  853. NZ B7,*+400000B
  854. SA2 CRYPTA READ WORD TO BE PLANTED
  855. MX6 -3B RANGE OF 0..7
  856. BX7 -X6*X7
  857. LX7 CRYPTAS SHIFT TO JK IN MXI JK
  858. BX7 X7-X2 XOR TO FORM NEW MASK WIDTH
  859. SA7 A2 STORE UPDATED WORD
  860.  
  861. SB7 4 NUMBER OF DELIMITERS BEFORE KEY
  862. SA3 COMMAS
  863. SA4 NINES
  864. SA5 SPACES
  865. MX0 6
  866. SA1 CCDR
  867.  
  868. PRS4 LX0 54D
  869. PL X0,PRS5
  870. SA1 A1+B1
  871. PRS5 LE B7,B0,PRS6 -- IF TERMINATING LINE
  872. BX6 X0*X1 CURRENT CHAR
  873. BX7 X0*X4 ',9',
  874. ZR X6,PRS9 -- PREMATURE END-OF-LINE
  875. IX7 X7-X6 ',9', - CURRENT CHAR
  876. PL X7,PRS4 -- NOT A DELIMITER
  877. BX7 X0*X5 SPACE
  878. IX7 X7-X6 SPACE - CURRENT CHAR
  879. ZR X7,PRS4 -- IGNORE SPACES
  880. BX1 -X0*X1 CLEAR OUT CHAR
  881. BX7 X0*X3 COMMA
  882. BX1 X1+X7 REPLACE DELIMITER WITH COMMA
  883. BX6 X1
  884. SA6 A1
  885. SB7 B7-B1 DECR DELIMITER COUNT
  886. EQ PRS4 -- GET NEXT CHAR
  887.  
  888. PRS6 BSS 0
  889. SA4 PERIODS
  890. BX1 -X0*X1 CLEAR CURRENT CHAR
  891. BX4 X0*X4 ',.',
  892. BX6 X1+X4 CURRENT CHAR REPLACED W/.
  893. PRS7 BSS 0
  894. LX0 54D
  895. NG X0,PRS8 -- LAST CHAR IN WORD
  896. BX6 -X0*X6 CLEAR CHAR
  897. EQ PRS7
  898.  
  899. PRS8 BSS 0
  900. SA6 A1
  901. MX6 0
  902. SA6 A1+B1 CLEAR ENTIRE WORD
  903.  
  904. MESSAGE CCDR
  905.  
  906. * /--- BLOCK NEW PRS 00 000 85/08/08 09.47
  907. SA0 I INPUT FILE
  908. RJ CDT CHECK IF CONTROL WORDS ALLOWED
  909. SA0 O OUTPUT FILE
  910. RJ CDT CHECK IF CONTROL WORDS ALLOWED
  911. RJ SFM SET FILE MODE
  912. RJ CFN CHECK FILE NAMES
  913. RJ CIC CHECK INDETERMINATE COPY
  914. SX7 0
  915. SA7 I+CWF DISABLE CONTROL WORD READ
  916. SA7 O+CWF DISABLE CONTROL WORD WRITE
  917. EQ PRSX -- EXIT
  918.  
  919. PRS9 BSS 0 NO KEY SPECIFIED
  920. MESSAGE CCDR SEND UNALTERED CONTROL CARD
  921. MESSAGE PRSA NO KEY SPECIFIED
  922. ABORT
  923.  
  924. PRS9.1 BSS 0 ENCRYPT/DECRYPT NOT SPECIFIED
  925. MESSAGE CCDR SEND UNALTERED CONTROL CARD
  926. MESSAGE PRSB ENCRYPT/DECRYPT NOT SPECIFIED
  927. ABORT
  928.  
  929. PRSA DIS ,* NO KEY SPECIFIED.*
  930. PRSB DIS ,* ENCRYPT/DECRYPT NOT SPECIFIED.*
  931.  
  932. NINES DATA 0L9999999999
  933. SPACES DATA 10H
  934. COMMAS DATA 10L,,,,,,,,,,
  935. PERIODS DATA 10L..........
  936. * /--- BLOCK CDT 00 000 83/03/30 19.53
  937. CDT SPACE 4,15
  938. ** CDT - CHECK DEVICE TYPE.
  939. *
  940. * ENTRY (A0) = FWA FET.
  941. *
  942. * EXIT ((A0)+CWF) .NE. 0, IF CONTROL WORDS ALLOWED.
  943. * ((A0)+SLF) = -1, IF F FORMAT TAPE.
  944. * = 1, IF S FORMAT TAPE.
  945. * = 2, IF L FORMAT TAPE.
  946. * ((A0)+NSZ) = NOISE SIZE IN FRAMES, IF TAPE FILE.
  947. * ((A0)+TRK) = TRACK AND LABEL TYPE, IF TAPE FILE.
  948. * ((A0)+PRU) = PRU SIZE, IF F FORMAT TAPE.
  949. * WARNING MESSAGE ISSUED IF INPUT FILE NOT FOUND.
  950. *
  951. * USES A - 1, 2, 3, 6, 7.
  952. * B - 2, 5.
  953. * X - 0, 1, 2, 3, 6, 7.
  954. *
  955. * CALLS GPS, SNM.
  956. *
  957. * MACROS FILINFO, MESSAGE.
  958.  
  959.  
  960. CDT4 RJ GPS CHECK FOR TERMINAL FILE
  961. SA3 A0+B1 GET DEVICE TYPE
  962. MX2 -11
  963. LX3 12
  964. BX3 -X2*X3
  965. SX7 X3-2RTT
  966. SX2 A0-I
  967. ZR X7,CDTX IF TERMINAL FILE
  968. NZ X2,CDT5 IF NOT INPUT FILE
  969. SA1 A0 GET INPUT FILE NAME
  970. SB5 -CDTA * FILE NOT FOUND - LFN.*
  971. BX1 X0*X1
  972. SB2 1RX
  973. SB3 ENDC REPLACE * EOI ENCOUNTERED.* MESSAGE
  974. RJ SNM SET NAME IN MESSAGE
  975. CDT5 SX7 B1+ ENABLE CONTROL WORDS
  976. SA7 A0+CWF
  977.  
  978. CDT SUBR ENTRY/EXIT
  979. SA1 A0 SET FILE NAME IN PARAMETER BLOCK
  980. MX0 42
  981. * /--- BLOCK CDT 00 000 83/03/30 19.53
  982. SA2 CDTB
  983. BX1 X0*X1
  984. SX2 X2
  985. BX6 X1+X2
  986. SA6 A2
  987. FILINFO CDTB GET FILE INFORMATION
  988. SA1 CDTB+1 GET DEVICE TYPE AND STATUS
  989. BX3 X1
  990. AX3 48
  991. ZR X3,CDT4 IF FILE NOT FOUND
  992. SX2 X3-2RNE
  993. LX1 59-15
  994. NG X1,CDT5 IF FILE ON MASS STORAGE
  995. LX1 59-19-59+15
  996. LX7 X1,B1
  997. ZR X2,CDT5 IF NULL EQUIPMENT
  998. NG X1,CDT2 IF 9-TRACK TAPE
  999. PL X7,CDTX IF NOT 7-TRACK TAPE
  1000. CDT2 MX6 2
  1001. SA2 CDTB+FIPBL+1 GET LABEL TYPE
  1002. MX0 -6
  1003. LX2 -12
  1004. BX6 X6*X1 GET TRACK BITS
  1005. SA3 A2-B1 GET TAPE FORMAT
  1006. BX2 -X0*X2
  1007. SA1 A2+B1 GET BLOCK SIZE AND NOISE SIZE
  1008. LX3 -6
  1009. BX6 X6+X2
  1010. LX1 -6
  1011. SA6 A0+TRK SAVE TRACK BITS AND LABEL TYPE
  1012. BX3 -X0*X3
  1013. BX6 -X0*X1
  1014. SA6 A0+NSZ SAVE NOISE SIZE
  1015. SX2 X3-/MTX/TFS
  1016. SX7 B1
  1017. ZR X2,CDT3 IF S TAPE
  1018. SX7 B1+B1
  1019. SX2 X3-/MTX/TFL
  1020. ZR X2,CDT3 IF L TAPE
  1021. SX7 -1
  1022. SX2 X3-/MTX/TFF
  1023. NZ X2,CDT5 IF NOT F TAPE
  1024. LX1 -18
  1025. SX6 X1
  1026. SA6 A0+PRU SET F TAPE PRU SIZE
  1027. CDT3 SA7 A0+SLF SET S/L/F TAPE INDICATOR
  1028. EQ CDT5 SET CONTROL WORD FLAG
  1029.  
  1030.  
  1031. CDTA DATA C* FILE NOT FOUND - XXXXXXX.*
  1032.  
  1033. CDTB VFD 42/0,6/CDTBL,12/1 *FILINFO* PARAMETER BLOCK
  1034. BSS FIPBL-1
  1035. CON FMTK TAPE FORMAT KEYWORD
  1036. CON LTYK TAPE LABEL TYPE KEYWORD
  1037. CON BSZK TAPE BLOCK SIZE, NOISE SIZE KEYWORD
  1038. CDTBL EQU *-CDTB
  1039. * /--- BLOCK CFN 00 000 83/03/30 19.54
  1040. CFN SPACE 4,10
  1041. ** CFN - CHECK FILE NAMES.
  1042. *
  1043. * EXIT SKIP FLAG SET IF INPUT FILE NAME SAME AS OUTPUT
  1044. * FILE NAME.
  1045. * TO *PER1*, IF ALTERNATE OUTPUT FILE NAME CONFLICT.
  1046. *
  1047. * USES A - 1, 2, 3, 4, 6, 7.
  1048. * B - 5.
  1049. * X - 0, 1, 2, 3, 4, 6, 7.
  1050.  
  1051.  
  1052. CFN SUBR ENTRY/EXIT
  1053. SA1 I COMPARE FILE NAMES
  1054. SA4 O
  1055. MX0 42
  1056. BX1 X0*X1
  1057. SA3 L
  1058. BX4 X0*X4
  1059. SA2 =10H SKIPPING SET SKIP FLAG AND MESSAGE
  1060. BX7 X1-X4
  1061. LX6 X2
  1062. NZ X7,CFN1 IF INPUT .NE. OUTPUT FILE NAME
  1063. SX7 B1
  1064. SA6 DRNA
  1065. SA7 SK
  1066. SA6 PEFB
  1067. CFN1 SA2 SEWI SKIP EOF WRITE INDICATOR
  1068. SB5 PERE * FILE NAME CONFLICT.*
  1069. ZR X2,CFN2 IF PO=M NOT SELECTED
  1070. SA6 PEFB
  1071. CFN2 SX6 A3 SET ALTERNATE OUTPUT FILE POINTER
  1072. BX3 X0*X3
  1073. SX7 A4 SET OUTPUT FILE POINTER
  1074. BX6 X6+X3
  1075. SA2 EL CHECK IF ALTERNATE OUTPUT FILE TO BE USED
  1076. BX7 X7+X4
  1077. R= A6,ARGR
  1078. BX1 X1-X3
  1079. SA7 A6+B1
  1080. ZR X2,CFNX IF ERROR LIMIT = 0
  1081. ZR X1,PER1 IF ALTERNATE OUTPUT = INPUT FILE NAME
  1082. BX7 X4-X3
  1083. ZR X7,PER1 IF ALTERNATE OUTPUT = OUTPUT FILE NAME
  1084. EQ CFNX RETURN
  1085. * /--- BLOCK CIC 00 000 83/03/30 19.54
  1086. CIC SPACE 4,15
  1087. ** CIC - CHECK FOR INDETERMINATE COPY.
  1088. *
  1089. * EXIT WARNING MESSAGE ISSUED IF S, L, OR F TAPE COPY.
  1090. * L TAPE PRU SIZE LIMITED IF COPYBF OR COPYEI CALL.
  1091. * TO *PER*, IF F TAPE PRU SIZE .GT. WORKING BUFFER SIZE.
  1092. *
  1093. * USES A - 1, 2, 3, 6.
  1094. * B - 2, 3, 4.
  1095. * X - 0, 1, 2, 3, 6.
  1096. *
  1097. * CALLS SYS=.
  1098.  
  1099.  
  1100. CIC SUBR ENTRY/EXIT
  1101. SA1 I+SLF
  1102. SA2 O+SLF
  1103. NZ X1,CIC1 IF S, L, OR F TAPE INPUT
  1104. ZR X2,CICX IF OUTPUT NOT S, L, OR F TAPE
  1105. CIC1 SA3 CRI GET CALLING ROUTINE INDICATOR
  1106. SB4 X2
  1107. SB2 X3
  1108. SB3 X1+
  1109. LE B2,CIC5 IF COPYBR OR COPYX CALL
  1110. SX6 BUFL-3 LIMIT L TAPE PRU SIZE TO WORKING BUFFER
  1111. LE B3,B1,CIC2 IF INPUT NOT L TAPE
  1112. SA6 I+6 SET MLRS FIELD IN INPUT FET
  1113. CIC2 LE B4,B1,CIC3 IF OUTPUT NOT L TAPE
  1114. SA6 O+6 SET MLRS FIELD OF OUTPUT FET
  1115. CIC3 SB5 PERB * BLOCK SIZE TOO LARGE ON LFN.*
  1116. GE B3,CIC4 IF INPUT NOT F TAPE
  1117. SA2 I+PRU GET INPUT FILE PRU SIZE
  1118. IX2 X6-X2
  1119. SA1 I
  1120. NG X2,PER IF F TAPE PRU SIZE EXCEEDS WORKING BUFFER
  1121. CIC4 GE B4,CIC5 IF OUTPUT NOT F TAPE
  1122. SA3 O+PRU GET OUTPUT FILE PRU SIZE
  1123. SA1 O
  1124. IX3 X6-X3
  1125. NG X3,PER IF F TAPE PRU SIZE EXCEEDS WORKING BUFFER
  1126. CIC5 MESSAGE CICA,3 * COPY INDETERMINATE.*
  1127. EQ CICX RETURN
  1128.  
  1129.  
  1130. CICA DATA C* COPY INDETERMINATE.*
  1131. * /--- BLOCK GPS 00 000 83/03/30 19.56
  1132. GPS SPACE 4,10
  1133. ** GPS - GET PRU SIZES.
  1134. *
  1135. * ENTRY (A0) = FWA FET.
  1136. *
  1137. * EXIT (A0+PRU) = PRU SIZE, IF NOT PREVIOUSLY SET.
  1138. *
  1139. * USES A - 1, 4, 6.
  1140. * X - 1, 4, 6.
  1141. *
  1142. * CALLS CIO=.
  1143.  
  1144.  
  1145. GPS SUBR ENTRY/EXIT
  1146. SA4 A0+PRU
  1147. PL X4,GPSX IF PRU SIZE ALREADY SET
  1148. OPEN A0,READNR,R
  1149. SA1 A0+4 GET PRU SIZE
  1150. LX1 -18
  1151. SX6 X1
  1152. SA6 A4
  1153. EQ GPSX RETURN
  1154. * /--- BLOCK PER 00 000 83/03/30 19.56
  1155. PER SPACE 4,10
  1156. ** PER - PRESET ERROR PROCESSOR.
  1157. *
  1158. * ENTRY (B5) = FWA MESSAGE, IF ENTRY AT *PER* OR *PER1*.
  1159. * (X1) = FILE NAME, IF ENTRY AT *PER*.
  1160. *
  1161. * USES B - 2, 5.
  1162. * X - 1, 2.
  1163. *
  1164. * CALLS MSG=, SNM, SYS=.
  1165.  
  1166.  
  1167. PER2 SB5 PERA * ARGUMENT ERROR.*
  1168. EQ PER1 ISSUE ERROR MESSAGE
  1169.  
  1170. PER MX2 42 SET NAME IN MESSAGE
  1171. SB2 1RX
  1172. BX1 X2*X1
  1173. RJ SNM
  1174. PER1 MESSAGE B5,0
  1175. ABORT
  1176.  
  1177.  
  1178. PERA DATA C* ARGUMENT ERROR.*
  1179. PERB DATA C* BLOCK SIZE TOO LARGE ON XXXXXXX.*
  1180. PERC DATA C* BLOCK SIZE TOO SMALL ON XXXXXXX.*
  1181. PERD DATA C* COPY FL ABOVE USER LIMIT.*
  1182. PERE DATA C* FILE NAME CONFLICT.*
  1183. PERF DATA C* ILLEGAL COPY.*
  1184. PERG DATA C* INVALID NOISE SIZE ON XXXXXXX.*
  1185. PERH DATA C* UNLABELED TAPE REQUIRED - XXXXXXX.*
  1186. PERI DATA C* UNRECOGNIZED TERMINATION CONDITION.*
  1187. PERJ DATA C* UNRECOGNIZED BACKSPACE CODE.*
  1188. PERK DATA C* BLOCK SIZE NOT APPLICABLE.*
  1189. PERL DATA C* PROCESSING OPTION NOT APPLICABLE.*
  1190. * /--- BLOCK SFM 00 000 83/03/30 20.01
  1191. SFM SPACE 4,10
  1192. ** SFM - SET FILE MODE.
  1193. *
  1194. * EXIT CODED MODE SET ON INPUT, OUTPUT, OR BOTH FILES,
  1195. * IF REQUESTED.
  1196. *
  1197. * USES A - 1, 2, 6.
  1198. * B - 2.
  1199. * X - 1, 2, 6.
  1200.  
  1201.  
  1202. SFM SUBR ENTRY/EXIT
  1203. SA2 CM GET MODE INDICATOR
  1204. ZR X2,SFMX IF CODED MODE NOT REQUESTED
  1205. SB2 X2
  1206. SX2 B1+B1
  1207. GT B2,B1,SFM1 IF SECOND FILE ONLY
  1208. SA1 I
  1209. BX6 -X2*X1
  1210. SA6 A1
  1211. SFM1 EQ B2,B1,SFMX IF FIRST FILE ONLY
  1212. SA1 O
  1213. BX6 -X2*X1
  1214. SA6 A1
  1215. EQ SFMX RETURN
  1216. * /--- BLOCK TABLES 00 000 83/04/27 12.42
  1217. SPACE 4,10
  1218. ** PRESET DATA STORAGE.
  1219.  
  1220.  
  1221. BS CON 0 BLOCK SIZE
  1222. CC CON 0 CHARACTER COUNT
  1223. CF CON 0 CONVERSION FORMAT
  1224. CM CON 0 CODED MODE (-1=BOTH,0=NEITHER,1=1ST,2=2ND)
  1225. DCT CON 1L1 DISPLAY CODE COPY COUNT
  1226. MAXFL CON 0 CURRENT MAXIMUM FIELD LENGTH
  1227. MCC CON 0 MAXIMUM CHARACTER COUNT
  1228. PO CON 0 PROCESSING OPTIONS
  1229. STAT VFD 30/-1,30/0 FIELD LENGTH STATUS WORD
  1230.  
  1231. * THE ORDER OF THE FOLLOWING MUST BE PRESERVED.
  1232.  
  1233. WBL CON BUFL WORKING BUFFER LENGTH
  1234. IBL CON FBUFL INPUT BUFFER LENGTH
  1235. OBL CON FBUFL OUTPUT BUFFER LENGTH
  1236. * /--- BLOCK COMMONS 00 000 83/04/18 16.37
  1237. SPACE 4,10
  1238. ** COMMON DECKS.
  1239.  
  1240.  
  1241. *CALL COMCARM
  1242. *CALL COMCCPA
  1243. *CALL COMCDXB
  1244. *CALL COMCLFM
  1245. *CALL COMCPOP
  1246. *CALL COMCUSB
  1247. SPACE 4,10
  1248. ** PRESET BUFFERS.
  1249.  
  1250.  
  1251. PASB EQU * POSITIONAL ARGUMENT STRING BUFFER
  1252. ERRNG RFL=-PASB-200 CHECK FOR BUFFER OVERFLOW FL
  1253. * /--- BLOCK END 00 000 83/04/20 21.13
  1254. * TEMP BUFFER UNTIL PLACED ON DST
  1255.  
  1256. BSSZ RFL=-*
  1257.  
  1258. SPACE 4,10
  1259. END