User Tools

Site Tools


cdc:nos2.source:opl871:copyc

Table of Contents

COPYC

Table Of Contents

  • [00013] COPYC - CODED FILE COPIES.
  • [00015] CODED FILE COPIES.
  • [00074] COMMON DATA
  • [00103] MAIN PROGRAMS.
  • [00300] SUBROUTINES.
  • [00302] CPR - COPY RECORD.
  • [00403] ITM - ISSUE TERMINATION MESSAGES.
  • [00506] SLR - SELECT LINE RANGE.
  • [00594] PRS - PRESET PROGRAM.
  • [00652] SCC - SET CHARACTER COUNTS.
  • [00696] CNA - CHECK FOR *NA* PARAMETER (NO ABORT).
  • [00718] SXP - SET EXTRA PARAMETERS.
  • [00782] CCS - CHECK CHARACTER SET.
  • [00809] ERR - PROCESS ERRORS.

Source Code

COPYC.txt
  1. IDENT COPYC,FETS
  2. ABS
  3. ENTRY COPYSBF
  4. ENTRY COPYCF
  5. ENTRY SCOPY
  6. ENTRY COPYCR
  7. ENTRY NPC=
  8. ENTRY RFL=
  9. ENTRY SSM=
  10. SYSCOM B1 DEFINE (B1) = 1
  11. *COMMENT COPYC - CODED FILE COPIES.
  12. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  13. TITLE COPYC - CODED FILE COPIES.
  14. SPACE 4
  15. *** COPYC - CODED FILE COPIES.
  16. * G. R. MANSFIELD. 70/11/25.
  17. SPACE 4
  18. *** DAYFILE MESSAGES.
  19. *
  20. * * COPY COMPLETE.* = INFORMATIVE MESSAGE INDICATING COPY
  21. * COUNT WAS EXHAUSTED BEFORE EOI REACHED.
  22. *
  23. * * EOI ENCOUNTERED.* = INFORMATIVE MESSAGE INDICATING END
  24. * OF INFORMATION WAS ENCOUNTED BEFORE THE COPY COUNT WAS
  25. * EXHAUSTED.
  26. *
  27. * *INCORRECT CHARACTER NUMBER.* = INCORRECT FIRST/LAST
  28. * CHARACTER NUMBER SPECIFIED.
  29. *
  30. * *INCORRECT COUNT.* = OPTIONAL RECORD/FILE COUNT INCORRECT
  31. * FORMAT.
  32. *
  33. * * NO LINE TERMINATOR AT EOR(S).* = NO LINE TERMINATOR WAS
  34. * FOUND FOR THE LAST LINE OF A RECORD(S) (RECORD NOT Z-TYPE
  35. * DATA). THE LINE TERMINATOR IS ADDED, AND THE JOB IS ABORTED
  36. * IF THE *NA* PARAMETER IS NOT SPECIFIED.
  37. *
  38. * * NNNN LINE(S) TRUNCATED.* = INFORMATIVE MESSAGE INDICATING
  39. * NNNN LINES WERE TRUNCATED DURING COPYING.
  40. *
  41. * *TOO MANY PARAMETERS.* = MORE THAN SIX PARAMETERS WERE
  42. * SPECIFIED ON A *COPYCF* OR *COPYCR* CALL, OR MORE THAN
  43. * ELEVEN ON AN *SCOPY* CALL.
  44. *
  45. * *INCORRECT LINE NUMBER SPECIFICATION.* = INCORRECT
  46. * FIRST/LAST LINE NUMBER SPECIFIED.
  47. *
  48. * *INCORRECT REWIND SPECIFICATION.* = REWIND PARAMETER
  49. * NOT *R* OR OMITTED.
  50. *
  51. * *INCORRECT STRUCTURE SPECIFICATION.* = STRUCTURE
  52. * PARAMETER NOT *NS* OR OMITTED.
  53. *
  54. * *INCORRECT CHARACTER SET SPECIFICATION.* = CHARACTER
  55. * SET PARAMETER NOT *D* OR OMITTED.
  56. SPACE 4
  57. **** ASSEMBLY CONSTANTS.
  58.  
  59.  
  60. LINL EQU 500D WORKING BUFFER LENGTH (6-BIT CHARACTERS)
  61. BUFL EQU LINL+1 WORKING BUFFER LENGTH + 1
  62. IBUFL EQU 2001B IFILE BUFFER LENGTH
  63. OBUFL EQU 2001B OFILE BUFFER LENGTH
  64. ****
  65.  
  66.  
  67. * SPECIAL ENTRY POINTS.
  68.  
  69. NPC= EQU 0 FORCE OPERATING SYSTEM PARAMETER FORMAT
  70.  
  71. SSM= EQU 0 SUPPRESS DUMPS OF FIELD LENGTH
  72.  
  73. *CALL COMCMAC
  74. TITLE COMMON DATA
  75. DATA SPACE 4
  76.  
  77.  
  78. ORG 120B
  79. FETS BSS 0
  80.  
  81. I BSS 0
  82. INPUT RFILEC IBUF,IBUFL,(FET=8)
  83.  
  84. O BSS 0
  85. OUTPUT RFILEC OBUF,OBUFL,(FET=8)
  86.  
  87. CT CON 1 COUNT
  88. SK CON 0 SKIP FLAG
  89. FC CON 0 FIRST CHARACTER
  90. LC CON 136 LAST CHARACTER
  91. LTC CON 0 COUNT OF LINES TRUNCATED
  92. NA CON 0 NO-ABORT FLAG
  93. NZ CON 0 NON Z-TYPE DATA FLAG
  94. FL CON 0 FIRST LINE NUMBER
  95. LL CON -1 LAST LINE NUMBER
  96. NS CON 0 STRUCTURE REPORTING FLAG
  97. AS CON 0 ASCII8 FLAG
  98. AF CON 0 ASCII8 WITH FORMAT EFFECTORS FLAG
  99. LN CON 0 LINE NUMBER ERROR MESSAGE FLAG
  100. SC CON 0 *SCOPY* FLAG
  101. FCNT CON 0 FILE COUNT
  102. RCNT CON 0 RECORD COUNT
  103. TITLE MAIN PROGRAMS.
  104. COPYCF SPACE 4,25
  105. *** COPYCF (IFILE,OFILE,N,FCHAR,LCHAR,NA)
  106. *
  107. *
  108. * COPYCF COPIES FILES FROM MEDIUM TO MEDIUM IN CODED MODE.
  109. * FILES ARE TREATED AS 6-BIT CHARACTER DATA WITH A MAXIMUM
  110. * LINE LENGTH DEFINED BY THE CONSTANT *LINL* (500) .
  111. *
  112. * IFILE INPUT FILE NAME.
  113. * OFILE OUTPUT FILE NAME.
  114. * N NUMBER OF FILES TO COPY.
  115. * FCHAR FIRST CHARACTER TO COPY.
  116. * LCHAR LAST CHARACTER TO COPY.
  117. * NA DO NOT ABORT IF RECORD NOT Z-TYPE DATA.
  118. *
  119. * IF IFILE = OFILE, FILES ON IFILE ARE SKIPPED.
  120. *
  121. * ASSUMED PARAMETERS.
  122. * IFILE = *INPUT*
  123. * OFILE = *OUTPUT*
  124. * N = 1
  125. * FCHAR = 1
  126. * LCHAR = 136
  127. * NA NOT SPECIFIED.
  128.  
  129.  
  130. COPYCF BSS 0 ENTRY
  131. SB1 1 (B1) = 1
  132. RJ PRS PRESET PROGRAM
  133. RJ SCC SET CHARACTER COUNTS
  134. NZ B7,ERR3 IF TOO MANY ARGUMENTS
  135. SX0 0 INITIALIZE LINE TRANSFER COUNT
  136.  
  137. CCF1 READ I BEGIN READ
  138. RECALL O
  139. READS I,BUF,-BUFL
  140. RJ CPR COPY RECORD
  141. NG X1,ITM IF EOI
  142. ZR X1,CCF1 LOOP TO EOF
  143. SA2 CT DECREMENT COUNT
  144. SX6 X2-1
  145. SA6 A2
  146. NZ X6,CCF1 LOOP FOR ALL FILES
  147. EQ ITM TERMINATE PROGRAM
  148. COPYCR SPACE 4,25
  149. *** COPYCR (IFILE,OFILE,N,FCHAR,LCHAR,NA)
  150. *
  151. *
  152. * COPYCR COPIES RECORDS FROM MEDIUM TO MEDIUM IN CODED MODE.
  153. * FILES ARE TREATED AS 6-BIT CHARACTER DATA WITH A MAXIMUM
  154. * LINE LENGTH DEFINED BY THE CONSTANT *LINL* (500) .
  155. *
  156. * IFILE INPUT FILE NAME.
  157. * OFILE OUTPUT FILE NAME.
  158. * N NUMBER OF RECORDS TO COPY.
  159. * FCHAR FIRST CHARACTER TO COPY.
  160. * LCHAR LAST CHARACTER TO COPY.
  161. * NA DO NOT ABORT IF RECORD NOT Z-TYPE DATA.
  162. *
  163. * IF IFILE = OFILE, RECORDS ON IFILE ARE SKIPPED.
  164. *
  165. * ASSUMED PARAMETERS.
  166. * IFILE = *INPUT*
  167. * OFILE = *OUTPUT*
  168. * N = 1
  169. * FCHAR = 1
  170. * LCHAR = 136
  171. * NA NOT SPECIFIED.
  172.  
  173.  
  174. COPYCR BSS 0 ENTRY
  175. SB1 1 (B1) = 1
  176. RJ PRS PRESET PROGRAM
  177. RJ SCC SET CHARACTER COUNTS
  178. NZ B7,ERR3 IF TOO MANY ARGUMENTS
  179. SX0 0 INITIALIZE LINE TRANSFER COUNT
  180.  
  181. CCR1 READ I BEGIN READ
  182. RECALL O
  183. READS I,BUF,-BUFL
  184. RJ CPR COPY RECORD
  185. NG X1,ITM IF EOI
  186. SA2 CT DECREMENT COUNT
  187. SX6 X2-1
  188. SA6 A2
  189. NZ X6,CCR1 LOOP FOR ALL RECORDS
  190. EQ ITM TERMINATE PROGRAM
  191. COPYSBF SPACE 4,20
  192. *** COPYSBF (IFILE,OFILE,N,NA)
  193. *
  194. *
  195. * COPYSBF COPIES FILES FROM MEDIUM TO MEDIUM IN BINARY MODE,
  196. * SHIFTING EACH LINE IMAGE 1 CHARACTER TO THE RIGHT AND ADDING
  197. * A LEADING SPACE. A PAGE EJECT IS WRITTEN AT THE BEGINNING
  198. * OF EACH RECORD.
  199. *
  200. * IFILE INPUT FILE NAME.
  201. * OFILE OUTPUT FILE NAME.
  202. * N NUMBER OF FILES TO COPY.
  203. * NA DO NOT ABORT IF RECORD NOT Z-TYPE DATA.
  204. *
  205. * ASSUMED PARAMETERS.
  206. * IFILE = *INPUT*
  207. * OFILE = *OUTPUT*
  208. * N = 1
  209. * NA NOT SPECIFIED.
  210.  
  211.  
  212. COPYSBF BSS 0 ENTRY
  213. SB1 1 (B1) = 1
  214. RJ PRS PRESET PROGRAM
  215. RJ CNA CHECK FOR *NO ABORT* PARAMETER
  216. NZ B7,ERR3 IF TOO MANY PARAMETERS
  217. SX6 -1 SET CHARACTER -1
  218. SA6 FC
  219. SX7 LINL SET MAXIMUM LINE LENGTH
  220. SA7 LC
  221. SA1 I SET BINARY OPERATION
  222. SA2 O
  223. SX3 2
  224. BX6 X1+X3
  225. BX7 X2+X3
  226. SA6 A1
  227. SA7 A2
  228. SX0 0 INITIALIZE LINE TRANSFER COUNT
  229.  
  230. CSF1 READ I BEGIN READ
  231. RECALL O
  232. READS I,BUF,-BUFL
  233. NZ X1,CSF3 IF EOR, EOF, OR EOI
  234. SA2 SK
  235. NZ X2,CSF2 IF SKIP SET
  236. SB7 BUF+BUFL LWA+1 OF BUFFER
  237. NE B6,B7,CSF1.1 IF BUFFER NOT FULL
  238. SA1 LTC INCREMENT TRUNCATION COUNT
  239. SX3 B1
  240. IX7 X1+X3
  241. SA7 A1 UPDATE COUNT
  242. SB6 B6-B1 DECREMENT CHARACTER COUNT
  243. CSF1.1 SX6 1R1 SET PAGE EJECT
  244. SB5 B6-BUF+1 GET NUMBER OF CHARACTERS IN BUFFER
  245. SA6 BUF-1
  246. WRITES O,BUF-1,B5 OUTPUT LINE
  247. SX6 1R CLEAR EJECT
  248. SA6 BUF-1
  249. SX1 B1
  250. IX0 X0+X1 SHOW LINE WRITTEN OUT ALREADY
  251. CSF2 READS I,BUF,-BUFL COPY REMAINDER OF RECORD
  252. CSF3 RJ CPR
  253. NG X1,ITM IF EOI
  254. ZR X1,CSF1 LOOP TO EOF
  255. SA2 CT DECREMENT COUNT
  256. SX6 X2-1
  257. SA6 A2
  258. NZ X6,CSF1 LOOP FOR ALL FILES
  259. EQ ITM TERMINATE PROGRAM
  260. SCOPY SPACE 4,25
  261. *** SCOPY(IFILE,OFILE,N,FCAR,LCAR,NA,R,FCS,FLINE,LLINE,NS)
  262. *
  263. *
  264. * *SCOPY* (STRUCTURE COPY) IS SIMILAR TO *COPYCF*, WITH EXTRA
  265. * PARAMETERS. THE FIRST SIX PARAMETERS ARE EXPLAINED IN THE
  266. * *COPYCF* HEADER. THE EXTRA PARAMETERS ARE AS FOLLOWS.
  267. *
  268. * R REWIND BOTH INPUT AND OUTPUT FILES.
  269. * FCS FILE CHARACTER SET -
  270. * D, BLANK, OR OMITTED = 6/12 DISPLAY CODE.
  271. * FLINE LINE NUMBER OF FIRST LINE TO COPY.
  272. * LLINE LINE NUMBER OF LAST LINE TO COPY.
  273. * NS NO STRUCTURE REPORTING.
  274. *
  275. * DEFAULT VALUES (IF PARAMETER OMITTED) -
  276. *
  277. * N -1 (COPY TO EOI).
  278. * LCHAR 500 (250 6/12 CHARACTERS).
  279. * R DO NOT REWIND FILES.
  280. * FCS 6/12 DISPLAY CODE.
  281. * FLINE PRESENT POSITION, BOI IF REWIND SPECIFIED.
  282. * LLINE EOI OR END OF FILE COUNT.
  283. * NS REPORT FILE STRUCTURE.
  284.  
  285.  
  286. SCOPY BSS 0 ENTRY
  287. SB1 1
  288. SX6 B1 SET *SCOPY* FLAG
  289. SX7 B1 SET STRUCTURE REPORTING
  290. SA6 SC
  291. SA7 NS
  292. SX6 500D SET 250-CHARACTER LINE LENGTH
  293. SX7 -1 SET TO COPY TO EOI
  294. SA6 LC
  295. SA7 CT
  296. RJ PRS PRESET PROGRAM
  297. RJ SCC SET CHARACTER COUNTS
  298. RJ SXP SET EXTRA PARAMETERS
  299. EQ CCF1 PROCESS FILE
  300. TITLE SUBROUTINES.
  301. CPR SPACE 4,20
  302. ** CPR - COPY RECORD.
  303. *
  304. * ENTRY (X1) = FIRST BLOCK STATUS.
  305. * (X0) = NUMBER OF LINES COPIED.
  306. * (B6) = ADDRESS PLUS ONE OF LAST CHARACTER IN BUFFER.
  307. *
  308. * EXIT (X1) .LT. 0, IF EOI ENCOUNTERED.
  309. * (X1) .NE. 0, IF EOF ENCOUNTERED.
  310. * (X1) = 0, IF EOR ENCOUNTERED.
  311. *
  312. * USES X - 0, 1, 2, 3, 6, 7.
  313. * B - 5, 7.
  314. * A - 1, 2, 3, 7.
  315. *
  316. * CALLS SLR.
  317. *
  318. * MACROS ABORT, READS, MESSAGE, WRITEF, WRITER, WRITEW.
  319.  
  320.  
  321. CPR SUBR ENTRY/EXIT
  322. BX7 X1
  323. SA7 CPRA SAVE READ STATUS
  324. NZ X1,CPR4 IF EOR, EOF, OR EOI
  325. CPR1 SA2 SK
  326. SX3 B1
  327. IX0 X0+X3 SHOW LINE COPIED
  328. NZ X2,CPR3 IF SKIP SET
  329. SB7 BUF+BUFL LWA+1 OF BUFFER
  330. NE B6,B7,CPR1.1 IF BUFFER NOT FULL
  331. SA1 LTC INCREMENT TRUNCATION COUNT
  332. IX7 X1+X3
  333. SA7 A1+ UPDATE COUNT
  334. SB6 B6-B1 DECREMENT CHARACTER COUNT
  335. CPR1.1 SA1 FC
  336. SA3 LC
  337. SB5 X1+BUF ADDRESS OF FIRST CHARACTER TO BE OUTPUT
  338. GE B5,B6,CPR9 IF FIRST CHARACTER TO COPY AFTER EOL
  339. SB5 X3+BUF ADDRESS OF LAST CHARACTER TO BE OUTPUT
  340. LE B5,B6,CPR2 IF LAST CHARACTER TO COPY BEFORE EOL
  341. SX3 B6-BUF RESET LAST CHARACTER
  342. CPR2 IX6 X3-X1 NUMBER OF CHARACTERS TO BE OUTPUT
  343. RJ SLR SELECT LINE RANGE
  344. NG X6,CPR3 IF LINE NOT TO BE PRINTED
  345. WRITES O,X1+BUF,X6
  346. CPR3 SA1 CPRA
  347. NZ X1,CPR4.1 IF LAST READ STATUS WAS EOR/EOF/EOI
  348. READS I,BUF,-BUFL
  349. BX7 X1
  350. SA7 CPRA SAVE READ STATUS
  351. ZR X1,CPR1 LOOP IF NO EOR/EOF
  352. CPR4 SB5 B6-BUF
  353. NZ B5,CPR8 IF UNTERMINATED LINE
  354. CPR4.1 NG X1,CPR6 IF EOF OR EOI
  355.  
  356. * PROCESS EOR.
  357.  
  358. SA2 NS CHECK STRUCTURE PARAMETER
  359. ZR X2,CPR4.2 IF STRUCTURE NOT REQUESTED
  360. WRITEW O,CPRB,2
  361. CPR4.2 SA2 SK
  362. NZ X2,CPR5 IF SKIP SET
  363. WRITER O END RECORD
  364. CPR5 SX1 B0 SET EOR STATUS
  365. SA3 RCNT INCREMENT RECORD COUNT
  366. SX7 X3+B1
  367. SA7 A3
  368. EQ CPRX RETURN
  369.  
  370. * PROCESS EOF AND EOI.
  371.  
  372. CPR6 SA2 NS
  373. ZR X2,CPR6.1 IF STRUCTURE NOT REQUESTED
  374. WRITEW O,CPRC,2
  375. CPR6.1 SA2 SK
  376. NZ X2,CPR7 IF SKIP SET
  377. WRITEF O
  378. CPR7 SA2 I CHECK FILE STATUS
  379. LX2 59-9
  380. SX1 B1 SET EOF
  381. SA3 FCNT INCREMENT FILE COUNT
  382. SX6 X3+B1
  383. SA6 A3
  384. PL X2,CPRX IF NOT EOI
  385. SX1 -B1 SET EOI STATUS
  386. EQ CPRX RETURN
  387.  
  388. CPR8 SX7 B1 SET NON Z-TYPE DATA FLAG
  389. SA7 NZ
  390. SA1 NA
  391. NZ X1,CPR1 IF NO-ABORT SPECIFIED
  392. MESSAGE ITMD,0 ISSUE NO LINE TERMINATOR MESSAGE
  393. ABORT
  394.  
  395. CPR9 WRITEW O,(=1L ),B1 ISSUE NULL LINE
  396. EQ CPR3 CONTINUE RECORD COPY
  397.  
  398.  
  399. CPRA CON 0 LAST READ STATUS
  400. CPRB DATA C*--EOR-- *
  401. CPRC DATA C*--EOF-- *
  402. ITM SPACE 4,15
  403. ** ITM - ISSUE TERMINATION MESSAGES.
  404. *
  405. * ENTRY (LTC) = NUMBER OF LINES TRUNCATED.
  406. * (X1) = -1 IF EOI ENCOUNTERED.
  407. * = 0 IF EOR ENCOUNTERED.
  408. * = 1 IF EOF ENCOUNTERED.
  409. *
  410. * EXIT APPROPRIATE MESSAGES ISSUED TO DAYFILE.
  411. *
  412. * USES X - 1, 2, 5, 7.
  413. * A - 1, 2, 7.
  414. * B - 2, 5.
  415. *
  416. * CALLS CDD, SNM.
  417. *
  418. * MACROS ENDRUN, MESSAGE.
  419.  
  420.  
  421. ITM BSS 0 ENTRY
  422. SX7 X1+ SAVE TERMINATION TYPE
  423. SA7 ITME
  424. SA1 X1+ITMG+1 TERMINATION TYPE
  425. SB5 ITMF
  426. SB2 1R/
  427. RJ SNM SET TERMINATION TYPE INTO MESSAGE
  428. SA1 LTC GET TRUNCATION COUNT
  429. ZR X1,ITM1 IF NO LINES TRUNCATED
  430. RJ CDD CONVERT TO DECIMAL DISPLAY CODE
  431. MX1 1 ENTER COUNT IN MESSAGE
  432. SB2 B2-B1
  433. AX1 B2
  434. BX1 X1*X4
  435. SB2 1RX
  436. SB5 ITMA
  437. RJ SNM
  438. MESSAGE ITMA,3 ISSUE LINES TRUNCATED MESSAGE
  439. ITM1 SA1 NZ
  440. ZR X1,ITM2 IF Z-TYPE DATA
  441. MESSAGE ITMD,0 ISSUE NO LINE TERMINATOR MESSAGE
  442. ITM2 SX1 ITMB * EOI ENCOUNTERED.*
  443. SA2 ITME
  444. NG X2,ITM3 IF EOI ENCOUNTERED
  445. SX1 ITMC * COPY COMPLETE.*
  446. ITM3 MESSAGE X1,0 ISSUE COMPLETION MESSAGE
  447. SA1 FCNT FILE COUNT
  448. RJ CDD CONVERT TO DISPLAY
  449. SB2 B2-B1
  450. MX5 1
  451. AX1 X5,B2
  452. BX1 X1*X4 ZERO FILL
  453. SB5 ITMF
  454. SB2 1R+
  455. RJ SNM SET FILE COUNT INTO MESSAGE
  456. SA1 FCNT
  457. SX1 X1-1
  458. ZR X1,ITM3.1 IF JUST ONE FILE
  459. SA1 =1LS
  460. ITM3.1 SB2 1R#
  461. RJ SNM SET PLURAL INTO MESSAGE
  462. SA1 RCNT RECORD COUNT
  463. RJ CDD CONVERT TO DISPLAY
  464. SB2 B2-B1
  465. AX1 X5,B2
  466. BX1 X1*X4 ZERO FILL
  467. SB2 1R-
  468. RJ SNM SET RECORD COUNT INTO MESSAGE
  469. SA1 RCNT
  470. SX1 X1-1
  471. ZR X1,ITM3.2 IF JUST ONE RECORD
  472. SA1 =1LS
  473. ITM3.2 SB2 1R$
  474. RJ SNM SET PLURAL INTO MESSAGE
  475. BX1 X0 LINE COUNT
  476. RJ CDD CONVERT TO DISPLAY
  477. SB2 B2-B1
  478. AX1 X5,B2
  479. BX1 X1*X4 ZERO FILL
  480. SB2 1R,
  481. RJ SNM SET LINE COUNT INTO MESSAGE
  482. SX1 B1
  483. IX1 X0-X1
  484. ZR X1,ITM3.3 IF JUST ONE LINE
  485. SA1 =1LS
  486. ITM3.3 SB2 1R=
  487. RJ SNM SET PLURAL INTO MESSAGE
  488. MESSAGE ITMF
  489. SA2 SC CHECK CALL
  490. ZR X2,ITM4 IF NOT *SCOPY*
  491. MESSAGE =0,1 CLEAR *MS1W* FOR INTERACTIVE USERS
  492. ITM4 ENDRUN
  493.  
  494.  
  495. ITMA DATA C* XXXXXXXXXX LINE(S) TRUNCATED.*
  496. ITMB DATA C* EOI ENCOUNTERED.*
  497. ITMC DATA C* COPY COMPLETE.*
  498. ITMD DATA C* NO LINE TERMINATOR AT EOR(S).*
  499. ITME BSS 1 TERMINATION TYPE
  500. ITMF DATA C* ///. ++++++++++ FILE#; ---------- RECORD$; ,,,,,,,,,
  501. ,, LINE=.*
  502. ITMG DATA L*EOI*
  503. DATA L*EOR*
  504. DATA L*EOF*
  505. SLR SPACE 4,15
  506. ** SLR - SELECT LINE RANGE.
  507. *
  508. * ENTRY (X1) = OFFSET INTO BUF OF FIRST CHARACTER OF LINE.
  509. * (X6) = NUMBER OF CHARACTERS IN LINE.
  510. *
  511. * EXIT (X1) = UNCHANGED.
  512. * (X6) = UNCHANGED IF LINE TO BE COPIED.
  513. * = -1 IF LINE TO BE SKIPPED.
  514. *
  515. * USES X - 1, 2, 3, 4, 5, 6.
  516. * A - 1, 2, 3, 4, 6.
  517. * B - 6, 7.
  518. *
  519. * CALLS DXB.
  520.  
  521.  
  522. SLR SUBR ENTRY/EXIT
  523. SA2 FL CHECK LINE RANGE
  524. SA3 LL
  525. IX2 X2+X3
  526. NG X2,SLRX IF NO LINE RANGE SPECIFIED
  527. SB7 X6 SET CHARACTER COUNT
  528. SA6 SLRB SAVE ENTRY CONDITION
  529. BX6 X1
  530. SA6 A6-B1
  531. SA1 X1+BUF GET FIRST CHARACTER
  532. BX5 X5-X5 CLEAR ASSEMBLY WORD
  533. SB6 60
  534.  
  535. * PROCESS DISPLAY CODE FILE.
  536.  
  537. SLR1 SX2 X1-1R0 CHECK CHARACTER
  538. NG X2,SLR2 IF NOT NUMERIC
  539. SX2 X1-1R+
  540. PL X2,SLR2 IF NOT NUMERIC
  541. SB6 B6-6
  542. LX1 X1,B6
  543. BX5 X1+X5 MERGE DIGIT
  544. ZR B6,SLR2 IF TEN DIGITS PROCESSED
  545. SB7 B7-B1
  546. SA1 A1+B1
  547. ZR B7,SLR2 IF END OF LINE
  548. EQ SLR1 CONTINUE PROCESSING
  549.  
  550. SLR2 ZR X5,SLR3 IF NO DIGITS FOUND
  551. RJ DXB TRANSLATE LINE NUMBER
  552. SA2 SLRB
  553. SA3 FL
  554. SA4 LL
  555. IX5 X6-X3
  556. SA1 SLRA
  557. IX3 X4-X6
  558. NG X5,SLR3 IF LINE NOT IN RANGE
  559. BX6 X2
  560. NG X4,SLRX IF NO END OF RANGE SPECIFIEC
  561. PL X3,SLRX IF IN RANGE
  562. SLR3 SX6 -1
  563. EQ SLRX EXIT
  564.  
  565.  
  566. SLRA CON 0 SAVE (X1)
  567. SLRB CON 0 SAVE (X6)
  568. SPACE 4
  569. * COMMON DECKS.
  570.  
  571.  
  572. *CALL COMCCDD
  573. *CALL COMCCIO
  574. *CALL COMCDXB
  575. *CALL COMCRDS
  576. *CALL COMCRDW
  577. *CALL COMCSNM
  578. *CALL COMCSYS
  579. *CALL COMCWTS
  580. *CALL COMCWTW
  581. SPACE 4
  582. ** BUFFERS.
  583.  
  584.  
  585. BUFFERS BSS 0
  586. USE //
  587. SEG
  588. BSS 1
  589. BUF BSS BUFL
  590. IBUF BSS IBUFL
  591. OBUF BSS OBUFL
  592. RFL= BSS 0
  593. PRS TITLE PRESET.
  594. ** PRS - PRESET PROGRAM.
  595. *
  596. * EXIT (B7) = REMAINDER ARGUMENT COUNT.
  597. * (A5) = LAST ARGUMENT ADDRESS.
  598.  
  599.  
  600. ORG BUF
  601. PRS SUBR ENTRY/EXIT
  602. SX6 IBUF ENTER POINTER TO INPUT BUFFER
  603. SA6 0
  604. SA1 ACTR CHECK ARGUMENT COUNT
  605. MX4 42
  606. SB7 X1
  607. ZR B7,PRSX IF NO ARGUMENTS
  608.  
  609. * PROCESS IFILE NAME.
  610.  
  611. SA5 ARGR SET IFILE NAME
  612. SA2 I
  613. BX7 X4*X5
  614. SX3 X2
  615. ZR X7,PRS1 IF BLANK ARGUMENT
  616. IX7 X7+X3
  617. SA7 A2
  618.  
  619. * PROCESS OFILE NAME.
  620.  
  621. PRS1 SB7 B7-B1
  622. ZR B7,PRS2 IF 1 ARGUMENT
  623. SA5 A5+B1 SET OFILE NAME
  624. SA2 O
  625. BX7 X4*X5
  626. SB7 B7-B1
  627. ZR X7,PRS2 IF BLANK ARGUMENT
  628. IX7 X7+X3
  629. SA7 A2
  630.  
  631. * CHECK FILE NAMES.
  632.  
  633. PRS2 SA1 I CHECK FILE NAMES
  634. SA2 O
  635. IX7 X1-X2
  636. NZ X7,PRS3 IF IFILE .NE. OFILE
  637. SX6 B1 SET SKIP FLAG
  638. SA6 SK
  639.  
  640. * PROCESS COUNT.
  641.  
  642. PRS3 ZR B7,PRSX IF NO ADDITIONAL ARGUMENTS
  643. SA5 A5+1
  644. ZR X5,PRS4 IF BLANK ARGUMENT
  645. RJ DXB CONVERT NUMBER
  646. NZ X4,ERR1 IF INCORRECT COUNT
  647. ZR X6,ERR1 IF COUNT = 0
  648. SA6 CT
  649. PRS4 SB7 B7-1
  650. EQ PRSX RETURN
  651. SPACE 4,15
  652. ** SCC - SET CHARACTER COUNTS.
  653. *
  654. * ENTRY (A5) = ADDRESS OF LAST ARGUMENT PROCESSED.
  655. * (B7) = REMAINING ARGUMENT COUNT.
  656. *
  657. * EXIT (A5) = ADDRESS-1 OF NEXT ARGUMENT.
  658. * (B7) = REMAINING ARGUMENT COUNT.
  659. * (NA) = 1 IF NO-ABORT SPECIFIED.
  660. *
  661. * USES X - 1, 2, 5, 6.
  662. * A - 1, 2, 5, 6.
  663. * B - 2, 7.
  664. *
  665. * CALLS CNA, DXB.
  666.  
  667.  
  668. SCC SUBR ENTRY/EXIT
  669. ZR B7,SCCX IF NO REMAINING ARGUMENTS
  670. SA5 A5+B1 CHECK START CHARACTER
  671. ZR X5,SCC2 IF BLANK
  672. RJ DXB
  673. NZ X4,ERR2 IF INCORRECT COUNT
  674. ZR X6,ERR2 IF FIRST CHARACTER COUNT = ZERO
  675. SB2 X6-BUFL-1
  676. PL B2,ERR2 IF FIRST OUT OF RANGE
  677. SX6 X6-1
  678. SA6 FC
  679. SCC2 SB7 B7-B1
  680. ZR B7,SCC3 IF NO ADDITIONAL COUNTS
  681. SA5 A5+B1 CHECK TERMINAL CHARACTER
  682. ZR X5,SCC2.1 IF BLANK
  683. RJ DXB
  684. NZ X4,ERR2 IF INCORRECT COUNT
  685. SB2 X6-BUFL-1
  686. PL B2,ERR2 IF LAST OUT OF RANGE
  687. SA6 LC
  688. SCC2.1 SB7 B7-B1 DECREMENT ARGUMENT COUNT
  689. SCC3 SA1 FC CHECK CHARACTER LIMITS
  690. SA2 LC
  691. IX6 X2-X1
  692. NG X6,ERR2 IF FIRST .GT. LAST
  693. RJ CNA CHECK FOR *NA* PARAMETER
  694. EQ SCCX RETURN
  695. CNA SPACE 4,10
  696. ** CNA - CHECK FOR *NA* PARAMETER (NO ABORT).
  697. *
  698. * ENTRY (A5) = ADDRESS OF LAST ARGUMENT PROCESSED.
  699. * (B7) = REMAINING ARGUMENT COUNT.
  700. *
  701. * EXIT (NA) = 1 IF NO-ABORT SPECIFIED.
  702. * (B7) = REMAINING ARGUMENT COUNT.
  703. *
  704. * USES X - 5, 6.
  705. * A - 5, 6.
  706. * B - 7.
  707.  
  708.  
  709. CNA SUBR ENTRY/EXIT
  710. ZR B7,CNAX IF NO REMAINING ARGUMENTS
  711. SA5 A5+B1 CHECK *NA* PARAMETER
  712. SB7 B7-B1
  713. ZR X5,CNAX IF BLANK
  714. SX6 B1
  715. SA6 NA SET *NA* FLAG
  716. EQ CNAX RETURN
  717. SXP SPACE 4,15
  718. ** SXP - SET EXTRA PARAMETERS.
  719. *
  720. * ENTRY (A5) = ADDRESS OF LAST ARGUMENT PROCESSED.
  721. * (B7) = ARGUMENT COUNT.
  722. *
  723. * USES X - 0, 1, 2, 4, 5, 6.
  724. * A - 1, 2, 5, 6.
  725. * B - 7.
  726. *
  727. * CALLS CCS, DXB, ERR.
  728. *
  729. * MACROS REWIND.
  730.  
  731.  
  732. SXP SUBR ENTRY/EXIT
  733. ZR B7,SXPX IF NO REMAINING ARGUMENTS
  734.  
  735. * PROCESS REWIND PARAMETER.
  736.  
  737. SA5 A5+B1
  738. ZR X5,SXP1 IF NULL PARAMETER
  739. AX5 54
  740. SX6 X5-1RR
  741. NZ X6,ERR4 IF INCORRECT PARAMETER
  742. REWIND I
  743. REWIND O
  744. SXP1 SB7 B7-B1
  745. RJ CCS CHECK CHARACTER SET
  746. ZR B7,SXPX IF NO MORE PARAMETERS
  747.  
  748. * PROCESS LINE NUMBER PARAMETERS.
  749.  
  750. SA5 A5+B1 GET FIRST LINE NUMBER
  751. ZR X5,SXP2 IF NULL PARAMETER
  752. RJ DXB TRANSLATE PARAMETER
  753. NZ X4,ERR5 IF ERROR DETECTED
  754. SA6 FL
  755. SXP2 SB7 B7-B1
  756. ZR B7,SXPX IF NO MORE PARAMETERS
  757. SA5 A5+B1
  758. ZR X5,SXP3 IF NULL PARAMETER
  759. RJ DXB TRANSLATE PARAMETER
  760. NZ X4,ERR5 IF ERROR DETECTED
  761. SA6 LL
  762. ZR X6,SXP3 IF EOI SPECIFIED
  763. SA1 FL
  764. IX6 X6-X1
  765. NG X6,ERR5 IF FIRST .GT. LAST
  766. SXP3 SB7 B7-B1
  767. ZR B7,SXPX IF NO MORE PARAMETERS
  768.  
  769. * PROCESS STRUCTURE PARAMETER.
  770.  
  771. SA5 A5+B1
  772. ZR X5,SXP4 IF NULL PARAMETER
  773. AX5 48
  774. BX6 X6-X6
  775. SX5 X5-2RNS
  776. NZ X5,ERR6 IF NOT *NS*
  777. SA6 NS
  778. SXP4 SB7 B7-B1
  779. NZ B7,ERR3 IF TOO MANY PARAMETERS
  780. EQ SXPX EXIT
  781. CCS SPACE 4,15
  782. ** CCS - CHECK CHARACTER SET.
  783. *
  784. * ENTRY (A5) = ADDRESS OF LAST ARGUMENT PROCESSED.
  785. * (B7) = NUMBER OF PARAMETERS LEFT TO PROCESS.
  786. *
  787. * EXIT (A5) = UPDATED.
  788. * (B7) = UPDATED.
  789. *
  790. * USES X - 1, 2, 5.
  791. * A - 5.
  792. * B - 7.
  793. *
  794. * CALLS ERR.
  795.  
  796.  
  797. CCS SUBR ENTRY/EXIT
  798. ZR B7,CCSX IF NO REMAINING ARGUMENTS
  799. SA5 A5+B1
  800. SB7 B7-B1
  801. ZR X5,CCSX IF NULL PARAMETER
  802. MX2 48
  803. BX5 X2*X5
  804. LX5 6
  805. SX1 X5-1RD
  806. NZ X1,ERR7 IF NOT 6/12 DISPLAY CODE
  807. EQ CCSX EXIT
  808. ERR SPACE 4
  809. ** ERR - PROCESS ERRORS.
  810.  
  811.  
  812. ERR1 SX0 ERRA
  813. EQ ERR
  814.  
  815. ERR2 SX0 ERRB
  816. EQ ERR EXIT
  817.  
  818. ERR3 SX0 ERRC
  819. EQ ERR EXIT
  820.  
  821. ERR4 SX0 ERRD
  822. EQ ERR EXIT
  823.  
  824. ERR5 SX0 ERRE
  825. EQ ERR EXIT
  826.  
  827. ERR6 SX0 ERRF
  828. EQ ERR EXIT
  829.  
  830. ERR7 SX0 ERRG
  831.  
  832. ERR MESSAGE X0
  833. ABORT
  834.  
  835. ERRA DATA C*INCORRECT COUNT.*
  836. ERRB DATA C*INCORRECT CHARACTER NUMBER.*
  837. ERRC DATA C*TOO MANY PARAMETERS.*
  838. ERRD DATA C*INCORRECT REWIND SPECIFICATION.*
  839. ERRE DATA C*INCORRECT LINE NUMBER SPECIFICATION.*
  840. ERRF DATA C*INCORRECT STRUCTURE SPECIFICATION.*
  841. ERRG DATA C*INCORRECT CHARACTER SET SPECIFICATION.*
  842. SPACE 4
  843. END
cdc/nos2.source/opl871/copyc.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator