User Tools

Site Tools


cdc:nos2.source:opl871:gtr

Table of Contents

GTR

Table Of Contents

  • [00134] ADDWORD - ADDWORD TO MANAGED TABLE.
  • [00145] ALLOC - ALLOCATE MEMORY.
  • [00158] SEARCH - SEARCH FOR ENTRY IN MANAGED TABLE.
  • [00178] TABLE - CREATE MANAGED TABLE.
  • [00192] FET - FILE ENVIORNMENT TABLES.
  • [00255] IPT - INSERT PROGRAM TABLE.
  • [00267] PNT - PROGRAM NAME TABLE.
  • [00278] NPT - NEW PROGRAM TABLE.
  • [00293] GET SELECTED RECORDS.
  • [00354] COPYRF - MAIN PROGRAM.
  • [00391] ADW - ADD WORD TO MANAGED TABLE.
  • [00406] ATS - ALLOCATE TABLE SPACE.
  • [00485] CDT - CHECK DEVICE TYPE.
  • [00526] CFE - CHECK FOR END OF INSERTS.
  • [00544] CFI - CHECK FOR INSERT.
  • [00599] CIT - CHECK INSERT TABLE.
  • [00674] CPP - COPY PROGRAMS.
  • [00773] CPY - COPY RECORD TO FILE *LGO*.
  • [00843] CUL - COPY USER LIBRARY.
  • [00871] DMP - DISPLAY MISSING PROGRAMS.
  • [00909] DPN - DISPLAY PROGRAM NAME.
  • [00937] MSG - SEND CONSOLE MESSAGE.
  • [00953] RDD - READ DIRECTORY.
  • [00991] RFR - READ FIRST RECORD.
  • [01015] SKR - SKIP RECORD.
  • [01026] SMT - SEARCH MANAGED TABLE.
  • [01052] WND - WRITE NEW DIRECTORY.
  • [01091] WNR - WRITE NEXT RECORD.
  • [01154] APN - ASSEMBLE PROGRAM NAME.
  • [01235] ARG - PROCESS ARGUMENTS ON COMMAND.
  • [01343] PRS - PRESET TABLE LENGTHS.
  • [01369] RCD - READ CORRECTION DIRECTIVES.
  • [01437] CBUF - CARD BUFFER.

Source Code

GTR.txt
  1. IDENT GTR,FET
  2. ABS
  3. ENTRY GTR
  4. ENTRY COPYRF
  5. ENTRY MFL=
  6. SYSCOM B1 DEFINE B1=1
  7. *COMMENT GTR - GET SELECTED RECORDS.
  8. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  9. GTR TITLE GTR - GET SELECTED RECORDS.
  10. SPACE 4,10
  11. *** GET SELECTED RECORDS.
  12. * D. A. CAHLANDER. 69/08/30.
  13. SPACE 4
  14. *** GTR SEARCHES FOR SELECTED RECORDS ON A LIBRARY FILE. THE
  15. * SELECTED RECORDS ARE COPIED TO THE NEW FILE.
  16. SPACE 4
  17. *** CONTROL CARD CALL -
  18. *
  19. * POSITIONAL PARAMETER FORMAT.
  20. *
  21. * GTR(OLD,LGO,DF,NR,S,NA,T)*SELECTION DIRECTIVES*
  22. *
  23. * OLD = OLD PROGRAM FILE.
  24. * LGO = NEW FILE.
  25. * DF = DIRECTORY FLAG.
  26. * *D* = BUILD DIRECTORY FOR NEW FILE, AND
  27. * INCLUDE USER LIBRARY DIRECTORIES.
  28. * *U* = COPY USER LIBRARY HEADER AND *OPLD* ONLY.
  29. * NR = NO REWIND FLAG.
  30. * S = SEQUENTIAL FILE PROCESSING.
  31. * NA = NO ABORT FLAG.
  32. * T = REMOVE RECORD NAME FROM SELECTED TEXT RECORDS.
  33. *
  34. * POSITION-INDEPENDENT PARAMETER FORMAT.
  35. *
  36. * GTR(OLD,LGO/P1,...,PN)*SELECTION DIRECTIVES*
  37. *
  38. * OLD = OLD PROGRAM FILE (POSITIONAL).
  39. * LGO = NEW FILE (POSITIONAL).
  40. * P1 - PN = OPTIONAL PARAMETERS IN ANY ORDER.
  41. * *D* = BUILD DIRECTORY FOR NEW FILE, AND
  42. * INCLUDE USER LIBRARY DIRECTORIES.
  43. * *U* = COPY USER LIBRARY HEADER AND *OPLD*.
  44. * *NR* = DO NOT REWIND NEW FILE.
  45. * *S* = SEQUENTIAL FILE PROCESSING.
  46. * *NA* = DO NOT ABORT ON ERRORS.
  47. * *T* = REMOVE RECORD NAME FROM
  48. * SELECTED TEXT RECORDS.
  49. *
  50. * SELECTION DIRECTIVES -
  51. *
  52. * LIB/PN
  53. * COPY PROGRAM *PN* (TYPE *LIB*) FROM *OLD* TO *LGO*.
  54. *
  55. * PN
  56. * COPY PROGRAM *PN* (TYPE *TEXT* OR PREVIOUS *LIB*)
  57. * FROM *OLD* TO *LGO*.
  58. *
  59. * *
  60. * COPY ALL PROGRAM OF TYPE *LIB* FROM *OLD* TO *LGO*.
  61. *
  62. * 0
  63. * INSERT 0-LENGTH RECORD ON FILE *LGO*.
  64. *
  65. * LIB/PN1-PN2
  66. * COPY PROGRAM *PN1* THROUGH *PN2* FROM *OLD* TO *LGO*.
  67. COPYRF SPACE 4
  68. *** COPYRF COPIES RECORDS FROM MEDIUM TO MEDIUM AND ADDS
  69. * A RANDOM INDEX ON THE END.
  70. COPYRF SPACE 4
  71. *** CONTROL CARD CALL.
  72. *
  73. *
  74. * COPYRF(IFILE,OFILE)
  75. * IFILE NAME OF INPUT FILE.
  76. * OFILE NAME OF OUTPUT FILE.
  77. *
  78. * ASSUMED PARAMETERS.
  79. * IFILE = *OLD*
  80. * OFILE = *LGO*
  81. SPACE 4,10
  82. *** DAYFILE MESSAGES.
  83. *
  84. *
  85. * * FILENAME CONFLICT.*
  86. * THE FIRST TWO PARAMETERS OF THE *GTR* COMMAND
  87. * ARE IDENTICAL.
  88. *
  89. * * FORMAT ERROR.*
  90. * INDICATES ONE OF THE FOLLOWING:
  91. * 1. THE *GTR* COMMAND FORMAT WAS INCORRECT.
  92. * 2. AN INCORRECT LIBRARY TYPE WAS SPECIFIED.
  93. * 3. A RECORD NAME LONGER THAN SEVEN CHARACTERS
  94. * WAS SPECIFIED.
  95. *
  96. * * GTR ERRORS.*
  97. * THERE ARE ERRORS ON THE *GTR* COMMAND.
  98. *
  99. * * INCORRECT PARAMETER. *
  100. * A KEYWORD FORMAT COMMAND PARAMETER CONTAINED A VALUE
  101. * OTHER THAN ONE OF THE RECOGNIZED KEYWORDS.
  102. *
  103. * * MASS STORAGE DIRECTORY NOT WRITTEN.*
  104. * A REQUEST WAS MADE TO WRITE A MASS STORAGE
  105. * DIRECTORY ON A NON-MASS STORAGE FILE.
  106. *
  107. * * TABLE OVERFLOW.*
  108. * THE JOB FIELD LENGTH IS TOO SMALL TO HOLD THE
  109. * TABLES FOR PROCESSING THE *GTR* COMMAND.
  110. *
  111. * * TOO MANY PARAMETERS.*
  112. * MORE PARAMETERS WERE ENTERED (INCLUDING NULL
  113. * PARAMETERS) THAN ARE ALLOWED FOR THE COMMAND.
  114. *
  115. * * UNUSUAL END-OF-FILE ENCOUNTERED.*
  116. * *GTR* DETECTED AN EOF NOT PRECEDED BY AN EOR.
  117. SPACE 4
  118. **** ASSEMBLY CONSTANTS.
  119.  
  120.  
  121. PBUFL EQU 20041B *OLD* BUFFER LENGTH
  122. BBUFL EQU 10021B *LGO* BUFFER LENGTH
  123. WSAL EQU 1000B WORKING BUFFER LENGTH
  124. BUFL EQU 14000B NOMINAL TABLE SPACE REQUIRED
  125. ODEBL EQU 20B OPTICAL DISK EXTENSION BUFFER LENGTH
  126. ****
  127. COMMON SPACE 4,10
  128. * COMMON DECKS.
  129.  
  130.  
  131. *CALL COMCMAC
  132. *CALL COMSSRT
  133. ADDWORD TITLE SUBROUTINES.
  134. ** ADDWORD - ADDWORD TO MANAGED TABLE.
  135. *
  136. * ADDWORD TABNAM
  137. * ENTRY (TABNAM) = MANAGED TABLE NAME.
  138.  
  139.  
  140. ADDWORD MACRO TABNAM
  141. R= A0,TABNAM
  142. RJ ADW
  143. ENDM
  144. ALLOC SPACE 4,5
  145. ** ALLOC - ALLOCATE MEMORY.
  146. *
  147. * ALLOC TABLE,INCR
  148. * ENTRY (TABLE) = TABLE NAME.
  149. * (INCR) = TABLE LENGTH INCREMENT.
  150.  
  151.  
  152. ALLOC MACRO TABLE,INCR
  153. R= A0,TABLE
  154. R= X3,INCR
  155. RJ ATS
  156. ENDM
  157. SEARCH SPACE 4,10
  158. ** SEARCH - SEARCH FOR ENTRY IN MANAGED TABLE.
  159. * THIS MACRO SETS UP A CALL TO SEARCH FOR AN ENTRY
  160. * IN A MANAGED TABLE.
  161. *
  162. * SEARCH TABLE,ENTRY,MASK
  163. * ENTRY (TABLE) = NAME OF MANAGED TABLE.
  164. * (ENTRY) = ADDRESS OF ENTRY.
  165. * (MASK) = ADDRESS OF SEARCH MASK.
  166.  
  167.  
  168. SEARCH MACRO TABLE,ENTRY,MASK
  169. R= A2,ENTRY
  170. IFC EQ,*MASK**
  171. MX3 60
  172. ELSE 1
  173. SA3 MASK
  174. SA1 O.TABLE
  175. RJ SMT
  176. ENDM
  177. TABLE SPACE 4,6
  178. ** TABLE - CREATE MANAGED TABLE.
  179. *
  180. * TABLE TNAM
  181. * ENTRY (TNAM) = TABLE NAME.
  182.  
  183.  
  184. MACRO TABLE,TNAM
  185. TNAM EQU *-TAB
  186. O.TNAM CON BUF
  187. RMT
  188. L.TNAM EQU TNAM+TAB+TABL
  189. RMT
  190. ENDM
  191. FET TITLE CONTROL CELLS.
  192. ** FET - FILE ENVIORNMENT TABLES.
  193.  
  194.  
  195. ORG 110B
  196. FET BSS 0
  197. P BSS 0 PROGRAM LIBRARY
  198. OLD RFILEB PBUF,PBUFL,FET=10
  199. ORG P+11B
  200. VFD 36/,6/ODEBL,18/PODEB POINTER TO *OD* EXT. BUFFER
  201. ORG P+10
  202.  
  203.  
  204. B BSS 0 NEW FILE
  205. LGO RFILEB BBUF,BBUFL,FET=10
  206. ORG B+11B
  207. VFD 36/,6/ODEBL,18/BODEB POINTER TO *OD* EXT. BUFFER
  208. ORG B+10
  209.  
  210. * OPTICAL DISK EXTENSION BUFFERS.
  211.  
  212. PODEB BSSZ ODEBL *OLD*
  213. BODEB BSSZ ODEBL *LGO*
  214. FLAGS SPACE 4,3
  215. ** CONTROL FLAGS.
  216.  
  217.  
  218. CP CON 0 CARD POINTER
  219. ID CON 77000016000000000000B
  220. CON 0LNAME
  221. BSSZ 15B
  222. CON 70000000000000000000B
  223. FL CON 0 FIELD LENGTH
  224. ND CON 0 NO DIRECTORY FLAG
  225. NR CON 0 NO REWIND FLAG
  226. SQ CON 0 SEQUENTIAL FILE FLAG
  227. NABT CON 0 NO ABORT FLAG
  228. TU CON 0 REMOVE RECORD NAMES FLAG
  229. RN CON 0 RECORD NAME
  230. MFL CON 0 MAXIMUM MEMORY
  231. T1 CON 0 TEMPORARY
  232. T2 CON 0 TEMPORARY
  233. T3 CON 0 TEMPORARY
  234. ZR CON 1 ZERO RECORD INSERT FLAG
  235. CPRF CON 0 COPYRF FLAG
  236. ERRF CON 0 ERROR FLAG
  237. RCWF CON 0 RECORDS WRITTEN FLAG
  238. BUFFER SPACE 4,3
  239. ** BUFFER SPACE.
  240.  
  241.  
  242. USE //
  243. WSA BSS WSAL WORKING STORAGE
  244. PBUF BSS PBUFL PROGRAM LIBRARY BUFFER
  245. BBUF BSS BBUFL CORRECTION FILE BUFFER
  246. BUF BSS 0 MANAGED TABLE SPACE
  247. USE *
  248. TABLE TITLE MANAGED TABLES.
  249. ** MANAGED TABLES.
  250. * TABLES ARE VARIABLE LENGTH MANAGED TABLES. POINTERS TO
  251. * TABLE *ABC* ARE -
  252. * O.ABC = FWA OF TABLE *ABC*.
  253. * L.ABC = LENGTH OF TABLE *ABC*.
  254. TABLE SPACE 4,11
  255. ** IPT - INSERT PROGRAM TABLE.
  256. *
  257. * 42/PROG1,18/TYPE1
  258. * 42/PROG2,18/TYPE2
  259. * 1. PROG1 = PROGRAM NAME FOR START OF INSERT.
  260. * 2. PROG2 = PROGRAM NAME FOR END OF INSERT.
  261. * 3. TYPE = PROGRAM TYPE.
  262.  
  263.  
  264. TAB BSS 0
  265. IPT TABLE
  266. TABLE SPACE 4,10
  267. ** PNT - PROGRAM NAME TABLE.
  268. *
  269. * 42/PROGRAM,18/TYPE
  270. * 60/POSITION
  271. * 1. PROGRAM = PROGRAM NAME LEFT JUSTIFIED.
  272. * 2. POSITION = RNADOM INDEX.
  273. * 3. TYPE = PROGRAM TYPE.
  274.  
  275.  
  276. PNT TABLE
  277. TABLE SPACE 4,10
  278. ** NPT - NEW PROGRAM TABLE.
  279. *
  280. * 42/PROGRAM,18/TYPE
  281. * 60/POSITION
  282. * 1. PROGRAM = PROGRAM NAME LEFT JUSTIFIED.
  283. * 2. POSITION = RNADOM INDEX.
  284. * 3. TYPE = PROGRAM TYPE.
  285.  
  286.  
  287. NPT TABLE
  288. END TABLE
  289. TABL EQU *-TAB
  290.  
  291. BSS TABL TABLE LENGTHS
  292. GTR TITLE MAIN PROGRAM.
  293. *** GTR - GET SELECTED RECORDS.
  294.  
  295.  
  296. GTR SB1 1 (B1) = 1
  297. RJ PRS PRESET TABLE LENGTHS
  298. RJ ARG PROCESS CONTROL CARD
  299. RJ RCD READ CORRECTION DIRECTIVES
  300. OPEN P,READNR,R
  301. SA1 NR
  302. NZ X1,GTR1 IF NO REWIND
  303. REWIND B
  304. GTR1 SA1 P+1
  305. SA2 SQ
  306. NZ X2,GTR3 IF SEQUENTIAL PROCESSING REQUESTED
  307.  
  308. NG X1,GTR3 IF FILE NON-RANDOM
  309. RJ RDD READ DIRECTORY
  310. ZR X1,GTR3 IF NO DIRECTORY
  311. RJ CPP COPY PROGRAMS
  312. GTR2 RJ WND WRITE NEW DIRECTORY
  313. SA2 ERRF
  314. NZ X2,GTR8 IF ERRORS
  315. MESSAGE (=C* EDITING COMPLETE.*)
  316. GTR2.1 ENDRUN
  317.  
  318. * PROCESS NON-RANDOM FILE.
  319.  
  320. GTR3 SA1 NR
  321. NZ X1,GTR4 IF NO REWIND
  322. REWIND P
  323. GTR4 RJ CFE CHECK FOR END OF INSERTS
  324. ZR X1,GTR2 IF END
  325. GTR5 RJ RFR READ FIRST RECORD
  326. NG X1,GTR7 IF EOF
  327. RJ CFI CHECK FOR INSERTS
  328. ZR X7,GTR6 IF INSERT FOUND
  329. RJ SKR SKIP RECORD
  330. EQ GTR5 LOOP
  331.  
  332. GTR6 RJ WNR WRITE NEXT RECORD
  333. SA5 ZR
  334. NZ X5,GTR4 IF NO ZERO RECORD INSERT
  335. WRITER B WRITE ZERO RECORD
  336. SX7 B1
  337. SA7 A5
  338. EQ GTR4 LOOP
  339.  
  340. GTR7 RJ DMP DISPLAY MISSING PROGRAMS
  341. EQ GTR2
  342.  
  343. * ERROR EXIT.
  344.  
  345. ERR MESSAGE (=C* FORMAT ERROR.*)
  346.  
  347. GTR8 SA2 CPRF
  348. NZ X2,GTR9 IF COPYRF
  349. MESSAGE (=C* GTR ERRORS.*)
  350. SA2 NABT
  351. NZ X2,GTR2.1 IF NO ABORT FLAG SET
  352. GTR9 ABORT
  353. COPYRF TITLE MAIN PROGRAM.
  354. ** COPYRF - MAIN PROGRAM.
  355.  
  356.  
  357. COPYRF SB1 1 (B1) = 1
  358. SX6 B1 SET COPYRF FLAG
  359. SA6 CPRF
  360. RJ PRS PRESET TABLE LENGTHS
  361. RJ ARG PROCESS CONTROL CARD
  362. OPEN P,READNR,R
  363. OPEN B,WRITENR,R
  364. SA1 =10H COPYING
  365. BX7 X1
  366. SX6 B1+B1 SELECT DIRECTORY OPTION
  367. SA7 WNRA
  368. SA6 ND
  369. SA6 NR SELECT NO REWIND
  370. SA1 B+1
  371. AX1 48
  372. SX3 X1-2ROD
  373. ZR X3,CRF1 IF OPTICAL DISK FILE
  374. EVICT B,R
  375. CRF1 RJ RFR READ FIRST RECORD
  376. NG X1,CRF2 IF EOF
  377. RECALL B
  378. SA1 RN
  379. ADDWORD NPT
  380. IX6 X3+X4 SET RANDOM RETURN ADDRESS
  381. SX6 X6-1
  382. SA6 B+6
  383. SA1 T1
  384. RJ WNR WRITE NEXT RECORD
  385. EQ CRF1 LOOP
  386.  
  387. CRF2 RJ WND WRITE NEW DIRECTORY
  388. MESSAGE (=C* CONVERSION COMPLETE.*),1
  389. ENDRUN
  390. ADW TITLE SUBROUTINES.
  391. ** ADW - ADD WORD TO MANAGED TABLE.
  392. * ENTRY (A0) = TABLE INDEX.
  393. * (X1) = ENTRY WORD 1.
  394. * (X2) = ENTRY WORD 2.
  395.  
  396.  
  397. ADW PS RETURN EXIT
  398. ALLOC A0,2
  399. LX7 X2 STORE ENTRY
  400. IX6 X3+X4
  401. SA7 X6-1
  402. BX6 X1
  403. SA6 A7-B1
  404. EQ ADW RETURN
  405. ATS SPACE 4,7
  406. ** ATS - ALLOCATE TABLE SPACE.
  407. *
  408. * ALLOCATE TABLE SPACE, REQUESTING MEMORY IF NECESSARY.
  409. *
  410. * ENTRY (A0) = TABLE INDEX.
  411. * (X3) = INCREMENT.
  412. *
  413. * EXIT (X1) = ENTRY VALUE RESTORED.
  414. * (X3) = FWA OF TABLE.
  415. * (X4) = LENGTH OF TABLE.
  416. *
  417. * ERROR TO *GTR8*.
  418. *
  419. * USES X - 1, 3, 4, 6, 7.
  420. * A - 1, 3, 4, 6, 7.
  421. * B - 2, 3.
  422. *
  423. * MACROS MEMORY, MESSAGE.
  424.  
  425.  
  426. ATS5 SA3 A0+TAB
  427. SA4 A0+TAB+TABL
  428.  
  429. ATS PS RETURN EXIT
  430. SA4 A0+TAB+TABL INCREMENT TABLE LENGTH
  431. IX6 X4+X3
  432. SA6 A4
  433. SB2 A0+1 INCREMENT TABLE ORIGINS
  434. SB3 TABL
  435. ATS1 SA4 B2+TAB
  436. IX6 X4+X3
  437. SA6 A4
  438. SB2 B2+1
  439. NE B2,B3,ATS1 LOOP TO END OF TABLES
  440. SA4 A6+TABL DECREMENT SPACE AVAILABLE
  441. IX7 X4-X3
  442. SA7 A4
  443. PL X7,ATS5 IF NO OVERFLOW
  444. BX7 -X7
  445. BX6 X1 PRESERVE (X1) ENTRY VALUE
  446. SA6 ATSA
  447. SX7 X7+77B ROUND TO NEXT EVEN 100B
  448. AX7 6
  449. LX7 6
  450. SA7 ATSC MINIMUM ADDITIONAL WORDS REQUIRED
  451. SX4 1000B MINIMUM DESIRABLE REQUEST
  452. SA1 FL
  453. IX6 X4-X7
  454. PL X6,ATS2 IF REQUIRED .LT. DESIRABLE
  455. BX4 X7
  456. ATS2 SA3 MFL MAXIMUM MEMORY
  457. IX6 X1+X4
  458. IX7 X6-X3
  459. NG X7,ATS3 IF MAXIMUM IS SUFFICIENT
  460. SA4 ATSC MINIMUM WORDS REQUIRED
  461. IX6 X1+X4
  462. IX1 X6-X3
  463. PL X1,ATS4 IF MAXIMUM IS INSUFFICIENT
  464. ATS3 SA6 FL NEW FL
  465. SA1 L.END SPACE AVAILABLE
  466. LX6 30
  467. SA6 ATSB MEMORY REQUEST STATUS WORD
  468. IX6 X1+X4
  469. SA6 A1+ NEW SPACE AVAILABLE
  470. MEMORY CM,ATSB,R,,NA
  471. SA4 ATSB
  472. SA1 FL
  473. AX4 30
  474. IX3 X4-X1
  475. SA1 ATSA RESTORE (X1)
  476. PL X3,ATS5 IF FL OBTAINED
  477. ATS4 MESSAGE (=C* TABLE OVERFLOW.*)
  478. EQ GTR8 ERROR EXIT
  479.  
  480.  
  481. ATSA CON 0 STORAGE FOR (X1)
  482. ATSB CON 0 MEMORY REQUEST STATUS WORD
  483. ATSC CON 0 MINIMUM MEMORY REQUIRED
  484. CDT SPACE 4,5
  485. ** CDT - CHECK DEVICE TYPE.
  486. *
  487. * EXIT (ND) = 0, IF DIRECTORY REQUESTED ON NON MASS
  488. * STORAGE FILE.
  489. *
  490. * USES X - 1, 5, 6.
  491. * A - 1, 6.
  492.  
  493.  
  494. CDT PS ENTRY/EXIT
  495. SA1 B+1 SET USER ERROR PROCESSING
  496. SX5 B1
  497. LX5 44
  498. BX6 X1+X5
  499. SA6 A1
  500. SA1 B+5 SAVE FET+5, FET+6
  501. BX6 X1
  502. SA1 A1+B1
  503. SA6 CDTA
  504. BX6 X1
  505. SA6 A6+B1
  506. STATUS B,P DETERMINE DEVICE TYPE
  507. SA1 CDTA RESTORE FET+5, FET+6
  508. BX6 X1
  509. SA1 A1+B1
  510. SA6 B+5
  511. BX6 X1
  512. SA6 A6+B1
  513. SA1 B+1 CLEAR ERROR PROCESSING
  514. BX6 X1-X5
  515. SA6 A1
  516. PL X1,CDT IF MASS STORAGE
  517. SX5 =C* MASS STORAGE DIRECTORY NOT WRITTEN.*
  518. MESSAGE X5
  519. BX6 X6-X6 SET NO DIRECTORY
  520. SA6 ND
  521. EQ CDT
  522.  
  523.  
  524. CDTA BSS 2 SCRATCH
  525. CFE SPACE 4,4
  526. ** CFE - CHECK FOR END OF INSERTS.
  527. * EXIT (X1) = 0 IF END OF INSERTS.
  528.  
  529.  
  530. CFE PS RETURN EXIT
  531. SA2 O.IPT
  532. SA1 L.IPT
  533. ZR X1,CFE IF NO INSERTS
  534. SB7 X1
  535. SA1 X2
  536. SB4 B1+B1
  537. CFE1 NZ X1,CFE IF MORE INSERTS
  538. SB7 B7-B4
  539. SA1 A1+B4
  540. NZ B7,CFE1 LOOP
  541. MX1 0
  542. EQ CFE RETURN
  543. CFI SPACE 4,7
  544. ** CFI - CHECK FOR INSERT.
  545. * ENTRY (X1) = EOR INDICATOR.
  546. * EXIT (X7) = 0 IF RECORD TO BE COPIED.
  547. * (X1) = EOR INDICATOR.
  548.  
  549.  
  550. CFI PS RETURN EXIT
  551. BX7 X1
  552. SA7 T1
  553. RECALL B
  554. SEARCH IPT,(=1L,)
  555. ZR X7,CFI1 IF INSERTING
  556. SA1 RN
  557. SA2 =1L*
  558. SX1 X1
  559. BX2 X1+X2
  560. SEARCH IPT,A2
  561. ZR X7,CFI2 IF INSERTING FULL FILE
  562. SEARCH IPT,RN
  563. SA1 RN
  564. NZ X1,CFI0 IF NOT ZERO RECORD
  565. SX7 B1
  566. CFI0 NZ X7,CFI IF RECORD NOT INSERTED
  567. CFI1 SA1 O.IPT CHECK FOR END OF INSERT
  568. IX0 X1+X6
  569. SA2 X0+B1
  570. SA3 =1L* CHECK FOR NEXT PARAMETER BEING +*+
  571. BX1 X2-X3
  572. BX3 X2
  573. MX6 42 MASK OFF RECORD TYPE
  574. BX1 X6*X1
  575. ZR X1,CFI1.1 IF INSERT FULL FILE FROM NOW ON
  576. SA1 RN
  577. SA3 =1L, SET INSERTING FLAG
  578. CFI1.1 BX6 X3
  579. SA6 X0
  580. BX6 X1-X2
  581. NZ X6,CFI2 IF NOT END OF INSERT
  582. SA6 X0 CLEAR IPT ENTRY
  583. SA6 X0+B1
  584. SA1 A6+B1 CHECK FOR ZERO RECORD INSERT
  585. AX1 42
  586. SX1 X1-1L0
  587. NZ X1,CFI2 IF NO ZERO RECORD
  588. SA6 ZR
  589. CFI2 SA1 RN
  590. BX2 X2-X2
  591. ADDWORD NPT
  592. IX6 X3+X4 SET RANDOM RETURN ADDRESS
  593. SX6 X6-1
  594. SA6 B+6
  595. MX7 0
  596. SA1 T1
  597. EQ CFI RETURN
  598. CIT SPACE 4,5
  599. ** CIT - CHECK INSERT TABLE.
  600. * THE INSERT TABLE IS CHECKED AGAINST THE PNT TO DETERMINE
  601. * IF ALL INSERTS ARE LEGAL.
  602.  
  603.  
  604. CIT PS RETURN EXIT
  605. SX6 B0 SET IPT INDEX
  606. SA6 T1
  607. CIT1 SA1 O.IPT
  608. SA2 L.IPT
  609. SA3 T1
  610. BX6 X3-X2
  611. ZR X6,CIT4 IF END OF IPT
  612. IX1 X1+X3
  613. SA2 X1
  614. BX6 X2
  615. AX6 42
  616. SX7 X6-1L0
  617. ZR X7,CIT3 IF 0-LENGTH RECORD INSERT
  618. SX7 X6-1L*
  619. ZR X7,CIT3 IF FULL FILE ADD
  620. SEARCH PNT,A2
  621. NZ X7,CIT2 IF RECORD NOT FOUND
  622. SA6 T2
  623. SA1 O.IPT
  624. SA2 T1
  625. IX1 X1+X2
  626. SA2 X1+B1
  627. BX6 X2
  628. AX6 42
  629. SX7 X6-1L*
  630. ZR X7,CIT3 IF FULL FILE ADD
  631. SEARCH PNT,A2
  632. NZ X7,CIT2 IF RECORD NOT FOUND
  633. SA1 T2
  634. IX7 X6-X1
  635. PL X7,CIT3 IF LEGAL INSERT
  636.  
  637. * BAD INSERT.
  638.  
  639. CIT2 RJ DPN DISPLAY PROGRAM NAME
  640. SA1 CITA INCREMENT ERROR COUNT
  641. SX6 X1+B1
  642. SA6 A1
  643.  
  644. * ADVANCE TO NEXT ENTRY.
  645.  
  646. CIT3 SA1 T1
  647. SX6 X1+2
  648. SA6 A1
  649. EQ CIT1 LOOP
  650.  
  651. * CHECK ERROR COUNT.
  652.  
  653. CIT4 SA1 CITA
  654. ZR X1,CIT IF NO ERRORS
  655. SX6 B1 SET ERROR FLAG
  656. SA6 ERRF
  657. SA2 NABT
  658. NZ X2,CIT IF NO ABORT FLAG SET
  659. EQ GTR8 ERROR EXIT
  660.  
  661. CITA CON 0 ERROR COUNT
  662. COMMON SPACE 4
  663. ** COMMON DECKS.
  664.  
  665.  
  666. *CALL COMCLFM
  667. *CALL COMCSYS
  668. *CALL COMCCIO
  669. *CALL COMCCPM
  670. *CALL COMCRDW
  671. *CALL COMCWTW
  672. *CALL COMCSRT
  673. CPP SPACE 4,3
  674. ** CPP - COPY PROGRAMS.
  675.  
  676.  
  677. CPP PS RETURN EXIT
  678. RJ CIT CHECK INSERT TABLE
  679. CPP1 SA1 O.IPT
  680. SA2 L.IPT
  681. ZR X2,CPP IF END OF INSERTS
  682.  
  683. * CHECK FOR 0-LENGTH RECORD INSERT.
  684.  
  685. SA2 X1
  686. AX2 42
  687. SX6 X2-1L0
  688. NZ X6,CPP2 IF NOT 0-LENGTH RECORD
  689. BX1 X1-X1 MAKE *OPLD* ENTRY
  690. BX2 X2-X2
  691. ADDWORD NPT
  692. RECALL B
  693. SA1 O.NPT SET RANDOM RETURN ADDRESS
  694. SA2 L.NPT
  695. IX6 X1+X2
  696. SX6 X6-1
  697. SA6 B+6
  698. WRITER B
  699. EQ CPP7
  700.  
  701. * CHECK FOR ENTIRE FILE INSERT.
  702.  
  703. CPP2 SX6 X2-1L*
  704. NZ X6,CPP5 IF NOT ENTIRE FILE INSERT
  705. SA6 T1 SET PNT INDEX
  706. CPP3 SA1 O.PNT
  707. SA2 L.PNT
  708. SA3 T1
  709. SB5 X1
  710. SB6 X2
  711. SB4 B1+B1
  712. MX0 42
  713. SB7 X3
  714. CPP4 EQ B6,B7,CPP7 IF END OF PNT
  715. SA2 B5+B7 CHECK PROGRAM TYPE
  716. SA4 O.IPT
  717. SA4 X4
  718. BX7 X4-X2
  719. BX7 -X0*X7
  720. SB7 B7+B4
  721. NZ X7,CPP4 IF NOT CORRECT PROGRAM TYPE
  722. SX6 B7
  723. SA6 T1
  724. SB2 B7-B4 COPY RECORD
  725. RJ CPY
  726. EQ CPP3 LOOP
  727.  
  728. * SEARCH PNT FOR START OF INSERT.
  729.  
  730. CPP5 SA2 X1
  731. SEARCH PNT,A2
  732. NZ X7,CPP7 IF RECORD NOT FOUND
  733. SA6 T1
  734.  
  735. * FIRST PROGRAM FOUND, START COPY.
  736.  
  737. CPP6 SA1 T1
  738. SB2 X1
  739. RJ CPY
  740. SA1 O.IPT
  741. SA2 X1
  742. SA4 X1+B1
  743. BX6 X2-X4
  744. ZR X6,CPP7 IF LAST PROGRAM FOUND
  745. BX6 X4
  746. AX6 42
  747. SX6 X6-1L*
  748. SA3 T1 INCREMENT PNT INDEX
  749. SX7 X3+2
  750. SA7 A3
  751. ZR X6,CPP3 IF ADD FULL FILE
  752. SA1 L.PNT
  753. BX2 X1-X7
  754. ZR X2,CPP7 IF END OF PNT
  755. SA1 O.PNT
  756. SB5 X1
  757. SA1 B5+X7 SET CURRENT PROGRAM NAME
  758. BX7 X1
  759. SA2 O.IPT
  760. SA7 X2
  761. EQ CPP6 LOOP
  762.  
  763. * ADVANCE TO NEXT IPT ENTRY.
  764.  
  765. CPP7 SA1 O.IPT
  766. SA2 L.IPT
  767. SX6 X1+2
  768. SX7 X2-2
  769. SA6 A1
  770. SA7 A2
  771. EQ CPP1 LOOP
  772. CPY SPACE 4,4
  773. ** CPY - COPY RECORD TO FILE *LGO*.
  774. * ENTRY (B2) = PNT INDEX.
  775.  
  776.  
  777. CPY PS RETURN EXIT
  778. SX6 B1 SET RECORDS WRITTEN FLAG
  779. SA6 RCWF
  780. SA1 O.PNT
  781. SA1 X1+B2
  782. SA2 A1+B1 SET RANDOM ADDRESS
  783. BX6 X2
  784. SA6 P+6
  785. BX6 X1
  786. SA6 RN SAVE RECORD NAME
  787. BX2 X2-X2
  788. ADDWORD NPT
  789. READ P
  790. RECALL B
  791. SA3 O.NPT SET RANDOM RETURN ADDRESS
  792. SA4 L.NPT
  793. IX6 X3+X4
  794. SA1 X6-2
  795. SX6 X6-1
  796. SA6 B+6
  797. SA2 WNRA
  798. RJ MSG
  799. SA1 RN CHECK TYPE
  800. SB7 X1-ULRT
  801. ZR B7,CPY4 IF *ULIB*
  802. SB7 X1-TXRT
  803. NZ B7,CPY1 IF NOT A TEXT RECORD
  804. SA1 TU
  805. ZR X1,CPY1 IF NOT REMOVING RECORD NAMES
  806. MX0 -12
  807. CPY0 READW P,WSA,1 SKIP RECORD NAME LINE
  808. NG X1,CPY3 IF EOF/EOI ENCOUNTERED
  809. NZ X1,CPY2.1 IF EOR ENCOUNTERED
  810. SA1 WSA
  811. BX1 -X0*X1
  812. NZ X1,CPY0 IF NOT END OF LINE
  813. CPY1 READW P,WSA,WSAL COPY RECORD
  814. NZ X1,CPY2 IF EOR
  815. WRITEW B,WSA,WSAL
  816. EQ CPY1
  817.  
  818. CPY2 NG X1,CPY3 IF EOF
  819. WRITEW B,WSA,X1-WSA
  820. CPY2.1 WRITER B
  821. EQ CPY RETURN
  822.  
  823. CPY3 MESSAGE (=C* UNUSUAL END-OF-FILE ENCOUNTERED.*)
  824. EQ GTR8 ERROR EXIT
  825.  
  826. CPY4 SA1 ND
  827. ZR X1,CPY7 IF DIRECTORY NOT REQUESTED
  828. CPY5 READW P,WSA,WSAL COPY DIRECTORY RECORD
  829. NZ X1,CPY6 IF EOR
  830. WRITEW B,WSA,WSAL
  831. EQ CPY5 LOOP ON COPY
  832.  
  833. CPY6 NG X1,CPY3 IF EOF/EOI
  834. WRITEW B,WSA,X1-WSA
  835. WRITER B
  836. CPY7 RJ SKR SKIP RECORD
  837. SA1 RN
  838. SA2 WNRA
  839. RJ MSG
  840. RJ CUL COPY USER LIBRARY
  841. EQ CPY RETURN
  842. CUL SPACE 4
  843. ** CUL - COPY USER LIBRARY.
  844. * ENTRY (RN) = CURRENT RECORD NAME.
  845.  
  846.  
  847. CUL PS RETURN EXIT
  848. CUL1 READ P
  849. RECALL B
  850. READW P,WSA,WSAL
  851. NG X1,CPY3 IF EOF
  852. BX6 X1
  853. SX1 B6 LWA+1 OF DATA READ
  854. SA6 T2 SAVE EOR INDICATOR
  855. SX2 WSA
  856. RJ SRT SET RECORD TYPE
  857. SA6 RN
  858. SA1 T2
  859. NZ X1,CUL3 IF EOR
  860. CUL2 WRITEW B,WSA,WSAL COPY RECORD
  861. READW P,WSA,WSAL
  862. ZR X1,CUL2 IF NOT EOR
  863. NG X1,CPY2 IF EOF/EOI
  864. CUL3 WRITEW B,WSA,X1-WSA
  865. WRITER B
  866. SA1 RN CHECK TYPE
  867. SB7 X1-ODRT
  868. NZ B7,CUL1 LOOP TO END OF ULIB
  869. EQ CUL RETURN
  870. DMP SPACE 4,3
  871. ** DMP - DISPLAY MISSING PROGRAMS.
  872.  
  873.  
  874. DMP PS RETURN EXIT
  875. SX6 B0
  876. SA6 T1
  877. DMP1 SA1 O.IPT
  878. SA2 L.IPT
  879. ZR X2,DMP4 IF END OF IPT
  880. SA2 X1 READ ENTRY
  881. BX6 X2
  882. AX6 42
  883. ZR X2,DMP3 IF NO ENTRY
  884. SX7 X6-1L0
  885. ZR X7,DMP3 IF ADD 0-LENGTH RECORD
  886. SX7 X6-1L*
  887. ZR X7,DMP3 IF FULL FILE ADD
  888. SX7 X6-1L,
  889. NZ X7,DMP2 IF INSERT NOT STARTED
  890. SA2 A2+B1
  891. DMP2 SA1 T1 INCREMENT ERROR COUNT
  892. SX6 X1+B1
  893. SA6 A1
  894. RJ DPN DISPLAY PROGRAM NAME
  895. DMP3 SA1 O.IPT ADVANCE TO NEXT INSERT
  896. SA2 L.IPT
  897. SX6 X1+2
  898. SX7 X2-2
  899. SA6 A1
  900. SA7 A2
  901. EQ DMP1 LOOP
  902.  
  903. DMP4 SA1 T1
  904. ZR X1,DMP IF NO ERRORS
  905. SX6 B1 SET ERROR FLAG
  906. SA6 ERRF
  907. EQ DMP RETURN
  908. DPN SPACE 4,4
  909. ** DPN - DISPLAY PROGRAM NAME.
  910. * ENTRY (X2) = 42/PROGRAM NAME LEFT JUSTIFIED, 18/RECORD TYPE.
  911.  
  912.  
  913. DPN PS RETURN EXIT
  914. MX0 30
  915. SA1 DPNB+X2
  916. LX6 X1
  917. LX2 30
  918. BX1 -X0*X2
  919. MX7 12
  920. BX7 X7*X2
  921. IX6 X6+X1
  922. SA6 DPNA+1
  923. SA7 A6+B1
  924. MESSAGE A6-B1,,R
  925. EQ DPN RETURN
  926.  
  927. DPNA DATA 22C MISSING
  928. DPNB BSS 0
  929. .E ECHO ,RT=("RTMIC")
  930. .A IFC NE,/RT//
  931. VFD 24/0A_RT,36/1L/
  932. .A ELSE
  933. DATA 0
  934. .A ENDIF
  935. .E ENDD
  936. MSG SPACE 4,5
  937. ** MSG - SEND CONSOLE MESSAGE.
  938. * ENTRY (X1) = PROGRAM NAME LEFT JUSTIFIED.
  939. * (X2) = CONSOLE MESSAGE.
  940.  
  941.  
  942. MSG PS RETURN EXIT
  943. MX0 42
  944. LX6 X2
  945. BX7 X0*X1
  946. SA6 MSGA
  947. SA7 A6+B1
  948. MESSAGE A6,1
  949. EQ MSG RETURN
  950.  
  951. MSGA DATA 17C GETTING
  952. RDD SPACE 4,4
  953. ** RDD - READ DIRECTORY.
  954. * EXIT (X1) = 0 IF DIRECTORY NOT FOUND.
  955.  
  956.  
  957. RDD PS RETURN EXIT
  958. SKIPEI P
  959. SKIPB P,2
  960. READ P
  961. READW P,T1,1
  962. NZ X1,RDD1 IF EOR OR EOF
  963. SA1 T1
  964. LX1 18
  965. SX6 X1-770000B
  966. NZ X6,RDD1 IF NO 7700 TABLE
  967. LX1 6
  968. READW P,WSA,X1
  969. SA1 WSA
  970. BX6 X1
  971. SA6 ID+1
  972. READW P,T1,1
  973. SA2 T1
  974. LX2 18
  975. BX3 X2
  976. SX6 X2-700000B
  977. LX3 18
  978. SX3 X3
  979. NZ X3,RDD1 IF NOT OPLD
  980. NZ X6,RDD1 IF NOT OPLD
  981. LX2 -18
  982. ALLOC PNT,X2
  983. READW P,X3,X4
  984. NZ X1,RDD1 IF EOR
  985. READW P,WSA,3
  986. NZ X1,RDD RETURN IF EOR
  987. RDD1 REWIND P
  988. MX1 0
  989. EQ RDD RETURN
  990. RFR SPACE 4,5
  991. ** RFR - READ FIRST RECORD.
  992. * EXIT (X1) = EOR INDICATOR.
  993. * (RN) = RECORD NAME AND TYPE.
  994.  
  995.  
  996. RFR PS RETURN EXIT
  997. RFR1 READ P
  998. READW P,WSA,WSAL
  999. NG X1,RFR EXIT IF EOF
  1000. BX6 X1
  1001. SX1 B6 LWA+1 OF DATA READ
  1002. SA6 T1
  1003. SX2 WSA
  1004. RJ SRT SET RECORD TYPE
  1005. SA6 RN
  1006. SA1 T1
  1007. SX7 X6-ODRT
  1008. NZ X7,RFR IF NOT OPLD
  1009. NZ X1,RFR1 IF EOR
  1010. RFR2 READW P,WSA,WSAL
  1011. ZR X1,RFR2 LOOP TO EOR
  1012. PL X1,RFR1 IF EOR
  1013. EQ RFR
  1014. SKR SPACE 4,3
  1015. ** SKR - SKIP RECORD.
  1016.  
  1017.  
  1018. SKR PS RETURN EXIT
  1019. SA1 RN
  1020. SA2 =10H SKIPPING
  1021. RJ MSG
  1022. SKR1 READW P,WSA,WSAL
  1023. ZR X1,SKR1 IF NOT EOR
  1024. EQ SKR RETURN
  1025. SMT SPACE 4,10
  1026. ** SMT - SEARCH MANAGED TABLE.
  1027. * ENTRY (A1) = ADDRESS OF TABLE ORIGIN.
  1028. * (X1) = TABLE ORIGIN.
  1029. * (X2) = ENTRY.
  1030. * (X3) = MASK.
  1031. * EXIT (X2) = ENTRY.
  1032. * (X6) = TABLE INDEX.
  1033. * (X7) = 0 IF FOUND.
  1034.  
  1035.  
  1036. SMT PS RETURN EXIT
  1037. SB2 X1
  1038. SA4 A1+TABL
  1039. SB7 X4+B2
  1040. MX7 1
  1041. SB3 B2
  1042. SB4 B1+B1
  1043. SMT1 EQ B3,B7,SMT IF END OF TABLE
  1044. SA1 B3
  1045. BX7 X1-X2
  1046. BX7 X3*X7
  1047. SB3 B3+B4
  1048. NZ X7,SMT1 IF NOT FOUND
  1049. SX6 A1-B2
  1050. EQ SMT RETURN
  1051. WND SPACE 4,3
  1052. ** WND - WRITE NEW DIRECTORY.
  1053.  
  1054.  
  1055. WND PS RETURN EXIT
  1056. RECALL B
  1057. RJ CDT CHECK DEVICE TYPE
  1058. SA1 ND
  1059. ZR X1,WND1 IF NO DIRECTORY
  1060. SX1 X1-1
  1061. ZR X1,WND1 IF *U* OPTION SELECTED
  1062. SA1 RCWF CHECK RECORDS WRITTEN FLAG
  1063. ZR X1,WND1 IF NO RECORDS WRITTEN
  1064. SA1 ID+1 ADD *NPT* ENTRY FOR NEW OPLD
  1065. SX3 8
  1066. SA2 B+6
  1067. IX1 X1+X3
  1068. AX2 30
  1069. ADDWORD NPT
  1070. SA1 L.NPT
  1071. MX6 3
  1072. BX6 X6+X1
  1073. SA6 ID+17B
  1074. WRITEW B,ID,20B
  1075. SA1 O.NPT
  1076. SA2 L.NPT
  1077. WRITEW B,X1,X2
  1078. WRITER B
  1079. WRITEF B
  1080. SA1 B+1
  1081. AX1 48
  1082. SX3 X1-2ROD
  1083. ZR X3,WND2 IF OPTICAL DISK FILE
  1084. BKSP B,R
  1085. WND1 SA1 NR
  1086. NZ X1,WND IF NO REWIND
  1087. WND2 REWIND B
  1088. REWIND P
  1089. EQ WND RETURN
  1090. WNR SPACE 4,4
  1091. ** WNR - WRITE NEXT RECORD.
  1092. * ENTRY (X1) = EOR INDICATOR.
  1093.  
  1094.  
  1095. WNR PS RETURN EXIT
  1096. SX6 B1 SET RECORDS WRITTEN FLAG
  1097. SA6 RCWF
  1098. BX6 X1
  1099. SA6 T1
  1100. SA1 RN
  1101. SA2 WNRA
  1102. RJ MSG
  1103. SA2 RN CHECK TYPE
  1104. SA1 T1
  1105. SB7 X2-ULRT
  1106. ZR B7,WNR3 IF *ULIB*
  1107. SB7 X2-TXRT
  1108. NZ B7,WNR0.2 IF NOT A TEXT RECORD
  1109. SA2 TU
  1110. ZR X2,WNR0.2 IF NOT REMOVING RECORD NAMES
  1111. SA2 WSA
  1112. SB7 WSAL
  1113. MX0 -12
  1114. ZR X1,WNR0.1 IF NOT AT EOR
  1115. SB7 X1-WSA
  1116. ZR B7,WNR2.1 IF EMPTY RECORD
  1117. WNR0.1 SB7 B7-B1
  1118. ZR B7,WNR2.1 IF EMPTY RECORD
  1119. BX6 -X0*X2
  1120. SA2 A2+B1
  1121. NZ X6,WNR0.1 IF NOT AT END OF LINE
  1122. BX0 X1
  1123. WRITEW B,A2,B7
  1124. NZ X0,WNR2.1 IF AT EOR
  1125. READW P,WSA,WSAL
  1126. WNR0.2 NZ X1,WNR2 IF AT EOR
  1127. WNR1 WRITEW B,WSA,WSAL
  1128. READW P,WSA,WSAL
  1129. ZR X1,WNR1 IF NOT EOR
  1130. NG X1,WNR IF EOF/EOI
  1131. WNR2 WRITEW B,WSA,X1-WSA
  1132. WNR2.1 WRITER B
  1133. EQ WNR RETURN
  1134.  
  1135. WNR3 SA2 ND
  1136. ZR X2,WNR6 IF DIRECTORY NOT REQUESTED
  1137. NZ X1,WNR5 IF EOR
  1138. WNR4 WRITEW B,WSA,WSAL
  1139. READW P,WSA,WSAL
  1140. ZR X1,WNR4 IF NOT EOR
  1141. NG X1,WNR IF EOF/EOI - RETURN
  1142. WNR5 WRITEW B,WSA,X1-WSA
  1143. WRITER B
  1144. WNR6 RJ SKR SKIP RECORD
  1145. SA1 RN
  1146. SA2 WNRA
  1147. RJ MSG
  1148. RJ CUL COPY USER LIBRARY
  1149. EQ WNR RETURN
  1150.  
  1151. WNRA DATA 10H GETTING
  1152. ENDS BSS 0 END OF SUBROUTINES
  1153. APN TITLE CONTROL CARD PROCESSING - OVERLAID CODE.
  1154. ** APN - ASSEMBLE PROGRAM NAME.
  1155. * ASSEMBLE ENTRY OF TYPE *LIB/PN,*
  1156. * EXIT (X2) = SEPARATOR CHARACTER
  1157. * (X6) = PROGRAM NAME AND TYPE.
  1158.  
  1159.  
  1160. ORG WSA
  1161. SEG
  1162. APN PS RETURN EXIT
  1163. SA1 CP
  1164. SB4 X1+B1 (B4) = STRING BUFFER POINTER
  1165. SX6 B0
  1166. SB7 60
  1167.  
  1168. * ASSEMBLE FIRST ENTRY.
  1169.  
  1170. APN1 SA2 B4
  1171. SB5 X2-1R/
  1172. ZR B5,APN2 IF CHARACTER = */*
  1173. SA1 =20000000000004030000B
  1174. SB5 X2+B1
  1175. LX1 X1,B5
  1176. NG X1,APN4 IF CHARACTER = EOL *-* * * *,*
  1177. LX6 6
  1178. SB7 B7-6
  1179. IX6 X6+X2
  1180. SB4 B4+B1
  1181. EQ APN1 LOOP
  1182.  
  1183. * CHARACTER = */* SET LIBRARY NAME. ASSEMBLE PROGRAM NAME.
  1184.  
  1185. APN2 LX6 X6,B7
  1186. SA6 APNA
  1187. SX6 B0
  1188. SB7 60
  1189. SB4 B4+B1
  1190. APN3 SA2 B4
  1191. SB5 X2-1R/
  1192. ZR B5,ERR IF CHARACTER = */*
  1193. SA1 =20000000000004030000B
  1194. SB5 X2+B1
  1195. LX1 X1,B5
  1196. NG X1,APN4 IF CHARACTER = EOL *-* * * *,*
  1197. LX6 6
  1198. IX6 X6+X2
  1199. SB7 B7-6
  1200. SB4 B4+B1
  1201. EQ APN3 LOOP
  1202.  
  1203. * CHARACTER = EOL *-* * * *,*. STORE PROGRAM NAME.
  1204.  
  1205. APN4 SA1 APNA CHECK LIBRARY TYPE
  1206. SA2 APNB
  1207. APN5 ZR X2,ERR IF ILLEGAL LIBRARY
  1208. BX7 X1-X2
  1209. SA2 A2+B1
  1210. NZ X7,APN5 IF NOT FOUND
  1211. SX7 A2-APNB-1
  1212. MX0 -18 SET PROGRAM AND LIBRARY NAMES
  1213. LX6 X6,B7
  1214. BX2 -X0*X6
  1215. NZ X2,ERR IF NAME MORE THAN 7 CHARACTERS
  1216. BX6 X0*X6
  1217. BX6 X6+X7
  1218. SA2 B4
  1219. SX7 B4
  1220. SA7 CP
  1221. EQ APN RETURN
  1222.  
  1223.  
  1224. APNA CON 0LTEXT LIBRARY NAME
  1225. APNB BSS 0
  1226. .E ECHO ,RT=("RTMIC")
  1227. .A IFC NE,/RT//
  1228. DATA L/RT/
  1229. .A ELSE
  1230. DATA 1
  1231. .A ENDIF
  1232. .E ENDD
  1233. CON 0
  1234. ARG SPACE 4,3
  1235. ** ARG - PROCESS ARGUMENTS ON COMMAND.
  1236. *
  1237. * ARG SETS FILE NAMES AND FLAGS BASED ON COMMAND PARAMETERS.
  1238. *
  1239. * ENTRY COMMAND PARAMETERS ARE IN JOB COMMUNICATION AREA.
  1240. *
  1241. * EXIT FILE NAMES AND SELECTED OPTION FLAGS ARE SET UP.
  1242. *
  1243. * ERROR TO *GTR8* IF FILE NAME CONFLICT, TOO MANY PARAMETERS,
  1244. * OR INCORRECT PARAMETER.
  1245. *
  1246. * USES X - 0, 1, 2, 3, 6, 7.
  1247. * A - 1, 2, 3, 6, 7.
  1248. * B - 6, 7.
  1249. *
  1250. * MACROS MESSAGE.
  1251.  
  1252.  
  1253. ARG3 SA1 P
  1254. SA2 B
  1255. BX6 X0*X2 SET NEW LFN AS NEW DIRECTORY NAME
  1256. SA6 ID+1
  1257. BX2 X2-X1
  1258. BX1 X0*X2
  1259. NZ X1,ARG4 IF FILE NAMES DIFFERENT
  1260. MESSAGE (=C* FILENAME CONFLICT.*)
  1261. EQ GTR8 ERROR EXIT
  1262.  
  1263. ARG4 SA1 ND READ NO DIRECTORY FLAG
  1264. ZR X1,ARG IF NO DIRECTORY OPTION SELECTED
  1265. SX2 1RU
  1266. LX1 5-59
  1267. IX6 X2-X1
  1268. ZR X6,ARG5 IF *U* OPTION SELECTED
  1269. SX6 B1+
  1270. ARG5 SX7 X6+1 SET OPTION AND RETURN
  1271. SA7 A1+
  1272.  
  1273. ARG PS RETURN EXIT
  1274. SA1 ACTR SET ARGUMENT COUNT
  1275. SA2 CPRF
  1276. SB6 B1+B1 COPYRF MAXIMUM NUMBER OF ARGUMENTS
  1277. SB7 X1
  1278. ZR X2,ARG0 IF NOT COPYRF
  1279. LE B7,B6,ARG0 IF 2 OR LESS ARGUMENTS
  1280. MESSAGE (=C* TOO MANY PARAMETERS.*)
  1281. EQ GTR8 ERROR EXIT
  1282.  
  1283. ARG0 MX0 42
  1284. SA1 B6 FIRST ARGUMENT
  1285. SA2 ARGA SET LIST OF OPTIONS
  1286. ARG1 ZR B7,ARG3 IF END OF ARGUMENTS
  1287. BX6 X0*X1
  1288. SA3 X2
  1289. SB7 B7-B1
  1290. BX3 -X0*X3
  1291. ZR X6,ARG2 IF NULL PARAMETER
  1292. BX6 X6+X3
  1293. SA6 X2
  1294. ARG2 SX3 X1-3 CHECK FOR */* SEPARATOR
  1295. SX6 X1-1R/
  1296. SA1 A1+B1 READ NEXT PARAMETER
  1297. SA2 A2+B1
  1298. ZR X3,ARG2.1 IF NON-POSITIONAL PARAMETERS FOLLOW
  1299. ZR X6,ARG2.1 IF NON-POSITIONAL PARAMETERS FOLLOW
  1300. NZ X2,ARG1 IF MORE PARAMETERS TO PROCESS
  1301. EQ ARG3 RETURN
  1302.  
  1303. ARG2.1 ZR B7,ARG3 IF END OF PARAMETERS
  1304. BX6 X0*X1
  1305. ZR X6,ARG2.3 IF NULL PARAMETER
  1306. SA2 ARGB-1
  1307. ARG2.2 SA2 A2+B1
  1308. ZR X2,ARG2.4 IF NO MATCH IN ARGUMENT TABLE
  1309. BX1 X0*X2
  1310. BX1 X1-X6
  1311. NZ X1,ARG2.2 IF NOT THIS ARGUMENT
  1312. SA6 X2
  1313. ARG2.3 SB7 B7-B1
  1314. SA1 A1+B1
  1315. EQ ARG2.1 PROCESS NEXT PARAMETER
  1316.  
  1317. ARG2.4 MESSAGE (=C* INCORRECT PARAMETER.*)
  1318. EQ GTR8 ERROR EXIT
  1319.  
  1320.  
  1321. * POSITIONAL PARAMETER ARGUMENT TABLE.
  1322.  
  1323. ARGA CON P
  1324. CON B
  1325. CON ND
  1326. CON NR
  1327. CON SQ
  1328. CON NABT
  1329. CON TU
  1330. CON 0
  1331.  
  1332.  
  1333. * POSITION-INDEPENDENT PARAMETER ARGUMENT TABLE.
  1334.  
  1335. ARGB VFD 42/0LD,18/ND
  1336. VFD 42/0LU,18/ND
  1337. VFD 42/0LNR,18/NR
  1338. VFD 42/0LS,18/SQ
  1339. VFD 42/0LNA,18/NABT
  1340. VFD 42/0LT,18/TU
  1341. CON 0
  1342. PRS SPACE 4,4
  1343. ** PRS - PRESET TABLE LENGTHS.
  1344. * ENTRY (A0) = FIELD LENGTH.
  1345.  
  1346.  
  1347. PRS PS RETURN EXIT
  1348. DATE ID+2
  1349. SA1 ID+2 POSITION DATE
  1350. SX6 TAB SET TABLE POINTER
  1351. BX7 X1
  1352. SA6 B0
  1353. LX7 6
  1354. SX6 A0
  1355. SA7 A1
  1356. SA6 FL
  1357. SX6 A0-BUF-10B SET BUFFER LENGTH
  1358. SA6 L.END
  1359. GETFLC MFL GET MAXIMUM MEMORY AND OTHER DATA
  1360. SA1 MFL
  1361. MX6 12
  1362. BX6 X6*X1 ISOLATE AND SAVE MAXIMUM MEMORY
  1363. LX6 17-59
  1364. SA6 A1
  1365. EQ PRS RETURN
  1366.  
  1367. MFL= EQU BUF+BUFL+200000B
  1368. RCD SPACE 4,5
  1369. ** RCD - READ CORRECTION DIRECTIVES.
  1370. * ENTRY (CCDR) = CONTROL CARD.
  1371. * EXIT (X1) < 0 IF FILE IS NON-RANDOM.
  1372.  
  1373.  
  1374. RCD PS RETURN EXIT
  1375. SB2 CCDR UNPACK CONTROL CARD
  1376. SB3 CCDR+10B
  1377. SB4 CBUF
  1378. MX0 -6
  1379. RCD1 SB5 B4+10
  1380. SA1 B2
  1381. SB2 B2+B1
  1382. RCD2 LX1 6
  1383. BX6 -X0*X1
  1384. SA6 B4
  1385. SB4 B4+B1
  1386. NZ X1,RCD2.1 IF NON-ZERO BYTES LEFT IN WORD
  1387. NE B4,B5,RCD3 IF MULTIPLE ZERO BYTES AT END OF WORD
  1388. EQ B2,B3,RCD3 IF END OF COMMAND LINE
  1389. SA2 B2+ CHECK NEXT WORD
  1390. ZR X2,RCD3 IF END OF COMMAND
  1391. RCD2.1 BX1 X1-X6
  1392. NE B4,B5,RCD2 LOOP FOR 10-CHARACTERS
  1393. SX6 B0+
  1394. NE B2,B3,RCD1 LOOP FOR END OF BUFFER
  1395. RCD3 SA6 B4 SUPPRESS TRAILING BLANKS
  1396. SB4 B4-B1
  1397. SA1 B4
  1398. SX6 X1-1R
  1399. ZR X6,RCD3 IF CHARACTER IS * *
  1400.  
  1401. * SKIP OVER GTR CALL.
  1402.  
  1403. SA1 CBUF
  1404. RCD4 SX6 X1-1R.
  1405. ZR X6,RCD5 IF *.* TERMINATOR
  1406. SX6 X1-1R)
  1407. ZR X6,RCD5 IF *)* TERMINATOR
  1408. SA1 A1+B1
  1409. EQ RCD4 LOOP
  1410.  
  1411. RCD5 SX6 A1 SET CHARACTER POINTER
  1412. SA6 CP
  1413.  
  1414. * BUILD INSERT PROGRAM TABLE.
  1415.  
  1416. RCD6 RJ APN
  1417. ZR X6,ERR IF NO NAME
  1418. SA6 T1
  1419. SB5 X2-1R-
  1420. SA6 A6+B1
  1421. NZ B5,RCD7 IF NO SECOND FIELD
  1422. RJ APN
  1423. SA6 T2
  1424. RCD7 SA1 T1
  1425. SA2 A1+B1
  1426. ADDWORD IPT
  1427.  
  1428. * PROCESS NEXT FIELD.
  1429.  
  1430. SA1 CP
  1431. SA2 X1
  1432. SX6 X2-1R
  1433. ZR X6,RCD RETURN IF * *
  1434. NZ X2,RCD6 IF NOT END-OF-LINE
  1435. EQ RCD RETURN
  1436. CBUF SPACE 4,3
  1437. ** CBUF - CARD BUFFER.
  1438.  
  1439.  
  1440. CBUF BSS 80
  1441. SPACE 4
  1442. END GTR GET SELECTED RECORDS
cdc/nos2.source/opl871/gtr.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator