User Tools

Site Tools


cdc:nos2.source:opl871:reseq

Table of Contents

RESEQ

Table Of Contents

  • [00010] RESEQ - TIME SHARING RESEQUENCE ROUTINE.
  • [00012] TIME SHARING RESEQUENCE ROUTINE.
  • [00057] WORKING STORAGE AND ASSEMBLY CONSTANTS.
  • [00096] SUBROUTINES
  • [00097] RES - RESEQUENCE.
  • [00263] ADL - ADD LINE NUMBER
  • [00297] CVD - CONVERT DISPLAY CODE NUMBER TO OCTAL.
  • [00329] ITM - ISSUE TRUNCATION MESSAGE.
  • [00357] PLB - PACK LINE INTO A BUFFER.
  • [00407] COMMON DECKS, LITERALS AND BUFFERS
  • [00444] BASIC INTERNAL LINE NUMBER RESEQUENCE ROUTINES
  • [00447] RBF - RESEQUENCE BASIC FILE.
  • [00541] PRE-RESEQUENCE PROCESSOR
  • [00542] PRE - PRE-RESEQUENCE PROCESSOR.

Source Code

RESEQ.txt
  1. IDENT RESEQ,FWA,RESEQ
  2. ABS
  3. SST
  4. SYSCOM B1
  5. ENTRY RESEQ
  6. ENTRY RFL=
  7. SPACE 4
  8. *COMMENT RESEQ - TIME SHARING RESEQUENCE ROUTINE.
  9. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  10. TITLE RESEQ - TIME SHARING RESEQUENCE ROUTINE.
  11. SPACE 4
  12. *** RESEQ - TIME SHARING RESEQUENCE ROUTINE.
  13. *
  14. * D.A. HIVELEY 71/02/14.
  15. SPACE 4
  16. *** RESEQ IS USED TO RESEQUENCE SOURCE FILES WHICH HAVE LEADING
  17. * SEQUENCE NUMBERS OR TO ADD SEQUENCE NUMBERS TO AN
  18. * UNSEQUENCED FILE. THIS MAINLY INCLUDES FORTRAN AND BASIC
  19. * SOURCE CODE. THE FORMAT OF EACH INDIVIDUAL SOURCE LINE
  20. * MAINTAINED. FOR BASIC PROGRAMS AN INTERNAL CHANGE OF LINE
  21. * NUMBERS MUST BE MADE. FOR NON-BASIC PROGRAMS, ALL
  22. * SUBROUTINES REQUIRED BY BASIC ONLY ARE OVERLAYED WITH
  23. * BUFFERS. IF THE FILE TYPE IS DECLARED *T*, THEN THE FILE
  24. * DATA IS NOT INSPECTED AT ALL. FIVE DIGIT SEQUENCE NUMBERS
  25. * PLUS A BLANK ARE MERELY ADDED TO THE BEGINNING OF EACH LINE.
  26. * DIRECT ACCESS FILES MAY BE RESEQUENCED.
  27.  
  28.  
  29. *** THE FORMAT COMMAND.
  30. *
  31. * RESEQ(PFILE,TYPE,SLINO,INCR)
  32. *
  33. * PFILE = PRIMARY FILE NAME.
  34. * TYPE = B - BASIC.
  35. * = F - FORTRAN.
  36. * = T - TEXT.
  37. * = OTHER.
  38. * SLINO = STARTING LINE NUMBER.
  39. * INCR = INCREMENT.
  40.  
  41.  
  42. *** DAYFILE MESSAGES.
  43. *
  44. * *LINE NUMBER LIMIT EXCEEDED* - IF LINE NUMBER ENCOUNTERED
  45. * OR REQUIRED GREATER THAN 99999.
  46. * *RESEQ COMMAND ERROR.* - NO PARAMETERS WERE GIVEN OR A SPECIAL
  47. * CHARACTER WAS USED AS A PARAMETER ON THE COMMAND.
  48. * * RESEQ ERRORS.* - IF UNABLE TO FIND LINE NUMBERS,
  49. * ALL ERRORS WRITTEN TO FILE OUTPUT.
  50. * *RESEQ NUMERIC PARAM ERROR.* - ROUTINE *CVD* TRIED TO
  51. * CONVERT A NON-NUMERIC PARAMETER.
  52. * * INCORRECT WRITE ON READ ONLY FILE.* (CIO ERROR 03) = DIRECT
  53. * ACCESS INPUT FILE WAS NOT ATTACHED IN WRITE MODE.
  54.  
  55.  
  56. *CALL COMCMAC
  57. TITLE WORKING STORAGE AND ASSEMBLY CONSTANTS.
  58. ORG 111B
  59. FWA BSS 0
  60. SPACE 4
  61. **** ASSEMBLY CONSTANTS.
  62.  
  63.  
  64. FETL EQU 10 FET LENGTH
  65. LIMIT EQU 99999 LINE NUMBER LIMIT FOR RESEQUENCE
  66. MNCL EQU 160 MAXIMUM NUMBER OF CHARACTERS IN A LINE
  67. MWBL EQU MNCL/5 MAXIMUM NUMBER OF WORDS IN A LINE
  68. NUMD EQU 5 MAXIMUM NUMBER OF DIGITS IN A LINE NUMBER
  69. OBUFL EQU 101B OUTPUT BUFFER LENGTH
  70. USBA$ SET 1 ENABLES UNPACKING OF 6/12 CHARACTERS
  71. USBL$ SET 1 SPECIFIES STRING BUFFER IN USER PROGRAM
  72. SPACE 4
  73. ** WORKING STORAGE.
  74.  
  75.  
  76. CSET CON 0 CHARACTER SET (0 = NORMAL, 1 = 6/12 ASCII)
  77. DAF CON 0 FILE TYPE (0 = DIRECT ACCESS)
  78. FLDL CON 0 FIELD LENGTH
  79. INCR CON 10 DEFAULT LINE NUMBER INCREMENT
  80. LNTE CON 0 LWA+1 OF LINE NUMBER TABLE
  81. LNTS CON 0 FWA OF LINE NUMBER TABLE
  82. LNUM CON 100 DEFAULT INITIAL LINE NUMBER
  83. SYST CON 2 FILE TYPE (-1 = FORTRAN)
  84. ( 0 = BASIC )
  85. ( 1 = TEXT )
  86. ( 2 = OTHER )
  87. SPACE 4
  88. ** FET DEFINITIONS.
  89.  
  90.  
  91. O BSS 0
  92. OUTPUT FILEB OBUF,OBUFL,EPR,FET=FETL OUTPUT FET
  93. SCR FILEB 2,1,FET=FETL SCRATCH FILE FET
  94. SCR1 FILEB 2,1,FET=FETL SCRATCH FILE FET
  95. INP FILEB 2,1,FET=FETL INPUT FILE FET
  96. TITLE SUBROUTINES
  97. ** RES - RESEQUENCE.
  98. *
  99. * USES X - ALL.
  100. * A - ALL.
  101. * B - 2, 3, 4, 5, 6.
  102. *
  103. * CALLS ADL, CDD, CVD, PLB, PRE, RBF, STF, USB.
  104. *
  105. * MACROS ABORT, ENDRUN, MEMORY, MESSAGE, READC, READEI, READO,
  106. * READW, RENAME, RETURN, REWIND, WRITEC, WRITER, WRITEW.
  107.  
  108.  
  109. RESEQ BSS 0 ENTRY
  110. RJ PRE PRESET
  111. REWIND INP
  112. READEI X2
  113. RES1 SX6 B0+
  114. SA6 RESA CLEAR TRUNCATED LINE FLAG
  115. READC INP,WBUF,MWBL+1
  116. NZ X1,RES16 IF EOI REACHED
  117. BX6 X4
  118. MX0 -12
  119. RES2 BX6 -X0*X6
  120. ZR X6,RES3 IF EOL ENCOUNTERED
  121. READO X2
  122. EQ RES2 CHECK FOR EOL
  123.  
  124. RES3 SB2 WBUF UNPACK LINE INTO STRING BUFFER
  125. SB6 MNCL+1
  126. SA1 CSET GET CHARACTER SET
  127. SB3 X1+
  128. RJ USB
  129. SA2 SYST
  130. SB6 SBUF
  131. SB5 NUMD
  132. SX2 X2-1
  133. ZR X2,RES6 IF TEXT
  134. SX2 B0+
  135. SB4 60
  136. RES4 SA3 B6
  137. GT B6,B7,RES5 IF END OF LINE
  138. SX4 X3-1R0
  139. SX5 X3-1R+
  140. NG X4,RES5 IF LETTER
  141. PL X5,RES5 IF SPECIAL CHARACTER
  142. SB5 B5-B1
  143. LX2 6
  144. SB4 B4-6
  145. IX2 X2+X3
  146. SB6 B6+B1
  147. NZ B5,RES4 IF NOT *NUMD* DIGITS
  148. RES5 LX6 X2,B4
  149. SA6 RESB OLD LINE NUMBER
  150. SX6 B5-NUMD
  151. NZ X6,RES7 IF LINE NUMBER PRESENT
  152. SA4 SYST
  153. SX4 X4+1
  154. ZR X4,RES7 IF FORTRAN
  155. RES6 SB6 B6-B1
  156. SX6 1R
  157. SA6 B6 INSERT BLANK
  158. RES7 SA1 LNUM
  159. RJ CDD CONVERT LINE NUMBER TO DISPLAY CODE
  160. BX2 X6
  161. RJ ADL GO ADD NEW LINE NUMBER TO LINE
  162. SB4 B7-B6
  163. SB4 B4+B1
  164. SB3 MNCL
  165. LE B4,B3,RES8 IF NO TRUNCATION
  166. SB4 B3
  167. SX7 B1
  168. SA7 RESA
  169. RES8 SA1 WBUF PACK LINE INTO WORKING BUFFER
  170. SA2 B6+
  171. RJ PLB
  172. SA2 INCR
  173. SX3 LIMIT
  174. SA1 LNUM
  175. IX6 X1+X2
  176. IX3 X3-X1
  177. NG X3,RES12 IF LIMIT EXCEEDED
  178. SA6 LNUM
  179. SA2 SYST
  180. NZ X2,RES9 IF NOT BASIC
  181. SA2 RESB
  182. RJ CVD
  183. NG X6,RES23 IF CONVERSION ERROR
  184. LX6 24-0 SET UP *LNT* ENTRY
  185. LX1 42-0
  186. BX6 X1+X6 MERGE OLD NUMBER WITH NEW NUMBER
  187. SA3 LNTE
  188. SX7 X3+B1
  189. SA5 FLDL
  190. SA6 X3+
  191. SA7 A3
  192. IX7 X5-X7
  193. PL X7,RES9 IF NO TABLE OVERFLOW
  194. SX7 X5+2000B
  195. SA7 A5+
  196. MEMORY CM,,R,X7
  197. RES9 WRITEC SCR1,WBUF
  198. SA1 RESA
  199. ZR X1,RES1 IF LINE WAS NOT TRUNCATED
  200. RJ ITM ISSUE TRUNCATION MESSAGE
  201. EQ RES1 PROCESS NEXT LINE
  202.  
  203. RES12 SX2 O SET ADDRESS OF FET
  204. RJ STF CHECK IF OUTPUT ASSIGNED TO TERMINAL
  205. NZ X6,RES13 IF NOT TELEX ORIGIN
  206. WRITEC O,(=C*LINE NUMBER LIMIT EXCEEDED.*)
  207. EQ RES23 SKIP ISSUING THE DAYFILE MESSAGE
  208.  
  209. RES13 MESSAGE (=C*LINE NUMBER LIMIT EXCEEDED.*)
  210. EQ RES23 COMPLETE ERROR TERMINATION
  211.  
  212. RES16 REWIND INP,R
  213. SA1 SYST
  214. NZ X1,RES17 IF NOT BASIC
  215. RJ RBF RESEQUENCE BASIC FILE
  216. RETURN SCR1
  217. SA1 SCR
  218. EQ RES18 FINISH FILE PROCESSING
  219.  
  220. RES17 SA1 SCR1
  221. RES18 SA0 A1
  222. SX0 77B
  223. BX2 X0*X1
  224. SX2 X2-3
  225. NZ X2,RES19 IF FILE USED
  226. SA2 ARGR
  227. SX3 B1
  228. MX0 42 MASK OFF NAME
  229. BX2 X0*X2
  230. IX6 X2+X3
  231. SA6 A1
  232. WRITER A0,R
  233. EQ RES22 COMPLETE NORMAL TERMINATION
  234.  
  235. RES19 WRITER A0
  236. REWIND X2,R
  237. SA3 DAF
  238. ZR X3,RES20 IF DIRECT ACCESS INPUT FILE
  239. RENAME A0,ARGR
  240. EQ RES22 COMPLETE NORMAL TERMINATION
  241.  
  242. RES20 READEI X2
  243. RES21 READW A0,SBUF,MNCL
  244. BX0 X1
  245. SX4 B6-SBUF
  246. WRITEW INP,SBUF,X4
  247. PL X0,RES21 IF NOT EOF, COMPLETE COPY
  248. WRITER X2
  249. REWIND X2,R
  250. RES22 WRITER O NORMAL TERMINATION
  251. ENDRUN
  252.  
  253. RES23 REWIND INP
  254. RETURN SCR
  255. RETURN SCR1
  256. MESSAGE (=C* RESEQ ERRORS.*)
  257. WRITER O
  258. ABORT ERROR TERMINATION
  259.  
  260. RESA CON 0 TRUNCATED LINE FLAG
  261. RESB CON 0 OLD LINE NUMBER
  262. ADL SPACE 4,15
  263. ** ADL - ADD LINE NUMBER
  264. *
  265. * ENTRY (B6) = STRING BUFFER ADDRESS+1 OF START OF STATEMENT.
  266. * (X2) = LINE NO. RIGHT JUSTIFIED WITH LEADING BLANKS.
  267. *
  268. * EXIT NUMBER STORED IN STRING BUFFER.
  269. * (B6) = STRING BUFFER ADDRESS OF LAST DIGIT STORED.
  270. *
  271. * USES X - 0, 2, 5, 6, 7.
  272. * A - 6, 7.
  273. * B - 5, 6.
  274.  
  275.  
  276.  
  277. ADL SUBR ENTRY/EXIT
  278. SB5 NUMD
  279. SX7 1R0
  280. SX0 77B
  281. ADL1 BX6 X0*X2
  282. SX5 X6-1R
  283. ZR X5,ADL2 IF SPACE
  284. SB6 B6-B1
  285. SA6 B6
  286. SB5 B5-B1
  287. ZR B5,ADLX IF *NUMD* DIGITS
  288. AX2 6
  289. EQ ADL1 ADD NEXT DIGIT
  290.  
  291. ADL2 SB6 B6-B1
  292. SA7 B6
  293. SB5 B5-B1
  294. NZ B5,ADL2 IF NOT *NUMD* DIGITS
  295. EQ ADLX RETURN
  296. CVD SPACE 4,15
  297. ** CVD - CONVERT DISPLAY CODE NUMBER TO OCTAL.
  298. *
  299. * ENTRY (X2) = LEFT JUSTIFIED NUMBER WITH TRAILING ZEROES.
  300. *
  301. * EXIT (X6) = RIGHT JUSTIFIED NUMBER (IN OCTAL).
  302. * (X6) = NEG., ERROR IN PARAMETER.
  303. *
  304. * USES X - 0, 2, 4, 6, 7.
  305. *
  306. * MACROS MESSAGE.
  307.  
  308.  
  309. CVD SUBR ENTRY/EXIT
  310. SX6 B0+
  311. MX0 -6
  312. CVD1 LX2 6
  313. BX4 -X0*X2
  314. ZR X4,CVDX IF END OF NUMBER
  315. SX7 X4-1R+
  316. SX4 X4-1R0
  317. NG X4,CVD2 IF ALPHA
  318. PL X7,CVD2 IF SPECIAL CHARACTER
  319. LX7 X6,B1
  320. LX6 3
  321. IX6 X6+X7
  322. IX6 X6+X4
  323. EQ CVD1 CHECK NEXT CHARACTER
  324.  
  325. CVD2 MESSAGE (=C*RESEQ NUMERIC PARAM ERROR.*)
  326. SX6 -B1
  327. EQ CVDX RETURN
  328. ITM SPACE 4,15
  329. ** ITM - ISSUE TRUNCATION MESSAGE.
  330. *
  331. * ENTRY (WBUF) = LINE NUMBER IN PACKED FORM.
  332. *
  333. * EXIT MESSAGE WRITTEN TO *OUTPUT*.
  334. *
  335. * USES X - 1, 2.
  336. * A - 1.
  337. * B - 2, 3, 5.
  338. *
  339. * CALLS SNM.
  340. *
  341. * MACROS WRITEC.
  342.  
  343.  
  344. ITM SUBR ENTRY/EXIT
  345. SA1 WBUF
  346. MX2 6*NUMD
  347. BX1 X1*X2 MASK OUT LINE NUMBER
  348. SB2 1R0
  349. SB3 WBUF
  350. SB5 -ITMA
  351. RJ SNM SET NAME IN MESSAGE
  352. WRITEC O,WBUF
  353. EQ ITMX RETURN
  354.  
  355. ITMA DATA C* LINE 00000 TRUNCATED.*
  356. PLB SPACE 4,15
  357. ** PLB - PACK LINE INTO A BUFFER.
  358. *
  359. * ENTRY (A1) = ADDRESS OF WORD TO START PACKING IN.
  360. * (A2) = ADDRESS OF STRING BUFFER TO PACK.
  361. * (B4) = LENGTH OF STRING TO PACK.
  362. *
  363. * EXIT LINE PACKED INTO BUFFER.
  364. *
  365. * USES X - 2, 4, 5, 7.
  366. * A - 2, 7.
  367. * B - 2, 4, 5, 7.
  368.  
  369.  
  370. PLB3 LX7 B2 LEFT ADJUST FINAL PACKED WORD
  371. SA7 A1+B7 STORE PACKED WORD
  372. SB5 12
  373. GE B2,B5,PLBX IF EOL GUARANTEED IN LAST WORD
  374. BX7 X7-X7
  375. SA7 A7+B1
  376.  
  377. PLB SUBR ENTRY/EXIT
  378. MX4 54
  379. SB2 60
  380. SB7 B0
  381. SA2 A2-1
  382. SX7 B0+
  383. PLB1 ZR B4,PLB3 IF ALL CHARACTERS HAVE BEEN PACKED
  384. SA2 A2+B1 GET NEXT CHARACTER
  385. BX5 X4*X2
  386. ZR X5,PLB2 IF NOT A TWELVE BIT CHARACTER
  387. AX5 6
  388. LX7 6
  389. BX7 X7+X5 PACK ESCAPE PARAT OF CHARACTER
  390. SB2 B2-6
  391. BX2 -X4*X2 GET BOTTOM SIX BITS OF CHARACTER
  392. GT B2,PLB2 IF ROOM LEFT FOR CHARACTER
  393. SA7 A1+B7
  394. SB7 B7+B1
  395. SX7 B0+
  396. SB2 60
  397. PLB2 LX7 6
  398. BX7 X7+X2 ADD NEW CHARACTER
  399. SB2 B2-6
  400. SB4 B4-B1
  401. GT B2,PLB1 IF ROOM LEFT FOR MORE CHARACTERS
  402. SA7 A1+B7 STORE PACKED WORD
  403. SB7 B7+B1
  404. SX7 B0
  405. SB2 60
  406. EQ PLB1 PROCESS NEXT CHARACTER
  407. TITLE COMMON DECKS, LITERALS AND BUFFERS
  408. ** COMMON DECKS.
  409.  
  410.  
  411. LIST X
  412. *CALL COMCBLP
  413. LIST -X
  414. *CALL COMCCDD
  415. *CALL COMCCIO
  416. *CALL COMCDXB
  417. *CALL COMCLFM
  418. *CALL COMCRDC
  419. *CALL COMCRDO
  420. *CALL COMCRDW
  421. *CALL COMCSNM
  422. *CALL COMCSTF
  423. *CALL COMCSYS
  424. *CALL COMCUSB
  425. *CALL COMCWTC
  426. *CALL COMCWTW
  427. BUFFERS SPACE 4,10
  428. ** BUFFERS.
  429.  
  430.  
  431. OBUF BSS OBUFL+1
  432. NBUF BSS NUMD+1 LINE NUMBER BUFFER
  433. USBB BSS 0
  434. SBUF BSS MNCL+1 STRING BUFFER
  435. WBUF BSS MWBL+1 WORKING BUFFER
  436. SPACE 4
  437. USE LITERALS
  438. SPACE 4
  439. ** IF THE FILE TYPE IS NOT BASIC, ALL ROUTINES FROM
  440. * THIS POINT ON ARE OVERLAYED WITH BUFFERS.
  441.  
  442.  
  443. BUFF BSS 0
  444. TITLE BASIC INTERNAL LINE NUMBER RESEQUENCE ROUTINES
  445.  
  446. RBF SPACE 4,10
  447. ** RBF - RESEQUENCE BASIC FILE.
  448. *
  449. * EXIT RESEQUENCED FILE RESIDING ON *SCR*.
  450. *
  451. * USES X - ALL.
  452. * A - 1, 2, 6, 7.
  453. * B - 2, 3, 4, 6, 7.
  454. *
  455. * CALLS BLP, PLB, USB.
  456. *
  457. * MACROS READC, READEI, READO, RETURN, REWIND, WRITEC, WRITER.
  458.  
  459.  
  460. RBF SUBR ENTRY/EXIT
  461. SA2 SCR1
  462. MX1 -18
  463. BX3 -X1*X2
  464. SX3 X3-3
  465. NZ X3,RBF1 IF FILE *SCR1* WAS USED
  466. SX4 1033B
  467. BX2 X1*X2
  468. IX6 X2+X4
  469. SA6 A2+ SET FILE NAME AND STATUS
  470. EQ RBF2 INITIALIZE FET FOR FILE *SCR*
  471.  
  472. RBF1 WRITER SCR1
  473. REWIND X2
  474. READEI X2
  475. RBF2 RETURN SCR,R PREPARE SCRATCH FILE
  476. SA2 SCR CLEAR FUNCTION CODE FROM FET
  477. MX0 42
  478. BX7 X0*X2
  479. SX0 3
  480. BX7 X0+X7
  481. SA7 A2
  482. SA1 INP+1
  483. SA2 INP+4
  484. BX7 X1
  485. SA7 SCR+1 SET FIRST
  486. SX7 X7
  487. SA7 A7+B1 SET IN
  488. SX6 X2
  489. SA7 A7+B1 SET OUT
  490. SA6 A7+B1 SET LIMIT
  491.  
  492. * READ A LINE.
  493.  
  494. RBF3 SX6 B0+
  495. SA6 RBFA CLEAR TRUNCATE FLAG
  496. READC SCR1,WBUF,MWBL+1
  497. NZ X1,RBFX IF EOI REACHED, RETURN
  498. BX6 X4
  499. MX0 -12
  500. RBF4 BX6 -X0*X6
  501. ZR X6,RBF5 IF EOL ENCOUNTERED
  502. READO X2
  503. EQ RBF4 CHECK FOR EOL
  504.  
  505. RBF5 SB2 WBUF UNPACK LINE INTO STRING BUFFER
  506. SB6 MNCL+1
  507. SA1 CSET GET CHARACTER SET
  508. SB3 X1+
  509. RJ USB
  510. SB2 B7-SBUF-MNCL
  511. NG B2,RBF6 IF LINE NOT TOO LONG
  512. SB7 MNCL+SBUF
  513. SX7 B1+
  514. SA7 RBFA SET TRUNCATION FLAG
  515. RBF6 SB2 B7+B1 BASIC RESEQUENCE THE LINE
  516. SB7 SBUF+NUMD
  517. SX5 B1 SET *LNT* SORTED
  518. SX6 SBUF+MNCL
  519. SA1 LNTS
  520. SA2 LNTE
  521. SX3 B0+
  522. RJ BLP
  523. SA2 RBFA MARK ANY TRUNCATION
  524. BX6 X1+X2
  525. SA6 A2
  526. SA2 SBUF PACK RESEQUENCED LINE
  527. SA1 WBUF
  528. SB4 B7-SBUF
  529. RJ PLB
  530. WRITEC SCR,WBUF WRITE OUT UPDATED LINE
  531. SA1 RBFA
  532. ZR X1,RBF3 IF LINE WAS NOT TRUNCATED
  533. RJ ITM ISSUE TRUNCATION MESSAGE
  534. EQ RBF3 PROCESS NEXT LINE
  535.  
  536. RBFA CON 0 TRUNCATE FLAG
  537. SPACE 4
  538. IBUFF BSS 0
  539. SPACE 4,10
  540. SPACE 4
  541. TITLE PRE-RESEQUENCE PROCESSOR
  542. ** PRE - PRE-RESEQUENCE PROCESSOR.
  543. *
  544. * *PRE* SETS UP THE FET FOR THE FILES, DETERMINES THE FILE
  545. * TYPE, STARTING LINE NUMBER AND INCREMENT, AND STORES THESE
  546. * INTO THEIR CORRESPONDING CELLS. IF AN ERROR IS DETECTED IN
  547. * THE STARTING LINE NUMBER, A MESSAGE IS ISSUED AND THE PROGRAM
  548. * IS ENDED. A FET IS ALSO ESTABLISHED FOR *SCR1*.
  549. * *PRE* IS THEN OVERLAYED WITH BUFFERS.
  550. *
  551. * EXIT (SYST) - SYSTEM TYPE(-1=FORTRAN,0=BASIC,1=TEXT,
  552. * 2=OTHER).
  553. * (LNUM) - STARTING LINE NUMBER.
  554. * (INCR) - INCREMENT.
  555. * (LNTS) = FWA OF LINE NUMBER TABLE.
  556. * (LNTE) = LWA+1 OF LINE NUMBER TABLE.
  557. *
  558. * USES X - ALL.
  559. * A - 1, 2, 3, 5, 6, 7.
  560. *
  561. * CALLS CVD.
  562. *
  563. * MACROS ABORT, MESSAGE, RETURN, STATUS, TSTATUS.
  564.  
  565.  
  566. PRE SUBR ENTRY/EXIT
  567. SB1 1
  568. SX6 A0-4
  569. SA6 FLDL SAVE FIELD LENGTH
  570. RETURN SCR1,R PREPARE SCRATCH FILE
  571. MX0 42 CLEAR FUNCTION CODE FROM FET
  572. SA1 SCR1
  573. BX6 X0*X1
  574. SX0 3
  575. BX6 X0+X6
  576. SA6 A1
  577. SX0 77B
  578. SA3 ACTR
  579. SX3 X3-1
  580. PL X3,PRE3 IF PARAMETER COUNT NOT ZERO
  581. PRE2 MESSAGE (=C*RESEQ COMMAND ERROR.*)
  582. ABORT
  583.  
  584. PRE3 SA2 ARGR
  585. MX5 42
  586. SX4 3
  587. BX6 X5*X2
  588. IX6 X4+X6
  589. SA6 INP SET FIRST WORD OF PRIMARY FILE FET
  590. SX3 X3-1
  591. NG X3,PRE5 IF NO SYSTEM PASSED
  592. SA2 ARGR+1 GET FILE TYPE (B=BASIC)
  593. BX2 X5*X2
  594. LX2 6
  595. SX1 B1+B1
  596. BX6 X2-X1
  597. ZR X6,PRE4 IF TYPE BASIC
  598. SX6 B1
  599. SA1 =1RT
  600. BX7 X2-X1
  601. SA1 =1RF
  602. BX5 X2-X1
  603. NZ X5,PRE3.1 IF TYPE NOT FORTRAN
  604. SX6 -B1
  605. EQ PRE4 STORE FILE TYPE
  606.  
  607. PRE3.1 NZ X7,PRE5 IF TYPE NOT TEXT
  608. PRE4 SA6 SYST STORE FILE TYPE
  609. PRE5 SA1 JOPR CHECK JOB ORIGIN TYPE
  610. LX1 -24
  611. MX0 -12
  612. BX1 -X0*X1
  613. SX1 X1-IAOT
  614. NZ X1,PRE5.1 IF NOT INTERACTIVE ORIGIN JOB
  615. TSTATUS PREA GET INTERACTIVE STATUS
  616. SA1 PREA+1 CHECK CHARACTER SET
  617. SX6 B1+
  618. LX1 0-2
  619. BX6 X6*X1
  620. SA6 CSET SAVE CHARACTER SET (NORMAL/ASCII)
  621. PRE5.1 SA5 FLDL
  622. SA2 SYST
  623. NZ X2,PRE6 IF FILE TYPE NOT BASIC
  624. SX7 IBUFF
  625. IX6 X5-X7
  626. AX6 2
  627. EQ PRE7 INITIALIZE REST OF FET
  628.  
  629. PRE6 SX7 BUFF OVERLAY BASIC ONLY ROUTINES
  630. IX6 X5-X7 SUBROUTINES WITH INPUT BUFFERS
  631. AX6 1
  632. PRE7 SX6 X6-50
  633. SX4 FETL-5 FET LENGTH - 5
  634. IX6 X6+X7
  635. LX4 18
  636. IX7 X7+X4
  637. SA7 INP+1 SET FIRST
  638. SX7 X7
  639. SA7 A7+B1 SET IN
  640. SA7 A7+B1 SET OUT
  641. SA6 A7+B1 SET LIMIT
  642. SX3 X3-1
  643. NG X3,PRE9 IF NO STARTING LINE NUMBER PASSED
  644. SA2 ARGR+2 GET STARTING LINE NUMBER
  645. MX0 -6
  646. BX7 -X0*X2
  647. NZ X7,PRE2 IF SPECIAL CHARACTER
  648. ZR X2,PRE9 IF NO PARAMETER
  649. RJ CVD CONVERT STARTING LINE NUMBER
  650. NG X6,PRE8 IF CONVERSION ERROR
  651. SX5 X6-LIMIT
  652. NG X5,PRE8.1 IF LINE NUMBER LIMIT NOT EXCEEDED
  653. MESSAGE (=C*LINE NUMBER LIMIT EXCEEDED.*)
  654. PRE8 ABORT
  655.  
  656. PRE8.1 SA6 LNUM SAVE STARTING LINE NUMBER
  657. PRE9 SX3 X3-1
  658. NG X3,PRE10 IF NO INCREMENT PASSED
  659. SA2 ARGR+3 GET LINE INCREMENT
  660. MX0 -6
  661. BX6 -X0*X2
  662. NZ X6,PRE2 IF SPECIAL CHARACTER
  663. ZR X2,PRE10 IF NO PARAMETER
  664. RJ CVD CONVERT LINE NUMBER INCREMENT
  665. NG X6,PRE8 IF CONVERSION ERROR
  666. SA6 INCR SAVE INCREMENT
  667. PRE10 STATUS INP,P
  668. SA1 INP+5
  669. MX3 -6
  670. BX7 X7-X7
  671. AX1 6
  672. BX4 -X3*X1
  673. SX6 X4-PMFT
  674. SA6 DAF STORE DIRECT ACCESS FILE FLAG
  675. SA3 INP+4
  676. SA7 A1+B1 CLEAR RANDOM INDEX
  677. SX7 X3+B1
  678. SX5 FETL-5 FET LENGTH - 5
  679. LX5 18
  680. BX6 X7+X5
  681. SA6 SCR1+1 SET FIRST
  682. SA7 A6+B1 SET IN
  683. SA7 A7+B1 SET OUT
  684. SA5 SYST
  685. NZ X5,PRE11 IF FILE TYPE NOT BASIC
  686. SA1 INP+2
  687. IX4 X3-X1 BUFFER LENGTH
  688. IX6 X7+X4
  689. SX6 X6+100
  690. SX7 X6+B1
  691. SA7 LNTS
  692. SA7 LNTE
  693. EQ PRE12 SET LIMIT
  694.  
  695. PRE11 SA1 FLDL
  696. SX6 X1+
  697. PRE12 SA6 SCR1+4 SET LIMIT
  698. EQ PREX RETURN
  699.  
  700.  
  701. PREA BSS 2 BUFFER FOR *TSTATUS* MACRO
  702. SPACE 4
  703. RFL= EQU 6000B
  704.  
  705.  
  706. END
cdc/nos2.source/opl871/reseq.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator