Table of Contents

SECHDR

Table Of Contents

  • [00008] SECHDR - WRITE SECURITY HEADERS.
  • [00012] WRITE SECURITY HEADERS.
  • [00079] FETS AND RESERVED LOCATIONS.
  • [00131] MAIN PROGRAM.
  • [00158] SUBROUTINES.
  • [00160] BCF - BACKCOPY FILE.
  • [00208] BPP - BANNER PAGE PROCESSOR.
  • [00291] CBP - CREATE BANNER PAGE.
  • [00322] CLC - CHECK LINE COUNT.
  • [00460] HFF - OUTPUT HEAD AND FOOT SECURITY LINES FOR A
  • [00556] HFU - OUTPUT HEAD AND FOOT SECURITY LINES FOR AN
  • [00683] RCC - REMOVE CARRIAGE CONTROL CHARACTER.
  • [00703] SBP - SKIP TO BOTTOM OF PAGE.
  • [00722] WBP - WRITE BANNER PAGE.
  • [00757] BUFFER AREA.
  • [00787] PRESET.
  • [00789] PRS - PRESET.

Source Code

SECHDR.txt
  1. IDENT SECHDR,FWA
  2. ABS
  3. SST
  4. ENTRY SECHDR
  5. ENTRY RFL=
  6. ENTRY SSJ=
  7. SYSCOM B1
  8. TITLE SECHDR - WRITE SECURITY HEADERS.
  9. *COMMENT SECHDR - WRITE SECURITY HEADERS.
  10. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  11. SPACE 4,10
  12. *** SECHDR - WRITE SECURITY HEADERS.
  13. *
  14. * P. J. ENGLE. 82/09/01.
  15. * J. HOLLISTER 83/06/21.
  16. SPACE 4,10
  17. *** *SECHDR* WRITES SECURITY BANNER AND/OR PAGE HEADING
  18. * AND FOOTING INFORMATION ON THE NAMED FILE.
  19. SPACE 4,10
  20. *** COMMAND FORMAT.
  21. *
  22. * SECHDR,LFN,FF,OP=BFRP.
  23. *
  24. * LFN = NAME OF THE FILE TO WHICH SECURITY INFORMATION
  25. * IS TO BE ADDED.
  26. *
  27. * FF = THE FILE IS ALREADY FORMATTED FOR OUTPUT.
  28. *
  29. * THE FOLLOWING OPTIONS ARE VALID -
  30. *
  31. * B = PRINT A BANNER PAGE AT THE BEGINNING AND END OF
  32. * EACH LOGICAL UNIT AS SPECIFIED BY THE *F* OR *R*
  33. * OPTION. IF NEITHER THE *F* NOR THE *R* OPTION IS
  34. * SPECIFIED, BANNER PAGES WILL BE PRINTED AT THE
  35. * BEGINNING AND END OF INFORMATION OF THE FILE. THIS
  36. * OPTION IS SELECTED BY DEFAULT.
  37. *
  38. * F = USE LOGICAL FILES AS BANNER PAGE UNIT.
  39. *
  40. * R = USE LOGICAL RECORDS AS BANNER PAGE UNIT.
  41. *
  42. * P = PRINT PAGE HEADINGS AND FOOTINGS ON EACH PAGE
  43. * OF OUTPUT. THIS OPTION IS DESELECTED BY DEFAULT.
  44. SPACE 4,10
  45. *** DAYFILE MESSAGES.
  46. *
  47. * * ERROR IN SECHDR PARAMETERS.* = *SECHDR* HAS ENCOUNTERED
  48. * AN UNKNOWN PARAMETER.
  49. *
  50. * * NNNNN LINES TRUNCATED.* = INFORMATIVE MESSAGE INDICATING
  51. * NNNNN LINES HAD TO BE TRUNCATED WHEN FORMATTING THE FILE.
  52. *
  53. * * NO FILE NAME SPECIFIED.* = *SECHDR* HAS FOUND THAT NO
  54. * FILE NAME WAS SPECIFIED ON THE COMMAND CALL.
  55. *
  56. * * UNABLE TO PROCESS TERMINAL FILE.* = THE SPECIFIED FILE IS
  57. * ASSIGNED TO A TERMINAL.
  58. *
  59. * * UNKNOWN OPTION - X.* = *SECHDR* HAS ENCOUNTERED AN UNKNOWN
  60. * OPTION.
  61. SPACE 4,10
  62. * COMMON DECKS.
  63.  
  64.  
  65. *CALL COMCMAC
  66. *CALL COMCCMD
  67. *CALL COMSMLS
  68. *CALL COMSPFM
  69. SPACE 4,10
  70. **** ASSEMBLY CONSTANTS.
  71.  
  72.  
  73. SSJ= EQU 0
  74. FBUFL EQU 1001B FILE BUFFER LENGTH
  75. SBUFL EQU 1001B SCRATCH BUFFER LENGTH
  76. WBUFL EQU 140D WORKING BUFFER LENGTH
  77. ****
  78. SPACE 4,10
  79. TITLE FETS AND RESERVED LOCATIONS.
  80. ORG 126B
  81. SPACE 4,10
  82. FWA BSS 0
  83.  
  84. * FETS.
  85.  
  86.  
  87. F BSS 0 LOCAL FILE
  88. SECFILE FILEB FBUF,FBUFL,FET=7
  89.  
  90. S BSS 0 SCRATCH FILE
  91. ZZZZZG1 FILEB SBUF,SBUFL,FET=7
  92. SPACE 4,10
  93. * GLOBAL STORAGE.
  94.  
  95.  
  96. ALVL CON 0 ACCESS LEVEL NAME
  97. BCFL CON 0 BACKCOPY FLAG
  98. BLKL CON 1L BLANK LINE
  99. BOPL CON 1L2 BOTTOM OF PAGE LINE
  100. BPBL CON 0 LENGTH OF ACCESS LEVEL NAME BUFFER
  101. BUNT CON 1 BANNER UNIT
  102. EPWH CON 0 EMPTY PAGE WITH HEADER FLAG
  103. FORM CON 0 FORMATTED FILE
  104. LCNT CON 0 LINES REMAINING
  105. LNPG CON 0 LINES/PAGE
  106. LTCT CON 0 LINES TRUNCATED COUNT
  107. PDEN CON 0 PRINT DENSITY
  108. POPT CON 0 PAGE HEAD/FOOT OPTION
  109.  
  110.  
  111. * PAGE HEADING/FOOTING.
  112.  
  113.  
  114. FOOT DATA 1L PAGE FOOTING
  115. DATA 40H XXXXXXX XXXXXXX
  116. DATA 50H XXXXXXX XXXXXXX
  117. DATA 40HXXXXXX XXXXXXX
  118. CON 0
  119. DATA 1L
  120. FOOTL EQU *-FOOT PAGE FOOTING LENGTH
  121.  
  122. HEAD DATA 1L1 PAGE HEADING
  123. DATA 40H XXXXXXX XXXXXXX
  124. DATA 50H XXXXXXX XXXXXXX
  125. DATA 40HXXXXXX XXXXXXX
  126. CON 0
  127. DATA 1L
  128. HEADL EQU *-HEAD PAGE HEADING LENGTH
  129.  
  130. SHFL EQU 6 SECURITY HEADING/FOOTING LINE COUNT
  131. TITLE MAIN PROGRAM.
  132. SPACE 4,10
  133. * MAIN PROGRAM.
  134.  
  135.  
  136. SECHDR SB1 1
  137. RJ PRS PRESET
  138. WRITEC S,PDEN WRITE PRINT DENSITY CONTROL
  139. SA1 BUNT
  140. SX1 X1-1
  141. PL X1,SEC1 IF NO BANNER PAGE TO BE WRITTEN
  142. RJ CBP CREATE BANNER PAGE
  143. RJ WBP WRITE BANNER PAGE
  144. SX0 B0+ SET DATA READ
  145. SEC1 SA1 POPT
  146. ZR X1,SEC3 IF HEAD/FOOT OPTION NOT SET
  147. SA1 FORM CHECK IF FILE FORMATTED
  148. ZR X1,SEC2 IF FILE NOT FORMATTED
  149. RJ HFF HEAD/FOOT PROCESSOR FOR FORMATTED FILE
  150. EQ SEC4 BACKCOPY FILE
  151.  
  152. SEC2 RJ HFU HEAD/FOOT PROCESSOR FOR UNFORMATTED FILE
  153. EQ SEC4 BACKCOPY FILE
  154.  
  155. SEC3 RJ BPP BANNER PAGE PROCESSOR
  156. SEC4 RJ BCF BACKCOPY FILE
  157. ENDRUN
  158. TITLE SUBROUTINES.
  159. BCF SPACE 4,10
  160. ** BCF - BACKCOPY FILE.
  161. *
  162. * ENTRY (BCFL) = BACKCOPY FLAG.
  163. *
  164. * USES X - 1.
  165. * A - 1.
  166. *
  167. * MACROS READ, READW, RECALL, RENAME, RETURN, REWIND, WRITEF,
  168. * WRITER, WRITEW.
  169.  
  170.  
  171. BCF SUBR ENTRY/EXIT
  172. REWIND F
  173. REWIND S
  174. SA1 BCFL GET BACKCOPY FLAG
  175. NZ X1,BCF6 IF BACKCOPY NOT REQUIRED
  176. BCF1 READ S
  177. RECALL F
  178. BCF2 READW S,WBUF,WBUFL
  179. ZR X1,BCF3 IF TRANSFER COMPLETE
  180. NG X1,BCF4 IF EOF OR EOI
  181.  
  182. * EOR ENCOUNTERED.
  183.  
  184. WRITEW F,WBUF,X1-WBUF WRITE LAST PORTION OF RECORD
  185. WRITER F
  186. EQ BCF1 READ NEXT RECORD
  187.  
  188. BCF3 WRITEW F,WBUF,WBUFL
  189. EQ BCF2 TRANSFER MORE DATA
  190.  
  191. BCF4 SX1 X1+1
  192. NG X1,BCF5 IF EOI ENCOUNTERED
  193.  
  194. * EOF ENCOUNTERED.
  195.  
  196. WRITEF F
  197. EQ BCF1 READ NEXT RECORD
  198.  
  199. * EOI ENCOUNTERED.
  200.  
  201. BCF5 RETURN S RETURN SCRATCH FILE
  202. REWIND F REWIND FILE
  203. EQ BCFX RETURN
  204.  
  205. BCF6 RENAME S,F
  206. EQ BCFX RETURN
  207. BPP SPACE 4,15
  208. ** BPP - BANNER PAGE PROCESSOR.
  209. *
  210. * ENTRY (BUNT) = BANNER UNIT VALUE.
  211. * (X0) = 0 (DATA READ FLAG).
  212. *
  213. * USES X - 0, 1, 2, 5, 6, 7.
  214. * A - 1, 2, 5, 6, 7.
  215. *
  216. * CALLS CLC, WBP.
  217. *
  218. * MACROS READ, READS, RECALL, WRITEC, WRITEF, WRITER, WRITES.
  219. *
  220. * DEFINE (X0) = 0 IF DATA READ.
  221. * = -1 IF NO DATA (EOR).
  222. * = -2 IF NO DATA (EOF).
  223.  
  224. BPP SUBR ENTRY/EXIT
  225.  
  226. * READ FILE.
  227.  
  228. BPP1 SX7 1R1 SET NEW PAGE FOR UNFORMATTED FILE
  229. SA7 WBUFS
  230. SA1 LNPG FORCE NEW PAGE
  231. BX6 X1
  232. SA6 LCNT
  233. READ F
  234. RECALL S
  235. BPP2 READS F,WBUF,WBUFL
  236. ZR X1,BPP3 IF TRANSFER COMPLETE
  237. SA5 BUNT GET BANNER UNIT
  238. SX5 X5+B1
  239. NG X1,BPP6 IF EOF OR EOI
  240.  
  241. * EOR ENCOUNTERED.
  242.  
  243. WRITER S
  244. SX0 B0+ SET DATA (EOR) READ
  245. SX1 X5-1
  246. NG X1,BPP1 IF BANNER UNIT NOT RECORD
  247. RJ WBP WRITE BANNER PAGE
  248. SX0 -1 SET NO DATA (EOR)
  249. EQ BPP1 READ NEXT RECORD
  250.  
  251. * WRITE FILE LINE
  252.  
  253. BPP3 SA2 FORM
  254. SA1 WBUFS+X2 GET FIRST CHARACTER IN LINE
  255. BX0 X0-X0 SET DATA READ
  256. LX1 -6 LEFT JUSTIFY CHARACTER
  257. RJ CLC CHECK LINE COUNT
  258. NG X2,BPP2 IF LINE SHOULD NOT BE WRITTEN
  259. NZ X2,BPP5 IF NOT END OF PAGE
  260. ZR X4,BPP5 IF LINE ALREADY HAS PAGE EJECT
  261. BPP4 WRITEC S,BOPL SKIP TO BOTTOM OF PAGE
  262. BPP5 SA1 FORM FORMAT OUTPUT IF FILE UNFORMATTED
  263. SX1 X1+WBUFS
  264. WRITES S,X1,WBUFL
  265. SX6 1R RESET FIRST CHARACTER BLANK
  266. SA6 WBUFS
  267. EQ BPP2 TRANSFER MORE DATA
  268.  
  269. BPP6 SX1 X1+1
  270. NG X1,BPP9 IF EOI ENCOUNTERED
  271.  
  272. * EOF ENCOUNTERED.
  273.  
  274. WRITEF S
  275. ZR X5,BPP7 IF BANNER UNIT FILE
  276. SX1 X5-1
  277. NZ X1,BPP8 IF BANNER UNIT NOT RECORD
  278. SX1 X0+1
  279. ZR X1,BPP8 IF NO DATA (EOR)
  280. BPP7 RJ WBP WRITE BANNER PAGE
  281. BPP8 SX0 -2 SET NO DATA (EOF)
  282. EQ BPP1 READ NEXT RECORD
  283.  
  284. * EOI ENCOUNTERED.
  285.  
  286. BPP9 NG X5,BPP10 IF BANNER AT BOI/EOI
  287. NG X0,BPPX IF NO DATA READ SINCE LAST BANNER WRITTEN
  288. BPP10 RJ WBP WRITE BANNER PAGE
  289. EQ BPPX
  290. CBP SPACE 4,15
  291. ** CBP - CREATE BANNER PAGE.
  292. *
  293. * EXIT (BPBL) = LENGTH OF ACCESS LEVEL NAME BUFFER.
  294. *
  295. * USES X - 0, 1, 2, 4, 6.
  296. * A - 1, 2, 4, 6.
  297. * B - 2.
  298. *
  299. * CALLS BAN.
  300. *
  301. * MACROS DATE, USERNUM.
  302.  
  303.  
  304. CBP SUBR ENTRY/EXIT
  305. SA1 F GET FILE NAME
  306. MX0 42
  307. BX6 X0*X1
  308. SA6 BPBA+2
  309. DATE BPBB+2 GET CURRENT DATE
  310. SA1 BPBB+2 REMOVE LEADING SPACE
  311. SB2 6
  312. LX6 X1,B2
  313. SA6 A1
  314. USERNUM BPBC+2 GET USER NAME
  315. SA4 ALVL GET ACCESS LEVEL NAME
  316. SA2 BPB2
  317. RJ BAN ENCODE BANNER MESSAGE
  318. SX6 A2-BPB2 STORE LENGTH OF ACCESS LEVEL NAME BUFFER
  319. SA6 BPBL
  320. EQ CBPX RETURN
  321. CLC SPACE 4,15
  322. ** CLC - CHECK LINE COUNT.
  323. *
  324. * ENTRY (X1) = FIRST CHARACTER OF LINE, LEFT JUSTIFIED.
  325. *
  326. * EXIT (X2) = 1, IF NOT END OF PAGE.
  327. * = 0, IF END OF PAGE.
  328. * = -1, IF LINE SHOULD NOT BE PRINTED.
  329. * (X7) = LINES LEFT ON PAGE.
  330. * (X5) = 0, IF PAGE EMPTY BEFORE READING THIS LINE.
  331. * (X4) = 0, IF CHARACTER IS PAGE EJECT.
  332. * = 1, IF CHARACTER IS NOT PAGE EJECT.
  333. *
  334. * USES X - 1, 2, 3, 4, 5, 6, 7.
  335. * A - 1, 2, 3, 4, 5, 6, 7.
  336. * B - 2.
  337. *
  338. * CALLS RCC, SBP.
  339. *
  340. * MACROS WRITEW.
  341.  
  342.  
  343. CLC10 SX3 1 FORCE LINE INCREMENT OF ONE
  344. CLC11 SA4 LCNT UPDATE LINE COUNT
  345. IX7 X4-X3
  346. SA7 A4
  347. SX2 B1+ SET NOT END OF PAGE
  348. PL X7,CLC13 IF NOT END OF PAGE
  349. CLC12 SA2 LNPG RESET LINE COUNT
  350. IX6 X2-X3
  351. IX7 X7+X3 RESET LINES REMAINING ON PAGE
  352. SA6 LCNT
  353. SX2 B0+ SET END OF PAGE
  354. CLC13 SX4 B1+ SET NOT PAGE EJECT
  355. SA5 CLCA SET PAGE EMPTY STATUS
  356.  
  357. CLC SUBR
  358. SA2 LNPG SAVE PAGE EMPTY STATUS
  359. SA3 LCNT
  360. SA4 EPWH
  361. IX6 X2-X3
  362. IX6 X4+X6 ADD *EMPTY PAGE WITH HEADER* FLAG
  363. SA6 CLCA
  364. BX7 X7-X7 CLEAR FLAG
  365. SA7 A4
  366. MX6 6
  367. SA3 BLKL CHECK FOR CARRIAGE CONTROL
  368. BX3 X1-X3
  369. ZR X3,CLC10 IF NO CARRIAGE CONTROL
  370. SB2 TCCCL-1
  371. CLC1 SA3 TCCC+B2 SEARCH FOR CARRIAGE CONTROL CHARACTER
  372. BX4 X6*X3
  373. BX7 X4-X1
  374. ZR X7,CLC2 IF CHARACTER FOUND
  375. SB2 B2-1
  376. PL B2,CLC1 IF MORE TABLE TO SEARCH
  377. EQ CLC10 IGNORE UNKNOWN CARRIAGE CONTROL CHARACTER
  378.  
  379. CLC2 SX3 X3 EXTRACT LINE COUNT
  380. SX2 -B1
  381. NG X3,CLCX IF LINE TO BE IGNORED
  382. SA1 LNPG SET PAGE EMPTY STATUS
  383. SA2 LCNT
  384. LX4 6
  385. SA5 CLCA
  386. SX7 X4-1R2
  387. ZR X7,CLC6 IF CARRIAGE CONTROL IS *2*
  388. SX7 X4-1R/
  389. ZR X7,CLC9 IF CARRIAGE CONTROL IS */*
  390. SX7 X4-1R1
  391. NZ X7,CLC11 IF CARRIAGE CONTROL IS NOT *1*
  392.  
  393. * PROCESS PAGE EJECT.
  394.  
  395. CLC3 BX7 X2 SET LINES LEFT ON PAGE
  396. IX6 X1-X3 UPDATE LINE COUNT
  397. SA6 LCNT
  398. SA1 POPT
  399. ZR X1,CLC4 IF CARRIAGE CONTROL SHOULD BE LEFT ON
  400. RJ RCC REMOVE CARRIAGE CONTROL CHARACTER
  401. CLC4 SX2 B0+ SET END OF PAGE
  402. NZ X5,CLC5 IF PAGE NOT EMPTY
  403. SX2 B1 SET NOT END OF PAGE
  404. CLC5 BX4 X4-X4 SET PAGE EJECT
  405. EQ CLCX RETURN
  406.  
  407. * PROCESS SKIP TO BOTTOM OF PAGE.
  408.  
  409. CLC6 SA3 POPT
  410. NZ X3,CLC7 IF CARRIAGE CONTROL SHOULD BE REMOVED
  411. BX7 X1 RESET LINE COUNT
  412. SA7 LCNT
  413. SX2 B1 SET NOT END OF PAGE
  414. EQ CLC13 SET NOT PAGE EJECT
  415.  
  416. CLC7 SX7 X2-1
  417. NZ X5,CLC8 IF PAGE NOT EMPTY
  418. WRITEW S,HEAD,HEADL WRITE HEADER
  419. SA1 LNPG
  420. SX7 X1-1
  421. CLC8 RJ SBP SKIP TO BOTTOM OF PAGE
  422. RJ RCC REMOVE CARRIAGE CONTROL CHARACTER
  423. BX7 X7-X7 SET PAGE AT LAST LINE
  424. SA7 LCNT
  425. SX2 B1 SET NOT END OF PAGE
  426. SX5 B1 INSURE NO HEADER WRITTEN
  427. SX4 B1 SET NOT PAGE EJECT
  428. EQ CLCX RETURN
  429.  
  430. * PROCESS SUPPRESS CARRIAGE ADVANCE AFTER PRINTING.
  431.  
  432. CLC9 NZ X2,CLC11 IF NOT END OF PAGE
  433. SX7 B0+
  434. SX6 B1 SET *EMPTY PAGE WITH HEADER* FLAG
  435. SA6 EPWH
  436. EQ CLC12 FORCE END OF PAGE
  437.  
  438.  
  439. CLCA CON 0 PAGE EMPTY STATUS
  440. TCCC SPACE 4,10
  441. ** TABLE OF CARRIAGE CONTROL CHARACTERS.
  442. *
  443. *T,TCCC 6/ CC,36/ 0,18/ LC
  444. *
  445. * CC = CHARACTER.
  446. * LC = LINE COUNT TO ADD.
  447.  
  448.  
  449. TCCC BSS 0
  450. VFD 6/1L/,36/0,18/0
  451. VFD 6/1L2,36/0,18/0
  452. VFD 6/1L+,36/0,18/0
  453. VFD 6/1L-,36/0,18/3
  454. VFD 6/1L0,36/0,18/2
  455. VFD 6/1LS,36/0,18/-1
  456. VFD 6/1LT,36/0,18/-1
  457. VFD 6/1L1,36/0,18/1
  458. TCCCL EQU *-TCCC
  459. HFF SPACE 4,20
  460. ** HFF - OUTPUT HEAD AND FOOT SECURITY LINES FOR A
  461. * FORMATTED FILE.
  462. *
  463. * ENTRY (BUNT) = BANNER UNIT VALUE.
  464. * (X0) = 0 (DATA READ).
  465. *
  466. * USES X - 0, 1, 2, 5, 6, 7.
  467. * A - 1, 2, 6.
  468. *
  469. * CALLS CLC, SBP, WBP.
  470. *
  471. * MACROS READ, READC, RECALL, WRITEC, WRITEF, WRITER, WRITEW.
  472. *
  473. * DEFINE (X0) = 0 IF DATA READ.
  474. * = -1 IF NO DATA (EOR).
  475. * = -2 IF NO DATA (EOF).
  476.  
  477.  
  478. HFF SUBR ENTRY/EXIT
  479.  
  480. * READ FILE.
  481.  
  482. HFF1 SA1 LNPG FORCE NEW PAGE
  483. BX6 X1
  484. BX7 X7-X7
  485. SA6 LCNT
  486. SA7 EPWH CLEAR EMPTY PAGE WITH HEADER FLAG
  487. READ F
  488. RECALL S
  489.  
  490. * READ FILE LINE.
  491.  
  492. HFF2 READC F,WBUF,WBUFL
  493. ZR X1,HFF4 IF TRANSFER COMPLETE
  494. NG X1,HFF8 IF EOF OR EOI
  495.  
  496. * END OF RECORD ENCOUNTERED.
  497.  
  498. SA2 LCNT ENSURE FOOTING AT BOTTOM OF PAGE
  499. SA1 LNPG
  500. IX1 X1-X2
  501. NZ X1,HFF3 IF HEADING ALREADY WRITTEN
  502. SA1 EPWH
  503. NZ X1,HFF3 IF HEADING ALREADY WRITTEN
  504. WRITEW S,HEAD,HEADL WRITE HEADING
  505. SA2 LNPG
  506. HFF3 BX7 X2
  507. RJ SBP SKIP TO BOTTOM OF PAGE
  508. WRITEW S,FOOT,FOOTL WRITE FOOTING
  509. WRITER S
  510. SX0 B0+ SET DATA (EOR) READ
  511. SA1 BUNT
  512. NZ X1,HFF1 IF BANNER UNIT NOT RECORD
  513. RJ WBP WRITE BANNER PAGE
  514. SX0 -1 SET NO DATA
  515. EQ HFF1 READ NEXT RECORD
  516.  
  517. * WRITE FILE LINE.
  518.  
  519. HFF4 SX0 B0+ SET DATA READ
  520. SA1 WBUF GET FIRST CHARACTER IN LINE
  521. MX2 6
  522. BX1 X2*X1
  523. RJ CLC CHECK LINE COUNT
  524. NG X2,HFF2 IF LINE SHOULD BE SKIPPED
  525. ZR X5,HFF6 IF HEADING NOT ALREADY WRITTEN
  526. NZ X2,HFF7 IF NOT END OF PAGE
  527. RJ SBP SKIP TO BOTTOM OF PAGE
  528. WRITEW S,FOOT,FOOTL WRITE FOOTING
  529. HFF6 WRITEW S,HEAD,HEADL WRITE HEADING
  530. HFF7 WRITEC S,WBUF WRITE DATA LINE
  531. EQ HFF2 READ NEXT LINE
  532.  
  533. HFF8 SX1 X1+1
  534. NG X1,HFF11 IF EOI ENCOUNTERED
  535. WRITEF S
  536. SA1 BUNT
  537. SX1 X1+1
  538. ZR X1,HFF9 IF BANNER UNIT FILE
  539. SX1 X1-1
  540. NZ X1,HFF10 IF BANNER UNIT NOT RECORD
  541. SX1 X0+1
  542. ZR X1,HFF10
  543. HFF9 RJ WBP WRITE BANNER PAGE
  544. HFF10 SX0 -2 SET NO DATA (EOF)
  545. EQ HFF1 READ NEXT RECORD
  546.  
  547. HFF11 SA1 BUNT
  548. SX2 X1+2
  549. ZR X2,HFF12 IF BANNER AT BOI/EOI
  550. NG X0,HFFX IF NO DATA READ SINCE LAST BANNER WRITTEN
  551. SX2 X1-1
  552. ZR X2,HFFX IF BANNER NOT TO BE WRITTEN
  553. HFF12 RJ WBP WRITE BANNER PAGE
  554. EQ HFFX RETURN
  555. HFU SPACE 4,20
  556. ** HFU - OUTPUT HEAD AND FOOT SECURITY LINES FOR AN
  557. * UNFORMATTED FILE.
  558. *
  559. * ENTRY (BUNT) = BANNER UNIT VALUE.
  560. *
  561. * USES X - 0, 1, 2, 3, 5, 6, 7.
  562. * A - 1, 2, 3, 5, 6, 7.
  563. * B - 2, 5, 7.
  564. *
  565. * CALLS CDD, SBP, SNM, WBP.
  566. *
  567. * MACROS MESSAGE, READ, READS, RECALL, WRITEF, WRITER, WRITES,
  568. * WRITEW.
  569. *
  570. * DEFINE (X0) = 0 IF DATA READ.
  571. * = -1 IF NO DATA (EOR).
  572. * = -2 IF NO DATA (EOF).
  573.  
  574.  
  575. HFU SUBR ENTRY/EXIT
  576. SX6 1R ENSURE FIRST CHARACTER BLANK
  577. SA6 WBUFS
  578.  
  579. * READ FILE.
  580.  
  581. HFU1 SA1 LNPG FORCE NEW PAGE
  582. BX6 X1
  583. BX7 X7-X7
  584. SA6 LCNT
  585. SA7 EPWH CLEAR EMPTY PAGE WITH HEADER FLAG
  586. READ F
  587. RECALL S
  588.  
  589. * READ FILE LINE.
  590.  
  591. HFU2 READS F,WBUF,WBUFL
  592. ZR X1,HFU4 IF TRANSFER COMPLETE
  593. NG X1,HFU8 IF EOF OR EOI
  594.  
  595. * EOR ENCOUNTERED.
  596.  
  597. SA2 LCNT ENSURE FOOTING AT BOTTOM PAGE
  598. SA1 LNPG
  599. IX1 X1-X2
  600. NZ X1,HFU3 IF HEADING ALREADY WRITTEN
  601. SA1 EPWH
  602. NZ X1,HFU3 IF HEADING ALREADY WRITTEN
  603. WRITEW S,HEAD,HEADL WRITE HEADING
  604. SA2 LNPG
  605. HFU3 BX7 X2
  606. RJ SBP SKIP TO BOTTOM OF PAGE
  607. WRITEW S,FOOT,FOOTL WRITE FOOTING
  608. WRITER S
  609. SX0 B0+ SET DATA (EOR) READ
  610. SA1 BUNT
  611. NZ X1,HFU1 IF NO BANNER PAGE
  612. RJ WBP WRITE BANNER PAGE
  613. SX0 -1 SET NO DATA
  614. EQ HFU1 READ NEXT RECORD
  615.  
  616. * WRITE FILE LINE.
  617.  
  618. HFU4 SX0 B0+ SET DATA READ
  619. SB7 WBUF+WBUFL LWA+1 OF BUFFER
  620. NE B6,B7,HFU5 IF BUFFER NOT FULL
  621. SA1 LTCT INCREMENT TRUNCATION COUNT
  622. SX3 B1
  623. IX7 X1+X3
  624. SA7 A1+
  625. HFU5 SA5 LCNT
  626. SA2 LNPG
  627. IX2 X5-X2
  628. ZR X2,HFU6 IF HEADING NOT WRITTEN YET
  629. NZ X5,HFU7 IF NOT END OF PAGE
  630. WRITEW S,FOOT,FOOTL WRITE FOOTING
  631. SA5 LNPG RESET LINE COUNT
  632. HFU6 WRITEW S,HEAD,HEADL WRITE HEADING
  633. HFU7 WRITES S,WBUFS,WBUFL WRITE DATA LINE
  634. SX7 X5-1 UPDATE LINE COUNT
  635. SA7 LCNT
  636. EQ HFU2 READ NEXT LINE
  637.  
  638. HFU8 SX1 X1+1
  639. NG X1,HFU11 IF EOI ENCOUNTERED
  640. WRITEF S
  641. SA1 BUNT
  642. SX1 X1+1
  643. ZR X1,HFU9 IF BANNER UNIT FILE
  644. SX1 X1-1
  645. NZ X1,HFU10 IF BANNER UNIT NOT RECORD
  646. SX1 X0+1
  647. ZR X1,HFU10 IF NO DATA (EOR)
  648. HFU9 RJ WBP WRITE BANNER PAGE
  649. HFU10 SX0 -2 SET NO DATA (EOF)
  650. EQ HFU1 READ NEXT RECORD
  651.  
  652. HFU11 SA1 BUNT
  653. SX2 X1+2
  654. ZR X2,HFU12 IF BANNER AT BOI/EOI
  655. NG X0,HFU13 IF NO DATA READ SINCE LAST BANNER WRITTEN
  656. SX2 X1-1
  657. ZR X2,HFU13 IF BANNER NOT TO BE WRITTEN
  658. HFU12 RJ WBP WRITE BANNER PAGE
  659.  
  660. * ISSUE LINES TRUNCATED MESSAGE.
  661.  
  662. HFU13 SA1 LTCT GET TRUNCATION COUNT
  663. ZR X1,HFUX IF NO LINES TRUNCATED
  664. SX5 HFUA
  665. SX2 X1-1
  666. ZR X2,HFU14 IF ONE LINE TRUNCATED
  667. SX5 HFUB
  668. RJ CDD CONVERT TO DECIMAL DISPLAY CODE
  669. MX1 1 ENTER COUNT IN MESSAGE
  670. SB2 B2-B1
  671. AX1 B2
  672. BX1 X1*X4
  673. SB2 1RX
  674. SB5 X5+
  675. RJ SNM SET LINE COUNT IN MESSAGE
  676. HFU14 MESSAGE X5,3 ISSUE LINES TRUNCATED MESSAGE
  677. EQ HFUX RETURN
  678.  
  679.  
  680. HFUA DATA C* 1 LINE TRUNCATED.*
  681. HFUB DATA C* XXXXXXXXXX LINES TRUNCATED.*
  682. RCC SPACE 4,10
  683. ** RCC - REMOVE CARRIAGE CONTROL CHARACTER.
  684. *
  685. * ENTRY (WBUF) = LINE OF FILE.
  686. *
  687. * EXIT CARRIAGE CONTROL (FIRST CHARACTER) REMOVED
  688. * FROM SPECIFIED LINE OF FILE.
  689. *
  690. * USES X - 1, 2, 4, 6.
  691. * A - 1, 4, 6.
  692.  
  693.  
  694. RCC SUBR ENTRY/EXIT
  695. SA1 WBUF REMOVE CARRIAGE CONTROL
  696. MX2 6
  697. BX1 -X2*X1
  698. SA4 BLKL FILL HOLE WITH BLANK
  699. BX6 X1+X4
  700. SA6 A1
  701. EQ RCCX RETURN
  702. SBP SPACE 4,10
  703. ** SBP - SKIP TO BOTTOM OF PAGE.
  704. *
  705. * ENTRY (X7) = NUMBER OF BLANK LINES TO WRITE.
  706. *
  707. * USES X - 7.
  708. * B - 7.
  709. *
  710. * MACROS WRITEC.
  711.  
  712.  
  713. SBP SUBR ENTRY/EXIT
  714. SB7 X7 NUMBER OF BLANK LINES TO WRITE
  715. SX7 X7-1
  716. NG X7,SBPX IF NO BLANK LINES NEEDED
  717. SBP1 WRITEC S,BLKL WRITE BLANK LINE
  718. SB7 B7-1
  719. NZ B7,SBP1 IF MORE LINES TO WRITE
  720. EQ SBPX RETURN
  721. WBP SPACE 4,10
  722. ** WBP - WRITE BANNER PAGE.
  723. *
  724. * USES X - 1.
  725. * A - 1.
  726. *
  727. * MACROS WRITER, WRITEW.
  728.  
  729.  
  730. WBP SUBR ENTRY/EXIT
  731. WRITEW S,BPB1,BPB1L
  732. SA1 BPBL GET BUFFER LENGTH
  733. WRITEW S,BPB2,X1
  734. WRITER S
  735. EQ WBPX RETURN
  736. SPACE 4,10
  737. * COMMON DECKS.
  738.  
  739.  
  740. *CALL COMCARG
  741. *CALL COMCBAN
  742. *CALL COMCCDD
  743. *CALL COMCCIO
  744. *CALL COMCCPM
  745. *CALL COMCLFM
  746. *CALL COMCRDC
  747. *CALL COMCRDS
  748. *CALL COMCRDW
  749. *CALL COMCSFN
  750. *CALL COMCSNM
  751. *CALL COMCSYS
  752. *CALL COMCWTC
  753. *CALL COMCWTS
  754. *CALL COMCWTW
  755. *CALL COMCVLC
  756. *CALL COMTBAN
  757. TITLE BUFFER AREA.
  758. SPACE 4,10
  759. * BUFFERS.
  760.  
  761. USE LITERALS
  762.  
  763.  
  764. BPB1 BSS 0 BANNER PAGE HEADER BUFFER
  765. DATA 40H1
  766. BPBA DATA 28H FILE NAME =
  767. DATA 1L
  768. DATA 40H
  769. BPBB DATA 30H DATE PRINTED =
  770. DATA 1L
  771. DATA 1L
  772. DATA 40H
  773. BPBC DATA 30H USER NAME =
  774. DATA 1L
  775. DUP 10,1
  776. DATA 1L
  777. BPB1L EQU *-BPB1
  778. SPACE 4,10
  779. BPB2 BSS 0 ACCESS LEVEL NAME BUFFER
  780. BSSZ 401
  781. SPACE 4,10
  782. FBUF EQU * SECURED FILE BUFFER
  783. SBUF EQU FBUF+FBUFL SCRATCH FILE BUFFER
  784. WBUFS EQU SBUF+SBUFL SHIFTED WORKING BUFFER
  785. WBUF EQU WBUFS+1 WORKING BUFFER
  786. RFL= EQU WBUF+WBUFL+4 SET *SECHDR* FL
  787. TITLE PRESET.
  788. PRS SPACE 4,20
  789. ** PRS - PRESET.
  790. *
  791. * EXIT ARGUMENTS PROCESSED.
  792. * (BUNT) = 1 IF NO BANNER PAGE TO BE WRITTEN.
  793. * = 0 IF BANNER UNIT IS RECORD.
  794. * = -1 IF BANNER UNIT IS FILE.
  795. * = -2 IF BANNER AT BOI/EOI.
  796. * (POPT) = 1 IF HEAD/FOOT TO BE WRITTEN.
  797. * = 0 IF NO HEAD/FOOT TO BE WRITTEN.
  798. * (BCFL) = 0 IF BACKCOPY NEEDS TO BE PERFORMED.
  799. *
  800. * USES X - ALL.
  801. * A - 1, 2, 4, 6, 7.
  802. * B - 2, 4, 5.
  803. *
  804. * CALLS ARG, SFN.
  805. *
  806. * MACROS ABORT, FILINFO, GETPP, MESSAGE, REQUEST, RETURN,
  807. * REWIND, SETFET, STATUS.
  808.  
  809.  
  810. PRS SUBR ENTRY/EXIT
  811.  
  812. * SET FILE NAME.
  813.  
  814. SA1 ARGR
  815. SX5 ERFN * NO FILE NAME SPECIFIED.*
  816. ZR X1,PRS9 IF NO ARGUMENTS
  817. MX0 42
  818. BX6 X0*X1
  819. ZR X6,PRS9 IF NULL FILE NAME
  820. SA1 FIPB SET FILE NAME IN *FILINFO* BLOCK
  821. BX7 X1+X6
  822. SA7 A1
  823. SA2 F SET FILE NAME IN FET
  824. BX3 -X0*X2
  825. BX6 X3+X6
  826. SA6 A2+
  827.  
  828. * SAVE FILE ACCESS LEVEL.
  829.  
  830. SA1 F+1 SET BIT TO RETURN FILE ACCESS LEVEL
  831. SX0 B1
  832. LX0 39
  833. BX6 X0+X1
  834. SA6 A1
  835. STATUS F,P
  836. SA1 F+CFAL GET ACCESS LEVEL
  837. LX1 -36
  838. MX0 -3
  839. BX6 -X0*X1
  840. SA6 PRSB
  841. SA2 TALV+X6 OBTAIN EQUIVALENT TEXT
  842. MX0 42
  843. BX1 X0*X2
  844. RJ SFN
  845. SA6 HEAD+2 SET HEADLINE
  846. SA6 HEAD+4
  847. SA6 HEAD+6
  848. SA6 HEAD+8
  849. SA6 HEAD+10
  850. SA6 HEAD+12
  851. SA6 FOOT+2 SET FOOTLINE
  852. SA6 FOOT+4
  853. SA6 FOOT+6
  854. SA6 FOOT+8
  855. SA6 FOOT+10
  856. SA6 FOOT+12
  857. SA6 ALVL
  858.  
  859. * CHECK FILE TYPE AND DEVICE TYPE.
  860.  
  861. FILINFO FIPB GET FILE INFORMATION
  862. SA1 FIPB+1
  863. MX0 -6 CHECK FILE TYPE
  864. BX2 -X0*X1
  865. SX6 X2-4 (X6) = 0 IF DIRECT ACCESS FILE
  866. LX1 59-16
  867. SX5 ERTF * UNABLE TO PROCESS TERMINAL FILE.*
  868. NG X1,PRS9 IF FILE ASSIGNED TO TERMINAL
  869. LX1 59-15-59+16 CHECK DEVICE TYPE
  870. NG X1,PRS1 IF FILE ON MASS STORAGE
  871. BX7 X7-X7 CLEAR RANDOM INDEX
  872. SA7 F+CFCN
  873. BX6 X6-X6
  874. PRS1 SA6 BCFL SET BACKCOPY FLAG
  875.  
  876. * PROCESS ARGUMENTS.
  877.  
  878. SA4 ACTR
  879. SB4 X4-1 SET ARGUMENT COUNT
  880. SA4 ARGR+1 SET FIRST ARGUMENT
  881. SB5 TARG SET ARGUMENT TABLE FWA
  882. RJ ARG PROCESS ARGUMENTS
  883. SX5 ERPR * ERROR IN SECHDR PARAMETERS.*
  884. NZ X1,PRS9 IF ARGUMENT ERROR
  885.  
  886. * PROCESS *OP* OPTIONS.
  887.  
  888. SA1 OP CHECK OPTIONS
  889. MX0 6
  890. NZ X1,PRS2 IF NOT DEFAULT OPTION
  891. SA1 DFOP
  892. PRS2 BX2 X0*X1
  893. ZR X2,PRS5 IF NO MORE OPTIONS SPECIFIED
  894. LX1 6 POSITION NEXT OPTION
  895.  
  896. * CHECK IF LEGAL OPTION.
  897.  
  898. SA4 TOPT
  899. PRS3 BX3 X0*X4 CHECK OPTION
  900. IX3 X3-X2
  901. ZR X3,PRS4 IF LEGAL OPTION
  902. SA4 A4+B1
  903. NZ X4,PRS3 IF MORE OPTIONS TO CHECK
  904. SA1 EROP+1 SET UNKNOWN OPTION IN MESSAGE
  905. MX0 -6
  906. LX0 6
  907. BX3 X0*X1
  908. LX2 12
  909. BX6 X3+X2
  910. SA6 A1
  911. SX5 EROP * UNKNOWN OPTION - X.*
  912. EQ PRS9 PROCESS ERROR
  913.  
  914. * SET BIT IN OPTION TABLE.
  915.  
  916. PRS4 LX4 59-0
  917. NG X4,PRS2 IF OPTION PREVIOUSLY SPECIFIED
  918. LX4 0-59
  919. SX6 B1+
  920. BX6 X6+X4
  921. SA6 A4
  922. EQ PRS2 CHECK REMAINING OPTIONS
  923.  
  924. * CHECK IF B, F, OR R OPTION SELECTED.
  925.  
  926. PRS5 SA1 TOPT-1
  927. SB2 B1+B1
  928. MX0 -1
  929. PRS6 SA1 A1+B1 CHECK NEXT OPTION
  930. NG B2,PRS7 IF END OF OPTIONS TO CHECK
  931. SB2 B2-B1
  932. BX2 -X0*X1
  933. ZR X2,PRS6 IF OPTION NOT SET
  934. SX6 B2-B1
  935. SA6 BUNT STORE BANNER UNIT
  936.  
  937. * SAVE P OPTION.
  938.  
  939. PRS7 SA1 TOPP
  940. BX6 -X0*X1
  941. SA6 POPT
  942. REWIND F,R
  943. RETURN S,R
  944.  
  945. * CREATE SCRATCH FILE WITH SAME ACCESS LEVEL.
  946.  
  947. SA1 S+1 SET FILE ACCESS LEVEL BIT
  948. MX0 1
  949. LX0 39-59
  950. BX6 X0+X1
  951. SA6 A1
  952. SA2 S+CFAL
  953. MX0 -3
  954. LX0 36
  955. SA1 PRSB GET ACCESS LEVEL OF OLD FILE
  956. BX2 X0*X2 CLEAR ACCESS LEVEL FIELD
  957. LX1 36
  958. BX6 X1+X2 MERGE NEW ACCESS LEVEL
  959. SA6 A2
  960. SETFET S,(DTY=PRSA) REQUEST MASS STORAGE RESIDENCE
  961. REQUEST S,U,N REQUEST FILE WITH NO DAYFILE MESSAGE
  962. GETPP PRSC,LNPG,PDEN GET PAGE INFORMATION
  963. SA1 POPT
  964. SX3 1
  965. SA2 LNPG SET PAGE SIZE
  966. ZR X1,PRS8 IF NO HEADERS REQUESTED
  967. SX3 SHFL+1 ALLOW ROOM FOR HEADERS
  968. PRS8 IX6 X2-X3
  969. SA6 A2
  970. EQ PRSX RETURN
  971.  
  972. * PROCESS ERRORS.
  973.  
  974. PRS9 MESSAGE X5 ISSUE ERROR MESSAGE
  975. ABORT
  976.  
  977. PRSA CON 2RMS MASS STORAGE DEVICE RESIDENCE
  978. PRSB CON 0 ACCESS LEVEL
  979. PRSC BSSZ 2 *GETPP* BUFFER
  980.  
  981. * ARGUMENT TABLE.
  982.  
  983. TARG BSS 0
  984. FF ARG -NZ,FORM
  985. OP ARG OP,OP
  986. ARG
  987.  
  988.  
  989. * OPTION TABLE.
  990. * THE OPTIONS IN THIS TABLE MUST REMAIN IN THIS ORDER.
  991.  
  992. TOPT BSS 0
  993. DATA 1LR
  994. DATA 1LF
  995. DFOP DATA 1LB
  996. TOPP DATA 1LP
  997. CON 0 END OF OPTION TABLE
  998.  
  999.  
  1000. * CONSTANTS.
  1001.  
  1002. NZ CON 1 NON-ZERO
  1003. OP CON 0 OPTION
  1004.  
  1005. * PARAMETER BLOCK.
  1006.  
  1007. FIPB BSS 0 *FILINFO* PARAMETER BLOCK
  1008. VFD 42/0,6/5,12/1
  1009. BSSZ 4
  1010.  
  1011. * ERROR MESSAGES TO DAYFILE.
  1012.  
  1013. ERFN DATA C* NO FILE NAME SPECIFIED.*
  1014. EROP DATA C* UNKNOWN OPTION - X.*
  1015. ERPR DATA C* ERROR IN SECHDR PARAMETERS.*
  1016. ERTF DATA C* UNABLE TO PROCESS TERMINAL FILE.*
  1017. SPACE 4
  1018. END SECHDR