User Tools

Site Tools


cdc:nos2.source:opl871:iedit

Table of Contents

IEDIT

Table Of Contents

  • [00010] IEDIT - IN-LINE EDITOR.
  • [00142] MACRO DEFINITIONS.
  • [00144] DAC - DECLARE ATTRIBUTES FOR CHARACTER POSITION.
  • [00200] FIELD - DEFINE FIELDS.
  • [00232] MXB - MASK WITH B REGISTER
  • [00255] OVLDEF - DEFINE IEDIT OVERLAY.
  • [00278] VERB - DECLARE VERB.
  • [00388] DSUB - DECLARE SUBROUTINE (HELPER MACRO).
  • [00425] COMMON DECKS.
  • [00431] WORKING STORAGE.
  • [00578] TABLES.
  • [00664] MAIN PROGRAM.
  • [00666] IED - MAIN LOOP OF PROGRAM.
  • [00778] FUNCTION PROCESSORS.
  • [00780] MRD - *MOVE*, *READ*, AND *DUP* FUNCTION PROCESSOR.
  • [00845] SUBROUTINES.
  • [00847] ABL - ADD BLANKS TO LINE.
  • [00893] ABS - ALLOCATE BUFFER SPACE.
  • [00964] AEC - APPEND AND ECHO CHANGE RECORD.
  • [01044] CBO - COPY BUFFER TO OUTPUT.
  • [01091] CBR - CALL *BASIC* RESEQUENCER.
  • [01119] CLN - CHECK IF LINE NUMBER IS IN LINE RANGE TABLE.
  • [01160] CNL - CONVERT AND NORMALIZE LINE NUMBER.
  • [01180] ERT - ECHO RECORD TO TERMINAL.
  • [01223] ERR - ERROR PROCESSOR.
  • [01249] FATAL ERRORS - ERRORS WHICH WHEN ENCOUNTERED CAUSE *IEDIT*
  • [01273] INFORMATIVE MESSAGES - ISSUED TO NOTIFY THE USER OF AN
  • [01281] MLB - MANAGE LINE BUFFER.
  • [01365] PIT - PROCESS TERMINAL INTERRUPT.
  • [01430] PLB - PACK LINE INTO A BUFFER.
  • [01498] RAF - RECALL ALL FETS.
  • [01514] RSF - REWIND/RETURN SCRATCH FILES.
  • [01566] SBE - SET BUFFER EMPTY.
  • [01592] SFI - SET FET INFORMATION.
  • [01633] SFP - SET FET POINTERS.
  • [01681] SLN - SET LOCAL FILE NAME.
  • [01704] SSF - SORT SELECTED FILE.
  • [01773] TOV - TABLE OVERFLOW.
  • [01793] VPL - EVALUATE PACKED LINE NUMBER.
  • [01867] WTL - WRITE TRUNCATED LINE.
  • [01893] WTO - WRITE DATA TO OUTPUT.
  • [01928] COMMON DECKS.
  • [01955] OVERLAYABLE FUNCTION PROCESSORS.
  • [01957] PSC - PROCESS SEQUENTIAL COMMANDS.
  • [02269] OVERLAYABLE SUBROUTINES.
  • [02271] CSL - CHANGE STRING IN LINE.
  • [02347] FSL - FIND STRING IN LINE.
  • [02390] ICE - INDEXED CODE EXECUTION.
  • [02406] MLT - MANAGE LINE NUMBER TABLE.
  • [02463] PLO - PROCESS LINE OVERLAP.
  • [02642] PWN - PROCESS *WRITEN*.
  • [02681] RLN - REPLACE LINE NUMBER.
  • [02949] SLF - SELECT LINES FROM FILE.
  • [03087] SLE - SORT *LNT* ENTRIES.
  • [03125] SLT - SORT LINE NUMBER TABLE.
  • [03173] SMT - SORT AND MERGE LINE NUMBER TABLE.
  • [03267] MEMORY ALLOCATION.
  • [03270] PRESET.
  • [03272] PRS - PRESET ARGUMENT PROCESSING.
  • [03520] PVA - PROCESS VERB ARGUMENTS.
  • [03620] GFN - GET FILE NAME.
  • [03670] GIN - GET INCREMENT.
  • [03705] GLI - GET LINE NUMBER TO INSERT TEXT AFTER.
  • [03739] GLS - GET LINES.
  • [03765] GSP - GET STRING PAIR.
  • [03809] GSR - GET SINGLE RANGE OF LINE NUMBERS.
  • [03831] GSS - GET STRING FOR SEARCH.
  • [03857] FVT - FIND VERB IN TABLE.
  • [03902] GCS - GET CHARACTER STRING FOR SEARCH.
  • [03943] GLN - GET LINE NUMBER.
  • [03992] GLR - GET LINE RANGE.
  • [04066] GTB - GET BLOCK.
  • [04162] GTC - GET CHARACTER AND ATTRIBUTE.
  • [04223] GTS - GET SEPARATOR.
  • [04408] TDVB - TABLE OF DEFINED VERBS.
  • [04443] PBR - PERFORM *BASIC* RESEQUENCING.
  • [04527] PEF - PROCESS EDIT FILE.
  • [04613] PLN - PROCESS LINE.
  • [04665] PNL - PROCESS NON-OVERLAPPED LINES.
  • [04699] POL - PROCESS OVERLAPPED LINES.
  • [04719] RNE - REMOVE NON-OVERLAP *LNT* ENTRIES.

Source Code

IEDIT.txt
  1. IDENT IEDIT,FWA,IEDIT
  2. ABS
  3. SST
  4. ENTRY IEDIT
  5. ENTRY MFL=
  6. ENTRY CLB=
  7. ENTRY SSM=
  8. SYSCOM B1 DEFINE (B1) = 1
  9. LIST F
  10. TITLE IEDIT - IN-LINE EDITOR.
  11. SPACE 4,10
  12. *COMMENT IEDIT - IN-LINE EDITOR.
  13. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  14. SPACE 4,10
  15. ***** IEDIT - IN-LINE EDITOR.
  16. *
  17. * J. W. YOCUM. 79/12/17.
  18. * C. S. MEAGHER. 80/04/22.
  19. * S. P. BOOTH. 80/05/31.
  20. * K. F. REHM. 81/08/10.
  21. * S. D. PAINTER. 81/08/10.
  22. SPACE 4,10
  23. *** *IEDIT* IS A *CPU* PROGRAM WHICH IS CALLED BY *IAF*
  24. * TO PERFORM AN EDITING FUNCTION ON A LINE NUMBERED FILE.
  25. * IT IS DESIGNED TO BE EXECUTED THROUGH THE *IAF* INTERFACE.
  26. * THE EDIT COMMAND IS PLACED INTO THE COMMAND LINE BUFFER,
  27. * THROUGH THE USE OF THE *CLB=* ENTRY POINT.
  28. SPACE 4,10
  29. *** COMMAND FORMAT.
  30. *
  31. *
  32. * IEDIT (FN=LFN,OP=OPTIONS,CS=CHARTYPE)
  33. *
  34. * LFN NAME OF EDIT FILE. THIS PARAMETER
  35. * IS REQUIRED.
  36. *
  37. * OPTIONS B, F, L (ANY COMBINATION MAY BE USED).
  38. *
  39. * B - BASIC SUBSYSTEM FLAG INDICATING BASIC
  40. * RESEQUENCING SHOULD BE PERFORMED AS
  41. * REQUIRED (OMITTED WHEN TERMINAL IS NOT
  42. * IN BASIC SUBSYSTEM).
  43. *
  44. * F - FORTRAN SUBSYSTEM FLAG INDICATING
  45. * TERMINAL IS IN FORTRAN SUBSYSTEM
  46. * (OMITTED WHEN TERMINAL IS NOT IN
  47. * FORTRAN SUBSYSTEM).
  48. *
  49. * L - LIST FLAG. IF PRESENT, ALL LINES
  50. * CHANGED WILL BE ECHOED TO THE
  51. * TERMINAL.
  52. * IF OMITTED CHANGED LINES ARE NOT
  53. * ECHOED. (TERMINAL USER MAY SUSPEND
  54. * ECHO CAPABILITIES BY ENTERING A USER
  55. * BREAK.)
  56. *
  57. *
  58. * CHARTYPE CHARACTER TYPE DEFINITION
  59. * NORMAL - DISPLAY CODE. ( DEFAULT )
  60. * ASCII - 6/12 ASCII.
  61. SPACE 4,10
  62. *** ERROR MESSAGES.
  63. *
  64. * THE FOLLOWING ERROR MESSAGES WILL BE ISSUED WHEN AN ERROR
  65. * IS ENCOUNTERED, CAUSING *IEDIT* TO ABORT WITHOUT EXECUTING
  66. * THE COMMAND.
  67. *
  68. * *BUFFER SPACE ERROR (TOV).* - INTERNAL ERROR.
  69. *
  70. * *COMMAND ARGUMENT ERROR.* - AN INCORRECT PARAMETER
  71. * WAS ENTERED ON THE COMMAND.
  72. *
  73. * *COMMAND NOT PROCESSED DUE TO OVERLAP.* - YOU HAVE SPECIFIED
  74. * THAT THE SELECTED EDIT COMMAND SHOULD NOT BE
  75. * PROCESSED DUE TO OVERLAPPING LINE NUMBERS.
  76. *
  77. * *DUPLICATE FILE NAME.* - A DUPLICATE FILE NAME WAS
  78. * ENCOUNTERED ON A SINGLE DIRECTIVE.
  79. *
  80. * *EMPTY FILE (SSF).* - INTERNAL ERROR.
  81. *
  82. * *FILE NAME ERROR.* - THE FILE NAME SPECIFIED CONTAINS MORE
  83. * THAN SEVEN CHARACTERS OR NON-ALPHANUMERIC CHARACTERS.
  84. *
  85. * *INCORRECT SYNTAX.* - A REQUIRED PARAMETER IS MISSING,
  86. * PARAMETERS ARE GIVEN IN THE WRONG ORDER, OR AN
  87. * INCORRECT SEPARATOR HAS BEEN ENCOUNTERED.
  88. *
  89. * *LINE NUMBER INCREMENT ERROR.* - THE LINE NUMBER INCREMENT
  90. * SPECIFIED IS LESS THAN ONE OR GREATER THAN 4095.
  91. *
  92. * *LINE NUMBER LIMIT EXCEEDED.* - AN ATTEMPT TO MOVE,
  93. * DUPLICATE, OR READ A GROUP OF LINES IN THE EDIT FILE
  94. * REQUIRED A LINE NUMBER GREATER THAN 99999 TO BE
  95. * ASSIGNED.
  96. *
  97. * *LINE NUMBER OVERLAP ERROR.* - TWO OR MORE LINE RANGES HAVE
  98. * AT LEAST ONE LINE NUMBER IN COMMON.
  99. *
  100. * *LINE RANGE ERROR.* - AN INCORRECT LINE NUMBER WAS SPECIFIED
  101. * IN A LINE RANGE.
  102. *
  103. * *NO LINE NUMBER ON LINE.* - EITHER THE PRIMARY FILE OR A
  104. * SEQUENCED READ FILE CONTAINS A LINE WITHOUT A LINE
  105. * NUMBER.
  106. *
  107. * *NO LINES FOUND.* - NO LINE IN THE EDIT FILE MEETS THE
  108. * CRITERIA SPECIFIED BY THE EDIT COMMAND.
  109. *
  110. * *NO READ/DESTINATION FILE SPECIFIED.* - NO READ OR
  111. * DESTINATION FILE WAS SPECIFIED IN THE EDIT COMMAND.
  112. *
  113. * *NON-EXISTENT EDIT VERB SPECIFIED.* - INTERNAL ERROR.
  114. *
  115. * *READ FILE EMPTY.* - THE READ FILE SPECIFIED DOES NOT EXIST
  116. * OR CONTAINS NO DATA.
  117. *
  118. * *RESERVED FILE NAME.* - A RESERVED FILE NAME WAS INCORRECTLY
  119. * USED.
  120. *
  121. * *TOO SMALL BUFFER SPACE.* - INTERNAL ERROR.
  122. *
  123. * THE FOLLOWING MESSAGES ARE ISSUED TO NOTIFY THE USER OF AN
  124. * UNUSUAL CONDITION. THE *IEDIT* COMMAND IS PROCESSED TO
  125. * COMPLETION.
  126. *
  127. * *NO CLOSING DELIMITER FOUND.* - NO CLOSING DELIMITER WAS
  128. * FOUND ON A STRING. A STRING IS CONSIDERED TO END
  129. * AFTER THE LAST NON BLANK CHARACTER.
  130. *
  131. * *ZZZZZ LINES TRUNCATED ON FILE QQQQQQQ.* - ZZZZZ LINES WERE
  132. * TRUNCATED ON FILE QQQQQQQ.
  133.  
  134.  
  135. * ESTABLISH QUAL BLOCK ORDER.
  136.  
  137. QUAL IEDIT1
  138. QUAL COMCBLP
  139. QUAL COMCSNF
  140. QUAL MACRO$
  141. QUAL
  142. TITLE MACRO DEFINITIONS.
  143. DAC SPACE 4,15
  144. ** DAC - DECLARE ATTRIBUTES FOR CHARACTER POSITION.
  145. *
  146. * DAC GENERATES A WORD WHICH STORES ATTRIBUTES FOR TWO
  147. * CHARACTERS. THE HIGH 30 BITS HOLD THE CHARACTER ATTRIBUTES
  148. * FOR AN ASCII 6/12 CHARACTER. THE LOW 30 BITS HOLD THE SAME
  149. * DATA FOR AN ASCII8 CHARACTER. EACH HALF ALSO CONTAINS THE
  150. * DISPLAY CODE EQUIVALENT OF ITS CHARACTER IF ONE EXISTS.
  151. *
  152. * DAC DI,DC,DA,AI,AC,AA
  153. *
  154. * ENTRY DI - IF SPECIFIED, NO DISPLAY CODE EQUIVALENT OF
  155. * ASCII 6/12 CHARACTER.
  156. * DC - DISPLAY CODE EQUIVALENT OF 6/12 ASCII
  157. * CHARACTER.
  158. * DA - ATTRIBUTES FOR ASCII 6/12 CHARACTER.
  159. * AI - IF SPECIFIED, NO DISPLAY CODE EQUIVALENT OF
  160. * ASCII8 CHARACTER.
  161. * AC - DISPLAY CODE EQUIVALENT OF ASCII8 CHARACTER.
  162. * AA - ATTRIBUTES FOR ASCII8 CHARACTER.
  163. *
  164. * EXIT ENTRIES GENERATED IN THE FOLLOWING FORMAT -
  165. *
  166. *T 1/DI,NBIC/DC,DIST/0,MXNA/DA,1/AI,NBIC/AC,DIST/0,MXNA/AA
  167. *
  168. * WHERE -
  169. * NBIC - NUMBER OF BITS IN DISPLAY CODE CHARACTER.
  170. * MXNA - MAXIMUM NUMBER OF ATTRIBUTES PER CHARACTER.
  171. * DIST - PROPER NUMBER OF BITS TO ENSURE THAT CHARACTER
  172. * DATA FITS EXACTLY IN 30 BITS.
  173. *
  174.  
  175.  
  176. PURGMAC DAC
  177. DAC MACRO DI,DC,DA,AI,AC,AA
  178. MACREF DAC
  179. DIST EQU 30-1-NBIC-MXNA
  180. .A IFC EQ,*DA**
  181. VFD 30/7777777777B
  182. .A ELSE
  183. .B IFC NE,*DI**
  184. VFD 1/1,NBIC/0,DIST/0,MXNA/DA
  185. .B ELSE
  186. VFD 1/0,NBIC/DC_B,DIST/0,MXNA/DA
  187. .B ENDIF
  188. .A ENDIF
  189. .A IFC EQ,*AA**
  190. VFD 30/7777777777B
  191. .A ELSE
  192. .B IFC NE,*AI**
  193. VFD 1/1,NBIC/0,DIST/0,MXNA/AA
  194. .B ELSE
  195. VFD 1/0,NBIC/AC_B,DIST/0,MXNA/AA
  196. .B ENDIF
  197. .A ENDIF
  198. DAC ENDM
  199. FIELD SPACE 4,20
  200. ** FIELD - DEFINE FIELDS.
  201. *
  202. * TAGS ARE GENERATED TO GIVE THE WORD LOCATION, BIT
  203. * LOCATION, AND NUMBER OF BITS IN FIELD.
  204. *
  205. * ENTRY TAG FIELD WP,LB,RP
  206. * TAG = NAME OF FIELD (1-6 LEGAL COMPASS CHARACTERS)
  207. * = *, USE CURRENT VALUE OF PSEUDO ORG COUNTER ORLOC1$
  208. * LB = LEFT-MOST BIT POSITION WITHIN A WORD (BIT 59 BEING
  209. * SIGN BIT).
  210. * RB = RIGHT-MOST BIT POSITION WITHIN A WORD.
  211. *
  212. * EXIT TAGW = WORD LOCATION OF FIELD.
  213. * TAGS = LEFT BIT POSITION OF FIELD.
  214. * TAGN = NUMBER OF BITS IN FIELD.
  215.  
  216.  
  217. PURGMAC FIELD
  218.  
  219. MACRO FIELD,TAG,WP,LB,RB
  220. MACREF FIELD
  221. IFC NE,/WP//,4
  222. IFC EQ,/WP/*/,2
  223. _TAG_W EQU ORLOC1$
  224. SKIP 1
  225. _TAG_W EQU WP
  226. _TAG_S EQU LB
  227. _TAG_N EQU LB-RB+1
  228. ENDM
  229. BASE *
  230. ENDX
  231. MXB SPACE 4,15
  232. ** MXB - MASK WITH B REGISTER
  233. *
  234. * ENTRY I - X REGISTER TO PLACE MASK IN.
  235. * J - B REGISTER SPECIFING SIZE OF MASK.
  236. * 0 .LE. (B(J)) .LE. 60.
  237. *
  238. * EXIT MX(I) CONTAINS MASK OF SIZE SPECIFIED IN B(J).
  239. * B(J) SAME AS ON ENTRY.
  240. *
  241. * MXB PROVIDES A MASK INSTRUCTION USING A B REGISTER.
  242. * RESTRICTION - 0 .LE. (B) .LE. 60
  243.  
  244.  
  245. MXB OPDEF I,J
  246. BX.I X.I-X.I CLEAR X REGISTER
  247. SB.J B.J-B1
  248. PX.I X.I,B.J
  249. AX.I 58
  250. LX.I 59-0
  251. AX.I B.J A BIT MASK
  252. SB.J B.J+B1 RESTORE BJ
  253. ENDM
  254. OVLDEF SPACE 4,10
  255. ** OVLDEF - DEFINE IEDIT OVERLAY.
  256. *
  257. * OVLDEF LA,EA,LEVEL,TITLE
  258. *
  259. * LA = LOAD ADDRESS.
  260. * EA = ENTRY ADDRESS.
  261. * LEVEL = LEVEL OF OVERLAY.
  262. * TITLE = TITLE OF OVERLAY.
  263.  
  264.  
  265. PURGMAC OVLDEF
  266.  
  267. OVLDEF MACRO LA,EA,LVL,TEXT
  268. MACREF OVLDEF
  269. QUAL IEDIT_LVL
  270. TTL IEDIT_LVL - TEXT
  271. TITLE
  272. IDENT IEDIT_LVL,LA,EA,LVL,0
  273. *COMMENT IEDIT - TEXT
  274. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  275. ORG LA
  276. ENDM OVLDEF
  277. VERB SPACE 4,40
  278. ** VERB - DECLARE VERB.
  279. *
  280. * VERB V,AL,P,FP DECLARE VERB
  281. * VERB DECLARE END OF VERB DECLARATIONS.
  282. *
  283. * ENTRY V - IEDIT VERB.
  284. * AL - * IF ALL ABBREVIATIONS OF THE VERB ARE TO BE
  285. * GENERATED; OTHERWISE NULL(OR ANY OTHER SYMBOL).
  286. * P - ORDERED LIST OF PROCESSOR DESCRIPTORS IN THE FORM
  287. * (AD,CON) -
  288. * AD - ENTRY ADDRESS OF PROCESSOR.
  289. * CON - R, IF SYNTACTIC ELEMENT REQUIRED.
  290. * O, IF SYNTACTIC ELEMENT IS OPTIONAL
  291. * (0 OR 1 OCCURRENCES).
  292. * A, IF ALTERNATE SYNTAX FOR COMMAND
  293. * FOLLOWS.
  294. * FP - FUNCTION PROCESSOR NUMBER.
  295. *
  296. * EXIT ENTRIES GENERATED ARE OF THREE TYPES, TYPE1, TYPE2
  297. * AND TYPE3.
  298. *T TYPE1 42/CV,6/0,6/P,6/V
  299. *T,TYPE2 2/OP,40/OFFSET,18/ADR
  300. *T,TYPE3 2/0,1/1,39/0,18/FP
  301. * WHERE -
  302. * CV - V OR ALLOWED ABBREVIATION OF V IN DISPLAY CODE.
  303. * P - NUMBER OF WORDS INCREMENT TO START OF LIST
  304. * OF PROCESSORS.
  305. * V - NUMBER OF WORDS INCREMENT TO NEXT VERB.
  306. * OP - 1, IF PROCESSOR RECOGNITION OF AN ELEMENT IS
  307. * OPTIONAL. I.E. 0 OR 1 OCCURRENCES ARE
  308. * TO BE ACCEPTED.
  309. * - 2 IF PROCESSOR MUST PROCESS AN OCCURENCE OF
  310. * THE SYNTACTIC ELEMENT
  311. * ( I.E. THIS FUNCTION IS REQUIRED).
  312. * OFFSET - OFFSET TO ALTERNATE SYNTAX FROM
  313. * START OF TABLE.
  314. * ADR - ENTRY ADDRESS OF SYNTAX PROCESSOR.
  315. *
  316. * MACROS DSUB.
  317.  
  318.  
  319. PURGMAC VERB
  320.  
  321. VERB MACRO V,AL,P,FP
  322. LOCAL S,L,NM1,R,CV,LIST
  323. MACREF VERB
  324.  
  325. .A IFC NE,$_V_AL_P_$$
  326.  
  327. S MICRO 1,,$V$
  328. L MICCNT S
  329. .B IFLT L,3
  330. ERR INCORRECT VERB SPECIFIED
  331. .B ENDIF
  332.  
  333. .B IFC EQ,$AL$*$
  334. R SET L-3+1 REPETITION COUNT
  335. .B ELSE
  336. R SET 1
  337. .B ENDIF
  338.  
  339. VERB DUP R
  340. .B IF -DEF,VERBA
  341. N1 SET 1
  342. LASTNM1 MICRO 1,,$VERBA$
  343. .B ELSE
  344. N1 SET N1+1
  345. .B ENDIF
  346. NM1 MICRO N1,1,$BCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$
  347. CV MICRO 1,L,$"S"$
  348. "LASTNM1" VFD TDVNN/0L_"CV",TDXXN/0,TDISN/LIST-*,TDIVN/VERB_"NM1"-*
  349. LASTNM1 MICRO 1,,$VERB_"NM1"$
  350. L SET L-1
  351. VERB ENDD
  352.  
  353. N2 SET 1
  354. NM2 MICRO N2,1,$1234567890$
  355. ALTM MICRO 1,,$."NM1"_"NM2"$
  356.  
  357. LIST BSS 0
  358. IRP P
  359. NWDS SET *
  360. DSUB P,"ALTM"
  361. .B IFEQ *-NWDS,0
  362. VFD TDRQN/0
  363. VFD TDOPN/0
  364. VFD TDFPN/1
  365. VFD TDRSN/0
  366. VFD TDASN/0
  367. VFD TDSAN/FP
  368. "ALTM" BSS 0
  369. N2 SET N2+1
  370. NM2 MICRO N2,1,$1234567890$
  371. ALTM MICRO 1,,$."NM1"_"NM2"$
  372. .B ENDIF
  373. IRP
  374. "ALTM" EQU 0
  375. VFD TDRQN/0
  376. VFD TDOPN/0
  377. VFD TDFPN/1
  378. VFD TDRSN/0
  379. VFD TDASN/0
  380. VFD TDSAN/FP
  381.  
  382. .A ELSE
  383.  
  384. "LASTNM1" BSSZ 1
  385. .A ENDIF
  386. VERB ENDM
  387. DSUB SPACE 4,10
  388. ** DSUB - DECLARE SUBROUTINE (HELPER MACRO).
  389. *
  390.  
  391.  
  392. PURGMAC DSUB
  393.  
  394. DSUB MACRO AD,C,ALT
  395. LOCAL F
  396. MACREF DSUB
  397.  
  398. .A IFC NE,$AD$$
  399. F EQU *
  400. .B IFC EQ,$C$R$
  401. VFD TDRQN/1
  402. VFD TDOPN/0
  403. VFD TDFPN/0
  404. VFD TDRSN/0
  405. VFD TDASN/ALT
  406. VFD TDSAN/AD
  407. .B ENDIF
  408. .B IFC EQ,$C$O$
  409. VFD TDRQN/0
  410. VFD TDOPN/1
  411. VFD TDFPN/0
  412. VFD TDRSN/0
  413. VFD TDASN/ALT
  414. VFD TDSAN/AD
  415. .B ENDIF
  416. .B IFEQ F-*,0
  417. ERR SECOND PARAMETER WRONG
  418. .B ENDIF
  419. .A ELSE
  420. .B IFC NE,$C$A$
  421. ERR
  422. .B ENDIF
  423. .A ENDIF
  424. DSUB ENDM
  425. TITLE COMMON DECKS.
  426. ** DEFINITION COMMON DECKS.
  427. *
  428. *CALL COMCMAC
  429. *CALL COMCCMD
  430. *CALL COMCMTM
  431. TITLE WORKING STORAGE.
  432. ORG 111B
  433. FWA BSS 0
  434.  
  435. ** ASSEMBLY CONSTANTS.
  436.  
  437. CLRL1 EQU 1 CLEAR LINE 1 OF CONTROL POINT
  438. EC1 EQU 74B ESCAPE CODE 1
  439. EC2 EQU 76B ESCAPE CODE 2
  440. LBINC EQU 250 LINE BUFFER TABLE INCREMENT
  441. LNTINC EQU 50 LINE NUMBER TABLE INCREMENT
  442. MINCR EQU 2000B MEMORY INCREMENT
  443. SNF$ SET 0 SNF WILL RETURN NUMBER OF SORTED LINES
  444. TRIM SET 0 TRIM MODE DESELECTED
  445. USBL$ SET 1
  446. USBA$ SET 1
  447. RDX$ SET 1 SUPPRESS HALF-BUFFER CIO THRESHOLD
  448. WTX$ SET 1 SUPPRESS HALF-BUFFER CIO THRESHOLD
  449. MXWL EQU 32D MAXIMUM CM WORDS IN LINE
  450. MXCIL EQU MXWL*10D/2 MAXIMUM CHARACTERS IN LINE
  451. MXIC EQU 4095 MAXIMUM INCREMENT SIZE
  452. MXLN EQU 99999 MAXIMUM LINE NUMBER
  453. MXWS EQU 7 MAXIMUM WORD SIZE IS SEVEN CHARACTERS
  454. NBIC EQU 6 NUMBER OF BITS IN CHARACTER
  455. NUMD EQU 5 MAXIMUM DIGITS IN LINE NUMBER
  456. NWIF EQU 7 NUMBER OF WORDS IN FET
  457.  
  458. * THE MAIN AND LINE BUFFERS EACH CONTAIN THREE EXTRA
  459. * WORDS TO ALLOW *COMCSNF* TO SPLIT EACH BUFFER IN HALF
  460. * AND STILL HAVE TWO EXTRA WORDS IN THE SECOND HALF.
  461. * FOR MORE INFORMATION SEE *COMCSNF*.
  462.  
  463. EBSZ EQU 4004B MAIN BUFFER SIZE
  464. LNTSZ EQU 201B LINE NUMBER TABLE SIZE
  465. LBSZ EQU 1404B LINE BUFFER SIZE
  466. SCRASZ EQU 1401B FIRST SCRATCH BUFFER SIZE
  467. SCRBSZ EQU 1401B SECOND SCRATCH BUFFER SIZE
  468. SCRCSZ EQU 4401B SEQUENTIAL FILE-REBUILD BUFFER SIZE
  469. OTSZ EQU 1001B OUTPUT BUFFER SIZE
  470. INSZ EQU 101B INPUT/CLB= BUFFER SIZE
  471. BUFL EQU EBSZ+LNTSZ+LBSZ+SCRASZ+SCRBSZ
  472. BUFL2 EQU EBSZ+SCRCSZ
  473.  
  474. ** COMMAND PARAMETERS.
  475.  
  476. EFN CON 0 EDIT FILE NAME
  477. BOP CON 0 B OPTION
  478. LOP CON 0 L OPTION
  479. FOP CON 0 F OPTION
  480.  
  481. ** VARIABLES SET BY PRESET.
  482.  
  483. BLNK CON 0 SET TO A BLANK IN CURRENT CHARACTER SET
  484. CSTI CON 0 CHARACTER SET TYPE INDICATOR
  485. FILEN CON 0 FILE NAME OF SECONDARY FILE
  486. FLNGTH CON 0 LENGTH OF ORIGINAL EDIT FILE
  487. FNUM CON 0 FUNCTION NUMBER
  488. INCR CON 1 RESEQUENCING INCREMENT
  489. LNIA CON MXLN+1 LINE NUMBER TO INSERT AFTER
  490. LSTFIL CON 0 LIST OPTION
  491. MSTAT VFD 30/-1,30/0 MEMORY STATUS WORD
  492. NCIS CON 0 NUMBER OF CHARACTERS IN SEARCH STRING
  493. NCIR CON 0 NUMBER OF CHARACTERS IN REPLACEMENT STRING
  494. NELR CON 0 NUMBER OF ENTRIES IN LINE RANGE TABLE
  495.  
  496. ** VARIABLES SET BY LINE SELECT/PROCESSING PHASE.
  497.  
  498. APPFLG CON 0 CHANGE RECORDS APPENDED FLAG
  499. CMAX CON 0 MAXIMUM AMOUNT OF MEMORY AVAILABLE
  500. CMEM CON 0 CURRENT AMOUNT OF MEMORY BEING USED
  501. DYNST CON 0 AMOUNT OF DYNAMIC STORAGE
  502. FLAGS CON 0 *LNTBUF* ENTRY FLAGS
  503. FNAI CON MXLN+1 FIRST LINE NUMBER AFTER INSERTION
  504. INTFLG CON 0 SET IF NOT INTERRUPTIBLE
  505. LSRA CON 0 NUMBER TO ASSIGN TO FIRST INSERTED LINE
  506. LTFILE CON 0 *LNT* FILE FLAG
  507. LBFILE CON 0 LINE BUFFER FULL FLAG
  508. LBFET CON E FET ADDRESS OF CURRENT LINE BUFFER
  509. LB2FET CON L FET ADDRESS OF SCRATCH LINE BUFFER
  510. LTFET CON LNT1 FET ADDRESS OF SORT/MERGED *LNT* FILE
  511. LT2FET CON LNT2 FET ADDRESS OF A FREE SCRATCH BUFFER
  512. NBLN CON 0 NEW BINARY LINE NUMBER
  513. NCOL CON 0 NUMBER OF CHARACTERS ON A LINE
  514. NMLS CON 0 NUMBER *LNT* ENTRIES CURRENTLY IN BUFFER
  515. NNOL CON 0 NUMBER OF NON-OVERLAPPED LINES
  516. NTBL CON 0 NUMBER OF TRAILING BLANKS IN LINE
  517. NTL CON 0 NUMBER OF TRUNCATED LINES
  518. OBLN CON -1 OLD BINARY LINE NUMBER
  519. OLLE CON 0 OVERLAPPED LINES LINE RANGE TABLE ENTRY
  520. OVLPFG CON 0 OVERLAP PROCESSING FLAG
  521. OUT DATA C*OUTPUT* FILE NAME TO WRITE TO
  522. SCRFIL CON 0 SCRATCH BUFFER FLAG
  523. TRNC CON 0 TRUNCATED LINE FLAG
  524. UNRF CON 0 UNNUMBERED *READ* FILE FLAG
  525. SPACE 4,15
  526. ** TABLE OF FUNCTION NUMBERS.
  527.  
  528. TOFN BSS 0 BEGINNING OF FUNCTION TABLE
  529. LOC 1
  530.  
  531. FNDU VFD 18/EFN,42/0 DUP
  532. FNMO VFD 18/EFN,42/0 MOVE
  533. FNRE VFD 18/EFN,42/0 READ
  534. MXIL EQU *-1 MAXIMUM FUNCTION TO CAUSE OVERLAP
  535.  
  536. FNAL VFD 18/EFN,42/0 ALTER
  537. FNDE VFD 18/EFN,42/0 DELETE
  538. FNLI VFD 18/OUT,42/0 LIST/LNH
  539. MXNW EQU *-1 MAXIMUM NON-*WRITE(N)* FUNCTION
  540.  
  541. FNWR VFD 18/FILEN,42/0 WRITE
  542. FNWN VFD 18/FILEN,42/0 WRITEN
  543. LOC *O
  544. SPACE 4
  545. ** TABLE OF SCRATCH FILES.
  546.  
  547. TSF BSS 0
  548. VFD 42/0LZZZZZG0,18/0 LINE BUFFER FILES
  549. VFD 42/0LZZZZZG1,18/0
  550. VFD 42/0LZZZZZG2,18/0 LINE NUMBER TABLE FILES
  551. VFD 42/0LZZZZZG3,18/0
  552. VFD 42/0LZZZZZG4,18/0 SORT FILES
  553. VFD 42/0LZZZZZG5,18/0
  554. VFD 42/0LZZZZZG6,18/0 DELETED LINE NUMBER FILE
  555. VFD 42/0LZZZZZG7,18/0 TRUNCATED LINE FILE
  556. CON 0
  557. SPACE 4,5
  558. ** *FILINFO* PARAMETER BLOCK.
  559.  
  560. FIPB VFD 42/0,6/5,12/1
  561. BSSZ 4
  562. SPACE 4,5
  563. ** *LOF* PARAMETER BLOCK.
  564.  
  565. LOFPRM VFD 12/0,18/PRMW2,30/0
  566. PRMW2 VFD 42/0,18/3
  567. VFD 42/0LOUTPUT,18/O
  568. VFD 60/0
  569. SPACE 4,5
  570. ** *REPRIEVE* PARAMETER BLOCK.
  571.  
  572. RPB BSS 0
  573. VFD 36/0,12/RPBL,12/0
  574. VFD 30/0,30/PIT
  575. BSSZ 7
  576. BSSZ 16 EXCHANGE PACKAGE
  577. RPBL EQU *-RPB
  578. TITLE TABLES.
  579. SPACE 4,10
  580. ** FIELD DEFINITIONS FOR VERB TABLE.
  581.  
  582.  
  583. TDVN FIELD ,59,18 VERB NAME
  584. TDXX FIELD ,17,12 RESERVED FOR CDC
  585. TDIS FIELD ,11,6 INCREMENT TO START OF PROCESSES FOR VERB
  586. TDIV FIELD ,5,0 INCREMENT TO NEXT VERB
  587. TDRQ FIELD ,59,59 REQUIRED ATTRIBUTE (SET IF YES)
  588. TDOP FIELD ,58,58 OPTIONAL
  589. TDFP FIELD ,57,57 SET IF AT END OF PROCESSORS FOR VERB
  590. TDRS FIELD ,56,36 RESERVED FOR CDC
  591. TDAS FIELD ,35,18 OFFSET TO FWA OF ALTERNATE SYNTAX
  592. TDSA FIELD ,17,0 SUBROUTINE ADDRESS TO PROCESS
  593.  
  594. ** CHARACTER ATTRIBUTE BIT LOCATIONS.
  595.  
  596.  
  597. LETA EQU 1S0 LETTER ATTRIBUTE
  598. DIGA EQU 1S1 DIGIT (NUMBER) ATTRIBUTE
  599. DLMA EQU 1S2 DELIMITER ATTRIBUTE
  600. CHAA EQU 1S3 CHARACTER ATTRIBUTE
  601. SEPA EQU 1S4 SEPARATOR ATTRIBUTE
  602. TERA EQU 1S5 TERMINATOR ATTRIBUTE
  603. MXNA EQU 6 MAXIMUM NUMBER OF ATTRIBUTES PER CHARACTER
  604. SEDE EQU SEPA+DLMA
  605. *LNT* SPACE 4,10 ATTRIBUTE BIT LOCATIONS DEFINED
  606. ** THE *LNT* CONSISTS OF ONE WORD ENTRIES EITHER IN A BUFFER
  607. * OR WRITTEN OUT TO A LOCAL DISK FILE. THE FORMAT OF A
  608. * *LNT* ENTRY IS -
  609. *
  610. *T 18/NLN, 18/OLN, 1/O, 23/
  611. *
  612. * NLN = NEW LINE NUMBER.
  613. * OLN = OLD LINE NUMBER.
  614. * O = OVERLAP PROCESSING FLAG.
  615.  
  616.  
  617. FOVL EQU 23 OVERLAPPED LINE FLAG
  618. BUFFERS SPACE 4,10
  619. ** BUFFER DEFINITIONS.
  620.  
  621. LRT BSS MXWL+1 LINE RANGE TABLE
  622. CLIN BSS 0 CURRENT EDIT FILE LINE BEING WORKED
  623. USBB BSS MXCIL+1 STRING BUFFER USED BY *USB*
  624. INBUF BSS INSZ INPUT BUFFER
  625. OTBUF BSS OTSZ OUTPUT BUFFER
  626. PCKDBF BSSZ MXWL+1 PACKED LINE BUFFER
  627. RBUF BSSZ MXCIL REPLACEMENT BUFFER
  628. SBUF BSSZ MXCIL SEARCH STRING BUFFER
  629. TRBUF BSS 204B TRUNCATED LINE BUFFER
  630. EFBUF TABLE EDIT FILE BUFFER
  631. SCRBA TABLE SCRATCH 1 / REBUILD BUFFER
  632. SCRBB TABLE SCRATCH BUFFER 2
  633. LNBUF TABLE LINE BUFFER
  634. LNTBUF TABLE LINE NUMBER TABLE BUFFER
  635. SPACE 4,10 INTERFACE FILE FETS
  636. ** FET DEFINITIONS.
  637.  
  638. E BSS 0 EDIT FILE BUFFER
  639. EFB FILEB 0,0,(FET=NWIF)
  640.  
  641. I BSS 0 INPUT BUFFER
  642. INPUT FILEB INBUF,INSZ,(FET=NWIF)
  643.  
  644. O BSS 0 OUTPUT BUFFER
  645. OUTPUT FILEB OTBUF,OTSZ,(FET=NWIF)
  646.  
  647. L BSS 0 LINE BUFFER FILE
  648. ZZZZZG0 FILEB 0,0,(FET=NWIF)
  649.  
  650. LNT1 BSS 0 LINE NUMBER TABLE FILE
  651. ZZZZZG2 FILEB 0,0,(FET=NWIF)
  652.  
  653. LNT2 BSS 0 *LNT* SCRATCH FILE
  654. ZZZZZG3 FILEB 0,0,(FET=NWIF)
  655.  
  656. SCR BSS 0 SCRATCH FILE 0
  657. ZZZZZG4 FILEB 0,0,(FET=NWIF)
  658.  
  659. SCR1 BSS 0 SCRATCH FILE 1
  660. ZZZZZG5 FILEB 0,0,(FET=NWIF)
  661.  
  662. TRNCFET BSS 0 TRUNCATED LINE BUFFER
  663. ZZZZZG7 FILEB TRBUF,204B,(FET=NWIF)
  664. TITLE MAIN PROGRAM.
  665. MAIN SPACE 4,20
  666. ** IED - MAIN LOOP OF PROGRAM.
  667. *
  668. * ENTRY NONE.
  669. *
  670. * EXIT *IEDIT* PROCESSING COMPLETED.
  671. * TO *ERR* - IF A FATAL ERROR IS DETECTED.
  672. *
  673. * USES X - 0, 1, 2, 3, 5, 6.
  674. * A - 1, 2, 3, 6.
  675. * B - 2, 5.
  676. *
  677. * CALLS ABS, CDD, ERT, MRD, PRS, PSC, RSF, SFI, SNM.
  678. *
  679. * MACROS ENDRUN, FILINFO, RETURN, SYSTEM, WRITEC, WRITER.
  680.  
  681.  
  682. IEDIT BSS 0 ENTRY
  683. RJ PRS
  684. SA1 EFBUF ALLOCATE SPACE FOR MAIN BUFFER
  685. SX2 EBSZ
  686. RJ ABS
  687. NG X6,IED9 IF NOT ENOUGH ROOM FOR MAIN BUFFER
  688. SA1 SCRBA ALLOCATE SPACE FOR SCRATCH/REBUILD
  689. SX2 SCRASZ
  690. SA3 FNUM
  691. SX3 X3-MXIL-1
  692. NG X3,IED1 IF NON-SEQUENTIAL COMMAND
  693. SX2 SCRCSZ
  694. RJ ABS
  695. NG X6,IED9 IF NOT ENOUGH SPACE FOR SEQUENTIAL COMMAND
  696. EQ IED2 PROCESS SEQUENTIAL COMMAND
  697.  
  698. IED1 RJ ABS
  699. NG X6,IED9 IF NOT ENOUGH SPACE FOR SCRATCH BUFFER
  700. SA1 SCRBB ALLOCATE SECOND SCRATCH BUFFER
  701. SX2 SCRBSZ
  702. RJ ABS
  703. NG X6,IED9 IF NOT ENOUGH SPACE FOR *SCRBB*
  704. SA1 LNBUF ALLOCATE SPACE FOR LINE BUFFER
  705. SX2 LBSZ
  706. RJ ABS
  707. NG X6,IED9 IF NOT ENOUGH SPACE FOR *LBUF*
  708. SA1 BOP
  709. ZR X1,IED2 IF *LNT* NOT NEEDED
  710. SA1 LNTBUF
  711. SX2 LNTSZ
  712. RJ ABS ALLOCATE BUFFER
  713. NG X6,IED9 IF NOT ENOUGH ROOM FOR *LNT*
  714. IED2 RJ SFI UPDATE FET POINTERS FOR ALLOCATED TABLES
  715. SA1 EFN
  716. SA2 FIPB
  717. MX3 42
  718. BX1 X1*X3
  719. BX2 -X3*X2
  720. BX6 X1+X2
  721. SA6 A2
  722. FILINFO FIPB GET LENGTH OF EDIT FILE
  723. SA2 FIPB+3
  724. MX3 24
  725. BX6 X2*X3
  726. LX6 24
  727. SA6 FLNGTH
  728. SA1 FNUM
  729. SX2 X1-MXIL-1
  730. PL X2,IED3 IF A SEQUENTIAL COMMAND
  731. SX7 B0+
  732. RJ RSF REWIND SCRATCH FILES
  733. RJ MRD PROCESS A *MOVE*, *READ*, OR *DUP*
  734. EQ IED4 POST PROCESS COMMAND
  735.  
  736. IED3 RJ PSC PROCESS A SEQUENTIAL COMMAND
  737. IED4 SA1 NTL
  738. ZR X1,IED6 IF NO TRUNCATED LINES
  739. RJ CDD REPORT TRUNCATIONS
  740. MX0 B2 DELETE TRAILING SPACES
  741. BX1 X0*X4
  742. SB2 1RZ
  743. SB5 ERRLTF
  744. RJ SNM SET NAME IN MESSAGE
  745. SB5 ERRLTF
  746. SB2 1RQ
  747. SA2 FNUM
  748. SA1 X2+TOFN-1
  749. LX1 18
  750. SA1 X1
  751. RJ SNM SET NAME IN MESSAGE
  752. WRITEC O,ERRLTF *ZZZZZ LINES TRUNCATED ON FILE QQQQQQQ.*
  753. SA3 TRNCFET PREPARE TO PRINT TRUNCATED NUMBERS
  754. MX2 42
  755. BX3 -X2*X3
  756. SX2 A3
  757. SX3 X3-3
  758. ZR X3,IED5 IF BUFFER NEVER WRITTEN TO DISK
  759. SX3 B1+ INDICATE ON-DISK STATUS
  760. RJ ERT
  761. RETURN TRNCFET
  762. EQ IED6 PERFORM FINAL PROCESSING
  763.  
  764. IED5 RJ ERT ECHO RECORD TO TERMINAL
  765. IED6 SA1 FNUM
  766. SX1 X1-MXIL-1
  767. PL X1,IED8 IF SEQUENTIAL COMMAND
  768. SA1 APPFLG SET SORT FLAG IN TERMINAL TABLE
  769. ZR X1,IED7 IF SORT STATUS DID NOT CHANGE
  770. SYSTEM TLX,R,X1,1000B
  771. IED7 SX7 B1
  772. RJ RSF RETURN SCRATCH FILES
  773. IED8 WRITER O
  774. ENDRUN
  775.  
  776. IED9 SX5 ERRNES *NOT ENOUGH BUFFER SPACE AVAILABLE.*
  777. EQ ERR EXIT TO ERROR PROCESSOR
  778. TITLE FUNCTION PROCESSORS.
  779. MRD SPACE 4,15
  780. ** MRD - *MOVE*, *READ*, AND *DUP* FUNCTION PROCESSOR.
  781. *
  782. * ENTRY (FILEN) = NAME OF *READ* FILE IF *READ* COMMAND.
  783. *
  784. * EXIT CHANGE RECORDS APPENDED TO END OF EDIT FILE.
  785. *
  786. * USES X - 1, 2, 3, 5, 6, 7.
  787. * A - 1, 2, 3, 5, 6, 7.
  788. *
  789. * CALLS AEC, CBR, PLO, RLN, SLF, SLN, SLT.
  790. *
  791. * NOTES ALL LINES FROM THE *READ* FILE ARE IMPLICITLY
  792. * SELECTED FOR INSERTION INTO THE EDIT FILE.
  793.  
  794.  
  795. MRD SUBR ENTRY/EXIT
  796. RJ SLF SELECT LINES FROM FILE
  797. SA1 FNUM
  798. SX1 X1-FNRE
  799. NZ X1,MRD1 IF NOT A *READ* COMMAND
  800. SX2 L SET *READ* FILE NAME INTO FET *L*
  801. SA5 FILEN
  802. RJ SLN
  803. SX7 B1+
  804. SA7 LBFILE
  805. MRD1 SA5 TSF+6
  806. SX2 SCR1
  807. RJ SLN RESTORE *ZZZZZG6* INTO FET *SCR1*
  808. SX5 B0+
  809. RJ SBE SET *SCR1* EMPTY
  810. SX7 B0+
  811. RJ RLN REPLACE LINE NUMBER ON LINE
  812. SA2 FNUM
  813. SX2 X2-FNRE
  814. NZ X2,MRD2 IF NOT A *READ* COMMAND
  815. SX2 L SET *ZZZZZG0* INTO FET *L*
  816. SA5 TSF+0
  817. RJ SLN
  818. MRD2 RJ PLO PROCESS LINE OVERLAP
  819. SA1 BOP
  820. ZR X1,MRD3 IF NOT IN *BASIC* SUBSYSTEM
  821. SA1 UNRF CHECK FOR AN UNNUMBERED *READ* FILE
  822. SA2 OVLPFG CHECK FOR NO OVERLAPPED LINES
  823. BX1 -X2*X1
  824. NZ X1,MRD3 IF BOTH CONDITIONS TRUE
  825. RJ SLT SORT LINE NUMBER TABLE
  826. RJ CBR CALL *BASIC* RESEQUENCER
  827. MRD3 SA1 SCRFIL
  828. ZR X1,MRD4 IF NOTHING WRITTEN TO DELETED LINES FILE
  829. SX2 SCR
  830. SA5 TSF+6
  831. RJ SLN PUT DELETED LINES RECORD FILE NAME IN FET
  832. SA5 EFN
  833. SX3 B1
  834. SX6 B0
  835. SA6 LSTFIL
  836. RJ AEC APPEND LINE NUMBERS TO EDIT FILE
  837. SA1 LOP
  838. SX6 X1+
  839. SA6 LSTFIL
  840. MRD4 SA5 EFN
  841. SA2 LBFET
  842. SA3 LBFILE
  843. RJ AEC APPEND AND ECHO RECORD
  844. EQ MRDX RETURN
  845. TITLE SUBROUTINES.
  846. ABL SPACE 4,10
  847. ** ABL - ADD BLANKS TO LINE.
  848. *
  849. * ENTRY (X2) = NUMBER OF DIGITS IN LINE NUMBER.
  850. * (NCOL) = NUMBER OF CHARACTERS IN LINE.
  851. * (BLNK) = BLANK CHARACTER TO BE APPENDED.
  852. * CLIN = ADDRESS OF THE BEGINNING OF THE LINE.
  853. *
  854. * EXIT (NCOL) = X7 = NUMBER OF CHARACTERS IN LINE.
  855. * PROPER NUMBER OF BLANKS APPENDED TO LINE, NOT
  856. * TO EXCEED *MXCIL*.
  857. *
  858. * USES X - 1, 2, 3, 4, 6, 7.
  859. * A - 1, 3, 4, 6, 7.
  860.  
  861.  
  862. ABL SUBR ENTRY/EXIT
  863. SA1 NCOL
  864. SA4 BLNK
  865. ABL1 SA3 X1+CLIN-1
  866. SX1 X1-1
  867. BX3 X3-X4
  868. ZR X3,ABL1 IF CHARACTER A BLANK
  869. SX7 X1+B1
  870. SX1 MXCIL
  871. SA3 X7+CLIN-1
  872. BX6 X4
  873. IX4 X7-X1
  874. PL X4,ABL4 IF LINE HAS REACHED *MXCIL*
  875. NZ X3,ABL2 IF LINE DOES NOT END IN A COLON
  876. SA6 X7+CLIN ADD A BLANK AFTER THE COLON
  877. SX7 X7+B1 UPDATE *NCOL*
  878. IX4 X7-X1
  879. PL X4,ABL4 IF LINE HAS REACHED *MXCIL*
  880. ABL2 IX2 X2-X7
  881. NZ X2,ABL3 IF LINE CONTAINS MORE THAN A LINE NUMBER
  882. SA6 X7+CLIN
  883. SX7 X7+2
  884. SA6 A6+1
  885. ABL3 BX2 X7
  886. LX2 59-0
  887. PL X2,ABL4 IF LINE HAS AN EVEN NUMBER OF CHARACTERS
  888. SA6 X7+CLIN
  889. SX7 X7+1
  890. ABL4 SA7 NCOL
  891. EQ ABLX RETURN
  892. ABS SPACE 4,20
  893. ** ABS - ALLOCATE BUFFER SPACE.
  894. *
  895. * ENTRY (A1) = TABLE NUMBER BEING ALLOCATED.
  896. * (X2) = WORD COUNT (+ OR -) TO BE ALLOCATED.
  897. * (DYNST) = AMOUNT OF DYNAMIC STORAGE LEFT.
  898. *
  899. * EXIT (DYNST) = AMOUNT OF DYNAMIC STORAGE LEFT.
  900. * (X6) .LT. 0, IF NOT ENOUGH MEMORY AVAILABLE.
  901. *
  902. * USES X - 1, 2, 3, 6, 7.
  903. * A - 0, 1, 2, 3, 6, 7.
  904. *
  905. * CALLS RAF.
  906. *
  907. * MACROS ALLOC, MEMORY.
  908. *
  909. * NOTES THERE MUST BE NO *CIO* ACTIVITY (ALL FETS MUST BE
  910. * *RECALLED*) BEFORE CALLING *ALLOC*.
  911.  
  912.  
  913. ABS3 BX6 X1
  914. SA6 CMEM
  915. SX6 -B1
  916.  
  917. ABS SUBR ENTRY/EXIT
  918. SX6 A1 SAVE ENTRY CONDITIONS
  919. SX7 X2
  920. SA6 ABSA
  921. SA7 ABSB
  922. RJ RAF RECALL ALL FETS
  923. ABS1 SA2 ABSA RESTORE ENTRY CONDITIONS
  924. SA1 ABSB
  925. SA0 X2
  926. SA3 DYNST AMOUNT OF DYNAMIC STORAGE LEFT
  927. IX6 X3-X1
  928. NG X6,ABS2 IF NOT ENOUGH DYNAMIC STORAGE
  929. SA6 DYNST
  930. ALLOC A0,X1
  931. BX6 X6-X6 INDICATE SUCCESSFUL REALLOCATION
  932. EQ ABSX RETURN
  933.  
  934. * SET UP MEMORY REQUEST.
  935.  
  936. ABS2 SA1 CMEM GET CURRENT MEMORY
  937. SX3 MINCR
  938. IX2 X1+X3
  939. SA3 CMAX
  940. IX6 X3-X2
  941. NG X6,ABSX IF REQUEST WOULD EXCEED VALIDATION LIMITS
  942. BX6 X2
  943. SA6 A1 UPDATE *CMEM*
  944. LX6 30-0
  945. SA6 MSTAT
  946. MEMORY CM,MSTAT,R,,NA REQUEST ADDITIONAL MEMORY
  947. SA1 MSTAT
  948. SA2 CMEM
  949. AX1 30
  950. BX2 X1-X2
  951. NZ X2,ABS3 IF REQUEST NOT HONORED
  952. SA3 F.TEND UPDATE LWA OF TABLE
  953. SX2 MINCR
  954. SA1 DYNST
  955. IX6 X3+X2
  956. IX7 X1+X2
  957. SA6 A3
  958. SA7 A1
  959. EQ ABS1 ALLOCATE SPACE FOR TABLE
  960.  
  961. ABSA CON 0 ENTRY CONDITIONS
  962. ABSB CON 0
  963. AEC SPACE 4,20
  964. ** AEC - APPEND AND ECHO CHANGE RECORD.
  965. *
  966. * ENTRY (X5) = NAME OF THE FILE TO APPEND TO.
  967. * (X2) = FET ADDRESS OF BUFFER CONTAINING RECORD.
  968. * (X3) = 0, IF CHANGE RECORD IS BUFFER RESIDENT.
  969. * 1, IF CHANGE RECORD IS DISK RESIDENT.
  970. * (LSTFIL) = 0, IF LIST OPTION IS OFF.
  971. * 1, IF LIST OPTION IS ON.
  972. *
  973. * EXIT (X2) = UNCHANGED.
  974. * RECORD APPENDED TO FILE AND ECHOED TO TERMINAL.
  975. *
  976. * USES X - 1, 2, 3, 5, 6, 7.
  977. * A - 1, 2, 3, 5, 6, 7.
  978. *
  979. * CALLS CBO, SBE, SLN.
  980. *
  981. * MACROS READEI, REWIND, WRITE, WRITER.
  982.  
  983.  
  984. AEC SUBR ENTRY/EXIT
  985. BX7 X2
  986. BX6 X5
  987. SA7 AECC
  988. SA6 A7-B1 SAVE APPENDED FILE NAME
  989. SA1 X2+3 *OUT* WILL BE FIRST CBO PARAMETER
  990. BX6 X1
  991. SA6 AECD
  992. ZR X3,AEC4 IF RECORD IS BUFFER RESIDENT
  993. MX3 42
  994. SA1 X2
  995. BX6 X1*X3
  996. SA6 AECA STORE ORIGINAL FILE NAME
  997. REWIND X2,R
  998. SA1 X2+3 *OUT* WILL BE FIRST CBO PARAMETER
  999. BX6 X1
  1000. SA6 AECD
  1001. AEC1 READEI X2,R
  1002. SA1 LSTFIL
  1003. NZ X1,AEC2 IF LIST OPTION IS ON
  1004. SX2 O
  1005. SX5 B0
  1006. RJ SBE SET *OUTPUT* BUFFER EMPTY
  1007. SA2 AECC
  1008. AEC2 SA1 X2
  1009. LX1 59-9
  1010. NG X1,AEC4 IF LAST BUFFER OF DATA
  1011. SA5 AECB
  1012. RJ SLN PUT APPENDED FILE NAME IN FET
  1013. SA1 LSTFIL
  1014. ZR X1,AEC3 IF LINES NOT TO BE ECHOED TO TERMINAL
  1015. SA3 AECD
  1016. RJ CBO COPY BUFFER TO OUTPUT FROM (X3)
  1017. BX6 X3 SAVE UPDATED CBO PARAMETER
  1018. SA6 AECD
  1019. SA2 AECC
  1020. AEC3 SX6 B1+
  1021. SA6 APPFLG
  1022. WRITE X2,R APPEND LINES TO FILE
  1023. SA5 AECA
  1024. RJ SLN PUT ORIGINAL FILE NAME BACK IN FET
  1025. EQ AEC1 READ IN NEXT SEGMENT
  1026.  
  1027. AEC4 SA2 AECC
  1028. SA5 AECB
  1029. RJ SLN PUT APPENDED FILE NAME IN FET
  1030. SA1 LSTFIL
  1031. ZR X1,AEC5 IF LINES NOT TO BE ECHOED TO TERMINAL
  1032. SA3 AECD
  1033. RJ CBO COPY BUFFER TO OUTPUT
  1034. AEC5 SX6 B1+
  1035. SA6 APPFLG
  1036. WRITER X2,R FLUSH BUFFER TO APPENDED FILE
  1037. EQ AECX RETURN
  1038.  
  1039. AECA CON 0 ORIGINAL FILE NAME
  1040. AECB CON 0 FILE NAME OF FILE TO APPEND TO
  1041. AECC CON 0 FET ADDRESS
  1042. AECD CON 0 CBO START POINTER
  1043. CBO SPACE 4,15
  1044. ** CBO - COPY BUFFER TO OUTPUT.
  1045. *
  1046. * ENTRY (X2) = FET WHOSE BUFFER IS TO BE PRINTED.
  1047. * (X3) = FIRST LOCATION TO TRANSMIT, INITIALLY *OUT*.
  1048. *
  1049. * EXIT (X2) = UNCHANGED.
  1050. * (X3) = LAST LOCATION TRANSMITTED + 1.
  1051. *
  1052. * USES X - 1, 2, 3, 4, 6.
  1053. * A - 1, 2, 3, 4, 6.
  1054. * B - 6, 7.
  1055. *
  1056. * CALLS WTO.
  1057.  
  1058.  
  1059. CBO SUBR ENTRY/EXIT
  1060. BX6 X2
  1061. SA6 CBOA SAVE FET ADDRESS
  1062. SA1 X2+B1 FIRST
  1063. SA4 X2+4 LIMIT
  1064. SA2 A1+B1 IN
  1065. SB6 X3 FIRST LOCATION TO OUTPUT
  1066. SB7 X2+ *IN* POINTER
  1067. SB7 B7-B6
  1068. ZR B7,CBO2 IF BUFFER EMPTY
  1069. NG B7,CBO1 IF BUFFER WRAPS AROUND
  1070. RJ WTO
  1071. EQ CBO2 EXIT
  1072.  
  1073. * PROCESS BUFFER WRAPAROUND.
  1074.  
  1075. CBO1 SB7 X4 LIMIT
  1076. SB7 B7-B6 COPY FIRST PART OF DATA
  1077. RJ WTO
  1078. SA2 CBOA
  1079. SA1 X2+B1 FIRST
  1080. SA2 A1+B1 IN
  1081. SB6 X1
  1082. SB7 X2
  1083. SB7 B7-B6 COPY SECOND PART OF DATA
  1084. RJ WTO
  1085. CBO2 SA2 CBOA RESTORE FET ADDRESS
  1086. SA3 X2+2
  1087. EQ CBOX RETURN
  1088.  
  1089. CBOA CON 0 FET ADDRESS OF BUFFER TO OUTPUT
  1090. CBR SPACE 4,15
  1091. ** CBR - CALL *BASIC* RESEQUENCER.
  1092. *
  1093. * EXIT *BASIC* RESEQUENCING COMPLETED.
  1094. *
  1095. * USES X - 0, 1, 2, 3, 6, 7.
  1096. * A - 1, 2, 3.
  1097. *
  1098. * CALLS OVL=, PBR.
  1099.  
  1100.  
  1101. CBR SUBR ENTRY/EXIT
  1102. SA1 =0LIEDIT1
  1103. SA2 ACTR GET FILE NAME
  1104. SA3 LWPR GET FILE/SYSTEM LOAD FLAG
  1105. SX6 B1+
  1106. SX0 B1
  1107. MX7 42
  1108. LX3 59-18
  1109. LX0 12-0
  1110. NG X3,CBR1 IF LOADED FROM SYSTEM
  1111. BX1 X2*X7
  1112. SX6 B0
  1113. CBR1 BX6 X0+X6
  1114. SX2 B0
  1115. RJ OVL= LOAD THE *BASIC* OVERLAY
  1116. RJ /IEDIT1/PBR
  1117. EQ CBRX RETURN
  1118. CLN SPACE 4,20
  1119. ** CLN - CHECK IF LINE NUMBER IS IN LINE RANGE TABLE.
  1120. *
  1121. * ENTRY ((A5)) = (X5) = PACKED LINE NUMBER TO BE EVALUATED.
  1122. *
  1123. * EXIT (X4) = 0, IF LINE NUMBER NOT IN *LRT*
  1124. * .NE. 0, IF LINE NUMBER IS IN *LRT*.
  1125. * (X3) = 0, IF LINE NOT FOLLOWED BY AT LEAST TWO
  1126. * BLANKS OR A NON-BLANK CHARACTER.
  1127. * (X6) = LINE NUMBER OF LINE IN BINARY FORM.
  1128. * (X7) = NUMBER OF DIGITS IN LINE NUMBER.
  1129. *
  1130. * USES X - 1, 4, 5.
  1131. * A - 5.
  1132. * B - 3, 4, 5.
  1133. *
  1134. * CALLS VPL.
  1135. *
  1136. * NOTES IF *LRT* (LINE RANGE TABLE) IS EMPTY, ALL LINES
  1137. * ARE ASSUMED TO HAVE BEEN SELECTED.
  1138.  
  1139.  
  1140. CLN SUBR ENTRY/EXIT
  1141. RJ VPL GET LINE NUMBER
  1142. SX5 ERRNLN *NO LINE NUMBER ON LINE.*
  1143. ZR X7,ERR IF NO LINE NUMBER ON LINE
  1144. SA5 NELR
  1145. MX4 1
  1146. SB5 X6
  1147. ZR X5,CLNX IF NO LINE NUMBERS IN *LRT*
  1148. SA5 LRT-1 INITIALIZE POINTER TO BEFORE *LRT*
  1149. CLN1 SA5 A5+B1 CHECK *LRT* ENTRY
  1150. SB4 X5 CHECK LOW ORDER VALUE
  1151. LT B5,B4,CLN2 IF LINE NUMBER NOT IN TABLE
  1152. SB3 -18 SET HIGH ORDER VALUE
  1153. LX1 X5,B3
  1154. SB3 X1
  1155. LE B5,B3,CLNX IF LINE NUMBER IN *LRT*
  1156. PL X5,CLN1 IF NOT AT END OF *LRT*
  1157. CLN2 SX4 B0+ NUMBER NOT IN *LRT*
  1158. EQ CLNX RETURN
  1159. CNL SPACE 4,15
  1160. ** CNL - CONVERT AND NORMALIZE LINE NUMBER.
  1161. *
  1162. * ENTRY (X1) = LINE NUMBER, RIGHT JUSTIFIED, IN BINARY.
  1163. *
  1164. * EXIT (X6) = LINE NUMBER IN DISPLAY CODE.
  1165. *
  1166. * USES X - 1, 4, 6.
  1167. *
  1168. * CALLS CDD.
  1169.  
  1170.  
  1171. CNL SUBR ENTRY/EXIT
  1172. SX4 100000
  1173. IX1 X1+X4 ENSURE LEADING ZEROES
  1174. RJ CDD CONVERT TO DECIMAL DISPLAY CODE
  1175. MX6 NBIC*NUMD
  1176. LX4 NBIC TRUNCATE LEADING *1* DIGIT
  1177. BX6 X4*X6
  1178. EQ CNLX RETURN
  1179. ERT SPACE 4,20
  1180. ** ERT - ECHO RECORD TO TERMINAL.
  1181. *
  1182. * ENTRY (X2) = FET ADDRESS OF BUFFER CONTAINING RECORD.
  1183. * (X3) = 0, IF RECORD IS BUFFER RESIDENT.
  1184. * 1, IF RECORD IS DISK RESIDENT.
  1185. * (LSTFIL) = 0, IF LIST OPTION IS OFF.
  1186. * 1, IF LIST OPTION IS ON.
  1187. *
  1188. * USES X - 1, 3, 5, 6.
  1189. * A - 1, 3, 6.
  1190. *
  1191. * CALLS CBO, SBE.
  1192. *
  1193. * MACROS READEI, REWIND.
  1194.  
  1195.  
  1196. ERT SUBR ENTRY/EXIT
  1197. SA1 LSTFIL
  1198. ZR X1,ERTX IF LIST OPTION IS OFF
  1199. ZR X3,ERT2 IF RECORD IS BUFFER RESIDENT
  1200. MX3 42
  1201. SA1 X2
  1202. BX6 X1*X3
  1203. SA6 ERTA SAVE ORIGINAL FILE NAME
  1204. REWIND X2
  1205. ERT1 READEI X2,R
  1206. SA1 LSTFIL
  1207. ZR X1,ERTX IF LINES NOT TO BE ECHOED
  1208. SA1 X2
  1209. LX1 59-9
  1210. NG X1,ERT2 IF LAST BUFFER OF DATA
  1211. SA3 X2+3 COPY BUFFER TO OUTPUT
  1212. RJ CBO
  1213. SX5 B0+
  1214. RJ SBE
  1215. EQ ERT1 READ IN NEXT SEGMENT
  1216.  
  1217. ERT2 SA3 X2+3 COPY BUFFER TO OUTPUT
  1218. RJ CBO
  1219. EQ ERTX RETURN
  1220.  
  1221. ERTA CON 0 ORIGINAL FILE NAME
  1222. ERR SPACE 4,10
  1223. ** ERR - ERROR PROCESSOR.
  1224. *
  1225. * ENTRY (X5) = FWA OF ERROR MESSAGE.
  1226. *
  1227. * EXIT ABORTS AFTER ISSUING APPROPRIATE MESSAGE.
  1228. *
  1229. * USES X - 1.
  1230. * A - 1.
  1231. *
  1232. * CALLS RSF.
  1233. *
  1234. * MACROS ABORT, SYSTEM, WRITEC.
  1235.  
  1236.  
  1237. ERR BSS 0 ENTRY
  1238. ZR X5,ERR1 IF NO MESSAGE TO ISSUE
  1239. WRITEC O,X5
  1240. ERR1 SA1 APPFLG
  1241. ZR X1,ERR2 IF SORT STATUS DID NOT CHANGE
  1242. SYSTEM TLX,R,X1,1000B
  1243. ERR2 RJ RAF RECALL ALL FETS
  1244. SX7 B1+
  1245. RJ RSF RETURN SCRATCH FILES
  1246. ABORT
  1247.  
  1248.  
  1249. ** FATAL ERRORS - ERRORS WHICH WHEN ENCOUNTERED CAUSE *IEDIT*
  1250. * TO ABORT WITHOUT EXECUTING THE COMMAND.
  1251.  
  1252.  
  1253. ERRBSE DATA C*BUFFER SPACE ERROR (TOV).*
  1254. ERRCNP DATA C*COMMAND NOT PROCESSED DUE TO OVERLAP.*
  1255. ERRCSE DATA C*COMMAND ARGUMENT ERROR.*
  1256. ERRDFN DATA C*DUPLICATE FILE NAME.*
  1257. ERREEF DATA C*EMPTY FILE (SSF).*
  1258. ERREIE DATA C*LINE NUMBER OVERLAP ERROR.*
  1259. ERREIF DATA C*FILE NAME ERROR.*
  1260. ERREII DATA C*LINE NUMBER INCREMENT ERROR.*
  1261. ERREIS DATA C*INCORRECT SYNTAX.*
  1262. ERRELR DATA C*LINE RANGE ERROR.*
  1263. ERRNES DATA C*TOO SMALL BUFFER SPACE.*
  1264. ERRNIV DATA C*NON-EXISTENT EDIT VERB SPECIFIED.*
  1265. ERRNLF DATA C*NO LINES FOUND.*
  1266. ERRNLN DATA C*NO LINE NUMBER ON LINE.*
  1267. ERRNRF DATA C*READ FILE EMPTY.*
  1268. ERRNRS DATA C*NO READ/DESTINATION FILE SPECIFIED.*
  1269. ERRNTL DATA C*LINE NUMBER LIMIT EXCEEDED.*
  1270. ERRRFN DATA C*RESERVED FILE NAME.*
  1271.  
  1272.  
  1273. ** INFORMATIVE MESSAGES - ISSUED TO NOTIFY THE USER OF AN
  1274. * UNUSUAL CONDITION. THE *IEDIT* COMMAND IS PROCESSED TO
  1275. * COMPLETION.
  1276.  
  1277.  
  1278. ERRLTF DATA C*ZZZZZ LINES TRUNCATED ON FILE QQQQQQQ.*
  1279. ERRNDF DATA C*NO CLOSING DELIMITER FOUND.*
  1280. MLB SPACE 4,20
  1281. ** MLB - MANAGE LINE BUFFER.
  1282. *
  1283. * ENTRY (X2) = ADDRESS OF LINE TO ADD TO INPUT BUFFER.
  1284. * .LT. 0, IF LINE IS IN CHARACTER BUFFER.
  1285. * (B3) = ADDRESS OF FET TO ADD LINE TO.
  1286. * (NCOL) = NUMBER OF CHARACTERS TO BE WRITTEN.
  1287. *
  1288. * EXIT LINE ADDED TO LINE BUFFER.
  1289. *
  1290. * USES X - 1, 2, 3, 6, 7.
  1291. * A - 1, 2, 3, 6, 7.
  1292. * B - 2, 4.
  1293. *
  1294. * CALLS ABS, PLB, SFI.
  1295. *
  1296. * MACROS WRITER.
  1297.  
  1298.  
  1299. MLB SUBR ENTRY/EXIT
  1300. SX6 B3 SAVE FET ADDRESS
  1301. BX7 X2
  1302. SA6 MLBB
  1303. SA7 MLBA
  1304. SX3 MXWL+1 MAXIMUM WORDS IN A LINE
  1305. MX6 -18
  1306. SA1 B3+2 GET *IN* POINTER
  1307. BX1 -X6*X1
  1308. IX1 X1+X3
  1309. SA2 B3+4 GET *LIMIT*
  1310. BX2 -X6*X2
  1311. SX2 X2-1
  1312. IX2 X1-X2
  1313. SB2 X2
  1314. LT B2,MLB2 IF ENOUGH ROOM LEFT IN BUFFER
  1315. SB2 L
  1316. NE B2,B3,MLB1 IF NOT *LNBUF*
  1317. SA1 LBFILE
  1318. NZ X1,MLB1 IF BUFFER PREVIOUSLY WRITTEN OUT
  1319. SA1 LNBUF
  1320. SX2 LBINC
  1321. RJ ABS ALLOCATE MORE LINEBUF SPACE
  1322. NZ X6,MLB1 IF NOT ENOUGH DYNAMIC STORAGE LEFT
  1323. RJ SFI UPDATE FET POINTERS FOR ALLOCATED BUFFERS
  1324. EQ MLB2 BUFFER HAS SPACE ENOUGH FOR THE LINE
  1325.  
  1326. MLB1 SX7 B1 SET LINE BUFFER FULL FLAG
  1327. SA7 LBFILE
  1328. WRITER B3,R WRITE LINE BUFFER TO FILE
  1329. SA1 B3+B1 SET LINE BUFFER TO EMPTY
  1330. SX6 X1
  1331. SA6 A1+B1
  1332. SA6 A6+B1
  1333. MLB2 SA3 MLBA RESTORE ADDRESS OF LINE TO INSERT
  1334. SA2 MLBB RESTORE FET ADDRESS
  1335. SA1 X2+2 SET *IN* POINTER
  1336. NG X3,MLB4 IF LINE IS UNPACKED
  1337. SA3 X3 GET FIRST WORD OF LINE TO BE MOVED
  1338. SX7 X1
  1339. MX1 -12
  1340. MLB3 BX6 X3
  1341. SA6 X7+ MOVE WORD
  1342. SX7 X7+B1
  1343. SA3 A3+B1 GET NEXT WORD
  1344. BX6 -X1*X6
  1345. NZ X6,MLB3 IF NOT END OF LINE
  1346. SA7 X2+2 UPDATE THE *IN* POINTER
  1347. EQ MLBX RETURN
  1348.  
  1349. MLB4 SA3 NCOL NUMBER OF CHARACTERS IN LINE
  1350. SA1 MLBB
  1351. SB2 60
  1352. SB4 X3+
  1353. SA1 X1+2 SET UP PARAMETERS FOR *PLB*
  1354. SA2 CLIN
  1355. SA1 X1
  1356. RJ PLB PACK THE LINE INTO THE LINE BUFFER
  1357. SX7 A1+1
  1358. SA2 MLBB
  1359. SA7 X2+2 UPDATE THE *IN* POINTER
  1360. EQ MLBX RETURN
  1361.  
  1362. MLBA CON 0 ADDRESS OF LINE TO INSERT
  1363. MLBB CON 0 FET ADDRESS
  1364. PIT SPACE 4,25
  1365. ** PIT - PROCESS TERMINAL INTERRUPT.
  1366. *
  1367. * ENTRY OPERATING SYSTEM HAS DETECTED A USER BREAK 1 OR USER
  1368. * BREAK 2.
  1369. *
  1370. * EXIT IF USER BREAK 1 OCCURRED, CHANGED RECORDS WILL NO
  1371. * LONGER BE ECHOED TO THE OUTPUT FILE.
  1372. *
  1373. * IF USER BREAK 2 OCCURRED, *IEDIT* PROCESSING WILL
  1374. * TERMINATE AFTER RESTORING THE EDIT FILE TO ITS
  1375. * ORIGINAL CONDITION IF NECESSARY. THE COMPLETE
  1376. * BIT IN THE INPUT FET MUST ALSO BE SET SINCE AN
  1377. * INPUT REQUEST MAY HAVE BEEN LEFT PENDING AT
  1378. * AT THE TIME OF THE INTERRUPT.
  1379. *
  1380. * USES X - 1, 2, 3, 5, 6, 7.
  1381. * A - 1, 3, 5, 6, 7.
  1382. *
  1383. * CALLS SBE, SLN.
  1384. *
  1385. * MACROS REPRIEVE, RPHR, WRITEF.
  1386.  
  1387.  
  1388. PIT BSS 0 ENTRY
  1389. SA1 INTFLG
  1390. SX6 B1 SET *NOT INTERRRUPTIBLE*
  1391. SA6 A1
  1392. NZ X1,PIT3 IF NOT INTERRUPTIBLE
  1393. SA1 RPB+7 CHECK WHICH USER BREAK OCCURED
  1394. MX2 -12
  1395. BX2 -X2*X1
  1396. SX2 X2-TIET
  1397. SX6 B0+
  1398. ZR X2,PIT2 IF USER BREAK ONE
  1399. SA1 APPFLG
  1400. ZR X1,PIT1 IF NOTHING APPENDED TO EDIT FILE
  1401. SX2 E SET FET ADDRESS
  1402. SA5 EFN
  1403. SA6 A1 CLEAR APPEND FLAG
  1404. RJ SLN SET EDIT FILE NAME INTO FET
  1405. BX5 X5-X5
  1406. RJ SBE SET EDIT BUFFER TO EMPTY
  1407. SA1 FLNGTH
  1408. MX6 1 SET *RANDOM* BIT IN FET
  1409. SA3 X2+B1 FET+1
  1410. LX6 47-59
  1411. BX7 X6+X3
  1412. BX6 X1 LOAD LAST SECTOR OF ORIGINAL FILE
  1413. SA7 A3
  1414. SA6 X2+6
  1415. RPHR X2 SET FET FOR *WRITEF*
  1416. BX5 X5-X5
  1417. RJ SBE SET BUFFER EMPTY
  1418. WRITEF X2,R WRITE *EOF* AFTER LAST ORIGINAL SECTOR
  1419. PIT1 SA1 I SET COMPLETE BIT IN INPUT FET
  1420. SX7 B1
  1421. BX7 X1+X7
  1422. SA7 A1
  1423. SX5 B0 SET NO MESSAGE TO ISSUE
  1424. EQ ERR EXIT TO ERROR PROCESSOR
  1425.  
  1426. PIT2 SA6 LOP TURN OFF LIST OPTION
  1427. SA6 LSTFIL
  1428. PIT3 REPRIEVE RPB,RESUME,200B RESUME PRIOR EXECUTION
  1429. PLB SPACE 4,15
  1430. ** PLB - PACK LINE INTO A BUFFER.
  1431. *
  1432. * ENTRY ((A1)) = (X1) = WORD TO START PACKING IN.
  1433. * (A2) = ADDRESS OF STRING BUFFER TO PACK.
  1434. * (B2) = FIRST FREE BIT IN WORD.
  1435. * (B4) = LENGTH OF STRING TO PACK.
  1436. * (CSTI) = CHARACTER SET IN USE.
  1437. *
  1438. * EXIT ((A1)) = LAST WORD PACKED.
  1439. *
  1440. * USES X - 1, 2, 3, 4, 5, 7.
  1441. * A - 1, 2, 3, 7.
  1442. * B - 2, 3, 4, 5, 6, 7.
  1443.  
  1444.  
  1445. PLB5 LX7 B2 LEFT ADJUST FINAL PACKED WORD
  1446. SA7 A1+B7 STORE PACKED WORD
  1447. SA1 A7+
  1448. SB5 12
  1449. GE B2,B5,PLBX IF EOL GUARANTEED IN LAST WORD
  1450. SA1 A1+B1
  1451. SX7 B0+
  1452. SA7 A1
  1453.  
  1454. PLB SUBR
  1455. MX4 54
  1456. SA3 CSTI
  1457. SB6 X3
  1458. SB5 12
  1459. GT B6,PLB1 IF *ASCII8* CHARACTER SET
  1460. SB5 6
  1461. SX3 X3+1
  1462. PLB1 NZ B2,PLB2 IF ROOM LEFT IN CURRENT WORD
  1463. SB2 60
  1464. SA1 A1+1
  1465. PLB2 SB7 B0+
  1466. SB3 60
  1467. SB3 B3-B2
  1468. LX7 X1,B3 ADJUST FIRST WORD FOR ADDING CHARACTERS
  1469. SA2 A2-1
  1470. NZ B3,PLB3 IF FIRST WORD PARTIALLY FILLED
  1471. SX7 B0+
  1472. PLB3 ZR B4,PLB5 IF ALL CHARACTERS HAVE BEEN PACKED
  1473. SA2 A2+B1 GET NEXT CHARACTER
  1474. BX5 X4*X2
  1475. NZ X3,PLB4 IF NOT *ASCII* CHARACTER SET
  1476. ZR X5,PLB4 IF NOT A TWELVE BIT CHARACTER
  1477. AX5 6
  1478. LX7 X7,B5
  1479. BX7 X7+X5 PACK ESCAPE PART OF CHARACTER
  1480. SB2 B2-B5
  1481. BX2 -X4*X2 GET LOW SIX BITS OF CHARACTER
  1482. GT B2,PLB4 IF ROOM LEFT FOR CHARACTER
  1483. SA7 A1+B7
  1484. SB7 B7+B1
  1485. SX7 B0
  1486. SB2 60
  1487. PLB4 LX7 X7,B5
  1488. BX7 X7+X2 ADD NEW CHARACTER
  1489. SB2 B2-B5
  1490. SB4 B4-B1
  1491. GT B2,PLB3 IF ROOM LEFT FOR MORE CHARACTERS
  1492. SA7 A1+B7 STORE PACKED WORD
  1493. SB7 B7+B1
  1494. SX7 B0+
  1495. SB2 60
  1496. EQ PLB3 CONTINUE WITH NEXT CHARACTER
  1497. RAF SPACE 4,10
  1498. ** RAF - RECALL ALL FETS.
  1499. *
  1500. * EXIT ALL FETS RECALLED.
  1501. *
  1502. * MACROS RECALL.
  1503.  
  1504.  
  1505. RAF SUBR ENTRY/EXIT
  1506. RECALL E RECALL ALL FETS
  1507. RECALL L
  1508. RECALL LNT1
  1509. RECALL LNT2
  1510. RECALL SCR
  1511. RECALL SCR1
  1512. EQ RAFX RETURN
  1513. RSF SPACE 4,10
  1514. ** RSF - REWIND/RETURN SCRATCH FILES.
  1515. *
  1516. * ENTRY (X7) = 0, REWIND ALL SCRATCH FILES.
  1517. * = 1, RETURN ALL SCRATCH FILES.
  1518. *
  1519. * EXIT SCRATCH FILES REWOUND/RETURNED.
  1520. * *READ* FILE REWOUND IF PRESENT.
  1521. *
  1522. * USES X - 1, 2, 5, 7.
  1523. * A - 1, 5, 7.
  1524. *
  1525. * CALLS SLN.
  1526. *
  1527. * MACROS RETURN, REWIND.
  1528.  
  1529.  
  1530. RSF SUBR ENTRY/EXIT
  1531. SA7 RSFC SAVE REWIND/RETURN FLAG
  1532. SX7 TSF
  1533. SA7 RSFA STORE ADDRESS OF FILE NAMES
  1534. SA1 I
  1535. BX7 X1
  1536. SX2 A1
  1537. SA7 RSFB PRESERVE THE ORIGINAL FILE NAME
  1538. RSF1 SA5 RSFA
  1539. SA5 X5 LOAD NEXT FILE NAME
  1540. ZR X5,RSF3 IF END OF TABLE
  1541. SX7 A5+1
  1542. SA7 RSFA
  1543. RJ SLN SET SCRATCH FILE NAME INTO FET
  1544. SA1 RSFC
  1545. ZR X1,RSF2 IF REWIND RATHER THAN RETURN
  1546. RETURN X2
  1547. EQ RSF1 GET NEXT FILE NAME
  1548.  
  1549. RSF2 REWIND X2,R
  1550. EQ RSF1 GET NEXT FILE NAME
  1551.  
  1552. RSF3 SA1 FNUM
  1553. SX1 X1-FNRE
  1554. NZ X1,RSF4 IF NO *READ* FILE EXISTS
  1555. SA5 FILEN
  1556. RJ SLN SET *READ* FILE NAME INTO FET
  1557. REWIND X2
  1558. RSF4 SA5 RSFB RESTORE ORIGINAL FET NAME
  1559. RJ SLN
  1560. EQ RSFX RETURN
  1561.  
  1562. RSFA CON 0 ADDRESS OF FILE NAMES
  1563. RSFB CON 0 ORIGINAL FET NAME
  1564. RSFC CON 0 REWIND/RETURN FLAG
  1565. SBE SPACE 4,10
  1566. ** SBE - SET BUFFER EMPTY.
  1567. *
  1568. * ENTRY (X2) = FET ADDRESS OF BUFFER.
  1569. * (X5) .NE. 0, IF FILE IS TO BE REWOUND.
  1570. *
  1571. * EXIT BUFFER IS SET TO EMPTY.
  1572. *
  1573. * USES X - 0, 3, 6.
  1574. * A - 3, 6.
  1575. *
  1576. * MACROS RECALL, REWIND.
  1577.  
  1578.  
  1579. SBE SUBR ENTRY/EXIT
  1580. ZR X5,SBE1 IF NO REWIND SPECIFIED
  1581. REWIND X2,R
  1582. EQ SBEX RETURN
  1583.  
  1584. SBE1 RECALL X2
  1585. MX0 -18 SET FIRST=IN=OUT
  1586. SA3 X2+B1
  1587. BX6 -X0*X3
  1588. SA6 A3+B1
  1589. SA6 A6+B1
  1590. EQ SBEX RETURN
  1591. SFI SPACE 4,15
  1592. ** SFI - SET FET INFORMATION.
  1593. *
  1594. * ENTRY FWA OF EACH MANAGED TABLE.
  1595. * LENGTH OF EACH MANGED TABLE.
  1596. *
  1597. * EXIT FETS WILL BE SET ACCORDING TO FWA AND LENGTH OF
  1598. * BUFFERS AS DETERMINED BY MANAGED TABLE PROCESSORS.
  1599. *
  1600. * USES X - 1, 2, 4.
  1601. * A - 2, 4.
  1602. *
  1603. * CALLS SFP.
  1604.  
  1605.  
  1606. SFI SUBR ENTRY/EXIT
  1607. SA4 F.EFBUF
  1608. SX1 E
  1609. SA2 L.EFBUF
  1610. RJ SFP
  1611. SA4 F.LNBUF
  1612. SX1 L
  1613. SA2 L.LNBUF
  1614. RJ SFP
  1615. SA4 F.SCRBA
  1616. SX1 LNT1
  1617. SA2 L.SCRBA
  1618. RJ SFP
  1619. SA4 F.SCRBB
  1620. SX1 LNT2
  1621. SA2 L.SCRBB
  1622. RJ SFP
  1623. SA4 F.SCRBA
  1624. SX1 SCR
  1625. SA2 L.SCRBA
  1626. RJ SFP
  1627. SA4 F.SCRBB
  1628. SX1 SCR1
  1629. SA2 L.SCRBB
  1630. RJ SFP
  1631. EQ SFIX RETURN
  1632. SFP SPACE 4,15
  1633. ** SFP - SET FET POINTERS.
  1634. *
  1635. * ENTRY (X1) = FWA OF FET TO BE SET.
  1636. * (X2) = BUFFER LENGTH TO BE USED IN THIS FET.
  1637. * (X4) = FIRST WORD ADDRESS OF BUFFER.
  1638. *
  1639. * EXIT FET POINTERS ARE RESET. INITIALLY A FET IS SET
  1640. * TO EMPTY (FIRST=IN=OUT).
  1641. *
  1642. * USES X - 0, 2, 3, 5, 6, 7.
  1643. * A - 3, 5, 6.
  1644. * B - 2.
  1645.  
  1646.  
  1647. SFP SUBR ENTRY/EXIT
  1648. SA3 X1+B1 CHECK *FIRST* POINTER
  1649. MX0 -18
  1650. BX5 -X0*X3
  1651. IX7 X4-X5 CALCULATE MOVEMENT OF TABLE
  1652. BX3 X3*X0 SET *FIRST* POINTER
  1653. BX6 X3+X4
  1654. SA6 A3
  1655. SA5 A3+B1 UPDATE *IN* POINTER
  1656. BX5 -X0*X5
  1657. ZR X5,SFP1 IF *IN* POINTER HAS NOT BEEN SET
  1658.  
  1659. * RESET FET POINTERS
  1660.  
  1661. SB2 X7 MOVEMENT OF TABLE
  1662. SX6 X5+B2 NEW *IN* POINTER
  1663. SA6 A3+B1
  1664. SA3 X1+3 RETRIEVE *OUT* POINTER
  1665. BX6 -X0*X3
  1666. SX6 X6+B2 SET NEW *OUT* POINTER
  1667. SA6 A6+1
  1668. EQ SFP2 SET *LIMIT* POINTER
  1669.  
  1670. SFP1 BX6 -X0*X6 SET *IN* POINTER IN FET TO *FIRST*
  1671. SA6 A6+B1
  1672. SA6 A6+1 SET *OUT* POINTER IN FET TO *FIRST*
  1673. SFP2 SA3 A6+B1 SET *LIMIT* POINTER IN FET
  1674. BX3 X0*X3
  1675. SX2 X2+B1
  1676. IX2 X2+X4
  1677. BX6 X2+X3
  1678. SA6 A3
  1679. EQ SFPX RETURN
  1680. SLN SPACE 4,15
  1681. ** SLN - SET LOCAL FILE NAME.
  1682. *
  1683. * ENTRY (X2) = FET ADDRESS.
  1684. * (X5) = FILE NAME TO PUT IN FET.
  1685. *
  1686. * EXIT FILE NAME HAS BEEN INSERTED IN THE SPECFIED FET.
  1687. * (X2) = FET ADDRESS.
  1688. * (X5) = FET+0 WITH ORIGINAL FILE NAME AFTER *RECALL*.
  1689. *
  1690. * USES X - 3, 5, 7.
  1691. * A - 5, 7.
  1692. *
  1693. * MACROS RECALL.
  1694.  
  1695.  
  1696. SLN SUBR ENTRY/EXIT
  1697. RECALL X2
  1698. SX3 B1
  1699. BX7 X3+X5
  1700. SA5 X2
  1701. SA7 X2
  1702. EQ SLNX RETURN
  1703. SSF SPACE 4,15
  1704. ** SSF - SORT SELECTED FILE.
  1705. *
  1706. * ENTRY (B2) = FET ADDRESS OF FILE TO BE SORTED.
  1707. *
  1708. * EXIT (X2) = FET ADDRESS OF SORTED FILE.
  1709. * (X6) = NUMBER OF LINES IN SORTED FILE.
  1710. *
  1711. * USES X - 1, 2, 4, 5, 6, 7.
  1712. * A - 1, 2, 5, 6.
  1713. *
  1714. * CALLS SLN, SNF.
  1715. *
  1716. * MACROS FILINFO.
  1717.  
  1718.  
  1719. SSF SUBR ENTRY/EXIT
  1720. SX6 B2+ ADDRESS OF FET OF FILE TO SORT
  1721. SA6 SSFA
  1722. SA5 TSF+4 RESET SCRATCH FILE NAME
  1723. SX2 SCR
  1724. RJ SLN
  1725. SA5 TSF+5 RESET SCRATCH FILE NAME
  1726. SX2 SCR1
  1727. RJ SLN
  1728. SX1 B1+ INDIRECT ACCESS FILES BEING WORKED WITH
  1729. SX6 NUMD NUMBER OF DIGITS TO SORT ON
  1730. SA5 CSTI CHARACTER TYPE FOR *COMCSNF*
  1731. SX4 X5-1
  1732. ZR X4,SSF1 IF CHARACTER SET IS ASCII8
  1733. SX5 B0+
  1734. SSF1 BX7 X5
  1735. SA2 SSFA EDIT FILE FET ADDRESS FOR *COMCSNF*
  1736. RJ SNF SORT LINE NUMBERED FILE
  1737. ZR X1,SSF2 IF SORT SUCCESSFUL
  1738. SX5 ERRNLN *NO LINE NUMBER ON LINE.*
  1739. ZR B2,ERR IF NO LINE NUMBER
  1740. SX5 ERREEF *EMPTY FILE (SSF).*
  1741. NG B2,ERR IF SORT FILE EMPTY
  1742. SX5 ERRNES *TOO SMALL BUFFER SPACE.*
  1743. EQ ERR NOT ENOUGH BUFFER SPACE AVAILABLE
  1744.  
  1745. SSF2 SA1 EFN GET EDIT FILE NAME
  1746. SA5 SSFA GET SORT FILE NAME
  1747. SA5 X5
  1748. MX4 42
  1749. BX5 X5*X4
  1750. BX1 X5-X1
  1751. NZ X1,SSFX IF NOT SORTING EDIT FILE
  1752. SA6 SSFB SAVE NUMBER OF LINES
  1753. SA1 EFN
  1754. SA2 FIPB
  1755. BX1 X1*X4
  1756. BX2 -X4*X2
  1757. BX6 X1+X2
  1758. SA6 A2
  1759. FILINFO FIPB GET NEW LENGTH OF EDIT FILE
  1760. SA2 FIPB+3
  1761. MX4 24
  1762. BX6 X2*X4
  1763. LX6 24
  1764. SA2 SSFA
  1765. SA6 FLNGTH
  1766. SA1 SSFB
  1767. BX6 X1
  1768. EQ SSFX RETURN
  1769.  
  1770. SSFA CON 0 FET ADDRESS OF FILE TO SORT
  1771. SSFB CON 0 NUMBER OF LINES IN FILE
  1772. TOV SPACE 4,20
  1773. ** TOV - TABLE OVERFLOW.
  1774. *
  1775. * THIS ROUTINE IS REQUIRED BY THE MANAGED TABLE PROCESSORS
  1776. * AND IS USED WHEN TABLES BECOME LARGER THAN THE
  1777. * CURRENT FIELD LENGTH. BECAUSE OF CODE IN *ABS* WHICH
  1778. * INCREASES THE FIELD LENGTH WHEN NECESSARY, THIS ROUTINE
  1779. * SHOULD NEVER BE CALLED.
  1780. *
  1781. * ENTRY THE CURRENT FIELD LENGTH IS NOT LARGE ENOUGH
  1782. * TO HANDLE THE INCREASE OF A TABLE THAT WAS REQUESTED.
  1783. *
  1784. * EXIT TO *ERR*.
  1785. *
  1786. * USES X - 5.
  1787.  
  1788.  
  1789. TOV BSS 0 ENTRY
  1790. SX5 ERRBSE *BUFFER SPACE ERROR (TOV).*
  1791. EQ ERR ISSUE ERROR MESSAGE AND ABORT
  1792. VPL SPACE 4,15
  1793. ** VPL - EVALUATE PACKED LINE NUMBER.
  1794. *
  1795. * ENTRY ((A5)) = (X5) = PACKED WORD TO BE EVALUATED.
  1796. * (CSTI) = CHARACTER SET.
  1797. *
  1798. * EXIT (X6) = LINE NUMBER IN BINARY FORM.
  1799. * (X7) = NUMBER OF DIGITS IN LINE NUMBER.
  1800. * (X3) = 0, IF LINE NOT FOLLOWED BY AT LEAST TWO
  1801. * BLANKS OR ONE NON-BLANK CHARACTER.
  1802. *
  1803. * USES X - ALL.
  1804. * A - 2, 5.
  1805. * B - 3, 4, 5, 6, 7.
  1806.  
  1807.  
  1808. VPL SUBR ENTRY/EXIT
  1809. SA2 CSTI GET CHARACTER SET
  1810. SX1 10D
  1811. SB5 60
  1812. SX0 NUMD
  1813. SB6 60B ZERO IN *ASCII8*
  1814. SB7 71B NINE IN *ASCII8*
  1815. SX2 X2-1
  1816. SB3 12
  1817. SX6 B0 INITIALIZE LINE NUMBER TO ZERO
  1818. MX3 -12
  1819. PL X2,VPL1 IF *ASCII8* CHARACTER SET
  1820. SB6 1R0
  1821. SB7 1R9
  1822. SB3 6
  1823. MX3 -6
  1824. VPL1 NZ B5,VPL2 IF MORE CHARACTERS REMAIN IN WORD
  1825. SB5 60
  1826. SA5 A5+1
  1827. VPL2 LX5 X5,B3
  1828. BX4 -X3*X5 GET NEXT CHARACTER
  1829. BX5 X3*X5 ISOLATE CHARACTER
  1830. SB5 B5-B3
  1831. ZR X4,VPL3 IF COLON OR EOL FOUND
  1832. ZR X0,VPL3 IF *NUMD* DIGITS FOUND
  1833. SB4 X4+
  1834. LT B4,B6,VPL3 IF ALPHABETIC CHARACTER
  1835. GT B4,B7,VPL3 IF NOT DIGIT
  1836. SB4 B4-B6 CONVERT DIGIT TO BINARY
  1837. IX6 X6*X1
  1838. SX0 X0-1
  1839. SX6 X6+B4 ADD DIGIT TO RUNNING TOTAL
  1840. EQ VPL1 PROCESS NEXT CHARACTER
  1841.  
  1842. VPL3 SX1 NUMD
  1843. SA2 BLNK
  1844. IX7 X1-X0
  1845. ZR X4,VPL5 IF COLON OF EOL FOUND
  1846. IX4 X4-X2
  1847. NZ X4,VPLX IF NOT BLANK CHARACTER
  1848. NZ B5,VPL4 IF MORE CHARACTERS LEFT IN WORD
  1849. SB5 60
  1850. SA5 A5+1
  1851. VPL4 LX5 X5,B3
  1852. BX4 -X3*X5 GET NEXT CHARACTER
  1853. BX5 X3*X5
  1854. SB5 B5-B3
  1855. NZ X4,VPLX IF AT LEAST TWO CHARACTERS AFTER NUMBER
  1856. VPL5 NZ B5,VPL6 IF MORE CHARACTERS LEFT IN WORD
  1857. SB5 60
  1858. SA5 A5+1
  1859. VPL6 NZ X5,VPLX IF CHARACTERS FOLLOW LINE NUMBER
  1860. SB6 12
  1861. GE B5,B6,VPL7 IF ZERO BYTE IN BOTTOM OF WORD
  1862. SA5 A5+1
  1863. NZ X5,VPLX IF NEXT WORD CONTAINS A CHARACTER
  1864. VPL7 SX3 B0 A LINE TO BE DELETED
  1865. EQ VPLX RETURN
  1866. WTL SPACE 4,15
  1867. ** WTL - WRITE TRUNCATED LINE.
  1868. *
  1869. * ENTRY (X1) = BINARY LINE NUMBER OF TRUNCATED LINE.
  1870. *
  1871. * EXIT LINE NUMBER OF TRUNCATED LINE WILL BE WRITTEN
  1872. * TO A SCRATCH FILE.
  1873. *
  1874. * USES X - 1, 6.
  1875. * A - 1, 6.
  1876. *
  1877. * CALLS CNL.
  1878. *
  1879. * MACROS WRITEO.
  1880.  
  1881.  
  1882. WTL SUBR ENTRY/EXIT
  1883. RJ CNL CONVERT LINE NUMBER TO DISPLAY
  1884. SX1 2R PAD BLANKS TO ALLOW SORTING
  1885. LX1 18
  1886. BX6 X1+X6
  1887. WRITEO TRNCFET
  1888. SA1 NTL
  1889. SX6 X1+B1
  1890. SA6 A1
  1891. EQ WTLX RETURN
  1892. WTO SPACE 4,25
  1893. ** WTO - WRITE DATA TO OUTPUT.
  1894. *
  1895. * ENTRY (B6) = FWA OF DATA TO WRITE OUT.
  1896. * (B7) = LENGTH OF DATA IN WORDS.
  1897. *
  1898. * EXIT DATA WRITTEN TO *OUTPUT*.
  1899. *
  1900. * USES X - 1, 6.
  1901. * A - 1, 6.
  1902. * B - 7.
  1903. *
  1904. * MACROS WRITEW.
  1905. *
  1906. * NOTES *WTO* IS EQUIVALENT TO *WRITEW O,B6,B7* EXCEPT
  1907. * THAT THE WRITE WILL NOT BE PERFORMED IF THE
  1908. * LIST FLAG HAS BEEN CLEARED (THIS MAY HAPPEN AT
  1909. * ANY TIME DUE TO A *USER BREAK ONE*). NOTE THAT
  1910. * *B6* IS UPDATED BY *COMCWTW*.
  1911.  
  1912. WTO SUBR ENTRY/EXIT
  1913. WTO1 SA1 LSTFIL
  1914. ZR X1,WTOX IF LISTING DISABLED (USER BREAK 1)
  1915. SX6 B7
  1916. SA6 WTOA SAVE NUMBER OF WORDS TO WRITE
  1917. SX6 X6-100B
  1918. NG X6,WTO2 IF LESS THAN 100B WORDS LEFT TO WRITE
  1919. WRITEW O,B6,100B
  1920. SA1 WTOA DECREMENT NUMBER OF WORDS TO WRITE
  1921. SB7 X1-100B
  1922. EQ WTO1 PROCESS THE NEXT BLOCK OF DATA
  1923.  
  1924. WTO2 WRITEW O,B6,B7
  1925. EQ WTOX RETURN
  1926.  
  1927. WTOA CON 0 NUMBER OF WORDS TO WRITE
  1928. TITLE COMMON DECKS.
  1929. SPACE 4,10
  1930. ** EXECUTABLE COMMON DECKS.
  1931.  
  1932. *CALL COMCCDD
  1933. *CALL COMCCIO
  1934. *CALL COMCCPM
  1935. *CALL COMCDXB
  1936. *CALL COMCLFM
  1937. *CALL COMCMTP
  1938. *CALL COMCMVE
  1939. *CALL COMCOVL
  1940. *CALL COMCRDC
  1941. *CALL COMCRDO
  1942. *CALL COMCRDW
  1943. LIST X
  1944. *CALL COMCSNF
  1945. LIST -X
  1946. *CALL COMCSNM
  1947. *CALL COMCSST
  1948. *CALL COMCSYS
  1949. *CALL COMCUSB
  1950. *CALL COMCWTC
  1951. *CALL COMCWTW
  1952. *CALL COMCWTO
  1953. USE LITERALS
  1954. OVLY EQU *
  1955. TITLE OVERLAYABLE FUNCTION PROCESSORS.
  1956. PSC SPACE 4,15
  1957. ** PSC - PROCESS SEQUENTIAL COMMANDS.
  1958. *
  1959. * *PSC* PROCESSES THE CLASS OF COMMANDS WHICH READ A CLEAN
  1960. * SOURCE FILE AND POTENTIALLY WRITE A NEW CLEAN FILE.
  1961. *
  1962. * EXIT EDIT FILE REWRITTEN IF NECESSARY AND LINES ECHOED
  1963. * TO THE TERMINAL.
  1964. *
  1965. * USES X - ALL.
  1966. * A - 1, 2, 3, 4, 5, 6, 7.
  1967. * B - 2, 3, 4, 5, 6, 7.
  1968. *
  1969. * CALLS ABL, CLN, CSL, FSL, PLB, PWN, SLN, USB, WTL.
  1970. *
  1971. * MACROS READC, READEI, READO, RENAME, WRITEC, WRITER.
  1972.  
  1973.  
  1974. PSC SUBR ENTRY/EXIT
  1975. SA1 FNUM
  1976. SX1 X1-MXNW-1
  1977. NG X1,PSC1 IF NOT A *WRITE* OR *WRITEN* FUNCTION
  1978. SA5 FILEN SET *WRITE(N)* FILE NAME INTO FET
  1979. SX2 SCR
  1980. RJ SLN
  1981. EQ PSC2 AVOID REWIND OF *WRITE(N)* FILE
  1982.  
  1983. PSC1 REWIND SCR
  1984. PSC2 READEI E
  1985. REWIND TRNCFET
  1986.  
  1987. * COUNT NUMBER OF TRAILING BLANKS IN SEARCH STRING AND
  1988. * PUT COUNT IN *PSCB*.
  1989.  
  1990. SA5 NCIS
  1991. SA4 BLNK
  1992. SB6 X5+
  1993. PSC3 ZR B6,PSC4 IF NO SEARCH STRING
  1994. SA3 B6+SBUF-1
  1995. BX3 X3-X4
  1996. NZ X3,PSC4 IF CHARACTER NOT A BLANK
  1997. SB6 B6-B1
  1998. EQ PSC3 CHECK NEXT CHARACTER
  1999.  
  2000. PSC4 SB6 -B6
  2001. SX6 X5+B6
  2002. SA6 PSCB
  2003.  
  2004. * THIS MARKS THE BEGINNING OF THE MAIN LOOP.
  2005. * CLEAR ALL FLAGS AND READ A LINE INTO THE WORKING BUFFER.
  2006.  
  2007. PSC5 SX7 B0+
  2008. SA7 TRNC
  2009. READC E,PCKDBF,MXWL+1
  2010. NZ X1,PSC28 IF END OF EDIT FILE REACHED
  2011. BX6 X4
  2012. PSC6 MX0 -12
  2013. BX6 -X0*X6
  2014. ZR X6,PSC7 IF NO MORE WORDS IN LINE
  2015. READO X2
  2016. EQ PSC6 CHECK FOR END OF LINE
  2017.  
  2018. * CRACK THE LINE NUMBER AND STORE ITS VALUE AND LENGTH.
  2019.  
  2020. PSC7 SA5 PCKDBF CHECK LINE NUMBER
  2021. RJ CLN
  2022. SA7 PSCA
  2023. SA6 OBLN
  2024. SA6 NBLN
  2025. BX0 X4 SAVE THE LINE SELECT PARAMETER
  2026.  
  2027. * UNPACK THE LINE INTO *CLIN* AND CHECK FOR TRUNCATION.
  2028.  
  2029. SB2 PCKDBF
  2030. SA1 CSTI
  2031. SB6 MXCIL+1
  2032. SB3 X1+
  2033. RJ USB UNPACK LINE INTO STRING BUFFER
  2034. SB4 B7-B6
  2035. SB4 B4+B1
  2036.  
  2037. * FIND THE LAST NON-BLANK CHARACTER.
  2038.  
  2039. SA4 BLNK
  2040. SB2 MXCIL
  2041. GE B2,B4,PSC8 IF LINE NOT TOO LONG
  2042. SX7 B2
  2043. SA7 NCOL
  2044. SX7 B1
  2045. SA7 TRNC
  2046. EQ PSC10 TRUNCATE FLAG IS SET
  2047.  
  2048. PSC8 SA3 B4+CLIN-1
  2049. BX7 X3-X4
  2050. NZ X7,PSC8.1 IF CHARACTER IS NOT A BLANK
  2051. SB4 B4-1
  2052. EQ PSC8 CHECK NEXT CHARACTER
  2053.  
  2054.  
  2055. PSC8.1 NZ X3,PSC9 IF NOT A 64 CHARACTER SET COLON
  2056. GE B4,B2,PSC9 IF ALREADY AT END OF LINE
  2057. SB4 B4+1 INSURE A BLANK AFTER THE COLON
  2058. PSC9 SX7 B4+
  2059. SA7 NCOL
  2060.  
  2061. * PERFORM ANY CHARACTER STRING REPLACEMENT
  2062. * NECESSARY FOR THE *ALTER* COMMAND.
  2063.  
  2064. PSC10 ZR X0,PSC27 IF LINE NOT SELECTED
  2065. SA5 NCIS
  2066. NZ X5,PSC13 IF NON-NULL SEARCH STRING
  2067. SA2 NCIR
  2068. ZR X2,PSC22 IF REPLACEMENT STRING ALSO NULL
  2069.  
  2070. * PROCESS THE *ALTER* COMMAND FORMAT IN
  2071. * WHICH A REPLACEMENT STRING IS SPECIFIED,
  2072. * BUT A SEARCH STRING IS NOT.
  2073. * (ALTER,//STRING2/)
  2074.  
  2075. SA1 NCOL
  2076. SB3 MXCIL MAXIMUM NUMBER OF CHARACTERS PER LINE
  2077. SB4 X2 LENGTH OF REPLACEMENT STRING
  2078. SB2 X1 CURRENT NUMBER OF CHARACTERS IN LINE
  2079. SB5 B0+
  2080. PSC11 GE B2,B3,PSC12 IF NEW LINE IS TOO LONG
  2081. SA1 B5+RBUF
  2082. SB5 B5+B1
  2083. BX7 X1
  2084. SA7 B2+CLIN
  2085. SB2 B2+B1
  2086. LT B5,B4,PSC11 IF MORE CHARACTERS ARE TO BE ADDED
  2087. SX7 B2
  2088. SA7 NCOL
  2089. EQ PSC22 COMPLETE PROCESSING SELECTED LINE
  2090.  
  2091. PSC12 SX6 B1
  2092. SX7 B3
  2093. SA6 TRNC
  2094. SA7 NCOL
  2095. EQ PSC22 COMPLETE PROCESSING SELECTED LINE
  2096.  
  2097. * PROCESS THE *ALTER* COMMAND FORMAT IN WHICH THE SEARCH
  2098. * STRING IS SPECIFIED.
  2099. * (ALTER,/STRING1/STRING2/ OR ALTER,/STRING1//)
  2100.  
  2101. PSC13 BSS 0
  2102. .TRIM IFEQ TRIM,0
  2103. SA2 PSCB
  2104. ZR X2,PSC16 IF NO TRAILING BLANKS IN SEARCH STRING
  2105. IFEQ TRIM,0
  2106. SA1 NCOL
  2107. SA3 BLNK
  2108. SB3 MXCIL
  2109. SB2 X1+
  2110. BX7 X3
  2111. SA1 B2+CLIN-1 GET LAST CHARACTER
  2112. BX1 X1-X3
  2113. NZ X1,PSC14 IF NOT A BLANK PROTECTING A COLON
  2114. SB2 B2-1 POINT TO THE COLON
  2115. PSC14 EQ B2,B3,PSC15 IF NO MORE ROOM IN STRING BUFFER
  2116. SA7 B2+CLIN
  2117. SB2 B2+1
  2118. SX2 X2-1
  2119. NZ X2,PSC14 IF ALL BLANKS NOT YET ADDED
  2120. PSC15 SX7 B2+
  2121. SA7 NCOL
  2122. .TRIM ENDIF
  2123.  
  2124. * STORE THE NUMBER OF TRAILING BLANKS IN LINE INTO *NTBL*.
  2125. * CHECK FOR SEARCH STRING PRESENT IN LINE.
  2126.  
  2127. PSC16 SA1 NCOL
  2128. SA2 PSCA
  2129. SX4 MXCIL
  2130. IX6 X4-X1
  2131. BX7 X2
  2132. SA6 NTBL
  2133. SB6 X1+
  2134. RJ FSL FIND STRING IN LINE
  2135. NG X4,PSC27 IF STRING NOT FOUND, DE-SELECT
  2136.  
  2137. * REPLACE ALL OCCURENCES OF SEARCH STRING IN LINE
  2138. * WITH THE REPLACEMENT STRING.
  2139.  
  2140. SA1 FNUM
  2141. SX1 X1-FNAL
  2142. NZ X1,PSC22 IF FUNCTION NOT *ALTER*
  2143. PSC17 RJ CSL CHANGE STRING IN LINE
  2144. SA5 NCIR
  2145. IX7 X4+X5
  2146. SA4 NCOL
  2147. SB6 X4+
  2148. RJ FSL
  2149. PL X4,PSC17 IF ANOTHER SEARCH STRING OCCURENCE FOUND
  2150. SA2 NCIS
  2151. SA1 PSCB
  2152. IX1 X1-X2
  2153. NZ X1,PSC22 IF SEARCH STRING IS NOT ALL BLANKS
  2154.  
  2155. * PROCESS THE SPECIAL CASE WHERE THE USER SPECIFIED
  2156. * AN ALL BLANK SEARCH STRING IN AN *ALTER* COMMAND.
  2157. * (ALTER,/ /STRING2/)
  2158.  
  2159. .TRIM IFEQ TRIM,0
  2160. SA3 NCOL
  2161. SB7 X3+ CURRENT NUMBER OF CHARACTERS IN LINE
  2162. SA1 NTBL
  2163. SA4 NCIR
  2164. SB2 X1 ORIGINAL NUMBER OF TRAILING BLANKS
  2165. SB3 X2 NUMBER OF CHARACTERS IN SEARCH STRING
  2166. SB6 MXCIL
  2167. SB4 X4+ NUMBER OF CHARACTERS IN REPLACEMENT STRING
  2168. PSC18 LT B2,B3,PSC21 IF LESS THAN *NCIS* BLANKS REMAIN
  2169. SB2 B2-B3
  2170. SB5 B0
  2171. PSC19 EQ B5,B4,PSC18 IF ENTIRE REPLACE STRING ADDED
  2172. EQ B7,B6,PSC20 IF NEW LINE IS TOO LONG
  2173. SA1 B5+RBUF
  2174. SX7 X1+
  2175. SA7 B7+CLIN
  2176. SB7 B7+B1
  2177. SB5 B5+B1
  2178. EQ PSC19 ADD THE NEXT CHARACTER
  2179.  
  2180. PSC20 SX7 B1+
  2181. SA7 TRNC
  2182. PSC21 SX7 B7+
  2183. SA7 NCOL
  2184. .TRIM ENDIF
  2185.  
  2186. * PROCESS SELECTED LINES. THE FOLLOWING CODE REPACKS,
  2187. * ECHOS TO OUTPUT, AND COPIES THE POTENTIALLY ALTERED
  2188. * LINE TO THE NEW SOURCE FILE.
  2189.  
  2190. PSC22 SA1 NMLS
  2191. SX6 X1+B1
  2192. SA6 A1
  2193. SA1 FNUM
  2194. SX1 X1-FNAL
  2195. NZ X1,PSC23 IF NOT AN *ALTER* COMMAND
  2196. SA2 PSCA ADD BLANKS AND REPACK
  2197. RJ ABL
  2198. SB2 60
  2199. SA1 PCKDBF
  2200. SA2 CLIN
  2201. SA3 NCOL
  2202. SB4 X3
  2203. RJ PLB
  2204. PSC23 SA1 FNUM
  2205. SX1 X1-MXNW-1
  2206. PL X1,PSC24 IF A *WRITE(N)* FUNCTION
  2207. SA1 LOP
  2208. ZR X1,PSC24 IF LIST FLAG NOT SET
  2209. WRITEC O,PCKDBF ECHO SELECTED LINES
  2210. PSC24 SA1 FNUM
  2211. SX2 X1-FNLI
  2212. ZR X2,PSC26 IF A *LIST* COMMAND
  2213. SX2 X1-FNDE
  2214. ZR X2,PSC26 IF A *DELETE* COMMAND
  2215. SX1 X1-FNWN
  2216. NZ X1,PSC25 IF NOT A *WRITE(N)* COMMAND
  2217. SA1 PSCA
  2218. RJ PWN SHIFT TEXT FOR *WRITEN*
  2219. PSC25 WRITEC SCR,PCKDBF BUILD NEW FILE
  2220. PSC26 SA1 TRNC
  2221. ZR X1,PSC5 IF LINE NOT TRUNCATED
  2222. SA1 OBLN
  2223. RJ WTL
  2224. EQ PSC5 PROCESS NEXT LINE
  2225.  
  2226. * PROCESS UNSELECTED LINES.
  2227. * THE FOLLOWING CODE SUPPRESSES PACKING AND ECHOING AND
  2228. * AS SUCH IS FOR THE SIMPLE COPYING OF UNSELECTED LINES.
  2229.  
  2230. PSC27 SA1 FNUM
  2231. SX2 X1-FNAL
  2232. ZR X2,PSC25 IF AN *ALTER* COMMAND
  2233. SX2 X1-FNDE
  2234. ZR X2,PSC25 IF A *DELETE* COMMAND
  2235. EQ PSC5 PROCESS NEXT LINE
  2236.  
  2237. * FINISH UP AFTER SCAN OF EDIT FILE IS COMPLETED.
  2238.  
  2239. PSC28 SA2 NMLS
  2240. SA1 FNUM
  2241. NZ X2,PSC29 IF AT LEAST ONE LINE WAS SELECTED
  2242. SX2 X1-FNLI
  2243. SX5 ERRNLF *NO LINES FOUND.*
  2244. NZ X2,ERR IF NOT A *LIST* COMMAND
  2245. SX5 B0+
  2246. EQ ERR NO LINES FOUND AND A *LIST* COMMAND
  2247.  
  2248. * FLUSH TRUNCATED LINES IF NECESSARY
  2249.  
  2250. PSC29 SA3 TRNCFET CHECK FET STATUS
  2251. MX2 -18
  2252. BX3 -X2*X3
  2253. SX2 A3+
  2254. SX3 X3-3
  2255. ZR X3,PSC30 IF BUFFER NEVER WRITTEN TO DISK
  2256. WRITER X2
  2257. PSC30 SA1 FNUM
  2258. SX2 X1-FNLI
  2259. ZR X2,PSCX IF A *LIST* COMMAND
  2260. WRITER SCR COMPLETE *ALTER*, *DELETE*, OR *WRITE(N)*
  2261. SA1 FNUM
  2262. SX1 X1-MXNW-1
  2263. PL X1,PSCX IF A *WRITE(N)* COMMAND
  2264. RENAME SCR,E COMPLETE *ALTER* OR *DELETE*
  2265. EQ PSCX RETURN
  2266.  
  2267. PSCA CON 0 NUMBER OF DIGITS IN LINE NUMBER
  2268. PSCB CON 0 NUMBER OF TRAILING BLANKS IN SEARCH STRING
  2269. TITLE OVERLAYABLE SUBROUTINES.
  2270. CSL SPACE 4,25
  2271. ** CSL - CHANGE STRING IN LINE.
  2272. *
  2273. * *CSL* CHANGES A STRING IN A LINE TO ANOTHER
  2274. * STRING OF CHARACTERS.
  2275. *
  2276. * ENTRY (NCOL) = NUMBER OF CHARACTERS ON LINE.
  2277. * (CLIN) = FWA OF UNPACKED LINE.
  2278. * (RBUF) = FWA OF REPLACEMENT BUFFER.
  2279. * (X4) = CHARACTER POSITION WHERE SEARCH STRING WAS
  2280. * FOUND.
  2281. *
  2282. * EXIT (X4) = CHARACTER POSITION POINTER.
  2283. * *CLIN* CHANGED TO INCLUDE THE STRING TO REPLACE
  2284. * WITH THE NEW STRING.
  2285. * (NCOL) CHANGED TO REFLECT NEW LENGTH OF LINE
  2286. * AFTER CHANGE HAS BEEN MADE.
  2287. *
  2288. * USES X - 1, 2, 3, 4, 5, 6, 7.
  2289. * A - 1, 4, 5, 7.
  2290. * B - 3, 5, 6.
  2291. *
  2292. * MACROS MOVE.
  2293.  
  2294.  
  2295. CSL SUBR ENTRY/EXIT
  2296. SA5 NCIS FIND DIFFERENCE IN STRING LENGTHS
  2297. SA1 NCIR
  2298. SX7 X4
  2299. IX3 X1-X5 NUMBER OF CHARACTERS TO INCREASE HOLE BY
  2300. SA7 CSLA
  2301. SX2 CLIN+X4 FIND BEGINNING OF SEARCH STRING
  2302. SA4 NCOL
  2303. IX7 X4+X3 COMPUTED LENGTH OF NEW STRING
  2304. SA7 A4 UPDATE *NCOL* TO ITS NEW LENGTH
  2305. ZR X3,CSL2 IF STRINGS ARE SAME SIZE
  2306. IX2 X2+X5 GET STARTING ADDRESS FOR MOVE
  2307. SX4 X4+CLIN ENDING ADDRESS OF OLD LINE PLUS ONE
  2308. IX3 X2+X3 DESTINATION ADDRESS FOR MOVE
  2309. IX1 X4-X2 COMPUTE LENGTH OF STRING TO MOVE
  2310. SB5 X7-MXCIL-1
  2311. SX7 B1
  2312. NG B5,CSL1 IF NO TRUNCATION
  2313. SA7 TRNC
  2314. SX7 MXCIL
  2315. SX6 X3-CLIN-MXCIL
  2316. SA7 NCOL CORRECT LENGTH OF NEW LINE TO *MXCIL*
  2317. PL X6,CSL2 IF DESTINATION ADDRESS BEYOND *MXCIL*
  2318. SX4 X7-MXCIL AMOUNT OF TRUNCATION
  2319. IX1 X1-X4 ADJUST NUMBER OF CHARACTERS TO MOVE
  2320.  
  2321. * ADJUST SEARCH STRING HOLE TO FIT REPLACEMENT STRING.
  2322.  
  2323. CSL1 MOVE X1,X2,X3
  2324.  
  2325. * MOVE REPLACEMENT STRING TO SEARCH STRING HOLE.
  2326.  
  2327. CSL2 SA4 CSLA
  2328. SA5 NCIR
  2329. SB5 CLIN+X4 ADDR TO START REPLACEMENT
  2330. SB6 MXCIL+1
  2331. SB3 X4
  2332. SB6 B6-B3
  2333. SB3 X5+
  2334. LE B3,B6,CSL3 IF ROOM FOR ENTIRE REPLACEMENT STRING
  2335. SB3 B6+
  2336. CSL3 SB6 B0+ CHARACTER REPLACEMENT COUNT
  2337. SA1 RBUF-1
  2338. CSL4 GE B6,B3,CSLX IF DONE MOVING STRING, RETURN
  2339. SA1 A1+B1 GET NEXT CHARACTER
  2340. SX7 X1
  2341. SA7 B5+B6
  2342. SB6 B6+B1
  2343. EQ CSL4 MOVE NEXT CHARACTER
  2344.  
  2345. CSLA CON 0 SEARCH STRING POSITION
  2346. FSL SPACE 4,20
  2347. ** FSL - FIND STRING IN LINE.
  2348. *
  2349. * ENTRY (CLIN) = FIRST CHARACTER OF LINE
  2350. * (LINE UNPACKED - 1 CHARACTER PER WORD).
  2351. * (X7) = NUMBER OF CHARACTERS ON LINE TO SKIP
  2352. * OVER BEFORE STARTING SEARCH.
  2353. * (B6) = COUNT OF CHARACTERS IN LINE.
  2354. * (SBUF) = UNPACKED SEARCH STRING.
  2355. * (NCIS) = NUMBER OF CHARACTERS IN SEARCH STRING.
  2356. *
  2357. * EXIT (X4) = CHARACTER POSITION IN LINE WHERE
  2358. * MATCH WAS FOUND.
  2359. * .LT. 0, IF CHARACTER STRING NOT IN LINE.
  2360. *
  2361. * USES X - 1, 4, 5, 7.
  2362. * A - 1, 5.
  2363. * B - 2, 3, 4, 7.
  2364.  
  2365.  
  2366. FSL SUBR ENTRY/EXIT
  2367. MX4 1
  2368. SA5 NCIS NUMBER OF CHARACTERS IN SEARCH STRING
  2369. SB4 X7 OFFSET TO START SEARCH AT
  2370. SB3 X5+
  2371. SB7 B6-B3
  2372. SB2 B0+ COUNT OF CHARACTERS FOUND
  2373. GT B4,B7,FSLX IF ALREADY AT END OF LINE
  2374. FSL1 SA5 CLIN+B4 GET CHARACTER FROM LINE
  2375. SA1 SBUF+B2 GET CHARACTER FROM *SBUF*
  2376. BX5 X5-X1
  2377. SB4 B4+B1 INCREMENT OFFSET OF *CLIN*
  2378. ZR X5,FSL2 IF CHARACTERS MATCH
  2379. SB4 X7+B1
  2380. SB2 B0+ RESET COUNT OF CHARACTERS FOUND
  2381. SX7 B4
  2382. LE B4,B7,FSL1 IF NOT AT END OF LINE
  2383. EQ FSLX RETURN
  2384.  
  2385. FSL2 SB2 B2+B1 INCREMENT COUNT OF CHARACTERS FOUND
  2386. NE B2,B3,FSL1 IF MORE CHARACTERS TO MATCH
  2387. SX4 B4-B3
  2388. EQ FSLX RETURN - MATCH SUCCESSFUL
  2389. ICE SPACE 4,10
  2390. ** ICE - INDEXED CODE EXECUTION.
  2391. *
  2392. * ENTRY (B7) = SUBROUTINE ADDRESS.
  2393. *
  2394. * EXIT TO SUBROUTINE WITH RETURN ADDRESS SET.
  2395. *
  2396. * USES X - 2, 7.
  2397. * A - 2, 7.
  2398.  
  2399.  
  2400. ICE SUBR ENTRY/ EXIT
  2401. SA2 ICEX SET RETURN ADDRESS
  2402. BX7 X2
  2403. SA7 B7
  2404. JP B7+1 JUMP TO SUBROUTINE
  2405. MLT SPACE 4,20
  2406. ** MLT - MANAGE LINE NUMBER TABLE.
  2407. *
  2408. * ENTRY (FLAGS) = FLAGS FOR *LNT* ENTRY.
  2409. * (OBLN) = OLD BINARY LINE NUMBER.
  2410. * (NBLN) = NEW BINARY LINE NUMBER.
  2411. *
  2412. * EXIT AN ENTRY IS MADE TO THE LINE NUMBER TABLE.
  2413. * IF *LNT* BUFFER IS FULL, THE *LNT* IS FLUSHED TO
  2414. * *ZZZZZG2* AND *NMLS* IS RESET TO ZERO BEFORE ADDING
  2415. * THE NEW ENTRY.
  2416. *
  2417. * USES X - 1, 2, 3, 5, 7.
  2418. * A - 1, 2, 3, 5, 7.
  2419. * B - 2.
  2420. *
  2421. * CALLS ABS, SFI.
  2422. *
  2423. * MACROS WRITEW.
  2424.  
  2425.  
  2426. MLT SUBR ENTRY/EXIT
  2427. SA1 NMLS
  2428. SA3 L.LNTBUF
  2429. SX1 X1+B1
  2430. IX3 X3-X1
  2431. PL X3,MLT2 IF BUFFER NOT FULL
  2432. SA1 LNTBUF
  2433. SX2 LNTINC
  2434. RJ ABS TRY TO ALLOCATE MORE SPACE
  2435. NZ X6,MLT1 IF NOT ENOUGH SPACE LEFT
  2436. RJ SFI UPDATE FET POINTERS FOR ALLOCATED BUFFER
  2437. EQ MLT2 PROCESS *LNT*
  2438.  
  2439. MLT1 SX7 B1+
  2440. SA7 LTFILE
  2441. SX2 LNT1
  2442. SA1 F.LNTBUF
  2443. SA3 NMLS
  2444. WRITEW X2,X1,X3 WRITE *LNT* OUT TO FILE
  2445. SX7 B0+
  2446. SA7 NMLS
  2447. MLT2 SA3 NBLN NEW BINARY LINE NUMBER
  2448. SB2 59-17 ALIGN NEW LINE NUMBER
  2449. SA1 NMLS NUMBER OF LINES SELECTED
  2450. SA2 OBLN
  2451. LX7 X3,B2
  2452. LX2 41-17 ALIGN OLD LINE NUMBER
  2453. BX7 X7+X2
  2454. SA5 FLAGS
  2455. BX7 X5+X7
  2456. SA5 F.LNTBUF
  2457. IX5 X5+X1
  2458. SA7 X5+
  2459. SX7 X1+1 UPDATE NUMBER OF LINES SELECTED
  2460. SA7 NMLS
  2461. EQ MLTX RETURN
  2462. PLO SPACE 4,25
  2463. ** PLO - PROCESS LINE OVERLAP.
  2464. *
  2465. * ENTRY SEE EXIT CONDITIONS FOR *RLN*.
  2466. *
  2467. * EXIT (LBFILE) = 0, ALL SELECTED AND OVERLAPPED LINES ARE
  2468. * RESEQUENCED AND IN *EFBUF*.
  2469. * 1, ALL SELECTED AND OVERLAPPED LINES ARE
  2470. * RESEQUENCED AND WRITTEN TO *ZZZZZG1*.
  2471. * (LTFILE) = 0, ALL *LNT* ENTRIES ARE IN *LNTBUF*, IF
  2472. * ANY EXIST.
  2473. * 1, ALL *LNT* ENTRIES ARE WRITTEN TO FILE
  2474. * *ZZZZZG2*.
  2475. * (SCRFIL) = 0, NO LINES HAVE BEEN DELETED FROM THEIR
  2476. * ORIGINAL POSITIONS.
  2477. * 1, THE LINE NUMBERS OF LINES TO BE DELETED
  2478. * FROM THEIR ORIGINAL POSITIONS ARE
  2479. * WRITTEN TO FILE *ZZZZZG6*.
  2480. *
  2481. * USES X - 0, 1, 2, 3, 5, 6, 7.
  2482. * A - 1, 2, 3, 5, 6, 7.
  2483. * B - 2, 3, 4, 5, 6.
  2484. *
  2485. * CALLS CDD, CLN, MLB, RLN, SLN, SNM, USB.
  2486. *
  2487. * MACROS READ, READC, READEI, READO, REWIND, SKIPEI, WRITEC,
  2488. * WRITER, WRITEW.
  2489.  
  2490.  
  2491. PLO SUBR ENTRY/EXIT
  2492. SA3 INCR
  2493. SA2 NBLN
  2494. SA1 FNAI
  2495. BX6 X2
  2496. IX2 X2-X1
  2497. SA6 PLOA SET BOUNDARY FOR OVERLAP CHECKING
  2498. NG X2,PLO16 IF NO LINE OVERLAP
  2499. RJ CDD
  2500. MX2 B2
  2501. BX1 X2*X4
  2502. SB2 1RQ
  2503. SB5 PLOD
  2504. RJ SNM SET NAME IN MESSAGE
  2505.  
  2506. * QUERY USER WITH REGARD TO STOPPING.
  2507.  
  2508. WRITEC O,PLOD
  2509. PLO1 WRITEC O,PLOE
  2510. READ I READ IN REPLY
  2511. READC I,PCKDBF,MXWL+1 READ REPLY INTO BUFFER
  2512. NZ X1,PLO1 IF UNEXPECTED RESPONSE
  2513. SA2 CSTI
  2514. SB2 PCKDBF
  2515. SB6 MXCIL+1
  2516. SB3 X2
  2517. RJ USB UNPACK REPLY, ONE CHARACTER PER WORD
  2518. SB4 B7-B6
  2519. SA2 BLNK
  2520. PLO2 SA3 B4+CLIN GET NEXT CHARACTER
  2521. BX3 X3-X2
  2522. NZ X3,PLO3 IF CHARACTER NOT A BLANK
  2523. SB4 B4-1
  2524. PL B4,PLO2 IF MORE CHARACTERS TO CHECK
  2525. PLO3 NZ B4,PLO1 IF MORE THAN ONE CHARACTER
  2526. SA5 CLIN
  2527. SA1 CSTI GET THE CHARACTER SET
  2528. SA2 X1+PLOB+1 CHECK FOR *Y*
  2529. SX3 X2
  2530. BX3 X3-X5
  2531. ZR X3,PLO5 IF UPPER CASE *Y*
  2532. AX2 18
  2533. BX3 X2-X5
  2534. ZR X3,PLO5 IF LOWER CASE *Y*
  2535. SA2 X1+PLOC+1 CHECK FOR *N*
  2536. SX3 X2
  2537. BX3 X3-X5
  2538. ZR X3,PLO4 IF UPPER CASE *N*
  2539. AX2 18
  2540. BX3 X2-X5
  2541. NZ X3,PLO1 IF NOT LOWER CASE *N*
  2542. PLO4 SX5 ERRCNP *COMMAND NOT PROCESSED DUE TO OVERLAP.*
  2543. EQ ERR TERMINATE IEDIT PROCESSING
  2544.  
  2545. PLO5 SX6 B1+
  2546. SA6 OVLPFG
  2547. WRITER E,R FLUSH *EFBUF* TO *ZZZZZG1*
  2548. SX6 B0+
  2549. SA6 LBFILE
  2550. SX2 L
  2551. SA5 TSF+0
  2552. RJ SLN PUT *ZZZZZG0* IN LINE BUFFER FET
  2553. REWIND X2
  2554. SA5 EFN SET EDIT FILE NAME
  2555. SX2 E
  2556. RJ SLN
  2557. REWIND X2,R
  2558. READEI X2
  2559. PLO6 READC E,PCKDBF,MXWL+1 SET LINE INTO BUFFER
  2560. NZ X1,PLO10 IF EOI ENCOUNTERED
  2561. BX6 X4
  2562. EQ PLO8 CHECK FOR END OF LINE
  2563.  
  2564. PLO7 READO X2
  2565. PLO8 MX0 -12
  2566. BX6 -X0*X6
  2567. NZ X6,PLO7 IF NOT END OF LINE
  2568. SA5 PCKDBF
  2569. RJ CLN EVALUATE THE LINE NUMBER
  2570. SA2 FNAI
  2571. IX2 X6-X2
  2572. NG X2,PLO6 IF NOT POSITIONED AT OVERLAP POINT
  2573. SA1 FNUM
  2574. SX1 X1-FNMO
  2575. NZ X1,PLO9 IF NOT A *MOVE* FUNCTION
  2576. NZ X4,PLO6 IF LINE IS TO BE DELETED
  2577. PLO9 SA1 PLOA
  2578. IX2 X1-X6
  2579. NG X2,PLO10 IF NO MORE OVERLAP
  2580. SA2 INCR
  2581. IX6 X1+X2
  2582. SA6 PLOA UPDATE OVERLAP BOUNDARY
  2583. SX2 PCKDBF
  2584. SB3 L
  2585. RJ MLB INSTALL OVERLAP LINE INTO BUFFER
  2586. EQ PLO6 GET NEXT LINE
  2587.  
  2588. PLO10 SKIPEI E
  2589. SA1 LBFILE
  2590. ZR X1,PLO11 IF LINE BUFFER NOT ON FILE
  2591. WRITER L
  2592. REWIND X2
  2593. PLO11 SX7 B1+
  2594. RJ RLN REPLACE OVERLAPPED LINE NUMBERS
  2595. SX7 B1+
  2596. SA7 LBFILE
  2597. PLO12 WRITER E,R WRITE LINES TO *ZZZZZG1*
  2598. PLO13 SA1 SCRFIL
  2599. ZR X1,PLO14 IF NO LINES DELETED FROM ORIGINAL POSITION
  2600. WRITER SCR1,R WRITE DELETED LINES TO *ZZZZZG6*
  2601.  
  2602. * FLUSH TRUNCATED LINES IF NECESSARY
  2603.  
  2604. PLO14 SA3 TRNCFET CHECK FET STATUS
  2605. MX2 -18
  2606. BX3 -X2*X3
  2607. SX2 A3+
  2608. SX3 X3-3
  2609. ZR X3,PLO15 IF BUFFER NEVER WRITTEN TO DISK
  2610. WRITER X2
  2611. PLO15 SA1 BOP
  2612. ZR X1,PLOX IF NO *LNT* WAS GENERATED
  2613. SA1 LTFILE
  2614. ZR X1,PLOX IF *LNT* ENTIRELY IN BUFFER
  2615. SX2 LNT1
  2616. SA1 F.LNTBUF
  2617. SA3 NMLS
  2618. WRITEW X2,X1,X3 WRITE REMAINDER OF *LNT* TO DISK
  2619. WRITER X2,R
  2620. EQ PLOX RETURN
  2621.  
  2622. PLO16 SA1 LBFILE
  2623. ZR X1,PLO13 IF NO NEED TO WRITE OUT SELECTED LINES
  2624. EQ PLO12 WRITE LINES TO *ZZZZZG1*
  2625.  
  2626. PLOA CON 0 LINE WITH WHICH RESEQUENCING BEGINS
  2627.  
  2628. PLOB BSS 0 TABLE OF *YES* RESPONSES
  2629. VFD 24/0,18/7631B,18/1RY *ASCII*
  2630. VFD 24/0,18/1RY,18/1RY *NORMAL*
  2631. VFD 24/0,18/171B,18/131B *ASCII8*
  2632.  
  2633. PLOC BSS 0 TABLE OF *NO* RESPONSES
  2634. VFD 24/0,18/7616B,18/1RN *ASCII*
  2635. VFD 24/0,18/1RN,18/1RN *NORMAL*
  2636. VFD 24/0,18/156B,18/116B *ASCII8
  2637.  
  2638. PLOD BSS 0
  2639. DATA C*INSERT LINES OVERLAP EXISTING LINES, AT QQQQQ.*
  2640. PLOE DATA C*ENTER Y TO CONTINUE OR N TO STOP*
  2641. PWN SPACE 4,20
  2642. ** PWN - PROCESS *WRITEN*.
  2643. *
  2644. * *PWN* PACKS THE LINE IN THE STRING BUFFER INTO *PCKDBF*
  2645. * AFTER STRIPPING OFF THE LINE NUMBER. IF THE FORTRAN
  2646. * OPTION IS NOT SELECTED, A BLANK IS ALSO STRIPPED OFF.
  2647. *
  2648. * ENTRY CLIN = ADDRESS OF UNPACKED LINE.
  2649. * (FOP) = FORTRAN OPTION.
  2650. * (X1) = NUMBER OF LINE NUMBER DIGITS.
  2651. *
  2652. * EXIT PCKDBF CONTAINS SHIFTED, PACKED LINE.
  2653. *
  2654. * USES X - 1, 2, 3.
  2655. * A - 1, 2, 3.
  2656. * B - 2, 4.
  2657. *
  2658. * CALLS PLB.
  2659.  
  2660.  
  2661. PWN SUBR ENTRY/EXIT
  2662. SA3 FOP
  2663. NZ X3,PWN1 IF FORTRAN SUBSYSTEM
  2664. SA3 NCOL
  2665. IX3 X3-X1
  2666. ZR X3,PWN1 IF LINE CONSISTS OF A LINE NUMBER ONLY
  2667. SA3 X1+CLIN
  2668. SA2 BLNK
  2669. BX2 X2-X3
  2670. NZ X2,PWN1 IF NOT BLANK
  2671. SX1 X1+B1 INCREMENT STRIPOFF COUNT
  2672. PWN1 SA3 NCOL
  2673. SA2 X1+CLIN FIRST USABLE CHARACTER
  2674. SB2 60 PACK LINE INTO BUFFER
  2675. IX3 X3-X1
  2676. SB4 X3
  2677. SA1 PCKDBF
  2678. RJ PLB
  2679. EQ PWNX RETURN
  2680. RLN SPACE 4,25
  2681. ** RLN - REPLACE LINE NUMBER.
  2682. *
  2683. * ENTRY (X7) = 0, IF USER SELECTED LINES TO BE RENUMBERED.
  2684. * .NE. 0, IF OVERLAPPED LINES TO BE RENUMBERED.
  2685. * (LBFILE) = 0, ALL LINES TO BE RESEQUENCED ARE IN
  2686. * *LNBUF*.
  2687. * 1, LINES TO BE RESEQUENCED MUST BE READ
  2688. * FROM THE FILE POINTED TO BY FET *L*
  2689. * (*ZZZZZG0* OR THE *READ* FILE).
  2690. * EXIT (LBFILE) = 0, ALL RESEQUENCED LINES ARE IN *EFBUF*.
  2691. * 1, AT LEAST SOME OF THE RESEQUENCED LINES
  2692. * HAVE BEEN WRITTEN TO FILE *ZZZZZG1*
  2693. * USING FET *E*.
  2694. * (LTFILE) = 0, ALL *LNT* ENTRIES ARE IN *LNTBUF, IF
  2695. * ANY EXIST.
  2696. * 1, AT LEAST SOME OF THE *LNT* ENTRIES HAVE
  2697. * BEEN WRITTEN TO FILE *ZZZZZG2* USING
  2698. * FET *LNT1*.
  2699. * (SCRFIL) = 0, NO LINES HAVE BEEN DELETED FROM THEIR
  2700. * ORIGINAL POSITIONS.
  2701. * 1, THE LINE NUMBERS OF LINES TO BE DELETED
  2702. * FROM THEIR ORIGINAL POSITIONS HAVE BEEN
  2703. * WRITTEN INTO *SCRBB* USING FET *SCR1*.
  2704. * SOME OF THE ENTRIES MAY HAVE BEEN
  2705. * FLUSHED TO FILE *ZZZZZG6*.
  2706. *
  2707. * USES X - ALL.
  2708. * A - 1, 2, 3, 4, 5, 6, 7.
  2709. * B - 2, 3, 4, 5, 6.
  2710. *
  2711. * CALLS ABL, CNL, MLB, MLT, SBE, SLN, USB, VPL, WTL.
  2712. *
  2713. * MACROS MOVE, READC, READEI, READO, WRITEO.
  2714.  
  2715.  
  2716. RLN SUBR ENTRY/EXIT
  2717. SA7 RLNA
  2718. SX6 B0+
  2719. SA6 RLNB INITIALIZE NUMBER OF CHAR TO MOVE
  2720. SA5 TSF+1
  2721. SX2 E
  2722. RJ SLN
  2723. SX5 B0+
  2724. RJ SBE SET *EFBUF* TO EMPTY
  2725. SA3 LBFILE
  2726. NZ X3,RLN1 IF LINE BUFFER ON FILE
  2727. SA5 L SET EOI STATUS INTO FET
  2728. SX6 741031B
  2729. MX4 42
  2730. BX6 -X4*X6
  2731. BX5 X4*X5
  2732. BX6 X5+X6
  2733. SA6 A5+
  2734. EQ RLN2 DO NOT READ FILE
  2735.  
  2736. RLN1 READEI L
  2737. SX6 B0+
  2738. SA6 LBFILE RESET *LBFILE* TO ZERO
  2739. RLN2 SX2 L
  2740. SX6 B0+
  2741. SA6 FLAGS
  2742. SA6 TRNC
  2743. READC X2,PCKDBF,MXWL+1
  2744. NZ X1,RLN21 IF EOI ENCOUNTERED
  2745. BX6 X4
  2746. RLN3 MX0 -12
  2747. BX6 -X0*X6
  2748. ZR X6,RLN4 IF EOL ENCOUNTERED
  2749. READO X2
  2750. EQ RLN3 CHECK FOR END OF LINE
  2751.  
  2752. * GET THE LINE NUMBER.
  2753.  
  2754. RLN4 SA5 PCKDBF
  2755. RJ VPL EVALUATE THE PACKED LINE NUMBER
  2756. SA6 OBLN
  2757. SA7 RLNC
  2758. ZR X3,RLN2 IF A DELETED LINE FOUND ON THE *READ* FILE
  2759.  
  2760. * IF THE FIRST LINE IN THE FILE, THEN CHECK FOR A
  2761. * LINE NUMBER.
  2762.  
  2763. SA2 RLNB
  2764. NZ X2,RLN7 IF NOT THE FIRST LINE IN THE FILE
  2765. SA3 RLNA
  2766. ZR X3,RLN5 IF NOT OVERLAPPED LINES
  2767. SA6 OLLE STORE LOWER BOUNDARY FOR OVERLAPPED LINES
  2768. RLN5 BX3 X7
  2769. MX7 1
  2770. NZ X3,RLN6 IF LINE NUMBER PRESENT
  2771. SX6 B1+ SET UNNUMBERED *READ* FILE FLAG
  2772. SA6 UNRF
  2773. SX7 NUMD
  2774. SA2 FOP
  2775. SX7 X7+CLIN
  2776. NZ X2,RLN6 IF FORTRAN SUBSYSTEM
  2777. SX7 X7+1
  2778. RLN6 SA7 RLNB
  2779.  
  2780. * UNPACK THE LINE AND SET THE TRUNCATE BIT IF NECESSARY.
  2781.  
  2782. RLN7 SB2 PCKDBF
  2783. SA2 CSTI
  2784. SB6 MXCIL+1
  2785. SB3 X2+
  2786. RJ USB UNPACK LINE INTO STRING BUFFER
  2787. SB4 B7-B6
  2788. SB4 B4+B1
  2789.  
  2790. * FIND THE LAST NON-BLANK CHARACTER.
  2791.  
  2792. SB2 MXCIL
  2793. SA4 BLNK
  2794. GE B2,B4,RLN8 IF LINE NOT TOO LONG
  2795. SB4 MXCIL
  2796. SX7 B1
  2797. SA7 TRNC FLAG LINE AS TRUNCATED
  2798. EQ RLN9 SET NUMBER OF CHARACTERS IN LINE
  2799.  
  2800. RLN8 SA3 B4+CLIN-1
  2801. BX3 X3-X4
  2802. NZ X3,RLN9 IF CHARACTER NOT A BLANK
  2803. SB4 B4-1
  2804. EQ RLN8 CHECK THE NEXT CHARACTER
  2805.  
  2806. RLN9 SX7 B4+
  2807. SA7 NCOL
  2808.  
  2809. * IF FUNCTION IS A *MOVE* COMMAND OR THE LINE IS AN OVERLAP
  2810. * LINE, THEN INSTALL THE DELETED LINE NUMBER IN (SCR1).
  2811.  
  2812. SA3 RLNA
  2813. SA1 FNUM
  2814. SX2 X1-FNMO
  2815. NZ X3,RLN10 IF AN OVERLAPPED LINE
  2816. NZ X2,RLN11 IF NOT A *MOVE* COMMAND
  2817. RLN10 SA1 PCKDBF
  2818. SA2 RLNC
  2819. SX6 6 CALCULATE MASK SIZE
  2820. IX2 X2*X6
  2821. SB4 X2
  2822. MX2 B4 FORM MASK INTO (X2)
  2823. BX6 X2*X1
  2824. WRITEO SCR1 WRITE LINE NUMBER TO SCRATCH FILE
  2825. SX6 B1+
  2826. SA6 SCRFIL
  2827.  
  2828. * GET NEW LINE NUMBER FOR LINE AND CHECK IF NEW LINE
  2829. * NUMBER VALUE WOULD BE TOO LARGE.
  2830.  
  2831. RLN11 SA1 LSRA SET VALUE (BINARY) OF NEW LINE NUMBER
  2832. SA2 INCR
  2833. IX7 X1+X2 INCREMENT FOR NEXT LINE NUMBER
  2834. SX4 MXLN+1
  2835. SA7 A1
  2836. IX7 X1-X4 COMPARE WITH LARGEST POSSIBLE NUMBER
  2837. SX5 ERRNTL *LINE NUMBER LIMIT EXCEEDED.*
  2838. PL X7,ERR IF NUMBER TOO LARGE, ISSUE ERROR MESSAGE
  2839. SX7 X1+
  2840. SA7 NBLN
  2841.  
  2842. * CONVERT NEW LINE NUMBER TO DISPLAY CODE.
  2843.  
  2844. RJ CNL CONVERT AND NORMALIZE LINE NUMBER
  2845. SA6 RLND SAVE LINE NUMBER
  2846.  
  2847. * MOVE LINE OVER IF NECESSARY.
  2848.  
  2849. SX2 CLIN
  2850. SA3 RLNB
  2851. PL X3,RLN12 IF NO LINE NUMBERS ON LINES
  2852. SA1 NCOL
  2853. SA2 RLNC NUMBER OF CHARACTERS IN OLD LINE NUMBER
  2854. SX5 ERRNLN *NO LINE NUMBER ON LINE.*
  2855. ZR X2,ERR IF NO LINE NUMBER PRESENT
  2856. SX3 NUMD+CLIN
  2857. SX2 X2+CLIN
  2858. RLN12 IX1 X3-X2
  2859. ZR X1,RLN14 IF LINE NUMBERS ARE THE SAME LENGTH
  2860. SA4 NCOL
  2861. SB3 MXCIL+1
  2862. IX7 X4+X1
  2863. SB2 X7
  2864. GT B3,B2,RLN13 IF LINE WILL NOT BE TRUNCATED
  2865. SX6 B1+
  2866. SA6 TRNC
  2867. SX7 MXCIL
  2868. RLN13 SA7 NCOL UPDATE LENGTH OF MOVED LINE
  2869. SX7 X7+CLIN COMPUTE STRING LENGTH TO MOVE
  2870. IX1 X7-X3
  2871. ZR X1,RLN14 IF NO CHARACTERS TO MOVE
  2872. MOVE X1,X2,X3 MOVE LINE OVER
  2873.  
  2874. * REPLACE LINE NUMBER ON LINE WITH NEW NUMBER.
  2875.  
  2876. RLN14 SA1 RLND
  2877. SA2 CSTI
  2878. MX0 -NBIC
  2879. SB4 B0
  2880. SB5 30
  2881. SB2 X2+
  2882. SB3 B0+
  2883. RLN15 SB4 B4+6
  2884. LX6 X1,B4
  2885. BX6 -X0*X6
  2886. LE B2,RLN16 IF NOT *ASCII8* CHARACTER SET
  2887. SX6 X6+25B CONVERT CHARACTER TO *ASCII8*
  2888. RLN16 SA6 CLIN+B3
  2889. SB3 B3+1
  2890. NE B4,B5,RLN15 IF NOT THROUGH INSERTING LINE NUMBER
  2891. SA4 BLNK
  2892. SA2 FOP
  2893. SA1 RLNB
  2894. NZ X2,RLN17 IF BLANK NOT TO FOLLOW LINE NUMBER
  2895. NG X1,RLN17 IF REPLACING EXISTING LINE NUMBER
  2896. SX7 X4+
  2897. SA7 B3+CLIN
  2898.  
  2899. * ADD PROPER NUMBER OF TRAILING BLANKS TO LINE AND
  2900. * INSTALL LINE WITH NEW LINE NUMBER INTO *EFBUF*.
  2901.  
  2902. RLN17 SX2 NUMD
  2903. RJ ABL
  2904. SB3 E
  2905. MX2 1 LINE IS IN CHARACTER BUFFER
  2906. RJ MLB PUT LINE INTO *EFBUF*
  2907. SA2 TRNC
  2908. ZR X2,RLN18 IF LINE WAS NOT TRUNCATED
  2909. SA1 NBLN
  2910. RJ WTL WRITE TRUNCATED LINE NUMBER
  2911. RLN18 SA2 RLNA
  2912. ZR X2,RLN20 IF NOT AN OVERLAP LINE
  2913. SA2 FLAGS
  2914. SX1 B1+
  2915. LX1 FOVL-0
  2916. BX6 X1+X2
  2917. SA6 A2+ SET OVERLAP BIT
  2918. RLN19 SA2 BOP
  2919. ZR X2,RLN2 IF *LNT* NOT NEEDED
  2920. RJ MLT BUILD *LNT* ENTRY
  2921. EQ RLN2 PROCESS NEXT LINE
  2922.  
  2923. RLN20 SA1 NNOL
  2924. SX6 X1+B1
  2925. SA6 A1 INCREMENT NUMBER OF NON-OVERLAPPED LINES
  2926. SA1 FNUM
  2927. SX1 X1-FNRE
  2928. NZ X1,RLN19 IF NOT A *READ* FUNCTION
  2929. SA1 RLNB
  2930. NG X1,RLN19 IF *READ* FILE HAD LINE NUMBERS
  2931. EQ RLN2 PROCESS NEXT LINE
  2932.  
  2933. RLN21 SA1 RLNA
  2934. ZR X1,RLNX IF NOT PROCESSING OVERLAPPED LINES
  2935. SA1 OBLN
  2936. SA2 OLLE
  2937. LX1 18
  2938. MX3 1
  2939. BX6 X1+X2 ADD UPPER BOUNDARY FOR OVERLAPPED LINES
  2940. BX6 X3+X6 SET END OF LINE RANGE TABLE
  2941. SA6 A2
  2942. EQ RLNX RETURN
  2943.  
  2944. RLNA CON 0 OVERLAP PARAMETER
  2945. RLNB CON 0 NUMBER OF CHARACTERS TO MOVE LINES OVER
  2946. RLNC CON 0 NUMBER OF CHAR IN ORIGINAL LINE NUMBER
  2947. RLND CON 0 NEW LINE NUMBER IN DISPLAY CODE
  2948. SLF SPACE 4,25
  2949. ** SLF - SELECT LINES FROM FILE.
  2950. *
  2951. * *SLF* SELECTS ALL LINES FROM THE EDIT FILE WHICH
  2952. * SATISFY THE USER SPECIFIED CRITERIA.
  2953. *
  2954. * ENTRY E = FET POINTING TO THE EDIT FILE.
  2955. * (LNIA) = LINE NUMBER SPECIFIED BY THE USER AFTER
  2956. * WHICH SELECTED LINES ARE TO BE INSERTED.
  2957. *
  2958. * EXIT (LBFILE) = 0, ALL SELECTED LINES ARE IN *LNBUF*.
  2959. * 1, ALL SELECTED LINES HAVE BEEN WRITTEN TO
  2960. * FILE *ZZZZZG0* USING FET *L*. THE FILE
  2961. * IS LEFT REWOUND.
  2962. * (FNAI) = FIRST LINE NUMBER FOLLOWING USER SPECIFIED
  2963. * INSERT POINT.
  2964. * (LSRA) = LINE NUMBER TO BE ASSIGNED TO THE
  2965. * FIRST INSERTED LINE.
  2966. *
  2967. * USES X - 0, 1, 2, 3, 5, 6, 7.
  2968. * A - 1, 2, 3, 5, 6, 7.
  2969. * B - 2, 3, 5, 7.
  2970. *
  2971. * CALLS CLN, MLB, SBE, SSF.
  2972. *
  2973. * MACROS READEI, READC, READO, REWIND, WRITER.
  2974.  
  2975.  
  2976. SLF SUBR ENTRY/EXIT
  2977. SLF1 READEI E
  2978.  
  2979. * THIS MARKS THE BEGINNING OF THE MAIN LOOP.
  2980. * CLEAR ALL FLAGS AND READ A LINE INTO THE WORKING BUFFER.
  2981.  
  2982. SLF2 READC E,PCKDBF,MXWL+1
  2983. NZ X1,SLF8 IF EOI ENCOUNTERED
  2984. BX6 X4
  2985. SLF3 MX0 -12
  2986. BX6 -X0*X6
  2987. ZR X6,SLF4 IF END OF LINE ENCOUNTERED
  2988. READO X2
  2989. EQ SLF3 CHECK FOR END OF LINE
  2990.  
  2991. * CRACK THE LINE NUMBER AND STORE ITS VALUE AND LENGTH.
  2992.  
  2993. SLF4 SA5 PCKDBF
  2994. RJ CLN
  2995. SA2 OBLN
  2996. IX2 X2-X6
  2997. PL X2,SLF9 IF NUMBER .LT. PREVIOUS LINE NUMBER
  2998. ZR X3,SLF9 IF LINE A NUMBER ONLY
  2999. SA6 OBLN
  3000. SA6 NBLN
  3001. SA1 FNUM
  3002. SX2 X1-FNMO
  3003. NZ X2,SLF5 IF A *READ* OR *DUP* FUNCTION
  3004. NZ X4,SLF7 IF LINE SELECTED BY *MOVE* COMMAND
  3005.  
  3006. * IF NECESSARY, UPDATE THE LAST LINE NUMBER IN THE FILE.
  3007.  
  3008. SLF5 SA5 LNIA
  3009. SX2 X5-MXLN-1
  3010. NG X2,SLF6 IF USER SPECIFIED A LINE NUMBER
  3011. SA6 SLFB
  3012. EQ SLF7 CHECK IF LINE IS SELECTED
  3013.  
  3014. * IF NECESSARY, UPDATE THE FIRST LINE NUMBER AFTER
  3015. * THE INSERT POINT.
  3016.  
  3017. SLF6 SA3 FNAI
  3018. SB3 X6+
  3019. SB5 X5 GET LINE NUMBER TO INSERT AFTER
  3020. SB7 X3 GET FIRST LINE NUMBER AFTER INSERT POINT
  3021. GE B5,B3,SLF7 IF CURRENT LINE BEFORE INSERT POINT
  3022. LT B7,B3,SLF7 IF CURRENT LINE BEYOND INSERT POINT
  3023. SA6 FNAI
  3024.  
  3025. * IF LINE IS SELECTED BASED UPON ITS LINE NUMBER,
  3026. * PUT THE LINE IN *LNBUF*.
  3027.  
  3028. SLF7 SA1 FNUM
  3029. SX1 X1-FNRE
  3030. ZR X1,SLF2 IF *READ*, PROCESS NEXT LINE
  3031. ZR X4,SLF2 IF LINE NOT SELECTED
  3032. SX7 B1+
  3033. SA7 SLFA A LINE WAS FOUND
  3034. SX2 PCKDBF
  3035. SB3 L
  3036. RJ MLB ADD LINE TO LINE BUFFER
  3037. EQ SLF2 PROCESS THE NEXT LINE
  3038.  
  3039. * FINISH UP AFTER SCAN OF EDIT FILE IS COMPLETED.
  3040.  
  3041. SLF8 SA1 FNUM
  3042. SX1 X1-FNRE
  3043. ZR X1,SLF10 IF A *READ* FUNCTION
  3044. SA1 SLFA
  3045. NZ X1,SLF10 IF AT LEAST ONE LINE SELECTED
  3046. SX5 ERRNLF *NO LINES FOUND.*
  3047. EQ ERR NO LINES FOUND
  3048.  
  3049. * SORT EDIT FILE WHEN NECESSARY.
  3050.  
  3051. SLF9 SX2 L
  3052. SA5 LBFILE
  3053. RJ SBE
  3054. SX6 B0+
  3055. SA6 LBFILE
  3056. SA6 SLFA
  3057. SX7 -1
  3058. SA7 SLFB
  3059. SA7 OBLN
  3060. SX6 MXLN+1
  3061. SA6 FNAI
  3062. SB2 E
  3063. RJ SSF SORT THE EDIT FILE
  3064. EQ SLF1 BEGIN SELECTION PHASE AGAIN
  3065.  
  3066. * IF NECESSARY, UPDATE THE LINE NUMBER TO INSERT AFTER.
  3067. * DETERMINE THE LINE NUMBER TO START RESEQUENCING AT.
  3068.  
  3069. SLF10 SA1 LNIA
  3070. SX2 X1-MXLN-1
  3071. NZ X2,SLF11 IF INSERT POINT WAS SPECIFIED BY USER
  3072. SA1 SLFB
  3073. SX7 X1+
  3074. SA7 LNIA
  3075. SLF11 SA2 INCR
  3076. IX7 X1+X2
  3077. SA7 LSRA
  3078. SA1 LBFILE
  3079. ZR X1,SLFX IF LINE BUFFER NOT WRITTEN TO FILE
  3080. WRITER L WRITE REST OF *LBUF* OUT TO FILE
  3081. REWIND X2
  3082. EQ SLFX RETURN
  3083.  
  3084. SLFA CON 0 LINES SELECTED FLAG
  3085. SLFB CON -1 LARGEST LINE NUMBER IN THE FILE
  3086. SLE SPACE 4,15
  3087. ** SLE - SORT *LNT* ENTRIES.
  3088. *
  3089. * ENTRY (X1) = NUMBER OF ENTRIES TO SORT.
  3090. * (B7) = FWA OF *LNT*
  3091. *
  3092. * EXIT *LNT* SORTED.
  3093. *
  3094. * USES X - 0, 1, 2, 3, 4, 6.
  3095. * A - 1, 2, 6.
  3096. * B - 5, 6.
  3097.  
  3098.  
  3099. SLE SUBR ENTRY/EXIT
  3100. MX0 18
  3101. LX0 -18
  3102. SB5 X1+B7 LWA+1
  3103. SB6 X1
  3104. LE B6,B1,SLEX IF NOT AT LEAST TWO ENTRIES
  3105. SA2 B7+ GET FIRST ENTRY
  3106. SA1 A2+B1 GET SECOND ENTRY
  3107. BX3 X0*X1
  3108. SLE1 BX4 X0*X2
  3109. IX4 X3-X4
  3110. PL X4,SLE2 IF PROPER INSERT POINT FOUND
  3111. BX6 X2
  3112. SA6 A2+1
  3113. SA2 A2-B1
  3114. SB6 A2-B7
  3115. PL B6,SLE1 IF MORE ENTRIES TO CHECK
  3116. SLE2 BX6 X1
  3117. SA6 A2+B1 PLACE ENTRY IN ITS PROPER SLOT
  3118. SA1 A1+B1
  3119. BX3 X0*X1
  3120. SA2 A1-B1
  3121. SB6 A1-B5
  3122. NG B6,SLE1 IF MORE ENTRIES TO SORT
  3123. EQ SLEX EXIT
  3124. SLT SPACE 4,20
  3125. ** SLT - SORT LINE NUMBER TABLE.
  3126. *
  3127. * *SLT* SORTS THE *LNT* INTO ASCENDING ORDER
  3128. * BASED UPON THE OLD LINE NUMBER FIELD.
  3129. *
  3130. * ENTRY (LTFILE) = 0, IF *LNT* IS NOT WRITTEN TO DISK.
  3131. * 1, IF *LNT* IS WRITTEN TO DISK.
  3132. *
  3133. * EXIT *LNT* IS SORTED.
  3134. *
  3135. * USES X - 1, 2, 5.
  3136. * A - 1, 2, 5.
  3137. * B - 7.
  3138. *
  3139. * CALLS SBE, SLE, SLN, SMT.
  3140. *
  3141. * MACROS READEI, RENAME, REWIND.
  3142.  
  3143.  
  3144. SLT1 SA5 TSF+2 PUT *ZZZZZG2* INTO FET *L*
  3145. SX2 L
  3146. RJ SLN
  3147. RENAME X2,TSF+4 RENAME *ZZZZZG2* TO *ZZZZZG4*
  3148. REWIND X2,R
  3149. SLT2 READEI X2 READ A SEGMENT INTO *LNBUF*
  3150. SA2 X2+B1
  3151. SX2 X2
  3152. SA1 A2+B1 GET *IN*
  3153. IX1 X1-X2
  3154. RJ SMT MERGE SEGMENT WITH NEW *LNT* FILE
  3155. SX2 L
  3156. SX5 B0+
  3157. RJ SBE
  3158. SA1 X2
  3159. LX1 59-9
  3160. PL X1,SLT2 IF MORE ENTRIES TO PROCESS
  3161. SA5 TSF+0
  3162. RJ SLN RESTORE *ZZZZZG0* INTO FET *L*
  3163.  
  3164. SLT SUBR ENTRY/EXIT
  3165. SA1 LTFILE
  3166. NZ X1,SLT1 IF *LNT* WRITTEN TO MASS STORAGE
  3167. SA2 F.LNTBUF
  3168. SA1 NMLS
  3169. SB7 X2+
  3170. RJ SLE SORT *LNT*
  3171. EQ SLTX RETURN
  3172. SMT SPACE 4,25
  3173. ** SMT - SORT AND MERGE LINE NUMBER TABLE.
  3174. *
  3175. * WHEN THE LINE NUMBER TABLE BECOMES FULL, IT IS
  3176. * SORTED AND MERGED WITH THE LINE NUMBER TABLE SCRATCH
  3177. * FILE.
  3178. *
  3179. * ENTRY (X1) = NUMBER OF ENTRIES IN TABLE.
  3180. * (X2) = FWA OF TABLE TO BE SORT/MERGED.
  3181. * (LTFET) = FET ADDRESS OF SORT/MERGED *LNT* FILE.
  3182. * (LT2FET) = FET ADDRESS OF SCRATCH FILE.
  3183. *
  3184. * EXIT (LTFET) = FET ADDRESS OF SORTED *LNT* FILE.
  3185. * (LT2FET) = FET ADDRESS OF SCRATCH FILE.
  3186. *
  3187. * USES X - ALL.
  3188. * A - 1, 2, 4, 5, 6, 7.
  3189. * B - 6, 7.
  3190. *
  3191. * CALLS SLE.
  3192. *
  3193. * MACROS READEI, READO, REWIND, WRITEO, WRITER.
  3194.  
  3195.  
  3196. SMT SUBR ENTRY/EXIT
  3197. ZR X1,SMTX IF NO ENTRIES IN TABLE
  3198. SX6 X2
  3199. SX7 X1
  3200. SA6 SMTA STORE FWA OF TABLE
  3201. SA7 SMTB STORE NUMBER OF TABLE ENTRIES
  3202. SA2 LT2FET
  3203. REWIND X2,R
  3204. SA2 LTFET
  3205. REWIND X2,R
  3206. READEI X2 PREPARE THE TWO FILES
  3207. SA2 SMTA
  3208. SA1 SMTB
  3209. SB7 X2 FWA OF TABLE
  3210. IX6 X1+X2
  3211. SA6 SMTB LWA+1 OF TABLE
  3212. RJ SLE SORT THE *LNT*
  3213. MX0 18
  3214. LX0 -18
  3215. SA1 SMTA
  3216. SA5 X1 GET THE FIRST TABLE ENTRY
  3217. SA2 LTFET
  3218. READO X2
  3219. NZ X1,SMT4 IF NO ENTRIES ON THE FILE
  3220. SMT1 BX3 X0*X5
  3221. BX4 X0*X6
  3222. IX3 X3-X4 COMPARE THE TWO ENTRIES
  3223. PL X3,SMT3 IF TABLE ENTRY .GE. THAN FILE ENTRY
  3224. BX5 X5-X6
  3225. BX6 X5-X6
  3226. BX5 X5-X6 REVERSE X5 AND X6
  3227. SA2 LT2FET
  3228. WRITEO X2 WRITE TABLE ENTRY TO NEW FILE
  3229. BX6 X5
  3230. SA5 A5+B1 GET NEXT TABLE ENTRY
  3231. SA4 SMTB
  3232. SB6 A5
  3233. SB7 X4
  3234. GT B7,B6,SMT1 IF A VALID TABLE ENTRY
  3235. SMT2 SA2 LT2FET EMPTY *LNT* FILE TO NEW FILE
  3236. WRITEO X2
  3237. SA2 LTFET
  3238. READO X2
  3239. ZR X1,SMT2 IF ENTRIES REMAINING ON FILE
  3240. EQ SMT5 FINISH THE SORT
  3241.  
  3242. SMT3 SA2 LT2FET WRITE FILE ENTRY TO NEW FILE
  3243. WRITEO X2
  3244. SA2 LTFET
  3245. READO X2
  3246. ZR X1,SMT1 IF MORE ENTRIES ON FILE
  3247. SMT4 BX6 X5 EMPTY THE LINE NUMBER TABLE TO FILE
  3248. SA2 LT2FET
  3249. WRITEO X2 WRITE TABLE ENTRY TO FILE
  3250. SA5 A5+B1
  3251. SA4 SMTB
  3252. SB6 A5
  3253. SB7 X4
  3254. GT B7,B6,SMT4 IF ENTRIES REMAINING IN TABLE
  3255. SMT5 SA2 LT2FET
  3256. WRITER X2 FLUSH BUFFER TO FILE
  3257. SA1 LTFET
  3258. SA2 LT2FET
  3259. BX6 X1
  3260. BX7 X2
  3261. SA6 A2
  3262. SA7 A1 SWITCH (LTFET) AND (LT2FET)
  3263. EQ SMTX RETURN
  3264.  
  3265. SMTA CON 0 FWA OF TABLE
  3266. SMTB CON 0 LWA OF TABLE
  3267. TITLE MEMORY ALLOCATION.
  3268. SPACE 4,10
  3269. MEM EQU * MANAGED TABLES START ADDRESS
  3270. TITLE PRESET.
  3271. PRS SPACE 4,55
  3272. ** PRS - PRESET ARGUMENT PROCESSING.
  3273. *
  3274. * *PRS* ANALYZES THE COMMAND AND COMMAND LINE BUFFER. THE
  3275. * FOLLOWING INFORMATION IS EXTRACTED AND STORED.
  3276. * 1. FILE NAME IN EFN (FOR EDIT FILE NAME)
  3277. * 2. FLAGS DENOTING OPTIONS SPECIFIED
  3278. * 3. CHARACTER SET TYPE SPECIFIED
  3279. * 4. INFORMATION EXTRACTED FROM COMMAND LINE BUFFER
  3280. *
  3281. * CELLS FOR THE SPECIFIED OPTIONS ARE SET OR LEFT ZERO
  3282. * DEPENDING ON THEIR PRESENCES OR ABSENCE, RESPECTIVELY
  3283. * IN *COPT*. THESE FLAGS ARE SET IN THE FOLLOWING
  3284. * LOCATIONS -
  3285. * BOP = FOR B OPTION (BASIC SUB-SYSTEM)
  3286. * LOP = FOR L OPTION (LIST OPTION)
  3287. * FOP = FOR F OPTION (FORTRAN SUB-SYSTEM)
  3288. *
  3289. * AFTER THE BREAKING UP AND STORING OF THE COMMAND, *FVT* IS
  3290. * EXECUTED TO FIND VERB IN TABLE (I.E. MATCH THE VERB IN THE
  3291. * COMMAND LINE TO A VERB IN THE TABLE OF DEFINED VERBS (TDVB)).
  3292. * WHEN A MATCH IS FOUND, *PVA* IS CALLED TO PROCESS THE VERB
  3293. * ARGUMENTS. THIS ROUTINE EXECUTES THE ROUTINES ASSOCIATED
  3294. * -VIA TDVB- WITH THE VERB.
  3295. *
  3296. * ENTRY COMMAND STARTING IN RA+2 IN NORMAL DISPLAY CODE, IN
  3297. * STANDARD SYSTEM FORMAT.
  3298. * (CLB=) = FWA OF FET FOR COMMAND TO BE PROCESSED
  3299. * BY IEDIT.
  3300. * (I) = FWA OF FET FOR INPUT FILE
  3301. * (WHICH CONTAINS THE FILE TO EDIT).
  3302. *
  3303. * EXIT *IEDIT* COMMAND ANALYZED, INFORMATION EXTRACTED
  3304. * AND STORED.
  3305. * COMMAND LINE BUFFER INFORMATION EXTRACTED AND
  3306. * STORED IN APPROPRIATE CELLS AND TABLES.
  3307. * FUNCTION TO BE PERFORMED ESTABLISHED
  3308. * (FUNCTION NUMBER RETURNED IN FNUM).
  3309. * TO ERR - IF A FATAL ERROR CONDITION IS DETECTED.
  3310. *
  3311. * USES X - ALL.
  3312. * A - 1, 2, 3, 4, 5, 6, 7.
  3313. * B - 1, 2, 3, 4, 5, 6, 7.
  3314. *
  3315. * CALLS ARG, FVT, PVA, SST, USB.
  3316. *
  3317. * MACROS FILINFO, MEMORY, MESSAGE, READ, REPRIEVE, SETLOF.
  3318.  
  3319.  
  3320. PRS SUBR ENTRY/EXIT
  3321. MX6 1
  3322. SA2 O+1 SET *FLUSH* BIT
  3323. LX6 36-59
  3324. SB1 1
  3325. BX6 X6+X2
  3326. SA6 A2
  3327. SETLOF LOFPRM
  3328. SA1 ACTR SET UP FOR CALL TO *ARG*
  3329. SA4 ARGR
  3330. SB5 PRSA
  3331. SB4 X1
  3332. RJ ARG PROCESS ARGUMENTS
  3333. SX5 ERRCSE *COMMAND ARGUMENT ERROR.*
  3334. NZ X1,ERR IF ARGUMENT ERROR
  3335. SA1 COPT PROCESS *OP* LIST
  3336. ZR X1,PRS5 IF NO OPTIONS SPECIFIED
  3337. MX0 60-18 CHECK FOR INCORRECT *OP=*
  3338. BX7 X1*X0 ERROR IF 60-18 ALL ZEROES
  3339. SX5 ERRCSE *COMMAND ARGUMENT ERROR.*
  3340. ZR X7,ERR IF INCORRECT *OP=* PASSED
  3341.  
  3342. * PROCESS *OP* PARAMETER CHECKING FOR VALIDITY.
  3343.  
  3344. SX7 B1 SET FOR USE AS FLAG
  3345. MX0 6 MASK FOR OPTION
  3346. PRS1 BX2 X0*X1
  3347. LX2 5-59 RIGHT JUSTIFY OPTION
  3348. ZR X2,PRS5 IF DONE CRACKING *OP*
  3349. SB5 X2+ SET CURRENT *OP* BEING COMPARED
  3350. SB2 1RB
  3351. EQ B2,B5,PRS2 IF *B* PARAMETER SET
  3352. SB2 1RL
  3353. EQ B2,B5,PRS3 IF *L* PARAMETER SET
  3354. SB2 1RF
  3355. EQ B2,B5,PRS4 IF *F* PARAMETER SET
  3356. SX5 ERRCSE *COMMAND ARGUMENT ERROR.*
  3357. EQ ERR *INCORRECT *OP* SPECIFIED*
  3358.  
  3359. PRS2 SA7 BOP SET FOR *B* OPTION
  3360. LX1 6 LINE UP LIST TO GET NEXT *OP*
  3361. EQ PRS1 PROCESS NEXT *OP*
  3362.  
  3363. PRS3 SA7 LOP SET FOR *L* OPTION
  3364. SA7 LSTFIL
  3365. LX1 6 LINE UP LIST TO GET NEXT *OP*
  3366. EQ PRS1 PROCESS NEXT *OP*
  3367.  
  3368. PRS4 SA7 FOP SET *F* OPTION SELECTED
  3369. LX1 6
  3370. EQ PRS1 PROCESS NEXT *OP*
  3371.  
  3372. PRS SPACE 2,5
  3373.  
  3374. * VALIDATE AND SET CHARACTER SET TYPE
  3375. * CSTI = -1 FOR ASCII 6/12
  3376. * = 0 FOR NORMAL
  3377. * = 1 FOR ASCII8
  3378.  
  3379. PRS5 SA2 CSCS
  3380. SX7 6
  3381. SA1 PRSC
  3382. BX6 X2-X1
  3383. SX7 1R
  3384. ZR X6,PRS6 IF NORMAL CHARACTER SET
  3385. SA1 PRSD
  3386. SX6 -B1
  3387. BX5 X2-X1
  3388. ZR X5,PRS6 IF ASCII 6/12
  3389. SX7 40B
  3390. SX6 1 CHARACTER SET MUST BE ASCII8
  3391. SA1 PRSE
  3392. BX5 X2-X1
  3393. ZR X5,PRS6 IF ASCII8
  3394. SX5 ERRCSE *COMMAND ARGUMENT ERROR.*
  3395. EQ ERR CHARACTER SET ERROR
  3396.  
  3397. PRS6 SA6 CSTI SAVE CHARACTER SET TYPE INDICATOR
  3398. SA7 BLNK
  3399. REPRIEVE RPB,SET,200B SET *REPRIEVE* PROCESSING
  3400. MESSAGE =0,1,R CLEAR COMMAND FROM *MS1W*
  3401. SA1 C+2 *IN* ADDRESS OF BUFFER
  3402. SA2 A1+B1 ADDRESS OF FIRST WORD OF BUFFER
  3403. IX3 X1-X2
  3404. NZ X3,PRS7 IF COMMAND TO PROCESS
  3405. SX5 ERRNIV *NON-EXISTANT EDIT VERB SPECIFIED.*
  3406. EQ ERR PROCESS ERROR
  3407.  
  3408. PRS7 SA1 CSTI
  3409. SB2 X2
  3410. SB3 X1
  3411. SB6 MXCIL
  3412. RJ USB
  3413. SA3 USBC
  3414. SA3 X3
  3415. PRS8 SX3 X3-1R
  3416. NZ X3,PRS9 IF NOT BLANK CHARACTER
  3417. SA3 A3-B1
  3418. EQ PRS8 GET NEXT CHARACTER
  3419.  
  3420. PRS9 SX7 A3
  3421. SA7 USBC
  3422. SA3 CLIN-1
  3423. RJ FVT FIND VERB IN TABLE
  3424. RJ PVA PROCESS VERB ARGUMENTS
  3425. SA1 NELR
  3426. ZR X1,PRS13 IF NO ENTRIES
  3427. SB7 LRT
  3428. SB6 X1+
  3429. RJ SST= SORT LINE RANGE TABLE ENTRIES
  3430.  
  3431. * VALIDATE LINE RANGE TABLE ENTRIES.
  3432.  
  3433. SX5 ERREIE LINE NUMBERS OVERLAP IN RANGE TABLE
  3434. SB4 B0
  3435. SA1 B7 FIRST HIGH ORDER VALUE
  3436. SB3 X1 FIRST LOW ORDER VALUE
  3437. AX1 18 HIGH ORDER VALUE OF PAIR
  3438. SB5 X1+
  3439. PRS10 LT B5,B3,PRS11 IF INCORRECT LINE RANGE ENTRY
  3440. SB4 B4+1
  3441. EQ B4,B6,PRS12 IF NO MORE ENTRIES TO VALIDATE
  3442. SA2 A1+B4 SET NEXT LOW ORDER VALUE
  3443. SB3 X2
  3444. LE B3,B5,ERR IF OVERLAP OF ENTRIES
  3445. AX2 18
  3446. SB5 X2
  3447. EQ PRS10 CHECK NEXT ENTRY
  3448.  
  3449. PRS11 SX5 ERRELR *ERROR IN LINE RANGE.*
  3450. EQ ERR PROCESS ERROR
  3451.  
  3452. PRS12 MX0 1 MARK THE END OF *LRT*
  3453. SA5 LRT+B4-1
  3454. BX6 X5+X0
  3455. SA6 A5+ REPLACE LAST ENTRY
  3456.  
  3457. * SET UP FET FOR EDIT FILE WITH LOCAL FILE.
  3458.  
  3459. PRS13 SX0 3 SET EDIT FILE NAME INTO FET
  3460. SA5 EFN
  3461. BX6 X0+X5
  3462. SA6 E
  3463. MEMORY CM,MSTAT,R DETERMINE MAXIMUM MEMORY AVAILABLE
  3464. SA2 MSTAT
  3465. SA1 FNUM
  3466. BX6 X2
  3467. AX6 30
  3468. SX2 X1-FNRE
  3469. SA6 CMAX
  3470. NZ X2,PRS14 IF NOT A *READ* FUNCTION
  3471. SA2 FILEN
  3472. SA3 FIPB
  3473. BX6 X2+X3
  3474. SA6 A3
  3475. FILINFO FIPB CHECK DEVICE TYPE OF *READ* FILE
  3476. SA1 FIPB+1 ISOLATE DEVICE TYPE
  3477. MX2 12
  3478. BX1 X2*X1
  3479. SX5 ERRNRF *READ FILE EMPTY.*
  3480. ZR X1,ERR IF FILE NOT ON MASS STORAGE
  3481. PRS14 SX7 B0+
  3482. SA7 MSTAT
  3483. MEMORY CM,A7,R
  3484. SX2 MEML FWA OF *PRS*
  3485. SA1 MSTAT
  3486. AX1 30
  3487. IX6 X1-X2 AVAILABLE SPACE FOR BUFFERS
  3488. SX7 X1+ LWA FOR TABLES
  3489. SX6 X6-NTAB ADJUST FOR *MTP* SPARE WORDS
  3490. SA6 DYNST
  3491. SA7 F.TEND
  3492. SA2 BOP
  3493. SA1 FNUM
  3494. SA7 CMEM
  3495. SX3 MEM-/IEDIT1/MEM2
  3496. PL X3,PRSX IF OVERLAY NOT LONGER THAN MAIN ROUTINE
  3497. SX1 X1-MXIL-1
  3498. LX1 1
  3499. BX1 X1*X2
  3500. NZ X1,PRSX IF *BASIC* AND *MOVE*, *DUP*, OR *READ*
  3501. SA1 LM
  3502. IX6 X1+X3
  3503. SA6 A1
  3504. SA2 DYNST
  3505. IX7 X2-X3
  3506. SA7 A2
  3507. EQ PRSX RETURN
  3508.  
  3509. PRSA BSS 0 COMMAND EQUIVALENCE TABLE
  3510. FN ARG EFN,EFN,400B FILE NAME
  3511. OP ARG PRSB,COPT,400B OPTIONS
  3512. CS ARG PRSC,CSCS CHARACTER SET
  3513. ARG
  3514. PRSB CON -1 SET -1 IF NO OPTIONS SPECIFIED
  3515. PRSC DATA C*NORMAL* NORMAL CHARACTER TYPE
  3516. PRSD DATA C*ASCII* ASCII 6/12
  3517. PRSE DATA C*ASCII8* ASCII 8/12
  3518. PRSF VFD 42/0LINPUT,18/1 TEST DATA FILE NAME
  3519. PVA SPACE 4,35
  3520. ** PVA - PROCESS VERB ARGUMENTS.
  3521. *
  3522. * PVA JUMPS TO THE SUBROUTINES TO PROCESS THE ARGUMENTS FOR
  3523. * THE VERB. THESE SUBROUTINES ARE OBTAINED FROM THE SET OF
  3524. * LINES IN THE TABLE CORRESPONDING TO THE VERB THAT WAS FOUND.
  3525. *
  3526. * ENTRY (A2) = ADDRESS OF TABLE ENTRY MATCHING VERB IN *CLB=*.
  3527. * (X2) = *TDVB* ENTRY MATCHING VERB IN *CLB=*.
  3528. *
  3529. * EXIT TABLES RELEVANT TO COMMAND BUILT.
  3530. * NECESSARY VALUES SAVED FOR EXECUTION OF COMMAND.
  3531. * COMMAND NUMBER SAVED.
  3532. * COMMAND PARAMETERS VALIDATED.
  3533. *
  3534. * USES X - 0, 1, 2, 3, 5, 6, 7.
  3535. * A - 1, 2, 3, 5, 6, 7.
  3536. * B - 2, 7.
  3537. *
  3538. * CALLS GTC, GTS, ICE.
  3539. *
  3540. * NOTES *ICE* MAY CALL ANY OF THE FOLLOWING ROUTINES -
  3541. * 1. *GFN* - GET FILE NAME.
  3542. * 2. *GIN* - GET INCREMENT.
  3543. * 3. *GLS* - GET LINES.
  3544. * 4. *GLI* - GET LINE NUMBER TO INSERT TEXT AFTER.
  3545. * 5. *GSP* - GET STRING PAIR.
  3546. * 6. *GSR* - GET SINGLE RANGE OF LINE NUMBERS.
  3547. * 7. *GSS* - GET STRING FOR SEARCH.
  3548.  
  3549.  
  3550. PVA SUBR ENTRY/EXIT
  3551. MX0 -TDISN INCREMENT TO FIRST SUBROUTINE
  3552. SB2 TDISN-TDISS-1
  3553. LX1 X2,B2
  3554. BX1 -X0*X1
  3555. SB2 X1+
  3556. SA2 A2+B2 FIRST PROCESS FOR COMMAND
  3557. PVA1 BX7 X2 SAVE *TDVB* ENTRY
  3558. SB7 X2 GET PROCESS ADDRESS
  3559. SA3 LCIP
  3560. SA7 LINE
  3561. SB2 59-TDFPS CHECK FOR END OF SUBROUTINES
  3562. SA3 X3
  3563. LX7 X2,B2
  3564. NG X7,PVA2 IF AT END OF FUNCTION PROCESSOR ENTRIES
  3565. SX7 A2 SAVE ADDRESS IN TABLE OF FUNCTION
  3566. SA7 ADRF
  3567. SX7 B1
  3568. SA7 SUCC
  3569. RJ ICE PERFORM FUNCTION
  3570.  
  3571. * FUNCTION PROCESSORS RETURN HERE.
  3572.  
  3573. SA2 ADRF RESTORE ADDRESS OF FUNCTION IN TABLE
  3574. SA1 LINE
  3575. SA2 X2+B1
  3576. LX1 59-TDRQS
  3577. PL X1,PVA1 IF FUNCTION OPTIONAL
  3578. SA5 SUCC
  3579. ZR X5,PVA1 IF PREVIOUS FUNCTION EXECUTED SUCCESSFULLY
  3580. MX0 TDASN GET INCREMENT TO FWA OF ALTERNATE SYNTAX
  3581. LX0 TDASS-59
  3582. SA1 LINE
  3583. SX5 ERREIS *INCORRECT SYNTAX.*
  3584. BX1 X0*X1
  3585. LX1 TDSAS-TDASS RIGHT JUSTIFY OFFSET
  3586. ZR X1,ERR IF THERE IS NO ALTERNATE SYNTAX
  3587. SA2 TDVB+X1 SET FIRST LINE OF ALTERNATE SYNTAX
  3588. SA5 LCIV
  3589. SX7 X5
  3590. SX6 B0
  3591. SA7 LCIP
  3592. SA6 NELR
  3593. EQ PVA1 PROCESS NEXT PARAMETER
  3594.  
  3595. PVA2 SX7 X2+
  3596. SA7 FNUM STORE COMMAND NUMBER
  3597. RJ GTS SKIP OVER ALL BLANKS
  3598. ZR X0,PVA3 IF NOT A SEPARATOR
  3599. SA3 A3-1
  3600. PVA3 RJ GTC REREAD THE CHARACTER
  3601. ZR X4,PVAX IF NO MORE CHARACTERS ON THE LINE
  3602. SX1 TERA
  3603. BX1 X1*X4
  3604. SX5 ERREIS *ERROR IN EDIT COMMAND SYNTAX*
  3605. ZR X1,ERR IF NOT A VALID TERMINATOR
  3606. SA2 CSTI CHECK CHARACTER SET
  3607. SX1 1R.
  3608. SX2 X2-1
  3609. NG X2,PVA4 IF NOT *ASCII8*
  3610. SX1 56B
  3611. PVA4 BX3 X3-X1
  3612. NZ X3,PVAX IF TERMINATOR NOT A PERIOD
  3613. RJ GTC GET THE FOLLOWING CHARACTER
  3614. ZR X4,PVAX IF END OF THE STRING
  3615. BX3 X3-X1
  3616. NZ X3,PVAX IF NOT AN ELLIPSIS
  3617. EQ ERR ISSUE *ERROR IN SYNTAX* MESSAGE
  3618. GFN TITLE VERB ARGUMENT PROCESSORS.
  3619. GFN SPACE 4,15
  3620. ** GFN - GET FILE NAME.
  3621. *
  3622. * ENTRY ((A3)) = (X3) = CHARACTER PRECEDING FILE NAME.
  3623. *
  3624. * EXIT (LCIP) = ADDRESS OF LAST CHARACTER PARSED.
  3625. * (SUCC) = 0, IF LEGAL FILE NAME FOUND.
  3626. * (FILN) = LEGAL FILE NAME FOLDED INTO *NORMAL*
  3627. * CHARACTER SET.
  3628. *
  3629. * USES X - 1, 2, 5, 6, 7.
  3630. * A - 1, 2, 6, 7.
  3631. * B - 7.
  3632. *
  3633. * CALLS GTS, GTB.
  3634.  
  3635.  
  3636. GFN2 SA6 FILEN STORE FILE NAME
  3637. SX7 A3
  3638. SX6 B0
  3639. SA7 LCIP MARK WHERE SCAN ENDED
  3640. SA6 SUCC SET SUCCESS FLAG TO TRUE
  3641.  
  3642. GFN SUBR ENTRY/EXIT
  3643. RJ GTS GET SEPARATOR
  3644. ZR X0,GFNX IF SEPARATOR NOT FOUND, RETURN
  3645. SX7 B0+
  3646. SA7 CNVRT SET CONVERSION FLAG
  3647. RJ GTB GET BLOCK
  3648. SX5 ERRNRS *NO READ/DESTINATION FILE SPECIFIED.*
  3649. ZR B2,ERR IF NO CHARACTERS IN BLOCK
  3650. SB7 MXWS GET MAXIMUM WORD SIZE INTO B7
  3651. SX1 LETA+DIGA GET MASK FOR FILE NAME
  3652. SX5 ERREIF *FILE NAME ERROR.*
  3653. GT B2,B7,ERR IF WORD TOO LONG
  3654. BX6 -X1*X6
  3655. NZ X6,ERR IF NON-VALID CHARACTERS IN FILE NAME
  3656. SA1 BLOCK LOAD FILE NAME
  3657. SA2 EFN GET EDIT FILE NAME
  3658. SX5 ERRDFN *DUPLICATE FILE NAME.*
  3659. BX2 X2-X1
  3660. BX6 X1
  3661. ZR X2,ERR IF DUPLICATE FILE NAME
  3662. SA2 TSF-1
  3663. SX5 ERRRFN *RESERVED FILE NAME.*
  3664. GFN1 SA2 A2+B1
  3665. ZR X2,GFN2 IF END OF TABLE
  3666. BX2 X2-X1
  3667. NZ X2,GFN1 IF NOT RESERVED FILE NAME
  3668. EQ ERR *RESERVED FILE NAME*
  3669. GIN SPACE 4,20
  3670. ** GIN - GET INCREMENT.
  3671. *
  3672. * ENTRY ((A3)) = (X3) = CHARACTER PRECEDING START OF
  3673. * INCREMENT BLOCK.
  3674. *
  3675. * EXIT (LCIP) = ADDRESS OF LAST CHARACTER PARSED.
  3676. * (SUCC) = 0, IF FUNCTION SUCCESSFUL.
  3677. * (INCR) = INCREMENT IN BINARY.
  3678. *
  3679. * USES X - 5, 6, 7.
  3680. * A - 6, 7.
  3681. * B - 2, 7.
  3682. *
  3683. * CALLS GLN, GTS.
  3684.  
  3685.  
  3686. GIN SUBR ENTRY/EXIT
  3687. RJ GTS GET SEPARATOR
  3688. ZR X0,GINX IF SEPARATOR NOT FOUND, RETURN
  3689. RJ GLN
  3690. NG X6,GINX IF NUMBER NOT FOUND
  3691. SB2 X6+
  3692. SB7 MXIC MAXIMUM INCREMENT
  3693. LT B2,B1,GIN1 IF INCREMENT TOO SMALL
  3694. GT B2,B7,GIN1 IF INCREMEMT TOO LARGE
  3695. SA6 INCR STORE INCREMENT
  3696. SX7 B0
  3697. SX6 A3
  3698. SA7 SUCC SET SUCCESS FLAG TO TRUE
  3699. SA6 LCIP MARK WHERE SCAN ENDED
  3700. EQ GINX RETURN
  3701.  
  3702. GIN1 SX5 ERREII *LINE NUMBER INCREMENT ERROR.*
  3703. EQ ERR ERROR IN INCREMENT
  3704. GLI SPACE 4,15
  3705. ** GLI - GET LINE NUMBER TO INSERT TEXT AFTER.
  3706. *
  3707. * ENTRY ((A3)) = (X3) = CHARACTER PRECEDING SEPARATOR
  3708. * PRECEDING LINE NUMBER.
  3709. *
  3710. * EXIT (LCIP) = ADDRESS OF LAST CHARACTER PARSED.
  3711. * (SUCC) = 0, IF FUNCTION SUCCESSFUL.
  3712. * (LNIA) = LINE NUMBER TO INSERT AFTER (IF FOUND).
  3713. *
  3714. * USES X - 3, 6, 7.
  3715. * A - 3, 6, 7.
  3716. *
  3717. * CALLS GLN, GTS.
  3718.  
  3719.  
  3720. GLI1 RJ GLN
  3721. NG X6,GLIX IF NO LINE NUMBER FOUND, RETURN
  3722. SX7 X6-MXLN-1
  3723. ZR X7,GLIX IF ASTERISK FOUND, RETURN
  3724. GLI2 SA6 LNIA STORE LINE NUMBER
  3725. SX7 B0
  3726. SX6 A3
  3727. SA7 SUCC SET SUCCESS FLAG TO TRUE
  3728. SA6 LCIP MARK WHERE SCAN ENDED
  3729.  
  3730. GLI SUBR ENTRY/EXIT
  3731. RJ GTS GET SEPARATOR
  3732. ZR X0,GLIX IF SEPARATOR NOT FOUND, RETURN
  3733. RJ GTS CHECK FOR SECOND SEPARATOR
  3734. ZR X0,GLI1 IF SEPARATOR NOT FOUND
  3735. SA3 A3-1
  3736. SX6 MXLN+1 RETURN *MXLN+1* AS LINE NUMBER
  3737. EQ GLI2 SET FUNCTION SUCCESSFUL
  3738. GLS SPACE 4,15
  3739. ** GLS - GET LINES.
  3740. *
  3741. * *GLS* GETS ONE OR MORE SETS OF LINE RANGES INCLUDING THE
  3742. * RANGE OF SINGLE LINE NUMBERS AND STORES THOSE RANGES AS
  3743. * ENTRIES IN *LRT*.
  3744. *
  3745. * ENTRY ((A3)) = (X3) = CHARACTER PRECEDING LINE RANGES.
  3746. *
  3747. * EXIT (LCIP) = ADDRESS OF LAST CHARACTER PARSED.
  3748. * (SUCC) = 0, IF AT LEAST ONE LINE NUMBER/RANGE FOUND.
  3749. *
  3750. * USES X - 6, 7.
  3751. * A - 6, 7.
  3752. *
  3753. * CALLS GLR.
  3754.  
  3755.  
  3756. GLS SUBR ENTRY/EXIT
  3757. GLS1 RJ GLR GET LINE RANGE
  3758. NG X6,GLSX IF NO LINE NUMBER READ, RETURN
  3759. SX7 A3
  3760. SX6 B0
  3761. SA7 LCIP MARK WHERE SCAN ENDED
  3762. SA6 SUCC SET SUCCESS FLAG TO TRUE
  3763. EQ GLS1 TRY TO GET ANOTHER LINE NUMBER
  3764. GSP SPACE 4,15
  3765. ** GSP - GET STRING PAIR.
  3766. *
  3767. * GSP GETS A PAIR OF STRINGS - ONE TO SEARCH WITH
  3768. * THE OTHER TO REPLACE THE FIRST VALUE WITH.
  3769. *
  3770. * ENTRY ((A3)) = (X3) = CHARACTER PRECEDING STRING PAIR.
  3771. *
  3772. * EXIT (LCIP) = ADDRESS OF LAST CHARACTER PARSED.
  3773. * (SUCC) = 0, IF SUCCESSFUL.
  3774. * (SBUF) = SEARCH STRING, ONE CHARACTER PER WORD.
  3775. * (RBUF) = REPLACEMENT STRING, ONE CHARACTER PER WORD.
  3776. * (SRTFLG) = 1, IF A CHARACTER STRING WAS SPECIFIED.
  3777. *
  3778. * USES X - 0, 3, 5, 6, 7.
  3779. * A - 3, 5, 6, 7.
  3780. *
  3781. * CALLS GTB, GCS.
  3782. *
  3783. * MACROS WRITEC.
  3784.  
  3785.  
  3786. GSP1 SX0 A3
  3787. WRITEC O,ERRNDF *NO CLOSING DELIMITER FOUND.*
  3788. SA3 X0+
  3789. GSP2 SX7 B0 SET FUNCTION SUCCESS FLAG
  3790. SX6 A3
  3791. SA7 SUCC SET SUCCESS FLAG TO TRUE
  3792. SA6 LCIP MARK WHERE SCAN ENDED
  3793.  
  3794. GSP SUBR ENTRY/EXIT
  3795. RJ GCS GET CHARACTER STRING TO SEARCH FOR
  3796. SA5 STRD
  3797. NZ X7,GSPX IF NO SEARCH STRING FOUND, RETURN
  3798. SX7 RBUF BUFFER TO WHICH BLOCK IS ADDED
  3799. NG X5,GSPX IF NO CLOSING DELIMITER ON SEARCH STRING
  3800. SA7 CNVRT
  3801. RJ GTB GET BLOCK UP TO DELIMITER
  3802. SX7 B2+
  3803. SA5 STRD CHECK THE CLOSING DELIMETER
  3804. SA7 NCIR STORE NUMBER OF CHARS IN REPLACE STRING
  3805. NG X5,GSP1 IF CLOSING DELIMETER MISSING
  3806. SA3 A3+1
  3807. EQ GSP2 SET FUNCTION SUCCESSFUL
  3808. GSR SPACE 4,20
  3809. ** GSR - GET SINGLE RANGE OF LINE NUMBERS.
  3810. *
  3811. * ENTRY ((A3)) = (X3) = CHARACTER PRECEDING LINE RANGE.
  3812. *
  3813. * EXIT (LCIP) = ADDRESS OF LAST CHARACTER PARSED.
  3814. * (SUCC) = 0, IF LINE NUMBER/RANGE FOUND.
  3815. *
  3816. * USES X - 6, 7.
  3817. * A - 6, 7.
  3818. *
  3819. * CALL GLR.
  3820.  
  3821.  
  3822. GSR SUBR ENTRY/EXIT
  3823. RJ GLR GET A LINE RANGE
  3824. NG X6,GSRX IF LINE NUMBER NOT FOUND, RETURN
  3825. SX7 A3
  3826. SX6 B0
  3827. SA7 LCIP SET SUCCESS FLAG TO TRUE
  3828. SA6 SUCC MARK WHERE SCAN ENDED
  3829. EQ GSRX RETURN
  3830. GSS SPACE 4,15
  3831. ** GSS - GET STRING FOR SEARCH.
  3832. *
  3833. * ENTRY ((A3)) = (X3) = CHARACTER PRECEDING STRING.
  3834. *
  3835. * EXIT (LCIP) = ADDRESS OF LAST CHARACTER PARSED.
  3836. * (SUCC) = 0, IF FUNCTION SUCCESSFUL.
  3837. * (SRTFLG) = 1, IF CHARACTER STRING SPECIFIED.
  3838. *
  3839. * USES X - 5, 6.
  3840. * A - 5, 6, 7.
  3841. *
  3842. * MACROS WRITEC.
  3843.  
  3844.  
  3845. GSS SUBR ENTRY/EXIT
  3846. RJ GCS GET SEARCH STRING
  3847. NZ X7,GSSX IF SEARCH STRING NOT FOUND, RETURN
  3848. SX6 A3+
  3849. SA7 SUCC SET SUCCESS FLAG TO TRUE
  3850. SA6 LCIP MARK WHERE SCAN ENDED
  3851. SA5 STRD
  3852. PL X5,GSSX IF CLOSING DELIMETER FOUND, RETURN
  3853. WRITEC O,ERRNDF *NO CLOSING DELIMITER FOUND.*
  3854. EQ GSSX RETURN
  3855. ABB TITLE PRESET SUBROUTINES
  3856. FVT SPACE 4,20
  3857. ** FVT - FIND VERB IN TABLE.
  3858. *
  3859. * FVT SCANS THE *VERB* TABLE LOOKING FOR THE VERB
  3860. * THAT MATCHES THE ONE IN THE COMMAND BUFFER.
  3861. *
  3862. * ENTRY ((A3)) = (X3) = CHARACTER PRECEDING VERB NAME.
  3863. *
  3864. * EXIT ((A2)) = (X2) = LINE IN *TDVB* CONTAINING VERB.
  3865. * (LCIV) = (LCIP) = ADDRESS OF LAST CHARACTER IN VERB.
  3866. *
  3867. * USES X - 0, 1, 2, 4, 5, 6, 7.
  3868. * A - 1, 2, 7.
  3869. * B - 6.
  3870. *
  3871. * CALLS GTB.
  3872.  
  3873.  
  3874. FVT2 SX7 A3+
  3875. SA7 LCIV STORE ADDRESS OF LAST CHARACTER IN VERB
  3876. SA7 LCIP MARK WHERE SCAN ENDED
  3877.  
  3878. FVT SUBR ENTRY/EXIT
  3879. SX7 B0+
  3880. SA7 CNVRT
  3881. RJ GTB GET VERB
  3882. SA1 BLOCK
  3883. SX5 ERRNIV *NON-EXISTENT EDIT VERB SPECIFIED.*
  3884. ZR B2,ERR IF NO CHARACTERS IN BLOCK
  3885. SB6 MXWS
  3886. SX2 LETA
  3887. GT B2,B6,ERR IF NAME TOO LONG
  3888. BX6 -X2*X6
  3889. NZ X6,ERR IF INCORRECT CHARACTERS FOUND
  3890. SA2 TDVB
  3891. MX0 TDVNN
  3892. MX7 -TDIVN
  3893. FVT1 BX4 X0*X2 VERB FROM TABLE
  3894. BX4 X1-X4
  3895. ZR X4,FVT2 IF MATCH FOUND
  3896. BX4 -X7*X2
  3897. SB6 X4+
  3898. SA2 A2+B6 NEXT TABLE ENTRY WITH VERB
  3899. ZR X2,ERR IF NO VERB FOUND
  3900. EQ FVT1 CHECK NEXT ENTRY FOR MATCH
  3901. GCS SPACE 4,20
  3902. ** GCS - GET CHARACTER STRING FOR SEARCH.
  3903. *
  3904. * ENTRY ((A3)) = (X3) = CHARACTER PRECEDING STRING.
  3905. *
  3906. * EXIT ((A3)) = (X3) = LAST CHARACTER IN STRING.
  3907. * (X7) = 0, IF FUNCTION SUCCESSFUL.
  3908. * (NCIS) = NUMBER OF CHARACTERS IN SEARCH STRING.
  3909. * (SBUF) = SEARCH STRING, ONE CHARACTER PER WORD.
  3910. * (STRD) = STRING DELIMITER CHARACTER.
  3911. *
  3912. * USES X - 3, 5, 6, 7.
  3913. * A - 3, 5, 6, 7.
  3914. *
  3915. * CALLS GTB, GTC, GTS.
  3916.  
  3917.  
  3918. GCS SUBR ENTRY/EXIT
  3919. SX7 B1+
  3920. RJ GTS GET SEPARATOR
  3921. ZR X0,GCSX IF SEPARATOR NOT FOUND, RETURN
  3922. RJ GTS GET NEXT SEPARATOR
  3923. ZR X0,GCS1 IF SEPARATOR NOT FOUND
  3924. SA3 A3-1
  3925. GCS1 RJ GTC GET CHARACTER
  3926. ZR X4,GCSX IF NO CHARACTERS FOUND, RETURN
  3927. SX5 DLMA
  3928. BX5 X5*X4
  3929. ZR X5,GCSX IF STRING DELIMITER NOT FOUND
  3930. SX7 X3 SAVE DELIMITER
  3931. SX6 SBUF SET UP FOR NO ASCII TO NORMAL CONVERSION
  3932. SA7 STRD
  3933. SA6 CNVRT
  3934. RJ GTB GET BLOCK UP TO DELIMITER
  3935. SX7 B2+ SAVE CHARACTER COUNT OF SEARCH STRING
  3936. SA5 STRD
  3937. SA7 NCIS
  3938. SX7 B0+
  3939. NG X5,GCSX IF SECOND DELIMITER NOT FOUND, RETURN
  3940. SA3 A3+B1
  3941. EQ GCSX RETURN
  3942. GLN SPACE 4,20
  3943. ** GLN - GET LINE NUMBER.
  3944. *
  3945. * *GLN* GETS A LINE NUMBER AND CONVERTS IT TO BINARY IN *X6*.
  3946. * AN ASTERISK IS CONVERTED INTO THE VALUE *MXLN+1*.
  3947. *
  3948. * ENTRY ((A3)) = (X3) = CHARACTER PRECEDING LINE NUMBER
  3949. *
  3950. * EXIT ((A3)) = (X3) = LAST CHARACTER IN LINE NUMBER.
  3951. * (X6) = LINE NUMBER READ RIGHT JUSTIFIED (BINARY).
  3952. * .LT. 0, IF LINE NUMBER NOT READ.
  3953. *
  3954. * USES X - 3, 5, 6, 7.
  3955. * A - 3, 5, 7.
  3956. * B - 2, 7.
  3957. *
  3958. * CALLS DXB, GTB.
  3959.  
  3960.  
  3961. GLN2 SA3 A3+B1
  3962. SA5 CSTI CHECK CHARACTER SET
  3963. SB2 X5
  3964. SB2 B2-B1
  3965. SX7 X3-1R*
  3966. NG B2,GLN3 IF NOT *ASCII8* CHARACTER SET
  3967. SX7 X3-52B
  3968. GLN3 NZ X7,GLN1 IF NOT AN ASTERISK
  3969. SX6 MXLN+1 SET VALUE TO *MXLN+1*
  3970.  
  3971. GLN SUBR ENTRY/EXIT
  3972. SX7 B0+
  3973. SA7 CNVRT
  3974. RJ GTB GET LINE NUMBER
  3975. ZR B2,GLN2 IF NO CHARACTERS FOUND
  3976. SX5 DIGA GET MASK FOR NUMBER
  3977. SB7 NUMD
  3978. BX5 -X5*X6
  3979. NZ X5,GLN1 IF NON-DIGIT FOUND
  3980. GT B2,B7,GLN1
  3981. SB7 B1
  3982. SA5 BLOCK
  3983. RJ DXB CONVERT NUMBER TO BINARY
  3984. SA3 A3
  3985. ZR X4,GLNX IF NUMBER CONVERTABLE
  3986. SX5 ERRELR *LINE RANGE ERROR.*
  3987. EQ ERR ISSUE *ERROR IN LINE RANGE* MESSAGE
  3988.  
  3989. GLN1 SX6 -1 SET FAILURE FLAG
  3990. EQ GLNX RETURN
  3991. GLR SPACE 4,25
  3992. ** GLR - GET LINE RANGE.
  3993. *
  3994. * *GLR* GETS A LINE RANGE (INCLUDING THE RANGE OF SINGLE LINE
  3995. * NUMBERS) AND MAKES A RANGE ENTRY FOR IT IN THE *LRT*.
  3996. *
  3997. * ENTRY ((A3)) = (X3) = CHARACTER PRECEDING LINE RANGE.
  3998. *
  3999. * EXIT ((A3)) = (X3) = LAST CHARACTER IN LINE RANGE.
  4000. * (X6) = .LT. 0, IF FUNCTION NOT SUCCESSFUL.
  4001. *
  4002. * USES X - 1, 2, 3, 4, 5, 6, 7.
  4003. * A - 1, 3, 4, 6, 7.
  4004. * B - 2.
  4005. *
  4006. * CALLS GLN, GTC, GTS.
  4007.  
  4008.  
  4009. GLR SUBR ENTRY/EXIT
  4010. SX6 -B1
  4011. RJ GTS
  4012. ZR X0,GLRX IF NO SEPARATOR FOUND, RETURN
  4013. RJ GLN GET LINE NUMBER
  4014. NG X6,GLRX IF NUMBER NOT FOUND, RETURN
  4015. SA6 LROP STORE NUMBER
  4016. RJ GTC GET CHARACTER
  4017. ZR X4,GLR2 IF END OF LINE
  4018. LX4 30
  4019. MX5 -NBIC
  4020. NG X4,GLR1 IF NO DISPLAY CODE EQUIVALENT
  4021. LX4 NBIC+1
  4022. BX1 -X5*X4
  4023. SX1 X1-1R.
  4024. ZR X1,GLR4 IF CHARACTER A PERIOD
  4025. GLR1 SA3 A3-1
  4026. GLR2 SA4 LROP
  4027. SX2 X4-MXLN-1
  4028. NZ X2,GLR3 IF ENTIRE FILE NOT SELECTED
  4029. SX6 MXLN
  4030. LX6 18 CONSTRUCT AN *..* *LRT* ENTRY
  4031. EQ GLR6 APPEND TO *LRT*
  4032.  
  4033. GLR3 SB2 18
  4034. LX4 B2,X6
  4035. BX6 X4+X6 CONSTRUCT A SINGLE LINE *LRT* ENTRY
  4036. EQ GLR6 APPEND TO *LRT*
  4037.  
  4038. GLR4 RJ GTC GET NEXT CHARACTER
  4039. SA3 A3-B1
  4040. ZR X4,GLR2 IF NO CHARACTER
  4041. SA3 A3-B1
  4042. LX4 30
  4043. NG X4,GLR2 IF NO DISPLAY CODE EQUIVALENT
  4044. LX4 NBIC+1
  4045. BX1 -X5*X4
  4046. SX2 X1-1R.
  4047. NZ X2,GLR2 IF NOT A PERIOD
  4048. SA3 A3+2
  4049. RJ GLN GET SECOND LINE NUMBER
  4050. NG X6,GLR7 IF NO NUMBER FOUND
  4051. SA4 LROP
  4052. SX2 X4-MXLN-1
  4053. NZ X2,GLR5 IF FIRST NUMBER NOT AN ASTERISK
  4054. SX4 B0+
  4055. GLR5 LX6 18
  4056. BX6 X6+X4
  4057. GLR6 SA1 NELR
  4058. SA6 X1+LRT ADD ENTRY TO *LRT*
  4059. SX7 X1+B1
  4060. SA7 A1 ADD ONE TO *LRT* ENTRY COUNT
  4061. EQ GLRX RETURN
  4062.  
  4063. GLR7 SX5 ERRELR *LINE RANGE ERROR.*
  4064. EQ ERR ISSUE *ERROR IN LINE RANGE* MESSAGE
  4065. GTB SPACE 4,30
  4066. ** GTB - GET BLOCK.
  4067. *
  4068. * IF (CNVRT) = 0, CHARACTERS ARE CONVERTED TO DISPLAY CODE AND
  4069. * PACKED INTO *BLOCK* UP TO THE FIRST SEPARATOR, TERMINATOR,
  4070. * OR DELIMITER. ANY BLANKS FOUND ARE REMOVED. IF
  4071. * (CNVRT) .NE. 0, IT CONTAINS A STRING BUFFER ADDRESS TO WHICH
  4072. * CHARACTERS SHOULD BE MOVED. THE CHARACTERS ARE NOT
  4073. * CONVERTED TO DISPLAY CODE AND BLANKS ARE NOT DISCARDED.
  4074. * THE CHARACTERS ARE STORED IN THE BUFFER, ONE CHARACTER PER
  4075. * WORD UNTIL THE CHARACTER IN *STRD* IS FOUND OR THE END OF
  4076. * THE COMMAND IS REACHED.
  4077. *
  4078. * ENTRY ((A3)) = (X3) = CHARACTER PRECEDING START OF BLOCK.
  4079. * (CNVRT)= 0, IF BLOCK TO BE CONVERTED TO DISPLAY CODE
  4080. * AND PACKED INTO *BLOCK* WITH ALL BLANKS
  4081. * REMOVED.
  4082. * .GT. 0, IF BLOCK IS NOT TO BE CONVERTED AND
  4083. * IS TO BE MOVED IN UNPACKED FORM TO THE
  4084. * ADDRESS IN *CNVRT*
  4085. * (STRD) = THE DESIRED DELIMITER WHEN *CNVRT* = ZERO.
  4086. *
  4087. * EXIT ((A3)) = (X3) = LAST CHARACTER OF BLOCK.
  4088. * (B2) = COUNT OF CHARACTERS READ IN BLOCK.
  4089. * (X6) = ATTRIBUTES OF BLOCK.
  4090. * BLOCK = FWA OF BLOCK OF CHARACTERS OBTAINED
  4091. * CHARACTERS IN LAST WORD OF *BLOCK* LEFT
  4092. * JUSTIFIED.
  4093. * (STRD) = .LT. 0, IF SPECIFIED DELIMETER NOT FOUND.
  4094. *
  4095. * USES X - 1, 2, 3, 4, 5, 6, 7.
  4096. * A - 2, 3, 5, 7.
  4097. * B - 2, 4, 6, 7.
  4098. *
  4099. * CALLS GTC.
  4100.  
  4101.  
  4102. GTB5 LX7 B7
  4103. SA7 BLOCK+B6 STORE LAST WORD OF BLOCK
  4104. GTB6 MX7 -MXNA
  4105. BX6 -X7*X6 LEAVE ONLY THE ATTRIBUTES IN *X6*
  4106. ZR X4,GTB7 IF NO CLOSING DELIMITER FOUND
  4107. SA3 A3-1
  4108. EQ GTBX RETURN
  4109.  
  4110. GTB7 SX7 -1
  4111. SA7 STRD
  4112.  
  4113. GTB SUBR ENTRY/EXIT
  4114. SA2 CNVRT
  4115. SX6 B0 INITIALIZE ATTRIBUTE OF BLOCK
  4116. SB2 B0 INITIALIZE COUNT OF CHARACTERS IN BLOCK
  4117. ZR X2,GTB2 IF BLOCK IS TO BE PACKED
  4118. SA5 STRD
  4119. SB4 X2-1
  4120. GTB1 RJ GTC GET CHARACTER AND ATTRIBUTE
  4121. ZR X4,GTB6 IF END OF LINE ENCOUNTERED
  4122. IX2 X5-X3
  4123. ZR X2,GTB6 IF SPECIFIED DELIMITER FOUND
  4124. BX6 X6+X4 ACCUMULATE ATTRIBUTES
  4125. SB2 B2+B1 INCREMENT COUNT OF CHARACTERS
  4126. BX7 X3
  4127. SA7 B4+B2 ADD CHARACTER TO BUFFER
  4128. EQ GTB1 GET NEXT CHARACTER
  4129.  
  4130. GTB2 SB6 B0
  4131. SX7 B0
  4132. SB7 60
  4133. GTB3 RJ GTC
  4134. ZR X4,GTB5 IF END OF LINE ENCOUNTERED
  4135. SX1 X3
  4136. SA2 CSTI
  4137. ZR X2,GTB4 IF *NORMAL* CHARACTER SET
  4138. LX4 30
  4139. SX5 ERREIS *ERROR IN EDIT COMMAND SYNTAX*
  4140. NG X4,ERR IF CHARACTER NOT CONVERTABLE TO *NORMAL*
  4141. LX4 NBIC+1
  4142. MX2 -NBIC
  4143. BX1 -X2*X4 GET DISPLAY CODE EQUIVALENT
  4144. LX4 29-NBIC
  4145. GTB4 SX2 X1-1R
  4146. ZR X2,GTB3 IF CHARACTER IS A BLANK
  4147. SX2 SEDE+TERA+CHAA
  4148. BX2 X2*X4
  4149. NZ X2,GTB5 IF DELIMITER, SEPARATOR, OR TERMINATOR
  4150. BX6 X6+X4 ACCUMULATE ATTRIBUTES
  4151. SB2 B2+1 INCREMENT COUNT OF CHARACTERS
  4152. LX7 NBIC
  4153. BX7 X7+X1 ADD CHARACTER TO BLOCK
  4154. SB7 B7-NBIC
  4155. GT B7,GTB3 IF ROOM FOR MORE CHARACTERS IN *X7*
  4156. SB7 60
  4157. SA7 BLOCK+B6 STORE PACKED WORD
  4158. SB6 B6+B1
  4159. SX7 B0
  4160. EQ GTB3 GET NEXT CHARACTER
  4161. GTC SPACE 4,25
  4162. ** GTC - GET CHARACTER AND ATTRIBUTE.
  4163. *
  4164. * *GTC* GETS THE NEXT CHARACTER IN THE COMMAND. THE
  4165. * ATTRIBUTES OF THE CHARACTER ARE OBTAINED BY EXTRACTING THE
  4166. * ENTRY FROM THE ATTRIBUTE TABLE CORRESPONDING TO THAT
  4167. * CHARACTER. THE ATTRIBUTES ARE RETURNED IN X4 (ONE BIT IS SET
  4168. * FOR EACH ATTRIBUTE OF THE CHARACTER). FOR ASCII 6/12 AND
  4169. * 8/12 CHARACTERS, THE HIGH ORDER BITS OF X4 CONTAIN THE
  4170. * DISPLAY CODE EQUIVALENT OF THAT CHARACTER IF IT EXISTS.
  4171. *
  4172. * ENTRY ((A3)) = (X3) = CHARACTER LAST RETRIEVED BY *GTC*.
  4173. *
  4174. * EXIT ((A3)) = (X3) = CHARACTER RIGHT JUSTIFIED, ZERO FILL.
  4175. * (X4) = ATTRIBUTES OF CHARACTER AND DISPLAY CODE
  4176. * EQUIVALENT (ZERO IF END OF LINE).
  4177. * AND DISPLAY CODE EQUIVALENT.
  4178. *
  4179. * USES X - 2, 3, 4.
  4180. * A - 2, 3, 4.
  4181. * B - 5.
  4182.  
  4183.  
  4184. GTC SUBR ENTRY/EXIT
  4185. SA2 USBC GET ADDRESS OF END OF LINE
  4186. SX4 B0 INITIALIZE ATTRIBUTES TO ZERO
  4187. SB5 X2
  4188. SB5 A3-B5
  4189. GE B5,GTCX IF END OF LINE, RETURN
  4190. SA3 A3+B1 GET NEXT CHARACTER
  4191. SA4 TATC
  4192. SA2 CSTI DETERMINE CHARACTER SET
  4193. SB5 X2
  4194. GT B5,GTC3 IF ASCII 8/12 CHARACTER SET
  4195. BX2 X3
  4196. ZR B5,GTC2 IF *NORMAL* CHARACTER SET
  4197. BX4 X3
  4198. AX4 NBIC
  4199. ZR X4,GTC2 IF NO ESCAPE CODE
  4200. SX4 X4-EC2
  4201. SB5 70 OFFSET FOR 76 ESCAPE CODE
  4202. ZR X4,GTC1 IF ESCAPE CODE 76
  4203. SB5 63 OFFSET FOR 74 ESCAPE CODE
  4204. GTC1 SA4 A4+B5
  4205. BX2 X3
  4206. MX4 -NBIC
  4207. BX2 -X4*X2 SET CHARACTER WITHOUT ESCAPE CODE
  4208. GTC2 SB5 X2+
  4209. SA4 A4+B5 GET *6/12* OR *NORMAL* CHAR ATTRIBUTE
  4210. MX2 30
  4211. BX4 X2*X4 SET ATTRIBUTE
  4212. LX4 30
  4213. EQ GTCX RETURN
  4214.  
  4215. GTC3 MX2 -7
  4216. BX2 -X2*X3
  4217. SB5 X2
  4218. SA4 A4+B5 GET 8/12 CHARACTER ATTRIBUTE
  4219. MX2 -30
  4220. BX4 -X2*X4
  4221. EQ GTCX RETURN
  4222. GTS SPACE 4,15
  4223. ** GTS - GET SEPARATOR.
  4224. *
  4225. * ENTRY ((A3)) = (X3) = CHARACTER PRECEDING SEPARATOR.
  4226. *
  4227. * EXIT ((A3)) = (X3) = SEPARATOR RIGHT JUSTIFIED.
  4228. * (X0) = 0, IF SEPARATOR NOT FOUND.
  4229. * .NE. 0, IF SEPARATOR FOUND.
  4230. *
  4231. * USES X - 0, 1, 3, 4.
  4232. * A - 3, 4.
  4233. *
  4234. * CALLS GTC.
  4235.  
  4236.  
  4237. GTS SUBR ENTRY/EXIT
  4238. SX1 SEPA GET MASK FOR SEPARATOR
  4239. SX0 B0+
  4240. GTS1 RJ GTC GET NEXT CHARACTER
  4241. ZR X4,GTSX IF NO MORE CHARACTERS, RETURN
  4242. BX0 X1*X4
  4243. NZ X0,GTSX IF CHARACTER A SEPARATOR, RETURN
  4244. SA4 BLNK
  4245. BX0 X4-X3
  4246. ZR X0,GTS1 IF CHARACTER IS A BLANK
  4247. GTS2 SA3 A3-B1
  4248. SX0 B0 SEPARATOR NOT FOUND
  4249. EQ GTSX RETURN
  4250. STORAGE EJECT PRESET WORKING STORAGE
  4251.  
  4252.  
  4253. ** PRESET WORKING STORAGE.
  4254.  
  4255. ADRF CON 0 ADDRESS OF CURRENT FUNCTION IN TABLE
  4256. BLOCK BSS MXWL BLOCK OF CHARACTERS READ FROM COMMAND LINE
  4257. C BSS 0
  4258. CLB= FILEB CLBF,INSZ
  4259. CLBF BSS INSZ
  4260. CNVRT CON 0 CONVERT ASCII TO NORMAL FLAG
  4261. COPT CON 0 CONTROL STATMENT OPTIONS
  4262. CSCS CON 0 CHARACTER SET FROM COMMAND
  4263. LINE CON 0 LINE FROM DEFINED VERB TABLE BEING WORKED
  4264. LROP CON 0 LOW VALUE IN ORDERED PAIR IN RANGE TABLE
  4265. LCIV CON 0 NUMBER OF CHARACTERS IN VERB
  4266. LCIP CON 0
  4267. STRD CON 0 STRING DELIMITER
  4268. SUCC CON 0 SUCCESSFUL FUNCTION FLAG, ZERO IF YES
  4269. TATC EJECT ATTRIBUTE TABLE
  4270. ** TABLE OF ATTRIBUTES FOR CHARACTERS.
  4271.  
  4272. TATC BSS 0 NORMAL ASCII ASCII8
  4273. DAC I,,CHAA,I,,CHAA CL 00 NUL 000
  4274. DAC ,01,LETA,I,,CHAA UC A 01 UC A SOH 001
  4275. DAC ,02,LETA,I,,CHAA UC B 02 UC B STX 002
  4276. DAC ,03,LETA,I,,CHAA UC C 03 UC C ETX 003
  4277. DAC ,04,LETA,I,,CHAA UC D 04 UC D EOT 004
  4278. DAC ,05,LETA,I,,CHAA UC E 05 UC E ENQ 005
  4279. DAC ,06,LETA,I,,CHAA UC F 06 UC F ACK 006
  4280. DAC ,07,LETA,I,,CHAA UC G 07 UC G BEL 007
  4281. DAC ,10,LETA,I,,CHAA UC H 10 UC H BS 010
  4282. DAC ,11,LETA,I,,CHAA UC I 11 UC I HT 011
  4283. DAC ,12,LETA,I,,CHAA UC J 12 UC J LF 012
  4284. DAC ,13,LETA,I,,CHAA UC K 13 UC K VT 013
  4285. DAC ,14,LETA,I,,CHAA UC L 14 UC L FF 014
  4286. DAC ,15,LETA,I,,CHAA UC M 15 UC M CR 015
  4287. DAC ,16,LETA,I,,CHAA UC N 16 UC N SO 016
  4288. DAC ,17,LETA,I,,CHAA UC O 17 UC O SI 017
  4289. DAC ,20,LETA,I,,CHAA UC P 20 UC P DLE 020
  4290. DAC ,21,LETA,I,,CHAA UC Q 21 UC Q DC1 021
  4291. DAC ,22,LETA,I,,CHAA UC R 22 UC R DC2 022
  4292. DAC ,23,LETA,I,,CHAA UC S 23 UC S DC3 023
  4293. DAC ,24,LETA,I,,CHAA UC T 24 UC T DC4 024
  4294. DAC ,25,LETA,I,,CHAA UC U 25 UC U NAK 025
  4295. DAC ,26,LETA,I,,CHAA UC V 26 UC V SYN 026
  4296. DAC ,27,LETA,I,,CHAA UC W 27 UC W ETB 027
  4297. DAC ,30,LETA,I,,CHAA UC X 30 UC X CAN 030
  4298. DAC ,31,LETA,I,,CHAA UC Y 31 UC Y EM 031
  4299. DAC ,32,LETA,I,,CHAA UC Z 32 UC Z SUB 032
  4300. DAC ,33,DIGA,I,,CHAA 0 33 0 ESC 033
  4301. DAC ,34,DIGA,I,,CHAA 1 34 1 FS 034
  4302. DAC ,35,DIGA,I,,CHAA 2 35 2 GS 035
  4303. DAC ,36,DIGA,I,,CHAA 3 36 3 RS 036
  4304. DAC ,37,DIGA,I,,CHAA 4 37 4 US 037
  4305. DAC ,40,DIGA,,55,CHAA 5 40 5 SP 040
  4306. DAC ,41,DIGA,,66,SEDE 6 41 6 EX 041
  4307. DAC ,42,DIGA,,64,SEDE 7 42 7 DQ 042
  4308. DAC ,43,DIGA,,60,SEDE 8 43 8 NM 043
  4309. DAC ,44,DIGA,,53,CHAA 9 44 9 DS 044
  4310. DAC ,45,SEDE,,63,SEDE PL 45 PL PC 045
  4311. DAC ,46,SEDE,,67,SEDE MI 46 MI AM 046
  4312. DAC ,47,CHAA,,70,SEDE AS 47 AS AP 047
  4313. DAC ,50,SEDE,,51,SEDE SL 50 SL OP 050
  4314. DAC ,51,SEDE,,52,TERA OP 51 OP CP 051
  4315. DAC ,52,TERA,,47,CHAA CP 52 CP AS 052
  4316. DAC ,53,CHAA,,45,SEDE DS 53 DS PL 053
  4317. DAC ,54,SEDE,,56,SEDE EQ 54 EQ CM 054
  4318. DAC ,55,CHAA,,46,SEDE SP 55 SP MI 055
  4319. DAC ,56,SEDE,,57,TERA CM 56 CM PD 056
  4320. DAC ,57,TERA,,50,SEDE PD 57 PD SL 057
  4321. DAC ,60,SEDE,,33,DIGA NM 60 NM 0 060
  4322. DAC ,61,SEDE,,34,DIGA OB 61 OB 1 061
  4323. DAC ,62,SEDE,,35,DIGA CB 62 CB 2 062
  4324. DAC ,63,SEDE,,36,DIGA PC 63 PC 3 063
  4325. DAC ,64,SEDE,,37,DIGA DQ 64 DQ 4 064
  4326. DAC ,65,SEDE,,40,DIGA UL 65 UL 5 065
  4327. DAC ,66,SEDE,,41,DIGA EX 66 EX 6 066
  4328. DAC ,67,SEDE,,42,DIGA AM 67 AM 7 067
  4329. DAC ,70,SEDE,,43,DIGA AP 70 AP 8 070
  4330. DAC ,71,SEDE,,44,DIGA QM 71 QM 9 071
  4331. DAC ,72,SEDE,,00,CHAA LT 72 LT CL 072
  4332. DAC ,73,SEDE,,77,SEDE GT 73 GT SC 073
  4333. DAC I,,CHAA,,72,SEDE AT 74 LT 074
  4334. DAC ,75,SEDE,,54,SEDE RVS 75 RVS EQ 075
  4335. DAC I,,CHAA,,73,SEDE CF 76 GT 076
  4336. DAC ,77,SEDE,,71,SEDE SC 77 SC QM 077
  4337. DAC ,74,CHAA,,74,CHAA 7401 AT AT 100
  4338. DAC ,76,CHAA,,01,LETA 7402 CF UC A 101
  4339. DAC ,,,,02,LETA UC B 102
  4340. DAC ,00,CHAA,,03,LETA 7404 CL UC C 103
  4341. DAC ,,,,04,LETA UC D 104
  4342. DAC ,,,,05,LETA UC E 105
  4343. DAC I,,CHAA,,06,LETA 7407 GV UC F 106
  4344. DAC ,01,LETA,,07,LETA 7601 LC A UC G 107
  4345. DAC ,02,LETA,,10,LETA 7602 LC B UC H 110
  4346. DAC ,03,LETA,,11,LETA 7603 LC C UC I 111
  4347. DAC ,04,LETA,,12,LETA 7604 LC D UC J 112
  4348. DAC ,05,LETA,,13,LETA 7605 LC E UC K 113
  4349. DAC ,06,LETA,,14,LETA 7606 LC F UC L 114
  4350. DAC ,07,LETA,,15,LETA 7607 LC G UC M 115
  4351. DAC ,10,LETA,,16,LETA 7610 LC H UC N 116
  4352. DAC ,11,LETA,,17,LETA 7611 LC I UC O 117
  4353. DAC ,12,LETA,,20,LETA 7612 LC J UC P 120
  4354. DAC ,13,LETA,,21,LETA 7613 LC K UC Q 121
  4355. DAC ,14,LETA,,22,LETA 7614 LC L UC R 122
  4356. DAC ,15,LETA,,23,LETA 7615 LC M UC S 123
  4357. DAC ,16,LETA,,24,LETA 7616 LC N UC T 124
  4358. DAC ,17,LETA,,25,LETA 7617 LC O UC U 125
  4359. DAC ,20,LETA,,26,LETA 7620 LC P UC V 126
  4360. DAC ,21,LETA,,27,LETA 7621 LC Q UC W 127
  4361. DAC ,22,LETA,,30,LETA 7622 LC R UC X 130
  4362. DAC ,23,LETA,,31,LETA 7623 LC S UC Y 131
  4363. DAC ,24,LETA,,32,LETA 7624 LC T UC Z 132
  4364. DAC ,25,LETA,,61,SEDE 7625 LC U OB 133
  4365. DAC ,26,LETA,,75,SEDE 7626 LC V RVS 134
  4366. DAC ,27,LETA,,62,SEDE 7627 LC W CB 135
  4367. DAC ,30,LETA,,76,CHAA 7630 LC X CF 136
  4368. DAC ,31,LETA,,65,SEDE 7631 LC Y UL 137
  4369. DAC ,32,LETA,I,,CHAA 7632 LC Z GV 140
  4370. DAC I,,CHAA,,01,LETA 7633 LB LC A 141
  4371. DAC I,,CHAA,,02,LETA 7634 VL LC B 142
  4372. DAC I,,CHAA,,03,LETA 7635 RB LC C 143
  4373. DAC I,,CHAA,,04,LETA 7636 TL LC D 144
  4374. DAC I,,CHAA,,05,LETA 7637 BRK LC E 145
  4375. DAC I,,CHAA,,06,LETA 7640 NUL LC F 146
  4376. DAC I,,CHAA,,07,LETA 7641 SOH LC G 147
  4377. DAC I,,CHAA,,10,LETA 7642 STX LC H 150
  4378. DAC I,,CHAA,,11,LETA 7643 ETX LC I 151
  4379. DAC I,,CHAA,,12,LETA 7644 EOT LC J 152
  4380. DAC I,,CHAA,,13,LETA 7645 ENQ LC K 153
  4381. DAC I,,CHAA,,14,LETA 7646 ACK LC L 154
  4382. DAC I,,CHAA,,15,LETA 7647 BEL LC M 155
  4383. DAC I,,CHAA,,16,LETA 7650 BS LC N 156
  4384. DAC I,,CHAA,,17,LETA 7651 HT LC O 157
  4385. DAC I,,CHAA,,20,LETA 7652 LF LC P 160
  4386. DAC I,,CHAA,,21,LETA 7653 VT LC Q 161
  4387. DAC I,,CHAA,,22,LETA 7654 FF LC R 162
  4388. DAC I,,CHAA,,23,LETA 7655 CR LC S 163
  4389. DAC I,,CHAA,,24,LETA 7656 SO LC T 164
  4390. DAC I,,CHAA,,25,LETA 7657 SI LC U 165
  4391. DAC I,,CHAA,,26,LETA 7660 DLE LC V 166
  4392. DAC I,,CHAA,,27,LETA 7661 DC1 LC W 167
  4393. DAC I,,CHAA,,30,LETA 7662 DC2 LC X 170
  4394. DAC I,,CHAA,,31,LETA 7663 DC3 LC Y 171
  4395. DAC I,,CHAA,,32,LETA 7664 DC4 LC Z 172
  4396. DAC I,,CHAA,I,,CHAA 7665 NAK LB 173
  4397. DAC I,,CHAA,I,,CHAA 7666 SYN VL 174
  4398. DAC I,,CHAA,I,,CHAA 7667 ETB RB 175
  4399. DAC I,,CHAA,I,,CHAA 7670 CAN TL 176
  4400. DAC I,,CHAA,I,,CHAA 7671 EM BRK 177
  4401. DAC I,,CHAA 7672 SUB
  4402. DAC I,,CHAA 7673 ESC
  4403. DAC I,,CHAA 7674 FS
  4404. DAC I,,CHAA 7675 GS
  4405. DAC I,,CHAA 7676 RS
  4406. DAC I,,CHAA 7677 US
  4407. TDVB SPACE 4,10
  4408. ** TDVB - TABLE OF DEFINED VERBS.
  4409. *
  4410. * THIS TABLE DEFINES ALL THE LEGAL VERBS FOR *IEDIT*.
  4411. * EACH OF THESE LEGAL VERBS EXIST IN ALL ALLOWED FORMS
  4412. * (I.E. ALL VERBS WITH ABBREVIATIONS HAVE THOSE ABBREVIATIONS
  4413. * INCLUDED IN THE TABLE.)
  4414. * THIS TABLE ALSO CONTAINS THE PROCESSES ASSOCIATED WITH
  4415. * EACH VERB. THE ADDRESS OF THAT PROCESS AND WHETHER IT IS
  4416. * REQUIRED FOR THAT PROCESS BE CALLED IN ORDER FOR THE
  4417. * RESPECTIVE VERB TO BE LEGAL.
  4418.  
  4419.  
  4420. TDVB BSS 0
  4421. LOC 0
  4422. VERB ALTER,*,((GLS,O),(GSP,R)),FNAL
  4423. VERB DELETE,*,((GLS,R),(GSS,O),(,A),(GSS,R)),FNDE
  4424. VERB DUP,,((GSR,R),(GLI,R),(GIN,O),(,A),(GSR,R),(GLI,O)),FNDU
  4425. VERB LIST,*,((GLS,O),(GSS,O)),FNLI
  4426. VERB LNH,,((GLS,O),(GSS,O)),FNLI
  4427. VERB READ,*,((GFN,R),(GLI,R),(GIN,O),(,A),(GFN,R),(GLI,O)),FNRE
  4428. VERB MOVE,*,((GSR,R),(GLI,R),(GIN,O),(,A),(GSR,R),(GLI,O)),FNMO
  4429. VERB WRITE,,((GFN,R),(GLS,O),(GSS,O)),FNWR
  4430. VERB WRITEN,,((GFN,R),(GLS,O),(GSS,O)),FNWN
  4431. VERB
  4432. LOC *O
  4433.  
  4434.  
  4435. ** PRESET COMMON DECKS.
  4436.  
  4437. *CALL COMCARG
  4438. SPACE 4,10
  4439. MINSZ EQU *
  4440. OVLDEF OVLY,PBR,1,(BASIC RESEQUENCING ROUTINES.)
  4441. SPACE 4,5
  4442. PBR SPACE 4,15
  4443. ** PBR - PERFORM *BASIC* RESEQUENCING.
  4444. *
  4445. * EXIT *BASIC* RESEQUENCING COMPLETED.
  4446. *
  4447. * USES X - 1, 2, 3, 5, 6, 7.
  4448. * A - 1, 2, 3, 5, 6, 7.
  4449. * B - 2.
  4450. *
  4451. * CALLS PEF, PNL, POL, SLN, SSF.
  4452. *
  4453. * MACROS READEI, REWIND, WRITER.
  4454.  
  4455.  
  4456. PBR SUBR ENTRY/EXIT
  4457. SX6 L
  4458. SA6 LBFET
  4459. SA1 NTL SAVE NUMBER OF TRUNCATED LINES
  4460. BX6 X1
  4461. MX1 42
  4462. SA6 PBRA
  4463. SA3 LBFILE
  4464. NZ X3,PBR1 IF WRITTEN TO DISK
  4465. SA5 E SET EOI STATUS IN FET *E*
  4466. SX6 741031B
  4467. BX6 -X1*X6
  4468. BX5 X1*X5
  4469. BX6 X5+X6
  4470. SA6 A5
  4471. EQ PBR2 PROCESS NON-OVERLAPPED LINES
  4472.  
  4473. PBR1 REWIND E,R REWIND FILE CONTAINING SELECTED LINES
  4474. READEI X2
  4475. PBR2 SA5 NNOL NUMBER OF NON-OVERLAPPED LINES
  4476. RJ PNL PROCESS NON-OVERLAPPED LINES
  4477. SA1 FNUM GET FUNCTION NUMBER
  4478. SA2 OVLPFG
  4479. SX1 X1-FNMO
  4480. NZ X2,PBR3 IF OVERLAPPED LINES
  4481. ZR X1,PBR4 IF A *MOVE* COMMAND
  4482. WRITER L FLUSH I/O BUFFER
  4483. EQ PBR8 CHECK IF TRUNCATED LINE COUNT HAS CHANGED
  4484.  
  4485. PBR3 RJ POL PROCESS OVERLAPPED LINES
  4486. PBR4 SA1 FNUM GET FUNCTION NUMBER
  4487. SA2 LRT GET FIRST *LRT* ENTRY
  4488. SX1 X1-FNMO
  4489. SA5 OLLE GET OVERLAPPED LINE RANGE TABLE ENTRY
  4490. SX6 B1 SET NUMBER OF *LRT* ENTRIES TO ONE
  4491. NZ X1,PBR6 IF NOT A *MOVE* COMMAND
  4492. MX1 1
  4493. SA3 OVLPFG
  4494. ZR X3,PBR7 IF NO OVERLAPPED LINES
  4495. IX3 X5-X2 ASSURE SORTED LINE RANGE TABLE
  4496. SX6 B1+B1 SET NUMBER OF *LRT* ENTRIES TO TWO
  4497. PL X3,PBR5 IF *LRT* WILL BE IN ASCENDING ORDER
  4498. BX3 X2 EXCHANGE *LRT* ENTRIES
  4499. BX2 X5
  4500. BX5 X3
  4501. PBR5 BX7 -X1*X2
  4502. SA7 A2 STORE *LRT* ENTRY
  4503. SA2 A2+B1
  4504. PBR6 SA6 NELR STORE NUMBER OF *LRT* ENTRIES
  4505. BX7 X5
  4506. SA7 A2 STORE *LRT* ENTRY
  4507. PBR7 SA5 EFN PUT EDIT FILE NAME INTO FET *E*
  4508. SX2 E
  4509. RJ SLN SET LOCAL FILE NAME
  4510. REWIND X2,R
  4511. READEI X2
  4512. RJ PEF PROCESS ENTIRE EDIT FILE
  4513. PBR8 SA1 NTL
  4514. SA2 PBRA
  4515. IX1 X1-X2
  4516. SX6 B1+ SET *WRITTEN TO DISK* FLAG FOR FET *L*
  4517. SA6 LBFILE
  4518. ZR X1,PBRX IF TRUNCATED LINE COUNT NEVER CHANGED
  4519. WRITER TRNCFET FLUSH TRNCFET I/O BUFFER
  4520. SB2 X2 SORT TRUNCATED LINES
  4521. RJ SSF SORT SELECTED FILE
  4522. SA6 NTL STORE NEW TRUNCATED LINE COUNT
  4523. EQ PBRX RETURN
  4524.  
  4525. PBRA CON 0 STORAGE FOR TRUNCATED LINE COUNT
  4526. PEF SPACE 4,15
  4527. ** PEF - PROCESS EDIT FILE.
  4528. *
  4529. * ENTRY FET *E* REWOUND AND READ INTO I/O BUFFER.
  4530. *
  4531. * EXIT BASIC LINE PROCESSING PERFORMED, SELECTED LINES
  4532. * WRITTEN TO FET *L*, FET *L* SORTED IF NECESSARY.
  4533. *
  4534. * USES X - 0, 1, 2, 3, 5, 6, 7.
  4535. * A - 1, 2, 3, 5, 6, 7.
  4536. * B - 2, 3, 4, 6, 7.
  4537. *
  4538. * CALLS ABL, BLP, CLN, PLB, SSF, USB, WTL.
  4539. *
  4540. * MACROS READC, WRITEC, WRITER.
  4541.  
  4542.  
  4543. PEF SUBR ENTRY/EXIT
  4544. PEF1 READC E,PCKDBF,MXWL+1 READ LINE FROM FET *E*
  4545. NZ X1,PEF5 IF EOI ON FET *E*
  4546. MX0 -12
  4547. BX7 -X0*X4
  4548. SA7 PEFA SET *CLEAR OUT PARTIAL LINE* FLAG
  4549. SA5 PCKDBF
  4550. RJ CLN CHECK IF LINE NUMBER IN LINE RANGE TABLE
  4551. NZ X4,PEF3 IF LINE IS NOT TO BE PROCESSED
  4552. SA6 PEFD SAVE BINARY LINE NUMBER
  4553. SA7 PEFE SAVE NUMBER OF CHARACTERS IN LINE NUMBER
  4554. SB2 PCKDBF
  4555. SA1 CSTI CHARACTER SET
  4556. SB6 MXCIL+1
  4557. SB3 X1
  4558. RJ USB UNPACK STRING BUFFER
  4559. SA1 F.LNTBUF FWA OF *LNT*
  4560. SA2 NMLS NUMBER OF *LNT* ENTRIES
  4561. SA5 LTFILE
  4562. SX3 B0+
  4563. ZR X5,PEF2 IF *LNT* IS NOT WRITTEN TO DISK
  4564. SA3 LTFET FET ADDRESS
  4565. PEF2 SA5 PEFE RESEQUENCE ONE *BASIC* COMMAND
  4566. IX2 X2+X1
  4567. SB2 B7+B1
  4568. SB7 X5+CLIN
  4569. SX5 B1+
  4570. SX6 CLIN+MXCIL
  4571. RJ BLP
  4572. ZR X2,PEF3 IF NO RESEQUENCING TOOK PLACE
  4573. SA2 PEFA GET PARTIAL LINE FLAG
  4574. BX6 X2+X1
  4575. SA6 PEFC IF TRUNCATED BY READ IN OR BY *BLP*
  4576. SX7 B1
  4577. SA7 PEFB SET SORT FET *L* FLAG
  4578. SX7 B7-CLIN ADD BLANKS TO LINE
  4579. SA2 PEFE
  4580. SA7 NCOL SAVE NUMBER OF CHARACTERS
  4581. RJ ABL
  4582. SB4 X7+ NUMBER OF CHARACTERS NOW IN LINE
  4583. SA1 PCKDBF PACK LINE INTO BUFFER
  4584. SA2 CLIN
  4585. SB2 60
  4586. RJ PLB
  4587. WRITEC L,PCKDBF WRITE CHANGED LINE TO FET *L*
  4588. SA2 PEFC CHECK IF TRUNCATED BY READ OR BY *BLP*
  4589. ZR X2,PEF1 IF LINE NOT TRUNCATED
  4590. SA1 PEFD WRITE TRUNCATED LINE
  4591. RJ WTL
  4592. PEF3 SA1 PEFA
  4593. ZR X1,PEF1 IF NO PARTIAL LINE TO CLEAR OUT
  4594. PEF4 READC E,PCKDBF,MXWL+1 THROW AWAY REMAINDER OF LINE
  4595. MX0 -12
  4596. BX7 -X0*X4
  4597. NZ X7,PEF4 IF EOL NOT YET FOUND
  4598. EQ PEF1 READ NEXT LINE
  4599.  
  4600. PEF5 WRITER L FLUSH I/O BUFFER
  4601. SA1 PEFB
  4602. ZR X1,PEFX IF NO NEED TO SORT FET *L*
  4603. SB2 X2+
  4604. RJ SSF SORT SELECTED FILE
  4605. EQ PEFX RETURN
  4606.  
  4607. PEFA CON 0 PARTIAL LINE FLAG
  4608. PEFB CON 0 SORT FET *L* FLAG (CHANGED LINES)
  4609. PEFC CON 0 TRUNCATE BY READ OR *BLP* FLAG
  4610. PEFD CON 0 BINARY LINE NUMBER
  4611. PEFE CON 0 NUMBER OF CHARACTERS IN LINE NUMBER
  4612. PLN SPACE 4,15
  4613. ** PLN - PROCESS LINE.
  4614. *
  4615. * ENTRY *PCKDBF* HOLDS THE LINE TO BE PROCESSED.
  4616. *
  4617. * EXIT BASIC LINE PROCESSING PERFORMED, TRUNCATED LINE
  4618. * COUNT UPDATED, AND LINE WRITTEN TO FET *L*.
  4619. *
  4620. * USES X - 1, 2, 3, 5, 7.
  4621. * A - 1, 2, 3, 5, 7.
  4622. * B - 2, 3, 4, 6, 7.
  4623. *
  4624. * CALLS ABL, BLP, PLB, USB, VPL, WTL.
  4625. *
  4626. * MACROS WRITEC.
  4627.  
  4628.  
  4629. PLN SUBR ENTRY/EXIT
  4630. SB2 PCKDBF UNPACK STRING BUFFER
  4631. SA1 CSTI
  4632. SB3 X1+
  4633. SB6 MXCIL+1
  4634. RJ USB
  4635. SA1 F.LNTBUF RESEQUENCE ONE *BASIC* COMMAND
  4636. SA2 NMLS
  4637. SA3 LTFET
  4638. IX2 X2+X1
  4639. SB2 B7+B1
  4640. SB7 CLIN+NUMD
  4641. SX6 CLIN+MXCIL
  4642. SA5 LTFILE
  4643. NZ X5,PLN1 IF *LNT* IS WRITTEN TO DISK
  4644. SX3 B0
  4645. SX5 B1 SET SORTED *LNT*
  4646. PLN1 RJ BLP *BASIC* LINE PROCESSOR
  4647. ZR X2,PLN3 IF LINE WAS NOT RESEQUENCED
  4648. SX7 B7-CLIN
  4649. SA7 NCOL
  4650. ZR X1,PLN2 IF LINE WAS NOT TRUNCATED
  4651. SA5 PCKDBF EVALUATE PACKED LINE NUMBER
  4652. RJ VPL
  4653. BX1 X6 WRITE TRUNCATED LINE NUMBER
  4654. RJ WTL
  4655. PLN2 SX2 NUMD ADD BLANKS TO LINE
  4656. RJ ABL
  4657. SB4 X7+ PACK LINE INTO BUFFER
  4658. SA1 PCKDBF
  4659. SA2 CLIN
  4660. SB2 60
  4661. RJ PLB
  4662. PLN3 WRITEC L,PCKDBF WRITE CHANGED LINE TO *L*
  4663. EQ PLNX RETURN
  4664. PNL SPACE 4,20
  4665. ** PNL - PROCESS NON-OVERLAPPED LINES.
  4666. *
  4667. * ENTRY (X5) = NUMBER OF NON-OVERLAPPED LINES.
  4668. *
  4669. * EXIT NON-OVERLAPPED LINES PROCESSED.
  4670. *
  4671. * USES X - 1, 2, 5.
  4672. * A - 0, 2.
  4673. *
  4674. * CALLS PLN.
  4675. *
  4676. * MACROS READC, WRITEC.
  4677. *
  4678. * NOTE THE NUMBER OF NON-OVERLAPPED LINES IS HELD IN (A0)
  4679. * DURING THE LOOP AT *PNL2* SINCE *BLP* USES ALL
  4680. * REGISTERS EXCEPT (A0) AND (A5).
  4681.  
  4682.  
  4683. PNL2 READC E,PCKDBF READ LINE FROM FET *E*
  4684. RJ PLN PROCESS LINE
  4685. SA0 A0-B1 DECREMENT NON-OVERLAPPED LINE COUNT
  4686. SX1 A0
  4687. NZ X1,PNL2 IF MORE NON-OVERLAPPED LINES
  4688.  
  4689. PNL SUBR ENTRY/EXIT
  4690. SA0 X5+ SAVE NUMBER OF NON-OVERLAPPED LINES
  4691. SA2 UNRF
  4692. ZR X2,PNL2 IF NOT AN UNNUMBERED *READ* FILE
  4693. PNL1 READC E,PCKDBF READ LINE FROM FET *E*
  4694. WRITEC L,PCKDBF WRITE LINE TO FET *L*
  4695. SX5 X5-1
  4696. NZ X5,PNL1 IF MORE NON-OVERLAPPED LINES
  4697. EQ PNLX RETURN
  4698. POL SPACE 4,10
  4699. ** POL - PROCESS OVERLAPPED LINES.
  4700. *
  4701. * ENTRY (X1) = 0, IF A *MOVE* FUNCTION.
  4702. * = NONZERO, OTHERWISE.
  4703. *
  4704. * EXIT OVERLAPPED LINES PROCESSED.
  4705. *
  4706. * CALLS PLN, RNE.
  4707. *
  4708. * MACROS READC.
  4709.  
  4710.  
  4711. POL SUBR ENTRY/EXIT
  4712. ZR X1,POL1 IF A *MOVE* COMMAND
  4713. RJ RNE REMOVE NON - OVERLAPPED *LNT* ENTRIES
  4714. POL1 READC E,PCKDBF READ LINE FROM FET *E*
  4715. NZ X1,POLX IF EOR ON FET *E*
  4716. RJ PLN PROCESS LINE
  4717. EQ POL1 READ NEXT LINE
  4718. RNE SPACE 4,15
  4719. ** RNE - REMOVE NON-OVERLAP *LNT* ENTRIES.
  4720. *
  4721. * *RNE* REMOVES ALL ENTRIES IN THE LINE NUMBER TABLE
  4722. * WHICH DO NOT HAVE THE OVERLAP BIT SET.
  4723. *
  4724. * ENTRY (LTFILE) = 0, IF THE *LNT* IS BUFFER RESIDENT.
  4725. * 1, IF THE *LNT* IS MASS STORAGE RESIDENT.
  4726. *
  4727. * EXIT *LNT* UPDATED.
  4728. *
  4729. * USES X - 0, 1, 2, 6, 7.
  4730. * A - 1, 2, 6, 7.
  4731. * B - 7.
  4732. *
  4733. * MACROS READEI, READO, REWIND, WRITEO, WRITER.
  4734.  
  4735.  
  4736. RNE SUBR ENTRY/EXIT
  4737. SA1 LTFILE
  4738. NZ X1,RNE3 IF *LNT* RESIDES ON MASS STORAGE
  4739. SA1 F.LNTBUF
  4740. SA2 NMLS
  4741. SX0 B1
  4742. LX0 FOVL-0 SET UP OVERLAP BIT MASK
  4743. SB7 X1 FWA OF TABLE
  4744. SA1 X1 GET FIRST ENTRY
  4745. RNE1 BX6 X0*X1
  4746. ZR X6,RNE2 IF OVERLAP BIT NOT SET
  4747. BX6 X1
  4748. SA6 B7+ STORE OVERLAP *LNT* ENTRY
  4749. SB7 B7+1
  4750. RNE2 SA1 A1+1
  4751. SX2 X2-1
  4752. NZ X2,RNE1 IF MORE ENTRIES TO PROCESS
  4753. SA1 F.LNTBUF
  4754. SX6 B7
  4755. IX6 X6-X1
  4756. SA6 NMLS UPDATE NUMBER OF *LNT* ENTRIES
  4757. EQ RNEX RETURN
  4758.  
  4759. RNE3 SA2 LT2FET
  4760. REWIND X2,R REWIND THE SCRATCH FILE
  4761. SA2 LTFET
  4762. REWIND X2,R
  4763. READEI X2 PREPARE THE *LNT* FILE
  4764. SX0 B1
  4765. LX0 FOVL-0 SET MASK FOR THE TRUNCATE BIT
  4766. SA1 LTFET
  4767. SA2 LT2FET REVERSE THE FILE NAMES
  4768. BX6 X1
  4769. BX7 X2
  4770. SA7 A1+
  4771. SA6 A2+
  4772. RNE4 SA2 LT2FET
  4773. READO X2 GET NEXT ENTRY
  4774. NZ X1,RNE5 IF NO MORE ENTRIES TO PROCESS
  4775. BX2 X0*X6
  4776. ZR X2,RNE4 IF NOT AN OVERLAP ENTRY
  4777. SA2 LTFET
  4778. WRITEO X2 ADD THE OVERLAP ENTRY TO THE NEW *LNT*
  4779. EQ RNE4 PROCESS NEXT ENTRY
  4780.  
  4781. RNE5 SA2 LTFET
  4782. WRITER X2 FLUSH THE *LNT* TO THE FILE
  4783. EQ RNEX RETURN
  4784. LIST X
  4785. *CALL COMCBLP
  4786. TTL IEDIT - IN-LINE EDITOR.
  4787.  
  4788. MEM2 EQU * MANAGED TABLES START ADDRESS
  4789. QUAL MAKE *MEML* A GLOBAL SYMBOL
  4790.  
  4791. * DEFINITION OF MEML IS CHANGED DURING PRESET TO MATCH
  4792. * ACTUAL OVERLAY SIZES AND UTILIZATION. THE *ERRNG* CHECKS
  4793. * ARE FOR THE WORST POSSIBLE CASES.
  4794.  
  4795. MEM2 EQU /IEDIT1/MEM2
  4796.  
  4797. MEML EQU MEM
  4798.  
  4799. MFL= EQU 17400B
  4800. SSM= EQU 0
  4801.  
  4802. ERRNG MEM-MEM2
  4803. ERRNG MFL=-MEM-BUFL
  4804. ERRNG MFL=-MEM-BUFL2
  4805. ERRNG MFL=-MEM2-BUFL
  4806. ERRNG MFL=-MINSZ
  4807.  
  4808. END
cdc/nos2.source/opl871/iedit.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator