Table of Contents

VERIFY

Table Of Contents

  • [00008] VERIFY - VERIFY FILES.
  • [00120] READW - REDEFINE READ WORDS MACRO TO USE CONTROL WORDS.
  • [00139] STORAGE ASSIGNMENTS.
  • [00237] MAIN PROGRAM.
  • [00359] SUBROUTINES.
  • [00361] CPR - COMPARE RECORDS.
  • [00487] EOF - PROCESS END OF FILE.
  • [00516] EXR - PROCESS EXCESS RECORDS.
  • [00611] IRF - INITIATE READ FUNCTION.
  • [00645] LEW - LIST ERROR WORDS.
  • [00783] RDA - READ DATA.
  • [00903] SRM - SEND RECORD MESSAGE.
  • [00942] UPN - UNPACK NAME.
  • [00966] UPW - UNPACK WORD.
  • [01017] WOF - WRITE LINE TO OUTPUT.
  • [01112] PRESET.
  • [01114] PRS - PROCESS ARGUMENTS.
  • [01240] CBL - CALCULATE BUFFER LENGTH.
  • [01272] CBS - CHECK BLOCK SIZE.
  • [01310] CDT - CHECK DEVICE TYPE.
  • [01405] PCM - PROCESS CODED MODE PARAMETER.
  • [01430] PER - PRESET ERROR PROCESSOR.
  • [01450] RLF - RFL UP FOR LARGE L AND F TAPES.
  • [01540] SPS - SET PRU SIZE.

Source Code

VERIFY.txt
  1. IDENT VERIFY,FETS
  2. ABS
  3. ENTRY VERIFY
  4. ENTRY RFL=
  5. ENTRY SSM=
  6. SYSCOM B1 DEFINE (B1) = 1
  7. SPACE 4,10
  8. TITLE VERIFY - VERIFY FILES.
  9. *COMMENT VERIFY - VERIFY FILES.
  10. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  11. SPACE 4,10
  12. ***** VERIFY - VERIFY FILES.
  13. *
  14. * G. R. MANSFIELD. 70/12/20.
  15. *
  16. * J. L. LARSON. 77/03/16.
  17. *
  18. * VERIFY EQUALITY OF RECORDS AND FILES ON TWO MEDIA,
  19. * WORD BY WORD.
  20. SPACE 4,10
  21. *** VERIFY COMPARES RECORDS ON TWO MEDIA FOR EQUALITY WORD
  22. * BY WORD. WHEN AN ERROR IS DETECTED THE RECORD NUMBER, WORD
  23. * NUMBER, AND THE DATA FROM EACH MEDIA ARE LISTED ON THE
  24. * OUTPUT FILE. THE LOGICAL DIFFERENCE WILL ALSO BE LISTED ON
  25. * THE OUTPUT FILE IF THE OUTPUT FILE IS NOT ASSIGNED TO AN
  26. * INTERACTIVE TERMINAL.
  27. SPACE 4,10
  28. *** CONTROL CARD CALL.
  29. *
  30. *
  31. * VERIFY (FILE1,FILE2,P1,P2,...,PN)
  32. *
  33. * FILE1 FIRST FILE NAME.
  34. *
  35. * FILE2 SECOND FILE NAME.
  36. *
  37. * PN ANY OF FOLLOWING IN ANY ORDER.
  38. *
  39. * N=X VERIFY X FILES.
  40. * IF X = 0, VERIFY WILL TERMINATE ON AN
  41. * EMPTY FILE FROM EITHER MEDIA.
  42. *
  43. * N VERIFY TO EOI.
  44. *
  45. * E=X LIST FIRST X DATA ERRORS.
  46. *
  47. * L=FNAME LIST ON FILE *FNAME*.
  48. *
  49. * A ABORT IF ERRORS OCCUR.
  50. *
  51. * R REWIND BOTH FILES BEFORE AND AFTER VERIFY.
  52. *
  53. * C CODED MODE SET ON BOTH FILES.
  54. *
  55. * C1 CODED MODE SET ON FILE 1 ONLY.
  56. *
  57. * C2 CODED MODE SET ON FILE 2 ONLY.
  58. *
  59. * BS=BSIZE MAXIMUM BLOCK SIZE IN CM WORDS.
  60. * APPLIES ONLY TO S AND L FORMAT TAPES.
  61. *
  62. * ASSUMED PARAMETERS.
  63. * FILE1 = *TAPE1*
  64. * FILE2 = *TAPE2*
  65. * N=1
  66. * E=100
  67. * L=*OUTPUT*
  68. * A NOT PRESENT (PROCESS ERRORS)
  69. * R NOT PRESENT (NO REWIND)
  70. * C, C1, C2 NOT PRESENT (BINARY)
  71. * BS = 1000B FOR S FORMAT TAPE.
  72. * BS = 2000B FOR L FORMAT TAPE.
  73. SPACE 4,10
  74. *** DAYFILE MESSAGES.
  75. *
  76. *
  77. * * FILE NOT FOUND - LFN.* = WARNING MESSAGE INDICATING THAT
  78. * LFN DID NOT EXIST PRIOR TO VERIFY.
  79. *
  80. * * FILE STRUCTURES NOT COMPATIBLE.* = WARNING MESSAGE ISSUED
  81. * BEFORE VERIFICATION BEGINS, TO INDICATE THAT THE RESULTS
  82. * OF THE VERIFY ARE NOT GUARANTEED SINCE THE LOGICAL
  83. * STRUCTURES OF THE FILES BEING COMPARED ARE NOT COMPATIBLE.
  84. *
  85. * * VERIFY ARGUMENT ERROR.* = CONTROL CARD CONTAINS ILLEGAL
  86. * PARAMETER.
  87. *
  88. * * VERIFY COMPLETE.* = VERIFY OPERATION COMPLETED WITH NO
  89. * ERRORS.
  90. *
  91. * * VERIFY ERRORS.* = ERRORS DETECTED DURING VERIFY.
  92. *
  93. * * VERIFY FILE NAME CONFLICT - LFN.* = REQUESTED FILE NAMES
  94. * THE SAME.
  95. *
  96. * * VERIFY FL ABOVE USER LIMIT.* = FIELD LENGTH REQUIRED
  97. * TO PROCESS L OR F TAPE VERIFY EXCEEDS USERS CURRENT
  98. * MAXIMUM FL.
  99. SPACE 4,10
  100. **** ASSEMBLY CONSTANTS.
  101.  
  102.  
  103. BUFL EQU 4000B WORKING BUFFER LENGTH = MAX PRUSIZE (OD)
  104. OBUFL EQU 1001B OUTPUT FILE BUFFER LENGTH
  105. FBUFL EQU 30061B VERIFY FILES BUFFER LENGTH
  106. FETODL EQU 16 OPTICAL DISK FET EXTENSION BUFFER
  107.  
  108. DSPS EQU 1000B DEFAULT S TAPE PRU SIZE
  109. DLPS EQU 2000B DEFAULT L TAPE PRU SIZE
  110. MSPS EQU 1000B MAXIMUM S TAPE PRU SIZE
  111.  
  112. MFLF EQU 70000B-2 MAXIMUM FIELD LENGTH FACTOR
  113. ****
  114.  
  115.  
  116. * SPECIAL ENTRY POINT.
  117.  
  118. SSM= EQU 0 SUPPRESS DUMPS OF FIELD LENGTH
  119. READW SPACE 4,10
  120. ** READW - REDEFINE READ WORDS MACRO TO USE CONTROL WORDS.
  121.  
  122.  
  123. PURGMAC READW
  124.  
  125. READW MACRO F,S,N
  126. R= B6,S
  127. R= B7,N
  128. R= X2,F
  129. RJ RDA
  130. ENDM
  131. SPACE 4
  132. *CALL COMCMAC
  133. *CALL COMCCMD
  134. *CALL COMSLFM
  135. QUAL MTX
  136. *CALL COMSMTX
  137. QUAL *
  138. *CALL COMSSRT
  139. TITLE STORAGE ASSIGNMENTS.
  140. * FETS.
  141.  
  142.  
  143. ORG 110B
  144. FETS BSS 0
  145.  
  146.  
  147. O BSS 0
  148. OUTPUT FILEC OBUF,OBUFL,(FET=8)
  149.  
  150.  
  151. * INDEX TAGS FOR WORDS PRECEEDING FILE 1 AND FILE 2 FETS.
  152.  
  153.  
  154. EFF EQU 8 EMPTY FILE FLAG
  155. LWD EQU 7 LWA+1 DATA TRANSFERRED TO WORKING BUFFER
  156. RST EQU 6 LAST READ STATUS
  157. CWF EQU 5 CONTROL WORD FLAG
  158. SLF EQU 4 S, L, OR F TAPE FLAG
  159. UBC EQU 3 UNUSED BIT COUNT
  160. WRB EQU 2 WORDS REMAINING IN BLOCK
  161. ERF EQU 1 EOR FLAG
  162.  
  163.  
  164. CON 0 ZERO IF EMPTY FILE ENCOUNTERED ON FILE 1
  165. CON 0 LWA+1 DATA IN WORKING BUFFER FOR FILE 1
  166. CON 0 FILE 1 LAST READ STATUS
  167. CON 0 NONZERO IF CONTROL WORDS ENABLED ON FILE 1
  168. CON 0 1= S TAPE, 2= L TAPE, -1= F TAPE, 0= OTHER
  169. CON 0 UNUSED BIT COUNT FOR FILE 1 BLOCK
  170. CON 0 WORDS REMAINING IN FILE 1 BLOCK
  171. CON 0 EOR FLAG
  172. F1 BSS 0
  173. TAPE1 FILEB BUF1,FBUFL,(FET=9)
  174. BSSZ FETODL TAPE1 OD FET EXTENSION BUFFER
  175.  
  176.  
  177. CON 0 ZERO IF EMPTY FILE ENCOUNTERED ON FILE 2
  178. CON 0 LWA+1 DATA IN WORKING BUFFER FOR FILE 2
  179. CON 0 FILE 2 LAST READ STATUS
  180. CON 0 NONZERO IF CONTROL WORDS ENABLED ON FILE 2
  181. CON 0 1= S TAPE, 2= L TAPE, -1= F TAPE, 0= OTHER
  182. CON 0 UNUSED BIT COUNT FOR FILE 2 BLOCK
  183. CON 0 WORDS REMAINING IN FILE 2 BLOCK
  184. CON 0 EOR FLAG
  185. F2 BSS 0
  186. TAPE2 FILEB BUF2,FBUFL,(FET=9)
  187. BSSZ FETODL TAPE2 OD FET EXTENSION BUFFER
  188. SPACE 4
  189. * COMMON DATA.
  190.  
  191.  
  192. EC CON 0 ERROR COUNT
  193. EL CON 0L100 ERROR LIMIT
  194. FC CON 0L1 FILE COUNT
  195. DFN CON 0 DISPLAY FILE NUMBER
  196. EOIF CON 0 NONZERO IF EOI ENCOUNTERED ON EIHER FILE
  197. AB CON 0 ABORT FLAG
  198. RW CON 0 REWIND FLAG
  199. FN CON 1 FILE NUMBER
  200. RN CON 1 RECORD NUMBER
  201. ER CON 0 WORD NUMBER
  202. CON 0 WORD FROM FILE 1
  203. CON 0 WORD FROM FILE 2
  204. CON 0 LOGICAL DIFFERENCE
  205. TY CON 0 RECORD TYPE FROM FILE 1
  206. CON 0 RECORD TYPE FROM FILE 2
  207.  
  208. * LIST DATA.
  209.  
  210. LC CON 99999,0 LINE COUNTER
  211. LL EQU LC+1 LINE LIMIT - PAGE SIZE
  212. PD CON 0 PRINT DENSITY
  213. PN CON 1 PAGE NUMBER
  214. PW CON 0 PAGE WIDTH
  215.  
  216. TITL DATA 50H VERIFY ERROR LIST.
  217. DATE DATA 1H
  218. TIME DATA 1H
  219. DATA 30H
  220. DATA 4APAGE
  221. PAGE DATA 8L
  222. TITLL EQU *-TITL
  223. TITSL EQU TITLL-5 SHORT TITLE LENGTH
  224.  
  225. SBTL DATA 10H RECORD
  226. DATA 10HWORD
  227. DATA 10HDATA FROM
  228. F1NM DATA 20H
  229. DATA 10HDATA FROM
  230. F2NM DATA 10H
  231. DATA 2ALO
  232. DATA 20CGICAL DIFFERENCE
  233. DATA 2L
  234. SBTLL EQU *-SBTL
  235. SBTSL EQU SBTLL-5 SHORT SUBTITLE LENGTH
  236. VERIFY TITLE MAIN PROGRAM.
  237. ** VERIFY - MAIN PROGRAM.
  238.  
  239.  
  240. VERIFY SB1 1 (B1) = 1
  241. RJ PRS PRESET PROGRAM
  242. RECALL F1
  243. RECALL F2
  244. SA3 PW
  245. ZR X3,VFY1 IF TERMINAL FILE
  246. WRITEC O,PD WRITE PRINT DENSITY FORMAT CONTROL
  247. VFY1 BX6 X6-X6 CLEAR EMPTY FILE FLAGS
  248. SX7 B1 INITIALIZE RECORD NUMBER
  249. SA6 F1-EFF
  250. SX0 B0+ INDICATE INITIAL READ
  251. SA6 F2-EFF
  252. SA7 RN
  253. SA6 LEWA CLEAR ERROR LINE RECORD NUMBER
  254. VFY2 SX2 F1 INITIATE READ FUNCTION ON FILE 1
  255. RJ IRF
  256. SX2 F2 INITIATE READ FUNCTION ON FILE 2
  257. RJ IRF
  258. SX7 B0+ CLEAR WORD COUNT
  259. SA7 ER
  260. READW F1,SBF1,BUFL
  261. SX4 X1+B1
  262. ZR X4,VFY3 IF EOF ON FILE 1
  263. SX7 B1+ INDICATE NOT EMPTY FILE
  264. SA7 F1-EFF
  265. VFY3 READW F2,SBF2,BUFL
  266. SA3 F1-RST
  267. SX4 X1+B1
  268. ZR X4,VFY4 IF EOF ON FILE 2
  269. SX7 B1 INDICATE NOT EMPTY FILE
  270. BX4 X1+X3
  271. SA7 F2-EFF
  272. NG X4,VFY4 IF EOF OR EOI ON EITHER FILE
  273. RJ SRM SEND RECORD MESSAGE
  274. RJ CPR COMPARE RECORDS
  275. SA1 RN ADVANCE RECORD NUMBER
  276. SX0 B1 INDICATE NON-INITIAL READ
  277. SX6 X1+B1
  278. SA6 A1
  279. EQ VFY2 CONTINUE RECORD COMPARISONS
  280.  
  281. * PROCESS EXCESS RECORDS OR FILES.
  282.  
  283. VFY4 SA4 EOIF CHECK EOI ENCOUNTERED FLAG
  284. SA0 F2
  285. SX4 X4-F1
  286. SX2 SBF2
  287. ZR X4,VFY6 IF EXTRA FILES ON FILE 2
  288. PL X4,VFY5 IF EXTRA FILES ON FILE 1
  289. BX6 X1*X3
  290. NG X6,VFY7 IF EOF OR EOI ON BOTH FILES
  291. NG X3,VFY6 IF EXTRA RECORDS ON FILE 2
  292. VFY5 SA0 F1
  293. SX2 SBF1
  294. BX1 X3
  295. VFY6 RJ EXR PROCESS EXCESS RECORDS OR FILES
  296.  
  297. * CHECK FOR EOI.
  298.  
  299. VFY7 SA1 F1-RST CHECK FILE STATUS
  300. SA2 F2-RST
  301. SX1 X1+B1
  302. SX2 X2+B1
  303. BX3 X1*X2
  304. BX4 X1+X2
  305. NG X3,VFY11 IF EOI ENCOUNTERED ON BOTH FILES
  306. PL X4,VFY9 IF EOF ENCOUNTERED ON BOTH FILES
  307. SA3 EOIF
  308. NZ X3,VFY9 IF EOI PREVIOUSLY ENCOUNTERED
  309. SX6 F1 SET EOI ENCOUNTERED FLAG
  310. NG X1,VFY8 IF EOI ON FILE 1
  311. SX6 F2
  312. VFY8 SA6 A3
  313. SA1 EXRG BUILD EXCESS FILE LINE
  314. SA2 A1+B1
  315. BX6 X1
  316. SA6 EXRD
  317. LX7 X2
  318. SA7 A6+B1
  319. SA3 =1H CLEAR FILE NUMBER FROM TITLE LINE
  320. BX7 X7-X7 CLEAR SUBTITLE LINE
  321. LX6 X3
  322. SA7 SBTL
  323. SX7 99999 FORCE PAGE EJECT
  324. SA7 LC
  325.  
  326. * CHECK FOR VERIFY COMPLETE.
  327.  
  328. VFY9 RJ EOF PROCESS END OF FILE
  329. SA1 FC
  330. ZR X1,VFY10 IF EMPTY FILE REQUEST
  331. SX2 B1 DECREMENT FILE COUNT
  332. IX6 X1-X2
  333. SA6 A1+
  334. ZR X6,VFY11 IF FILE COUNT EXHAUSTED
  335. EQ VFY1 CONTINUE VERIFY
  336.  
  337. VFY10 SA1 F1-EFF CHECK FOR EMPTY FILE
  338. SA2 F2-EFF
  339. BX1 X1*X2
  340. NZ X1,VFY1 IF NO EMPTY FILE ENCOUNTERED
  341.  
  342. * PROCESS REWIND REQUEST, ISSUE COMPLETION MESSAGE,
  343. * AND END OR ABORT.
  344.  
  345. VFY11 SA1 RW
  346. ZR X1,VFY12 IF NO REWIND
  347. REWIND F1
  348. REWIND F2
  349. VFY12 SA1 EC
  350. NZ X1,VFY14 IF ERRORS DETECTED
  351. MESSAGE (=C* VERIFY GOOD.*)
  352. VFY13 ENDRUN
  353.  
  354. VFY14 WRITER O FLUSH OUTPUT BUFFER
  355. MESSAGE (=C* VERIFY ERRORS.*)
  356. SA1 AB
  357. ZR X1,VFY13 IF ABORT NOT REQUESTED
  358. ABORT
  359. TITLE SUBROUTINES.
  360. CPR SPACE 4,10
  361. ** CPR - COMPARE RECORDS.
  362. *
  363. * ENTRY (F1-RST) = FILE 1 READ STATUS.
  364. * (F2-RST) = FILE 2 READ STATUS.
  365. * (F1-LWD) = LWA+1 DATA IN WORKING BUFFER FOR FILE 1.
  366. * (F2-LWD) = LWA+1 DATA IN WORKING BUFFER FOR FILE 2.
  367. *
  368. * USES A - ALL.
  369. * X - ALL.
  370. *
  371. * CALLS CDD, COD, LEW, WOF.
  372. *
  373. * MACROS READW.
  374.  
  375.  
  376. CPR SUBR ENTRY/EXIT
  377. CPR1 SA4 F1-LWD GET LWA+1 DATA FOR FILE 1
  378. SA5 F2-LWD GET LWA+1 DATA FOR FILE 2
  379. SX4 X4-SBF1 SET WORD COUNT FOR FILE 1
  380. SX5 X5-SBF2 SET WORD COUNT FOR FILE 2
  381. IX6 X4-X5
  382. PL X6,CPR2 IF FILE 2 WORD COUNT .LE. FILE 1
  383. SX5 X4 SET NUMBER OF WORDS TO COMPARE
  384. CPR2 SA6 CPRA SAVE WORD COUNT DIFFERENCE
  385. ZR X5,CPR6 IF NO DATA TO COMPARE
  386. SA0 B0+ INITIALIZE WORD INDEX
  387.  
  388. * COMPARE DATA WORDS.
  389.  
  390. CPR3 SA1 SBF1+A0 COMPARE FILE 1 AND FILE 2 DATA WORDS
  391. SA2 SBF2+A0
  392. BX6 X1-X2
  393. NZ X6,CPR4 IF NO MATCH
  394. PL X6,CPR5 IF MATCH
  395. CPR4 SA6 ER+3 STORE DIFFERENCE
  396. BX7 X2 STORE WORD 2
  397. LX6 X1 STORE WORD 1
  398. SA7 A6-B1
  399. SA6 A7-B1
  400. RJ LEW LIST ERROR WORDS
  401. CPR5 SA1 ER ADVANCE WORD NUMBER
  402. SX2 B1
  403. IX7 X1+X2
  404. SA0 A0+B1 ADVANCE WORD INDEX
  405. IX5 X5-X2 DECREMENT WORD COUNT
  406. SA7 A1
  407. NZ X5,CPR3 IF MORE WORDS TO COMPARE
  408. CPR6 SA5 CPRA GET WORD COUNT DIFFERENCE
  409. NZ X5,CPR7 IF EXCESS WORDS
  410. SA1 F1-RST GET FILE 1 READ STATUS
  411. NZ X1,CPR11 IF EOR/EOF/EOI ENCOUNTERED ON BOTH FILES
  412. READW F1,SBF1,BUFL
  413. READW F2,SBF2,BUFL
  414. EQ CPR1 CONTINUE PROCESSING DATA IN RECORD
  415.  
  416. * PROCESS EXCESS WORDS.
  417.  
  418. CPR7 SX2 F1
  419. SX0 B0+
  420. PL X5,CPR8 IF FILE 1 RECORD LONGER
  421. SX2 F2
  422. BX5 -X5
  423. CPR8 SA1 X2-RST CHECK FILE LAST READ STATUS
  424. NZ X1,CPR10 IF EOR/EOF/EOI ENCOUNTERED
  425. CPR9 IX5 X5+X0 COUNT EXCESS WORDS
  426. READW X2,SBF1,BUFL
  427. SX0 BUFL
  428. ZR X1,CPR9 IF NOT EOR
  429. SX0 B6-SBF1
  430. IX5 X5+X0
  431. CPR10 SA1 X2 SPACE FILL NAME
  432. MX0 42
  433. BX6 X0*X1
  434. SX1 X5 CONVERT WORD COUNT
  435. SA6 CPRE
  436. RJ COD
  437. SA6 CPRD+1
  438. SA1 RN CONVERT RECORD NUMBER
  439. RJ CDD
  440. LX6 30
  441. SA1 EC ADVANCE ERROR COUNT
  442. SA6 CPRD
  443. SX7 X1+B1
  444. SA7 A1
  445. SX2 CPRL
  446. SX1 A6 LIST ERROR LINE
  447. RJ WOF
  448.  
  449. * CHECK FOR NONSTANDARD RECORD COMPARED WITH STANDARD RECORD.
  450.  
  451. CPR11 SA2 F1-RST CHECK FILE 1 LAST READ STATUS
  452. SA3 F2-RST CHECK FILE 2 LAST READ STATUS
  453. MX0 42
  454. BX3 X2-X3
  455. PL X3,CPRX IF MATCHING RECORD STRUCTURE
  456. SA1 F1
  457. SA3 EC
  458. NG X2,CPR12 IF NONSTANDARD RECORD ON FILE 1
  459. SA1 F2
  460. CPR12 BX6 X0*X1 SET FILE NAME IN MESSAGE
  461. SX7 X3+B1 ADVANCE ERROR COUNT
  462. SA6 CPRC
  463. SA7 A3
  464. SA1 RN CONVERT RECORD NUMBER
  465. RJ CDD
  466. LX6 30
  467. SA6 CPRB
  468. SX1 CPRB LIST ERROR LINE
  469. SX2 CPRL
  470. RJ WOF
  471. EQ CPRX RETURN
  472.  
  473.  
  474. CPRA CON 0 WORD COUNT DIFFERENCE
  475.  
  476. CPRB DATA 1H
  477. DATA 1H
  478. DATA 20H EOR MISSING ON
  479. CPRC DATA 1H
  480.  
  481. CPRD DATA 1H
  482. DATA 1H
  483. DATA 20H EXCESS WORD(S) ON
  484. CPRE DATA 1H
  485. CPRL EQU *-CPRD
  486. EOF SPACE 4,10
  487. ** EOF - PROCESS END OF FILE.
  488. *
  489. * USES A - 1, 6, 7.
  490. * X - 1, 6, 7.
  491. *
  492. * CALLS CDD.
  493.  
  494.  
  495. EOF SUBR ENTRY/EXIT
  496. SA1 FN ADVANCE FILE NUMBER
  497. SX6 X1+B1
  498. SA6 A1
  499. SX1 X6 CONVERT NUMBER
  500. RJ CDD
  501. SA1 =10HVERIFYING
  502. LX6 5*6
  503. BX7 X1
  504. SA7 SRMA
  505. SB2 B2-B1 CLEAR BLANK FILL FROM FILE NUMBER
  506. MX7 1
  507. AX7 B2
  508. BX7 X7*X4
  509. SA1 EOIF
  510. SA7 DFN SAVE DISPLAY FILE NUMBER
  511. NZ X1,EOFX IF EOI ENCOUNTERED
  512. SX7 99999 FORCE PAGE EJECT
  513. SA7 LC
  514. EQ EOFX RETURN
  515. EXR SPACE 4,15
  516. ** EXR - PROCESS EXCESS RECORDS.
  517. *
  518. * ENTRY (A0) = FET ADDRESS.
  519. * (X2) = BUFFER ADDRESS.
  520. * (X1) = FILE READ STATUS.
  521. *
  522. * USES A - 1, 2, 3, 4, 6, 7.
  523. * B - 2, 5.
  524. * X - ALL.
  525. *
  526. * CALLS CDD, CIO=, RDA, SFN, SNM, SRT, SYS=, WOF.
  527. *
  528. * MACROS MESSAGE, READ, READW.
  529.  
  530.  
  531. EXR5 SA1 RN
  532. ZR X5,EXR6 IF NO DATA TRANSFERRED
  533. SX1 X1+B1 INCREMENT RECORD COUNT
  534. EXR6 RJ CDD CONVERT RECORD COUNT TO DISPLAY
  535. SA6 EXRC
  536. SA1 A0+ ADD FILE NAME
  537. MX2 42
  538. SX3 1R
  539. BX6 X2*X1
  540. SA4 EOIF
  541. BX6 X6+X3
  542. LX6 -6
  543. SA6 EXRE
  544. ZR X4,EXR7 IF EOI NOT ENCOUNTERED ON EITHER FILE
  545. SA1 EXRH
  546. SA6 EXRF
  547. SA2 A1+B1
  548. BX6 X1
  549. SA6 EXRE
  550. LX7 X2
  551. SA7 A6+B1
  552. SA1 DFN GET DISPLAY CODE FILE NUMBER
  553. SB2 1RZ
  554. SB5 EXRB
  555. RJ SNM ENTER FILE NUMBER INTO MESSAGE
  556. EXR7 SX1 EXRB
  557. SA3 PW
  558. NZ X3,EXR8 IF NOT SHORT FORMAT
  559. SA4 EXRB
  560. MX3 6
  561. BX6 -X3*X4
  562. SA3 =1L
  563. BX6 X3+X6
  564. SA6 A4
  565. EXR8 RJ WOF WRITE EXCESS RECORDS/FILE LINE
  566.  
  567. EXR SUBR ENTRY/EXIT
  568. SA3 EC ADVANCE ERROR COUNT
  569. BX7 X7-X7 CLEAR EXCESS RECORD COUNT
  570. SX6 X3+B1
  571. SA7 RN
  572. SA6 A3
  573. BX5 X5-X5 CLEAR DATA TRANSFERRED FLAG
  574. SX0 B1 SET PREVIOUS EOR FLAG
  575. EQ EXR3 DISPLAY RECORD NAME
  576.  
  577. EXR1 SA4 RN INCREMENT RECORD COUNT
  578. BX5 X5-X5 CLEAR DATA TRANSFERRED FLAG
  579. SX6 X4+B1
  580. SA3 A0-CWF
  581. SA6 A4+
  582. NZ X3,EXR2 IF CONTROL WORDS ENABLED
  583. READ A0
  584. EXR2 READW A0,SBF1,BUFL
  585. SX2 SBF1
  586. EXR3 NG X1,EXR5 IF EOF OR EOI ENCOUNTERED
  587. SB5 X1 SAVE CURRENT READ STATUS
  588. SX5 B1 INDICATE DATA TRANSFERRED
  589. ZR X0,EXR4 IF PREVIOUS READ NOT EOR
  590. SA1 A0-LWD LWA+1 OF DATA READ
  591. RJ SRT SET RECORD TYPE
  592. SA7 EXRA+1
  593. MESSAGE A7-B1,B1 DISPLAY RECORD NAME
  594. EXR4 SX0 B5
  595. ZR X0,EXR2 IF NOT EOR
  596. EQ EXR1 INCREMENT RECORD COUNT
  597.  
  598.  
  599. EXRA DATA 10H READING
  600. CON 0
  601.  
  602. EXRB DATA 10H0 *****
  603. EXRC CON 0
  604. EXRD DATA 20H EXCESS RECORD(S) ON
  605. EXRE CON 0,0
  606. EXRF CON 0
  607.  
  608. EXRG DATA 20H RECORD(S) IN EXCESS
  609. EXRH DATA 20H FILE ZZZZZZZZZZZ ON
  610. IRF SPACE 4,15
  611. ** IRF - INITIATE READ FUNCTION.
  612. *
  613. * IF EOI STATUS IS DETECTED ON THIS FILE, NO FURTHER READ
  614. * FUNCTION IS INITIATED. IF CONTROL WORDS ARE ALLOWED OR IF
  615. * EOF STATUS IS DETECTED, NO FURTHER READ IS INITIATED UNLESS
  616. * AN INITIAL READ IS REQUESTED (INDICATES PREVIOUS EOF HAS
  617. * BEEN PROCESSED).
  618. *
  619. * ENTRY (X2) = FWA FET.
  620. * (X0) = 0, IF INITIAL READ.
  621. *
  622. * USES A - 1, 3, 6.
  623. * X - 1, 3, 6.
  624. *
  625. * CALLS CIO=.
  626.  
  627.  
  628. IRF1 PL X3,IRF2 IF NOT EOF
  629. NZ X0,IRFX IF NOT INITIAL READ
  630. IRF2 READ X2
  631.  
  632. IRF SUBR ENTRY/EXIT
  633. SA3 X2
  634. SA1 X2-CWF CONTROL WORD FLAG
  635. LX3 59-9 CHECK FOR EOI
  636. MX6 1
  637. NG X3,IRFX IF EOI ENCOUNTERED
  638. LX3 59-3-59+9 CHECK FOR EOF
  639. ZR X1,IRF1 IF CONTROL WORDS DISABLED
  640. NZ X0,IRFX IF NOT INITIAL READ
  641. SA6 X2-WRB SET FIRST READ FLAG
  642. READCW X2,17B
  643. EQ IRFX RETURN
  644. LEW SPACE 4,15
  645. ** LEW - LIST ERROR WORDS.
  646. *
  647. * ENTRY (RN) = RECORD NUMBER.
  648. * (ER) = WORD NUMBER.
  649. * (ER+1) = WORD FROM FILE 1.
  650. * (ER+2) = WORD FROM FILE 2.
  651. * (ER+3) = LOGICAL DIFFERENCE.
  652. *
  653. * USES A - 1, 2, 3, 6, 7.
  654. * B - 7.
  655. * X - 1, 2, 3, 4, 6, 7.
  656. *
  657. * CALLS CDD, COD, UPN, UPW, WOF.
  658. *
  659. * MACROS MOVE.
  660.  
  661.  
  662. LEW SUBR ENTRY/EXIT
  663. SA2 EL
  664. SA3 EC
  665. ZR X2,LEW4 IF ERROR LIMIT ZERO
  666. IX6 X3-X2
  667. PL X6,LEWX IF ERROR LIMIT EXCEEDED
  668. SA1 RN CHECK RECORD CHANGE
  669. SA2 LEWA
  670. BX6 X1-X2
  671. ZR X6,LEW3 IF NO CHANGE
  672. BX6 X1
  673. SA6 A2 SET NEW RECORD
  674. SA3 LC CHECK LINE COUNT
  675. SX7 X3+5
  676. SA1 A3+B1 GET LINE LIMIT
  677. IX7 X7-X1
  678. NG X7,LEW1 IF NOT BOTTOM OF PAGE
  679. SX7 99999 FORCE EJECT
  680. SA7 A3
  681. EQ LEW2
  682.  
  683. LEW1 SX1 =C* *
  684. RJ WOF
  685. SX1 =C* *
  686. RJ WOF
  687. LEW2 SA1 SRMB PRINT RECORD NAME
  688. SA2 A1+B1
  689. SA3 =3R
  690. MX4 -18
  691. LX1 18
  692. LX2 18
  693. BX6 X4*X1
  694. IX6 X6+X3
  695. BX7 X4*X2
  696. IX7 X7+X3
  697. SA6 LEWB+3
  698. SA7 LEWB+6
  699. BX6 -X4*X1
  700. BX7 -X4*X2
  701. SA1 TY PRINT TYPE
  702. SA2 A1+B1
  703. SA1 X1+LEWC
  704. SA2 X2+LEWC
  705. IX6 X6+X1
  706. IX7 X7+X2
  707. SA6 A6-B1
  708. SA7 A7-B1
  709. SX1 LEWB
  710. RJ WOF
  711. SX1 =C* *
  712. RJ WOF
  713. LEW3 SA1 RN CONVERT RECORD NUMBER
  714. RJ CDD
  715. SB7 CHAR
  716. RJ UPN
  717. SA1 ER CONVERT WORD NUMBER
  718. RJ COD
  719. SX7 1R
  720. SA7 B7
  721. SA7 A7+B1
  722. SA7 A7+B1
  723. SB7 A7+B1
  724. RJ UPN
  725. SA1 ER+1 UNPACK WORD FROM FILE 1
  726. SA2 TY
  727. RJ UPW
  728. SA1 ER+2 UNPACK WORD FROM FILE 2
  729. SA2 TY+1
  730. SB7 B7-B1
  731. RJ UPW
  732. SX6 B7+
  733. SA6 LEWL SAVE LENGTH OF SHORT LINE
  734. SA1 ER+3 UNPACK LOGICAL DIFFERENCE
  735. SA2 TY+1
  736. RJ UPW
  737. SA1 PW
  738. ZR X1,LEW3.1 IF SHORT LINE
  739. SX6 B7+ RESET LINE LENGTH
  740. SA6 LEWL
  741. LEW3.1 SX1 4
  742. SX2 CHAR+6
  743. SX3 CHAR+11D
  744. MOVE X1,X2,X3 PACK RECORD NUMBER INTO WORD COUNT WORD
  745. SX6 1RB INSERT OCTAL CHARACTER
  746. SX3 CHAR+10D RESET FWA OF LINE
  747. SA6 CHAR+23D
  748. BX1 -X3 LIST LINE
  749. SA2 LEWL
  750. IX2 X2-X3
  751. RJ WOF
  752. LEW4 SA1 EC ADVANCE ERROR COUNT
  753. SA2 EL
  754. SX6 X1+B1
  755. SA6 A1
  756. ZR X2,LEWX IF ZERO ERROR LIMIT
  757. IX7 X6-X2
  758. NG X7,LEWX IF LIMIT NOT REACHED
  759. SX1 =C+ ** ERROR LIMIT EXCEEDED **+
  760. RJ WOF
  761. SX1 =C* *
  762. RJ WOF
  763. EQ LEWX RETURN
  764.  
  765.  
  766. LEWA DATA 0 RECORD NUMBER
  767. LEWB DATA 10H
  768. DATA 10H
  769. DATA 0,0 RECORD NAME 1
  770. DATA 20H
  771. DATA 0,0 RECORD NAME 2
  772.  
  773. LEWC BSS 0
  774. .E ECHO ,RT=("RTMIC")
  775. .A IFC NE,/RT//
  776. VFD 36/0A_RT,24/1L/
  777. .A ELSE
  778. VFD 36/3A ,24/1L/
  779. .A ENDIF
  780. .E ENDD
  781. LEWL CON 0
  782. RDA SPACE 4,20
  783. ** RDA - READ DATA.
  784. * PROCESSES CALLS TO READ WORDS (RDW=).
  785. * DEBLOCKS DATA IF CONTROL WORD READS.
  786. *
  787. * ENTRY (X2) = FWA FET.
  788. * (B6) = FWA WORKING BUFFER.
  789. * (B7) = NUMBER OF WORDS TO TRANSFER.
  790. *
  791. * EXIT (X1) = 0, IF TRANSFER COMPLETE.
  792. * (X1) = -1, IF EOF DETECTED ON FILE.
  793. * (X1) = -2, IF EOI DETECTED ON FILE.
  794. * (X1) = (B6), IF EOR DETECTED BEFORE TRANSFER COMPLETE.
  795. * (B6) = LWA+1 DATA TRANSFERRED TO WORKING BUFFER.
  796. * ((X2)-RST) = (X1).
  797. * ((X2)-LWD) = (B6).
  798. *
  799. * USES A - 1, 3, 4, 6, 7.
  800. * B - 3, 4, 5, 6, 7.
  801. * X - 1, 3, 4, 6, 7.
  802. *
  803. * CALLS RDW=.
  804.  
  805.  
  806. RDA7 SX6 B5-B7 UPDATE WORDS REMAINING
  807. SA6 A1
  808. RDA8 RJ RDW= READ WORDS
  809. SA3 X2-WRB
  810. NZ X3,RDA10 IF MORE WORDS IN BLOCK
  811. RDA9 SA4 X2-UBC
  812. ZR X4,RDA10 IF NO UNUSED BIT COUNT
  813. SB3 X4 CLEAR EXTRANEOUS DATA IN LAST WORD
  814. MX6 1
  815. SB4 B3-B1
  816. AX6 B4
  817. SA3 B6-B1 LAST WORD TRANSFERRED
  818. LX6 B3
  819. BX6 -X6*X3
  820. SA6 A3
  821. RDA10 BX6 X1 SAVE FILE READ STATUS
  822. SX7 B6 SAVE LWA+1 DATA IN WORKING BUFFER
  823. SA6 X2-RST
  824. SA7 X2-LWD
  825.  
  826. RDA SUBR ENTRY/EXIT
  827. SA1 X2-CWF
  828. ZR X1,RDA8 IF CONTROL WORD READ DISABLED
  829. RDA1 SA1 X2-WRB NUMBER OF WORDS BEFORE CONTROL WORD
  830. SB5 X1+
  831. PL X1,RDA2 IF NOT FIRST READ
  832. SX7 B7+ SET WORDS NEEDED
  833. SA7 RDAA
  834. JP RDA4
  835.  
  836. RDA2 GE B5,B7,RDA7 IF ENOUGH DATA TO FILL BUFFER
  837. SA3 X2-ERF CHECK EOR FLAG
  838. PL X3,RDA3 IF NOT EOR ON FILE
  839. MX6 1 SET NEW READ FLAG
  840. SB7 B5+B1 SET WORDS TO READ
  841. SA6 A3
  842. SA6 A1
  843. RJ RDW= READ WORDS
  844. SA1 B6-B1 CHECK CONTROL WORD
  845. AX1 48
  846. SX6 X1-17B
  847. MX1 -1
  848. SB6 B6-B1 BACK UP LAST WORD ADDRESS
  849. ZR X6,RDA10 IF *EOF* CONTROL WORD
  850. SX1 B6 SET *EOR* INDICATION
  851. EQ RDA9 CLEAR EXTRANEOUS DATA IN LAST DATA WORD
  852.  
  853. RDA3 SX6 B7-B5 SAVE ADDITIONAL WORDS NEEDED
  854. SA6 RDAA
  855. SB7 B5+B1 SET WORDS TO TRANSFER
  856. RJ RDW= READ WORDS
  857. SB6 B6-1 BACK UP OVER LAST CONTROL WORD
  858. RDA4 SB7 B1 READ CONTROL WORD
  859. RJ RDW=
  860. NG X1,RDA10 IF EOF/EOI ENCOUNTERED
  861. SB6 B6-B1 BACK UP WORKING BUFFER
  862. SA1 B6 CONTROL WORD
  863.  
  864. * FOR MASS STORAGE AND WORD BOUNDARY FORMAT TAPES (ALL EXCEPT
  865. * S, L, AND F FORMATS), UNUSED BIT COUNT IN CONTROL WORD HEADER
  866. * IS ASSUMED ZERO AND BYTE COUNT SHOULD BE A MULTIPLE OF 5.
  867.  
  868. MX3 -24
  869. BX7 -X3*X1 BYTE COUNT
  870. SX3 4
  871. LX4 X7
  872. IX7 X7+X3 ROUND UP BYTE COUNT
  873. SX3 X3+B1
  874. IX7 X7/X3 WORD COUNT
  875. MX3 -6
  876. SA7 X2-WRB
  877. LX1 -24
  878. BX6 -X3*X1 UNUSED BIT COUNT (BASED ON BYTE)
  879. SX3 5
  880. IX3 X7*X3
  881. IX4 X3-X4 UNUSED BYTES
  882. ZR X4,RDA5 IF NO EXTRANEOUS DATA BYTES
  883. SX3 12
  884. IX3 X4*X3
  885. IX6 X3+X6
  886. RDA5 SA6 X2-UBC STORE UNUSED BIT COUNT
  887. LX4 X6
  888. SX6 -B1 INDICATE EOR
  889. NZ X4,RDA6 IF EXTRANEOUS DATA IN LAST WORD
  890. SA3 X2-SLF
  891. LX1 -12
  892. NZ X3,RDA6 IF S, L, OR F TAPE
  893. SX1 X1 PRU SIZE
  894. IX6 X7-X1 NO EOR IF FULL BLOCK
  895. RDA6 SA6 X2-ERF SAVE EOR FLAG
  896. SA1 RDAA RESET WORDS NEEDED
  897. SB7 X1
  898. EQ RDA1 LOOP
  899.  
  900.  
  901. RDAA CON 0
  902. SRM SPACE 4,10
  903. ** SRM - SEND RECORD MESSAGE.
  904. *
  905. * ENTRY (F1-LWD) = LWA+1 OF DATA IN FILE 1 BUFFER.
  906. * (F2-LWD) = LWA+1 OF DATA IN FILE 2 BUFFER.
  907. *
  908. * USES A - 1, 6.
  909. * X - 1, 2, 6.
  910. *
  911. * CALLS SFN, SRT, SYS=.
  912.  
  913.  
  914. SRM SUBR ENTRY/EXIT
  915. SA1 F1-LWD LWA+1 OF DATA IN FILE 1
  916. SX2 SBF1
  917. RJ SRT SET RECORD TYPE
  918. SA6 TY
  919. BX1 X7
  920. RJ SFN SPACE FILL NAME
  921. SA6 SRMB
  922. SA1 F2-LWD LWA+1 OF DATA IN FILE 2
  923. SX2 SBF2
  924. RJ SRT SET RECORD TYPE
  925. SA6 TY+1
  926. BX1 X7
  927. RJ SFN SPACE FILL NAME
  928. SA6 SRMB+1
  929. SA1 EC
  930. ZR X1,SRM1 IF NO ERRORS
  931. SA1 =0LERRORS.
  932. BX6 X1
  933. SA6 SRMC
  934. SRM1 MESSAGE SRMA,1
  935. EQ SRMX RETURN
  936.  
  937.  
  938. SRMA DATA 10HVERIFYING
  939. SRMB DATA 0,0
  940. SRMC DATA 0
  941. UPN SPACE 4,10
  942. ** UPN - UNPACK NAME.
  943. *
  944. * ENTRY (X6) = NAME LEFT JUSTIFIED.
  945. * (B7) = CHARACTER ADDRESS.
  946. *
  947. * EXIT (B7) ADVANCED.
  948. *
  949. * USES A - 7.
  950. * B - 2, 7.
  951. * X - 1, 6, 7.
  952.  
  953.  
  954. UPN SUBR ENTRY/EXIT
  955. MX1 60-6
  956. SB2 B7+10
  957. LX6 6
  958. UPN1 BX7 -X1*X6
  959. ZR B7,UPNX IF END OF NAME
  960. SA7 B7
  961. SB7 B7+B1
  962. LX6 6
  963. NE B7,B2,UPN1 LOOP FOR 10 CHARACTERS
  964. EQ UPNX RETURN
  965. UPW SPACE 4,15
  966. ** UPW - UNPACK WORD.
  967. *
  968. * ENTRY (X1) = WORD.
  969. * (B7) = CHARACTER ADDRESS.
  970. * (X2) = RECORD TYPE.
  971. *
  972. * EXIT (B7) ADVANCED.
  973. *
  974. * USES A - 7.
  975. * B - 2, 4, 5, 7.
  976. * X - 0, 1, 2, 7.
  977.  
  978.  
  979. UPW SUBR ENTRY/EXIT
  980. SB2 X2
  981. SX2 UPWA
  982. LX2 48
  983. LX2 X2,B2
  984. SB5 4
  985. SB4 5
  986. PL X2,UPW1 IF TEXT TYPE
  987. SB5 B4
  988. SB4 B4-B1
  989. UPW1 SX7 1R
  990. SX7 1R
  991. MX0 60-3
  992. SA7 B7
  993. SA7 A7+B1
  994. SA7 A7+B1
  995. SA7 A7+B1
  996. SA7 A7+B1
  997. UPW2 SB2 B5
  998. UPW3 LX1 3
  999. SB2 B2-B1
  1000. BX2 -X0*X1 CONVERT DIGIT
  1001. SX7 X2+1R0
  1002. SA7 A7+B1 STORE CHARACTER
  1003. NZ B2,UPW3 IF MORE DIGITS
  1004. SX7 1R
  1005. SB4 B4-B1
  1006. SA7 A7+B1 SPACE
  1007. NZ B4,UPW2 IF MORE BYTES
  1008. SB2 B5-4
  1009. ZR B2,UPW4 IF 5 GROUPS OF 4
  1010. SA7 A7+B1 SPACE
  1011. UPW4 SB7 A7+B1 ADVANCE CHARACTER ADDRESS
  1012. EQ UPWX RETURN
  1013.  
  1014.  
  1015. UPWA EQURT (RLRT,OVRT,ABRT),12
  1016. WOF SPACE 4,15
  1017. ** WOF - WRITE LINE TO OUTPUT.
  1018. *
  1019. * ENTRY (X1) = FWA LINE.
  1020. * IF (X1) < 0, LINE IS *S* FORMAT.
  1021. * OTHERWISE LINE IS *C* FORMAT.
  1022. * (X2) = WORD COUNT.
  1023. *
  1024. * USES A - 1, 2, 3, 4, 6, 7.
  1025. * X - 1, 2, 3, 4, 6, 7.
  1026. * B - 7.
  1027. *
  1028. * CALLS CDD.
  1029. *
  1030. * MACROS WRITEC, WRITES, WRITEW.
  1031.  
  1032.  
  1033. WOF4 BX1 -X1
  1034. WRITES O,X1,X2
  1035.  
  1036. WOF SUBR ENTRY/EXIT
  1037. SA4 EL
  1038. ZR X4,WOFX IF ERROR LIMIT
  1039. SA3 LC ADVANCE LINE COUNT
  1040. SX6 X3+B1
  1041. SA6 A3
  1042. SA4 A3+B1 GET PAGE LENGTH
  1043. IX7 X6-X4
  1044. NG X7,WOF3 IF BOTTOM OF PAGE NOT REACHED
  1045. BX6 X1 SAVE REQUEST
  1046. LX7 X2
  1047. SA6 WOFA
  1048. SA7 A6+B1
  1049. SA1 PN ADVANCE PAGE NUMBER
  1050. SX7 X1+B1
  1051. SX6 3
  1052. SA6 A3
  1053. SA7 A1
  1054. RJ CDD CONVERT PAGE NUMBER
  1055. MX1 48
  1056. LX6 18 STORE PAGE NUMBER
  1057. BX6 X1*X6
  1058. SA6 PAGE
  1059. SA3 PW
  1060. ZR X3,WOF1 IF SHORT PAGE FORMAT
  1061. WRITEW O,(=1H1),1
  1062. WRITEC X2,TITL WRITE TITLE LINE
  1063. WRITEC X2,SBTL WRITE SUBTITLE LINE
  1064. WRITEW X2,(=1L ),1 WRITE BLANK LINE
  1065. EQ WOF2 RESTORE REQUEST
  1066.  
  1067. WOF1 SA3 PN
  1068. SB7 X3-2
  1069. NZ B7,WOF2 IF TITLE NOT ISSUED
  1070. WRITEW O,(=1L ),1 WRITE BLANK LINE
  1071. WRITEW X2,TITL,TITSL WRITE SHORT TITLE
  1072. WRITEC X2,(=C* *)
  1073. WRITEW X2,SBTL,SBTSL WRITE SHORT SUBTITLE
  1074. WRITEC X2,(=C* *)
  1075. WOF2 SA1 WOFA RESTORE REQUEST
  1076. SA2 A1+B1
  1077. WOF3 NG X1,WOF4 IF *S* FORMAT
  1078. WRITEC O,X1,X2
  1079. EQ WOFX RETURN
  1080.  
  1081.  
  1082. WOFA DATA 0,0
  1083. SPACE 4,10
  1084. ** COMMON DECKS.
  1085.  
  1086.  
  1087. *CALL COMCCDD
  1088. *CALL COMCCIO
  1089. *CALL COMCCOD
  1090. *CALL COMCMVE
  1091. *CALL COMCRDW
  1092. *CALL COMCSFN
  1093. *CALL COMCSNM
  1094. *CALL COMCSRT
  1095. *CALL COMCSYS
  1096. *CALL COMCWTC
  1097. *CALL COMCWTS
  1098. *CALL COMCWTW
  1099. SPACE 4,10
  1100. ** BUFFERS.
  1101.  
  1102.  
  1103. USE //
  1104. SEG
  1105. OBUF BSS 0 OUTPUT FILE CIO BUFFER
  1106. CHAR EQU OBUF+OBUFL CHARACTER STRING BUFFER
  1107. SBF1 EQU CHAR+136 FILE 1 WORKING BUFFER
  1108. SBF2 EQU SBF1+BUFL+1 FILE 2 WORKING BUFFER
  1109. BUF1 EQU SBF2+BUFL FILE 1 CIO BUFFER
  1110. BUF2 EQU BUF1+FBUFL FILE 2 CIO BUFFER
  1111. RFL= EQU BUF2+FBUFL+4 FIELD LENGTH
  1112. TITLE PRESET.
  1113. PRS SPACE 4,10
  1114. ** PRS - PROCESS ARGUMENTS.
  1115. *
  1116. * ENTRY NONE
  1117. *
  1118. * EXIT (PW) .EQ. ZERO IF SMALL PAGE WIDTH
  1119. * .NE. ZERO IF STANDARD PAGE WIDTH.
  1120. *
  1121. * USES A - ALL.
  1122. * B - 4, 5, 7.
  1123. * X - ALL.
  1124. *
  1125. * CALLS ARG, CBS, CDT, DXB, PCM, RLF, SFN, STF.
  1126. *
  1127. * MACROS CLOCK, DATE, GETPP, MEMORY, MESSAGE, REWIND.
  1128.  
  1129.  
  1130. PRS SUBR ENTRY/EXIT
  1131. DATE DATE
  1132. CLOCK TIME
  1133. MEMORY ,,,RFL= SET FIELD LENGTH
  1134. SA1 ACTR CHECK ARGUMENT COUNT
  1135. SB4 X1
  1136. MX0 42
  1137. ZR B4,PRS3 IF NO ARGUMENTS
  1138. SA4 ARGR
  1139. BX7 X0*X4
  1140. SB4 B4-B1
  1141. SX2 3
  1142. ZR X7,PRS1 IF FIRST ARGUMENT NULL
  1143. IX7 X7+X2
  1144. SA7 F1
  1145. PRS1 ZR B4,PRS3 IF END OF ARGUMENTS
  1146. SA4 A4+B1
  1147. BX7 X0*X4
  1148. ZR X7,PRS2 IF SECOND ARGUMENT NULL
  1149. IX7 X7+X2
  1150. SA7 F2
  1151. PRS2 SB4 B4-B1
  1152. ZR B4,PRS3 IF END OF ARGUMENTS
  1153. SA4 A4+B1 CONVERT SPECIAL ARGUMENTS
  1154. SB5 PRSA
  1155. RJ ARG
  1156. NZ X1,PER2 IF ARGUMENT ERROR
  1157. PRS3 SA5 FC CHECK FILE COUNT
  1158. SB7 B1+ DECIMAL CONVERSION
  1159. RJ DXB
  1160. SA6 FC STORE VALUE
  1161. NZ X4,PER2 IF ASSEMBLY ERROR
  1162. SA1 O
  1163. SX6 B1
  1164. SX2 A1
  1165. ZR X1,PRS4 IF NO FILE NAME IN FET
  1166. RJ STF SET TERMINAL FILE
  1167. PRS4 SA6 PW SET PAGE WIDTH
  1168. GETPP *,LL,PD GET PAGE SIZE PARAMETERS
  1169. SA5 EL CONVERT ERROR LIMIT
  1170. RJ DXB
  1171. SA6 EL STORE VALUE
  1172. NZ X4,PER2 IF ASSEMBLY ERROR
  1173. RJ PCM PROCESS CODED MODE PARAMETER
  1174. SA1 F1 COMPARE FILE NAMES
  1175. SA2 F2
  1176. MX0 42
  1177. BX1 X0*X1
  1178. SA3 O
  1179. BX2 X0*X2
  1180. IX6 X1-X2
  1181. SX5 PERB * VERIFY FILE NAME CONFLICT - LFN.*
  1182. ZR X6,PER3 IF FILE 1 = FILE 2
  1183. BX3 X0*X3
  1184. IX4 X3-X1
  1185. BX7 X3-X2
  1186. ZR X4,PER3 IF O = FILE 1
  1187. BX0 X1
  1188. LX1 X2
  1189. ZR X7,PER3 IF O = FILE 2
  1190. RJ SFN SPACE FILL FILE NAMES
  1191. SA6 F2NM
  1192. BX1 X0
  1193. RJ SFN
  1194. SA1 PRSG SET POINTER TO OUTPUT FET
  1195. SA6 F1NM
  1196. BX7 X1
  1197. MX6 0
  1198. SA7 B1+B1
  1199. SA6 A7+B1
  1200. SA0 F1
  1201. RJ CDT CHECK IF CONTROL WORDS ALLOWED ON FILE 1
  1202. SA0 F2
  1203. RJ CDT CHECK IF CONTROL WORDS ALLOWED ON FILE 2
  1204. RJ CBS CHECK BLOCK SIZE
  1205. RJ RLF RFL UP FOR LARGE L AND F TAPES
  1206. SA1 RW
  1207. ZR X1,PRS5 IF REWIND NOT REQUESTED
  1208. REWIND F1
  1209. REWIND F2
  1210. PRS5 SA1 F1-SLF
  1211. SA2 F2-SLF
  1212. BX3 X1+X2
  1213. ZR X3,PRSX IF NO S, L, OR F TAPES
  1214. BX3 X1-X2
  1215. ZR X3,PRSX IF FILES HAVE SAME FORMAT
  1216. MESSAGE PRSH,3 ISSUE VERIFY NOT GUARANTEED WARNING
  1217. EQ PRSX RETURN
  1218.  
  1219.  
  1220. PRSA BSS 0 CONTROL CARD ARGUMENT EQUIVALENCE TABLE
  1221. L ARG O,O ERROR LIMIT FILE
  1222. N ARG PRSD,FC FILE COUNT
  1223. E ARG PRSE,EL ERROR LIMIT
  1224. R ARG -PRSF,RW REWIND
  1225. A ARG -PRSF,AB ABORT ON ERROR
  1226. C ARG -PRSB,CM CODED MODE ON BOTH FILES
  1227. C1 ARG -PRSF,CM CODED MODE ON FIRST FILE ONLY
  1228. C2 ARG -PRSC,CM CODED MODE ON SECOND FILE ONLY
  1229. BS ARG PRSE,BS BLOCK SIZE
  1230. ARG
  1231.  
  1232. PRSB CON -1
  1233. PRSC CON 2
  1234. PRSD CON 0L999999
  1235. PRSE CON 0L0
  1236. PRSF CON 1
  1237. PRSG CON 0LOUTPUT+O
  1238. PRSH DATA C* FILE STRUCTURES NOT COMPATIBLE.*
  1239. CBL SPACE 4,10
  1240. ** CBL - CALCULATE BUFFER LENGTH.
  1241. *
  1242. * ENTRY (A0) = FWA FET.
  1243. * ((A0)+6) = PRU SIZE, IF S OR L FORMAT TAPE.
  1244. * ((A0)+8) = PRU SIZE, IF F FORMAT TAPE.
  1245. *
  1246. * EXIT (X6) = DESIRED BUFFER LENGTH.
  1247. * (B3) .LT. 0, IF BUFFER LENGTH CHANGE REQUIRED.
  1248. *
  1249. * USES A - 1.
  1250. * B - 2, 3.
  1251. * X - 1, 2, 3, 6.
  1252.  
  1253.  
  1254. CBL SUBR ENTRY/EXIT
  1255. SA1 A0-SLF S, L, OR F TAPE INDICATOR
  1256. SX6 FBUFL DEFAULT BUFFER LENGTH
  1257. SB2 X1
  1258. SB3 B1
  1259. SX3 3
  1260. SA1 A0+6 GET S/L TAPE MAXIMUM BLOCK SIZE
  1261. GT B2,B1,CBL1 IF L TAPE
  1262. PL B2,CBLX IF NOT F TAPE
  1263. SA1 A0+8 GET F TAPE PRU SIZE
  1264. CBL1 IX2 X1+X3 ALLOW FOR CONTROL WORDS
  1265. LX2 1 PRU SIZE * 2
  1266. IX3 X6-X2
  1267. PL X3,CBLX IF CALCULATED BUFFER LENGTH .LE. DEFAULT
  1268. BX6 X2
  1269. SB3 -B1
  1270. EQ CBLX RETURN
  1271. CBS SPACE 4,15
  1272. ** CBS - CHECK BLOCK SIZE.
  1273. *
  1274. * EXIT BS PARAMETER VERIFIED, PRU SIZE SET IN MLRS FIELD OF
  1275. * S AND L TAPE FET(S).
  1276. * TO PER2, IF ERROR ENCOUNTERED.
  1277. *
  1278. * USES A - 0, 1, 2, 5, 6.
  1279. * B - 2, 7.
  1280. * X - 1, 2, 5, 6.
  1281. *
  1282. * CALLS DXB, SPS.
  1283.  
  1284.  
  1285. CBS SUBR ENTRY/EXIT
  1286. SA5 BS CONVERT BLOCK SIZE
  1287. SX1 X5
  1288. SB7 B1
  1289. NZ X1,CBS2 IF BS NOT SPECIFIED
  1290. RJ DXB
  1291. SA6 BS
  1292. NZ X4,PER2 IF ASSEMBLY ERROR
  1293. ZR X6,PER2 IF BS=0 SPECIFIED
  1294. SA1 F1-SLF
  1295. SA2 F2-SLF
  1296. SB3 X1
  1297. SB4 X2
  1298. GT B3,CBS1 IF S OR L TAPE
  1299. LE B4,PER2 IF BS PARAMETER NOT ALLOWED
  1300. CBS1 SX2 X6-MSPS-1
  1301. NG X2,CBS2 IF BS .LE. MAXIMUM S TAPE PRU SIZE
  1302. GT B3,B1,CBS2 IF FILE 1 IS L TAPE
  1303. LE B4,B1,PER2 IF FILE 2 IS NOT L TAPE
  1304. CBS2 SA0 F1
  1305. RJ SPS SET FILE 1 PRU SIZE IF S OR L TAPE
  1306. SA0 F2
  1307. RJ SPS SET FILE 2 PRU SIZE IF S OR L TAPE
  1308. EQ CBSX RETURN
  1309. CDT SPACE 4,15
  1310. ** CDT - CHECK DEVICE TYPE.
  1311. *
  1312. * ENTRY (A0) = FWA FET.
  1313. *
  1314. * EXIT CONTROL WORD FLAG AND S, L, OR F TAPE INDICATOR
  1315. * SET APPROPRIATELY FOR THIS FILE.
  1316. * OPTICAL DISK FET EXTENSION INITIALIZED, IF APPLICABLE.
  1317. * WARNING MESSAGE ISSUED IF FILE NOT FOUND.
  1318. * ((A0)+8) = PRU SIZE, IF F FORMAT TAPE.
  1319. *
  1320. * USES A - 1, 2, 3, 6, 7.
  1321. * B - 2, 3, 5.
  1322. * X - 0, 1, 2, 3, 6, 7.
  1323. *
  1324. * CALLS SNM.
  1325. *
  1326. * MACROS FILINFO, MESSAGE, OPEN.
  1327.  
  1328.  
  1329. CDT4 OPEN A0,READNR,R CHECK FOR TERMINAL FILE
  1330. SA3 A0+B1 GET DEVICE TYPE
  1331. MX2 -11
  1332. LX3 12
  1333. BX3 -X2*X3
  1334. SX7 X3-2RTT
  1335. ZR X7,CDTX IF TERMINAL FILE
  1336. SA1 A0 GET FILE NAME
  1337. SB5 -CDTA * FILE NOT FOUND - LFN.*
  1338. BX1 X0*X1
  1339. SB3 CDTB MESSAGE ASSEMBLY AREA
  1340. SB2 1RX SET REPLACEMENT CHARACTER
  1341. RJ SNM SET NAME IN MESSAGE
  1342. MESSAGE CDTB,3 ISSUE WARNING MESSAGE
  1343. CDT5 SX7 B1+ ENABLE CONTROL WORDS
  1344. SA7 A0-CWF
  1345.  
  1346. CDT SUBR ENTRY/EXIT
  1347. SA1 A0 SET FILE NAME IN PARAMETER BLOCK
  1348. MX0 42
  1349. SA2 CDTC
  1350. BX1 X0*X1
  1351. SX2 X2
  1352. BX6 X1+X2
  1353. SA6 A2
  1354. FILINFO CDTC GET FILE INFORMATION
  1355. SA1 CDTC+1 GET DEVICE TYPE AND STATUS
  1356. ZR X1,CDT4 IF FILE NOT FOUND
  1357. BX3 X1
  1358. AX3 48
  1359. SX2 X3-2ROD OPTICAL DISK DEVICE TYPE
  1360. NZ X2,CDT1 IF NOT OD DEVICE
  1361. SX7 FETODL OD FET EXTENSION LENGTH
  1362. SX2 A0+12B BUILD POINTER TO FET EXTENSION
  1363. LX7 18
  1364. BX7 X2+X7
  1365. SA7 A0+11B STORE POINTER AND LENGTH
  1366. OPEN A0,READNR,R
  1367. EQ CDT5 ENABLE CONTROL WORDS
  1368.  
  1369. CDT1 LX1 59-15
  1370. NG X1,CDT5 IF FILE ON MASS STORAGE
  1371. LX1 59-24-59+15
  1372. PL X1,CDTX IF FILE NOT ON TAPE
  1373. CDT2 SA1 CDTC+FIPBL GET TAPE FORMAT
  1374. MX0 -6
  1375. LX1 -6
  1376. SX7 B1
  1377. BX1 -X0*X1
  1378. SX2 X1-/MTX/TFS
  1379. ZR X2,CDT3 IF S TAPE
  1380. SX2 X1-/MTX/TFL
  1381. SX7 B1+B1
  1382. ZR X2,CDT3 IF L TAPE
  1383. SX7 -B1
  1384. SX2 X1-/MTX/TFF
  1385. NZ X2,CDT5 IF NOT F TAPE
  1386. SA3 A1+B1 GET BLOCK SIZE
  1387. LX3 -24
  1388. SX6 X3+
  1389. SA6 A0+8
  1390. CDT3 SA7 A0-SLF SET S/L/F TAPE INDICATOR
  1391. EQ CDT5 SET CONTROL WORD FLAG
  1392.  
  1393.  
  1394. CDTA DATA C* FILE NOT FOUND - XXXXXXX.*
  1395. CDTAL EQU *-CDTA
  1396.  
  1397. CDTB BSS CDTAL MESSAGE BUFFER
  1398.  
  1399. CDTC VFD 42/0,6/CDTCL,12/1 *FILINFO* PARAMETER BLOCK
  1400. BSS FIPBL-1
  1401. CON FMTK TAPE FORMAT KEYWORD
  1402. CON BSZK TAPE BLOCK SIZE KEYWORD
  1403. CDTCL EQU *-CDTC
  1404. PCM SPACE 4,10
  1405. ** PCM - PROCESS CODED MODE PARAMETER.
  1406. *
  1407. * EXIT CODED MODE SET ON FIRST, SECOND, OR BOTH FILES,
  1408. * IF REQUESTED.
  1409. *
  1410. * USES A - 1, 2, 6.
  1411. * B - 2.
  1412. * X - 1, 2, 6.
  1413.  
  1414.  
  1415. PCM SUBR ENTRY/EXIT
  1416. SA2 CM
  1417. ZR X2,PCMX IF CODED MODE NOT REQUESTED
  1418. SB2 X2
  1419. SX2 B1+B1
  1420. GT B2,B1,PCM1 IF SECOND FILE ONLY
  1421. SA1 F1 SET CODED MODE ON FIRST FILE
  1422. BX6 -X2*X1
  1423. SA6 A1
  1424. PCM1 EQ B2,B1,PCMX IF FIRST FILE ONLY
  1425. SA1 F2 SET CODED MODE ON SECOND FILE
  1426. BX6 -X2*X1
  1427. SA6 A1
  1428. EQ PCMX RETURN
  1429. PER SPACE 4,10
  1430. ** PER - PRESET ERROR PROCESSOR.
  1431. *
  1432. * ENTRY (X5) = FWA MESSAGE, IF ENTRY AT PER1 OR PER3.
  1433. * (X1) = FILE NAME, IF ENTRY AT PER3.
  1434.  
  1435.  
  1436. PER3 SB5 X5 SET NAME IN MESSAGE
  1437. SB2 1RX
  1438. RJ SNM
  1439. EQ PER1 ISSUE ERROR MESSAGE
  1440.  
  1441. PER2 SX5 PERA * VERIFY ARGUMENT ERROR.*
  1442. PER1 MESSAGE X5,,R
  1443. PER ABORT
  1444.  
  1445.  
  1446. PERA DATA C* VERIFY ARGUMENT ERROR.*
  1447. PERB DATA C* VERIFY FILE NAME CONFLICT - XXXXXXX.*
  1448. PERC DATA C* VERIFY FL ABOVE USER LIMIT.*
  1449. RLF SPACE 4,25
  1450. ** RLF - RFL UP FOR LARGE L AND F TAPES.
  1451. *
  1452. * IF L OR F TAPE(S) TO BE VERIFIED, CALCULATE REQUIRED FL,
  1453. * RFL UP, AND RESET CIO BUFFER POINTERS IN FETS.
  1454. * 1. FOR L TAPE FILES, USE MLRS VALUE AS MAXIMUM BLOCK SIZE.
  1455. * FOR F TAPE FILES, USE BLOCK SIZE SAVED IN FET+8.
  1456. * 2. GET CURRENT MAXIMUM FL (MAXFL) VIA MEMORY MACRO.
  1457. * 3. FOR EACH L OR F TAPE, BUFFER LENGTH = MAXIMUM(FBUFL,
  1458. * 2*BLOCK SIZE).
  1459. * 4. IF FL REQUIREMENTS EXCEED MINIMUM(MAXFL,MFLF), SET EACH
  1460. * L OR F TAPE BUFFER LENGTH = BLOCK SIZE.
  1461. * 5. IF FL REQUIREMENTS EXCEED MAXFL, ABORT WITH * VERIFY
  1462. * FL ABOVE USER LIMIT.*.
  1463. *
  1464. * EXIT FIELD LENGTH INCREASED AS NECESSARY FOR L AND F TAPES.
  1465. * TO PER1, IF FIELD LENGTH ERROR.
  1466. *
  1467. * USES A - 0, 1, 2, 5, 6, 7.
  1468. * B - 3, 4.
  1469. * X - ALL.
  1470. *
  1471. * CALLS CBL, SYS=.
  1472.  
  1473.  
  1474. RLF SUBR ENTRY/EXIT
  1475. SA0 F1
  1476. RJ CBL CALCULATE FILE 1 BUFFER LENGTH
  1477. SA6 RLFA
  1478. SA0 F2
  1479. SB4 B3 SAVE BUFFER LENGTH CHANGE INDICATOR
  1480. RJ CBL CALCULATE FILE 2 BUFFER LENGTH
  1481. SA6 RLFB
  1482. SX0 MFLF MAXIMUM FIELD LENGTH FACTOR
  1483. NG B4,RLF1 IF FILE 1 BUFFER LENGTH CHANGE REQUIRED
  1484. PL B3,RLFX IF NO BUFFER LENGTH CHANGE ON FILE 2
  1485. RLF1 MEMORY CM,STAT,R GET CURRENT MAXIMUM FL
  1486. SA5 STAT
  1487. AX5 30 CURRENT MAXIMUM FL (MAXFL)
  1488. IX1 X5-X0
  1489. PL X1,RLF2 IF MAXFL .GE. MFLF
  1490. BX0 X5
  1491. RLF2 SA1 RLFA CALCULATE REQUIRED FL
  1492. SX4 X1+BUF1
  1493. SA2 RLFB
  1494. IX4 X4+X2
  1495. IX3 X0-X4
  1496. PL X3,RLF4 IF REQUIRED FL .LE. MINIMUM(MAXFL,MFLF)
  1497. PL B4,RLF3 IF NO BUFFER LENGTH CHANGE ON FILE 1
  1498. AX6 X1,B1 SET BUFFER LENGTH = BLOCK SIZE
  1499. SA6 A1
  1500. RLF3 PL B3,RLF4 IF NO BUFFER LENGTH CHANGE ON FILE 2
  1501. AX6 X2,B1
  1502. SA6 A2
  1503. RLF4 SA1 RLFA CALCULATE REQUIRED FL
  1504. SX3 X1+BUF1
  1505. SA2 A1+B1
  1506. IX4 X3+X2
  1507. SX6 X4+2
  1508. IX2 X5-X6
  1509. LX6 30
  1510. SX5 PERC *VERIFY FL ABOVE USER LIMIT.*
  1511. SA6 STAT
  1512. NG X2,PER1 IF REQUIRED FL .GT. MAXFL
  1513.  
  1514. * INCREASE FIELD LENGTH AS NECESSARY FOR L AND F TAPES AND
  1515. * RESET CIO BUFFER POINTERS IN FETS.
  1516.  
  1517. MEMORY CM,STAT,R
  1518. SA1 F1+4 RESET CIO BUFFER POINTERS
  1519. MX0 42
  1520. BX6 X0*X1
  1521. SA2 F2+1
  1522. BX6 X6+X3
  1523. SA6 A1 FILE 1 LIMIT
  1524. BX7 X0*X2
  1525. LX6 X3
  1526. BX7 X7+X3
  1527. SA6 A2+B1 FILE 2 IN
  1528. SA7 A2 FILE 2 FIRST
  1529. SA6 A6+B1 FILE 2 OUT
  1530. SA1 A6+B1
  1531. BX7 X0*X1
  1532. BX7 X7+X4
  1533. SA7 A1 FILE 2 LIMIT
  1534. EQ RLFX RETURN
  1535.  
  1536.  
  1537. RLFA CON 0 FILE 1 BUFFER LENGTH
  1538. RLFB CON 0 FILE 2 BUFFER LENGTH
  1539. SPS SPACE 4,10
  1540. ** SPS - SET PRU SIZE.
  1541. *
  1542. * ENTRY (A0) = FWA FET.
  1543. *
  1544. * EXIT PRU SIZE SET IN MLRS FIELD OF FET IF S OR L TAPE.
  1545. * TO PER2, IF ERROR ENCOUNTERED.
  1546. *
  1547. * USES A - 1, 2, 6.
  1548. * B - 2.
  1549. * X - 1, 2, 3, 6.
  1550.  
  1551.  
  1552. SPS SUBR ENTRY/EXIT
  1553. SA1 A0-SLF S, L, OR F TAPE INDICATOR
  1554. SA2 BS BLOCK SIZE PARAMETER VALUE
  1555. SX3 MSPS MAXIMUM S TAPE PRU SIZE
  1556. SB2 X1
  1557. IX3 X3-X2
  1558. LE B2,SPSX IF NOT S OR L TAPE
  1559. SX6 DLPS DEFAULT L TAPE PRU SIZE
  1560. GT B2,B1,SPS1 IF L TAPE
  1561. SX6 DSPS DEFAULT S TAPE PRU SIZE
  1562. NG X2,SPS2 IF BS PARAMETER NOT SPECIFIED
  1563. NG X3,SPS2 IF BLOCK SIZE EXCEEDS MAXIMUM S PRU SIZE
  1564. SPS1 NG X2,SPS2 IF BS PARAMETER NOT SPECIFIED
  1565. BX6 X2
  1566. SPS2 SA6 A0+6 SET MLRS FIELD OF FET
  1567. EQ SPSX RETURN
  1568. SPACE 4,10
  1569. ** PRESET DATA STORAGE.
  1570.  
  1571.  
  1572. BS CON -1 MAXIMUM BLOCK SIZE
  1573. CM CON 0 CODED MODE
  1574. STAT VFD 30/-1,30/0 FIELD LENGTH STATUS WORD
  1575. SPACE 4,10
  1576. ** COMMON DECKS.
  1577.  
  1578.  
  1579. *CALL COMCARG
  1580. *CALL COMCCPM
  1581. *CALL COMCDXB
  1582. *CALL COMCLFM
  1583. *CALL COMCSTF
  1584. SPACE 4
  1585. END