User Tools

Site Tools


cdc:nos2.source:opl871:redo

Table of Contents

REDO

Table Of Contents

  • [00010] REDO - REENTER PREVIOUS COMMAND.
  • [00014] REENTER PREVIOUS COMMAND.
  • [00095] DEFINITIONS.
  • [00141] MAIN PROGRAM.
  • [00143] MAIN PROGRAM.
  • [00248] SUBROUTINES.
  • [00250] ACT - ADD COMMAND TERMINATOR.
  • [00297] CCL - CHECK COMMAND LINE.
  • [00401] MDY - PROCESS MODIFY DIRECTIVES.
  • [00536] PSB - PACK STRING BUFFER.
  • [00586] RMC - READ MODIFIED COMMAND.
  • [00626] TSL - TRIM SPACES OFF LINE (STRING BUFFER).
  • [00651] WOC - WRITE OUT COMMAND.
  • [00704] PRESET.
  • [00705] PRS - GET PARAMETER VALUE.

Source Code

REDO.txt
  1. IDENT REDO,FWA
  2. ABS
  3. SST
  4. ENTRY REDO
  5. ENTRY R
  6. ENTRY ARG=
  7. ENTRY RFL=
  8. ENTRY SDM=
  9. SYSCOM B1
  10. TITLE REDO - REENTER PREVIOUS COMMAND.
  11. *COMMENT REDO - REENTER PREVIOUS COMMAND.
  12. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  13. SPACE 4,10
  14. *** REDO - REENTER PREVIOUS COMMAND.
  15. *
  16. * R. R. RAGAN 82/12/01.
  17. SPACE 4,10
  18. *** *REDO* ALLOWS A PREVIOUSLY ENTERED COMMAND TO BE MODIFIED
  19. * AND REEXECUTED WITHOUT RETYPING THE ENTIRE COMMAND.
  20. *
  21. * FOR COMPATIBILITY WITH A PREVIOUS VERSION OF *REDO* RELEASED
  22. * IN BINARY AT NOS 2.2, *R* IS ALSO AN ENTRY POINT. ONLY
  23. * *REDO* IS DOCUMENTED IN THE MANUALS. *R* MAY THEREFORE
  24. * BE REMOVED IF IT CONFLICTS WITH LOCAL CODE.
  25. SPACE 4,10
  26. ** COMMAND FORMAT.
  27. *
  28. * REDO.
  29. *
  30. * REDO,STRING.
  31. *
  32. * CALLING *REDO* WITH NO PARAMETERS WILL CAUSE IT TO DISPLAY
  33. * THE PREVIOUS COMMAND AND PROVIDE A MODIFICATION LINE WHERE
  34. * CHANGES TO THE COMMAND CAN BE MADE. WHEN A CARRIAGE RETURN
  35. * IS ENTERED THE POSSIBLY MODIFIED COMMAND IS EXECUTED.
  36. *
  37. * FOR EXAMPLE, IF THE LAST COMMAND WAS - MODIFY,Z./*EDIT,CIO
  38. * AND YOU WANTED TO EDIT LFM INSTEAD -
  39. *
  40. * REDO
  41. * OLD: MODIFY,Z./*EDIT,CIO
  42. * MOD: LFM
  43. * NEW: MODIFY,Z./*EDIT,LFM
  44. *
  45. * THE *OLD* LINE IS OUTPUT BY *REDO* AND YOU ARE PROMPTED
  46. * WITH THE *MOD* LINE. MODIFICATIONS ARE ENTERED MUCH AS IN
  47. * THE MODIFY COMMAND OF *XEDIT*. THE *NEW* LINE ECHOS THE
  48. * COMMAND THAT IS ABOUT TO BE EXECUTED.
  49. *
  50. * MODIFICATION IS DONE BY VISUAL ALIGNMENT OF THE *OLD* AND
  51. * THE *MOD* LINES. THE MODIFICATION COMMAND CHARACTERS ARE:
  52. *
  53. * SPACE - RETAINS THE CHARACTER FROM *OLD*.
  54. * # (NUM. SIGN) - DELETES THE CHARACTER FROM *OLD*.
  55. * & (AMPERSAND) - CHANGES THE *OLD* CHARACTER TO A SPACE.
  56. * ^ (CIRCUMFLEX) - INSERTS FOLLOWING CHARACTERS BEFORE THE
  57. * *OLD* CHARACTER ABOVE THE THE^. INSERTED TEXT IS
  58. * TERMINATED BY A # OR BY CARRIAGE RETURN.
  59. * IF A CARAT IS ENTERED FOLLOWED BY END OF LINE
  60. * THE LINE WILL BE REDISPLAYED AS SO FAR
  61. * MODIFIED AND FURTHER MODS WILL BE ALLOWED.
  62. * ! (EXCLAMATION) - DELETES THE REST OF THE TEXT OF *OLD*.
  63. * OTHER - REPLACES THE CHARACTER FROM *OLD*.
  64. *
  65. * IF *REDO* IS CALLED WITH A PARAMETER, A PREVIOUS COMMAND
  66. * THAT BEGINS WITH THE SAME CHARACTERS AS THE PARAMETER
  67. * IS FOUND AND BECOMES THE COMMAND TO BE REENTERED. NOTE THAT
  68. * COMMAS, PARANTHESES, ETC. ARE CONSIDERED TO BE PART OF THE
  69. * STRING, BUT THAT LEADING BLANKS ARE NOT. IF THE PARAMETER
  70. * BEGINS WITH LEADING ASTERISKS(*) OR BLANKS, THE COMMAND
  71. * BEING LOCATED MAY HAVE AN ARBITRARY NUMBER OF LEADING
  72. * BLANKS. *REDO* DOES NOT PROCESS ANY PARAMETERS ITSELF.
  73. * THE FIRST 10 CHARACTERS OF THE PARAMETER OR UP TO A BLANK
  74. * END OF COMMAND INPUT ARE USED FOR THE PARAMETER.
  75. * THUS COMMANDS SUCH AS THE FOLLOWING WILL WORK -
  76. *
  77. * REDO,FTN,I=A
  78. * REDO,GTR,OPL.AB
  79. * REDO, COPY,TAPE
  80. * REDO/GO.
  81. * REDO./GO.
  82. *
  83. * IF THE *REDO* COMMAND IS SUFFIXED WITH */GO*, THE *OLD*,
  84. * *MOD* AND *NEW* MESSAGES WILL BE SUPPRESSED. THIS IS USEFUL
  85. * FOR SLOW BAUD RATE TERMINALS.
  86. *
  87. * IF THE *REDO* COMMAND IS USED IN A NON-INTERACTIVE JOB, THE
  88. * */GO* OPTION IS FORCED ON.
  89. SPACE 4,10
  90. * COMMON DECKS.
  91.  
  92. *CALL COMCMAC
  93. *CALL COMSIOQ
  94. *CALL COMSSFM
  95. TITLE DEFINITIONS.
  96. * ASSEMBLY CONSTANTS.
  97.  
  98. BUFL EQU 401B DAYFILE BUFFER LENGTH
  99. IBUFL EQU 101B INPUT BUFFER LENGTH
  100. OBUFL EQU 101B OUTPUT BUFFER LENGTH
  101. USBFL EQU 81 UNPACKED STRING BUFFER LENGTH
  102. SPACE 4,10
  103. * FETS.
  104.  
  105. ORG 105B
  106. FWA BSS 0
  107.  
  108. I BSS 0 DAYFILE BUFFER
  109. ZZZZZDD FILEB IBUF,BUFL,FET=7
  110.  
  111. O BSS 0 OUTPUT BUFFER
  112. OUTPUT FILEB OBUF,OBUFL,FET=7
  113.  
  114. T BSS 0 TERMINAL INPUT BUFFER
  115. INPUT FILEB TBUF,IBUFL,FET=7
  116. SPACE 4,10
  117. * BUFFERS AND WORKING STORAGE.
  118.  
  119. RPVBLK VFD 36/0,12/25,2/0,9/1,1/0 *REPRIEVE* PARAMETER BLOCK
  120. VFD 30/0,12/0,18/RED9
  121. CON 0
  122. VFD 24/200B,36/0
  123. DSTR BSS USBFL MODIFICATION COMMANDS
  124. ELEN CON 0 *ELEN* MUST PRECEDE *ESTR*
  125. USBB BSS 0
  126. ESTR BSS USBFL UNPACKED STRING BUFFER
  127. ESCR BSS USBFL
  128. TIME BSS 1 TIME PART OF DAYFILE LINE
  129. LINE BSS 9
  130. DLINE BSS 10 DISPLAY VERSION OF LINE
  131. ULT CON 77770000000000000000B
  132. BSS 8
  133. MLINE VFD 36/6LMOD: ,12/0013B,12/0
  134. ZERO CON 0
  135. GOFLAG CON 0 NONZERO IF */GO* OPTION OR NON-INTERACTIVE
  136. LBFLAG CON 0 NONZERO IF LEADING BLANKS OK ON COMMAND
  137. WDCT CON 0 WORD COUNT IN CM BUFFER
  138. TIOPTR VFD 42/6LOUTPUT,18/O OUTPUT FET POINTER
  139. ARGV CON 0 ARGUMENT VALUE
  140. ARGM CON 0 ARGUMENT MASK
  141. TITLE MAIN PROGRAM.
  142. SPACE 4,10
  143. ** REDO - MAIN PROGRAM.
  144.  
  145.  
  146. R BSS 0
  147. REDO RJ PRS PRESET
  148.  
  149. * GET THE JOB DAYFILE AND POSITION TO EOI FOR BACK SCAN.
  150.  
  151. CSET NORMAL
  152. DAYFILE I,USER
  153. READW I,CBUF,BUFL SAVE LAST PART OF DAYFILE
  154. SX6 B6
  155. SA6 WDCT SAVE IN POINTER FOR CBUF
  156. REWIND I,R
  157. READ I
  158. MX0 -12
  159.  
  160. * SEARCH FOR LINE MATCHING THE ARGUMENT.
  161.  
  162. RED1 READC I,TIME READ A DAYFILE LINE
  163. RED2 NZ X1,RED10 IF END OF INPUT
  164. RJ CCL CHECK COMMAND LINE
  165. SA3 LINE
  166. SA4 ARGV
  167. SA5 ARGM
  168. SA2 LBFLAG
  169. BX6 X3-X4
  170. BX6 X5*X6
  171. ZR B5,RED3 IF NO LEADING BLANKS
  172. ZR X5,RED1 IF NO SEARCH ARGUMENT - NOT A COMMAND
  173. ZR X2,RED1 IF LEADING BLANKS NOT ACCEPTABLE
  174. RED3 NZ X6,RED1 IF NOT DESIRED LINE
  175.  
  176. * SAVE THE LINE FOUND AND CONTINUE.
  177.  
  178. SB5 B0+
  179. RED4 SA2 LINE+B5
  180. BX6 X2
  181. SA6 ULT+B5 MOVE LINE TO ULTIMATE
  182. BX3 -X0*X2
  183. SB5 B5+B1
  184. NZ X3,RED4 IF NOT END OF LINE
  185. EQ RED1 CONTINUE READING TO EOI
  186.  
  187. * DISPLAY THE ORIGINAL LINE AND GET THE MODS.
  188.  
  189. RED5 SA3 ULT
  190. SA0 A3
  191. MX4 12
  192. IX3 X3-X4
  193. ZR X3,RED8 IF NOT FOUND
  194. SA2 REDA
  195. RJ WOC WRITE OUT COMMAND
  196. RED7 SA2 GOFLAG
  197. NZ X2,RED7.1 IF *GO* SPECIFIED
  198. PROMPT OFF
  199. RED7.1 RJ RMC READ MODIFIED COMMAND
  200.  
  201. * DISPLAY MODIFIED COMMAND AND EXECUTE IT.
  202.  
  203. SA0 LINE
  204. SA2 REDB
  205. RJ WOC WRITE OUT COMMAND
  206. SB6 X0+2
  207. ZR B6,RED7.1 IF REMOD SPECIFIED
  208. SA2 GOFLAG
  209. NZ X2,RED7.3 IF *GO* SPECIFIED
  210. WRITER O
  211. RED7.3 RETURN I
  212. CSET RESTORE
  213. EXCST LINE
  214.  
  215. * COMMAND STRING CANNOT BE FOUND.
  216.  
  217. RED8 MESSAGE CCDR,3 ISSUE COMMAND AND ERROR MESSAGE TO DAYFILE
  218. MESSAGE (=C*COMMAND NOT FOUND.*),3
  219. RED9 RETURN I
  220. CSET RESTORE
  221. ABORT ABORT
  222.  
  223. * HANDLE LINE BROKEN ACROSS DISK/MEMORY.
  224.  
  225. RED10 SA2 I+1 FIRST
  226. SB4 X2+
  227. SB5 CBUF
  228. EQ B4,B5,RED5 IF REAL EOI
  229. SX7 B5
  230. MX5 -18
  231. BX3 X5*X2
  232. IX6 X3+X7 SET FIRST TO *CBUF*
  233. SA6 A2
  234. SA2 WDCT
  235. BX6 X2
  236. SA6 A6+B1 SET IN
  237. SA7 A6+B1 SET OUT TO *CBUF*
  238. SA2 A7+B1 LIMIT
  239. BX3 X5*X2
  240. SX7 CBUF+BUFL
  241. IX6 X3+X7
  242. SA6 A2 SET LIMIT
  243. READC I,B6 READ REST OF LINE
  244. EQ RED2 CONTINUE ON BROKEN RECORD
  245.  
  246. REDA VFD 36/6LOLD: ,24/0
  247. REDB VFD 36/6LNEW: ,24/0
  248. TITLE SUBROUTINES.
  249. ACT SPACE 4,15
  250. ** ACT - ADD COMMAND TERMINATOR.
  251. *
  252. * *ACT* ADDS A PERIOD TO THE END OF THE MODIFIED COMMAND IF
  253. * THERE IS NO PERIOD OR RIGHT PARENTHESIS ALREADY IN THE
  254. * COMMAND OUTSIDE OF LITERALS.
  255. *
  256. * ENTRY (B6) = STRING BUFFER ADDRESS.
  257. *
  258. * EXIT (B6) = STRING BUFFER ADDRESS, LEADING BLANKS REMOVED.
  259. *
  260. * USES X - 1, 2, 6, 7.
  261. * A - 1, 6, 7.
  262. * B - 6.
  263.  
  264.  
  265. ACT SUBR ENTRY/EXIT
  266. SX6 B0
  267. SX7 B0
  268. SA1 B6+
  269. ACT1 NG X1,ACT5 IF END OF COMMAND
  270. ZR X7,ACT3 IF CHECKING LEADING BLANKS
  271. SX2 X1-1R$
  272. ZR X2,ACT2 IF A LITERAL DELIMITER
  273. NZ X6,ACT4 IF INSIDE A LITERAL
  274. SX2 X1-1R.
  275. ZR X2,ACTX IF TERMINATOR IN COMMAND
  276. SX2 X1-1R)
  277. NZ X2,ACT4 IF NOT TERMINATOR
  278. EQ ACTX RETURN
  279.  
  280. ACT2 BX6 X6-X7 TOGGLE LITERAL FLAG
  281. SA1 A1+B1
  282. EQ ACT1 CONTINUE
  283.  
  284. ACT3 SX2 X1-1R
  285. ZR X2,ACT4 IF BLANK
  286. SB6 A1+
  287. SX7 B1+
  288. ACT4 SA1 A1+1
  289. EQ ACT1 CONTINUE
  290.  
  291. ACT5 SX6 1R.
  292. MX7 2
  293. SA6 A1
  294. SA7 A1+1
  295. EQ ACTX RETURN
  296. CCL SPACE 4,15
  297. ** CCL - CHECK COMMAND LINE.
  298. *
  299. * *CCL* CHECKS TO SEE IF THE LINE FOUND SEEMS TO BE A COMMAND.
  300. * COMMAND CRITERIA - 1) FIRST NON-BLANK MUST BE ALPHANUMERIC,
  301. * $ OR /.
  302. * 2) AT LEAST ONE BUT NO MORE THAN SEVEN
  303. * ALPHANUMERIC CHARACTERS MUST OCCUR
  304. * BEFORE THE FIRST SEPARATOR/TERMINATOR.
  305. * 3) A LITERAL DELIMITER ($) MAY NOT OCCUR
  306. * BEFORE THE FIRST SEPARATOR/TERMINATOR.
  307. * 4) THE LINE MUST HAVE A TERMINATOR WHICH
  308. * IS NOT ENCLOSED WITHIN A LITERAL.
  309. * IF LEADING BLANKS ARE FOUND, THEY ARE REMOVED.
  310. *
  311. * ENTRY (X0) = 7777 7777 7777 7777 0000B.
  312. * (LINE) = LINE TO BE EXAMINED.
  313. *
  314. * EXIT (B5) = NUMBER OF LEADING BLANKS.
  315. * (B5) = -1 IF LINE DOES NOT MEET COMMAND CRITERIA.
  316. *
  317. * USES X - 2, 3, 4, 5, 6, 7.
  318. * A - 2, 6.
  319. * B - 2, 3, 5, 6, 7.
  320. *
  321. * CALLS PSB, USB.
  322.  
  323.  
  324. CCL11 ZR B5,CCLX IF NO LEADING BLANKS
  325. SB2 LINE
  326. SB3 B0+ SELECT NORMAL MODE
  327. SB6 USBFL LENGTH OF UNPACK BUFFER
  328. RJ USB UNPACK TO STRING BUFFER
  329. MX6 59
  330. SA6 B7+B1 ADD END OF LINE TERMINATOR
  331. SB6 USBB+B5
  332. SB7 LINE
  333. RJ PSB PACK STRING BUFFER
  334.  
  335. CCL SUBR ENTRY/EXIT
  336. SA2 LINE
  337. SB2 B1+
  338. SB3 B0+
  339. SB5 B0
  340. MX7 -6
  341.  
  342. * SEARCH LINE FOR LEADING BLANKS AND START OF COMMAND.
  343.  
  344. CCL1 SB6 B0
  345. SB7 60
  346. BX5 -X0*X2 EXTRACT END OF LINE FOR TEST
  347. CCL2 LX2 6
  348. BX3 -X7*X2
  349. SX4 X3-1R
  350. NZ X4,CCL4 IF NOT A BLANK
  351. SB5 B5+B2 INCREMENT COUNT OF LEADING BLANKS
  352. CCL3 SB6 B6+6
  353. NE B6,B7,CCL2 IF WORD NOT ALL SCANNED
  354. ZR X5,CCLX IF END OF LINE
  355. SA2 A2+1 NEXT WORD OF LINE
  356. EQ CCL1 CONTINUE
  357.  
  358. CCL4 SX4 X3-1R9-1
  359. NG X4,CCL9 IF ALPHANUMERIC
  360. ZR B2,CCL5 IF SEPARATOR AFTER $ OR /
  361. SB2 B0+
  362. SX4 X3-1R$
  363. ZR X4,CCL3 IF DOLLAR SYMBOL
  364. SX4 X3-1R/
  365. ZR X4,CCL3 IF SLASH
  366. CCL5 SB5 -1 INDICATE NOT A COMMAND
  367. EQ CCLX RETURN WITH ERROR
  368.  
  369. CCL6 SB6 B0
  370. SB7 60
  371. BX5 -X0*X2 EXTRACT END OF LINE FOR TEST
  372. CCL7 LX2 6
  373. BX3 -X7*X2
  374. SX4 X3-1R$
  375. NZ X4,CCL8 IF NOT A LITERAL DELIMITER
  376. SX4 B3-8
  377. NG X4,CCL5 IF LITERAL BEFORE FIRST SEPARATOR
  378. SB2 B2-1
  379. ZR B2,CCL10 IF END OF LITERAL
  380. SB2 B1+ INDICATE START OF LITERAL
  381. CCL8 NZ B2,CCL10 IF WITHIN A LITERAL
  382. SX4 X3-1R9-1
  383. NG X4,CCL9 IF ALPHANUMERIC
  384. SX4 X3-1R
  385. ZR X4,CCL10 IF BLANK (IGNORE)
  386. SX4 X3-1R.
  387. ZR X4,CCL11 IF TERMINATOR FOUND
  388. SX4 X3-1R)
  389. ZR X4,CCL11 IF TERMINATOR FOUND
  390. SB3 8 INDICATE PAST COMMAND NAME
  391. CCL9 SB3 B3+1 COUNT COMMAND CHARACTER
  392. SX3 B3-8
  393. SB2 B0+ CLEAR LITERAL FLAG
  394. ZR X3,CCL5 IF TOO MANY CHARACTERS
  395. CCL10 SB6 B6+6
  396. NE B6,B7,CCL7 IF WORD NOT ALL SCANNED
  397. ZR X5,CCL5 IF END OF LINE (NO TERMINATOR)
  398. SA2 A2+1 NEXT WORD OF LINE
  399. EQ CCL6 CONTINUE
  400. MDY SPACE 4,15
  401. ** MDY - PROCESS MODIFY DIRECTIVES.
  402. *
  403. * ENTRY (ESTR) = ORIGINAL LINE (UNPACKED).
  404. * (DSTR) = DIRECTIVES LINE (UNPACKED).
  405. *
  406. * EXIT (X0) = -1, IF TRUNCATION ENCOUNTERED.
  407. * (X0) = -2, IF REMODIFICATION SPECIFIED
  408. * (ESTR) = NEW TEXT LINE.
  409. *
  410. * USES X, 0, 1, 2, 6, 7.
  411. * A - 1, 2, 6.
  412. * B - 2, 3, 4, 5, 6.
  413. *
  414. * CALLS TSL.
  415.  
  416.  
  417. MDY5 SX6 1R SET BLANK CHARACTER
  418. MDY6 GT B3,B4,MDY1 IF AT END OF BUFFER
  419. SA6 B3
  420. SB3 B3+B1 SET TO NEXT PLACE TO SAVE
  421. MDY7 SA2 A2+B2 GET NEXT *ESTR* CHARACTER
  422. PL X2,MDY8 IF NOT AT END OF LINE
  423. SX6 1R
  424. SB2 B0 SET TO NOT ESCAPE END OF LINE
  425. BX2 X2+X6 GET END LINE (WITH BLANK)
  426. MDY8 SA1 A1+B1 GET NEXT DIRECTIVES CHARACTER
  427. SX6 X2 MOVE CURRENT TEXT CHARACTER
  428. SX7 X1-1R
  429. ZR X7,MDY11 IF SPACE DIRECTIVE
  430. NG X1,MDY17 IF END OF DIRECTIVE LINE
  431. SX7 X1-1R#
  432. ZR X7,MDY7 IF SHARP (DELETE TEXT CHARACTER)
  433. SX7 X1-1R!
  434. ZR X7,MDY10 IF ! (TRUNCATE TEXT CHARACTER)
  435. SX7 X1-1R&
  436. ZR X7,MDY5 IF AMPERSAND (SET TEXT TO BLANK)
  437. BX6 X1
  438. SB6 X1+B5 B5 = -UP ARROW
  439. NZ B6,MDY6 IF CHARACTER (REPLACE TEXT)
  440. MDY9 SA1 A1+B1 GET NEXT DIRECTIVES
  441. SX3 X1-1R#
  442. BX6 X1
  443. SX7 B6+B1 SET NUMBER OF CHARACTERS SCANNED
  444. NG X1,MDY12 IF END OF DIRECTIVES
  445. SB6 B6+B1 INCREMENT COUNT OF CHARACTERS SCANNED
  446. ZR X3,MDY13 IF SHARP
  447. GT B3,B4,MDY2 IF PAST 80 CHARACTERS
  448. SA6 B3
  449. SB3 B3+B1
  450. EQ MDY9 LOOP
  451.  
  452. MDY10 SX2 -B1 FLAG EARLY END OF *ESTR*
  453. EQ MDY17 COPY REST OF TEXT
  454.  
  455. MDY11 PL X2,MDY6 IF MORE IN *ESTR*
  456. SX6 1R PRETEND A SPACE IN *ESTR*
  457. EQ MDY6 CHECK IF END OF BUFFER
  458.  
  459. MDY12 NZ B6,MDY16 IF SOMETHING WAS AFTER THE UPARROW
  460. SB2 -2 SET REMODIFICATION FLAG
  461. EQ MDY17 COPY REST OF TEXT
  462.  
  463. MDY13 SX7 B6+B1
  464. NE B6,B1,MDY16 IF NOT (UP ARROW)(SHARP)
  465. SX7 B1 RESET COPY COUNTER
  466. MDY14 GT B3,B4,MDY4 IF POSSIBLE TRUNCATION
  467. SA6 B3
  468. SB3 B3+B1
  469. MDY15 SA2 A2+B2 GET NEXT *ESTR* CHARACTER
  470. PL X2,MDY16 IF NOT END OF LINE
  471. SB2 B0
  472. SX6 1R
  473. MX2 2 SET END OF LINE
  474. BX2 X2+X6
  475. MDY16 SX6 X2+
  476. SX7 X7-1
  477. PL X7,MDY14 IF MORE TO MOVE
  478. PL X1,MDY8 IF MORE DIRECTIVES
  479.  
  480. * END OF DIRECTIVES, COPY REST OF TEXT.
  481.  
  482. MDY17 NG X2,MDY20 IF END OF TEXT
  483. GT B3,B4,MDY3 IF END OF BUFFER
  484. SX6 X2+
  485. SA6 B3+
  486. MDY18 SA2 A2+B1 GET NEXT TEXT
  487. SB3 B3+B1
  488. EQ MDY17 CONTINUE COPY
  489.  
  490. * SET TRUNCATION FLAG AND CLEANUP.
  491.  
  492. MDY19 SB2 -1
  493.  
  494. * SET END OF LINE AND COPY BACK TO *ESTR*.
  495.  
  496. MDY20 MX6 2
  497. SA6 B3+
  498. SB6 ESTR
  499. SA1 ESCR
  500. MDY21 BX6 X1
  501. SB6 B6+B1
  502. SA1 A1+B1
  503. SA6 B6-B1
  504. PL X6,MDY21 IF NOT FINISHED
  505. SB6 ESTR-1 SET LINE WIDTH CELL
  506. SX0 B2+ MOVE TRUNCATION FLAG
  507. RJ TSL TRIM ANY TRAILING SPACES
  508.  
  509. MDY SUBR ENTRY/EXIT
  510. SB5 -1R^
  511. SB2 B1+ SET NOT AT END OF TEXT LINE
  512. SB3 ESCR SET NEXT SAVE CHARACTER ADDRESS
  513. SB4 ESCR+80 SET LWA
  514. SA1 DSTR-1
  515. SA2 ESTR-1
  516. EQ MDY7 BEGIN LOOP
  517.  
  518. * HANDLE SPECIAL CASES OF FULL BUFFER, ADDING CHARACTERS.
  519.  
  520. MDY1 SX7 X6-1R
  521. ZR X7,MDY7 IF SPACE (NO TRUNCATION)
  522. EQ MDY19 TRUNCATE
  523.  
  524. MDY2 SX7 X6-1R
  525. ZR X7,MDY9 IF SPACE (NO TRUNCATION)
  526. EQ MDY19 TRUNCATE
  527.  
  528. MDY3 SX7 X6-1R
  529. ZR X7,MDY17 IF SPACE (NO TRUNCATION)
  530. EQ MDY19 TRUNCATE
  531.  
  532. MDY4 SX7 X6-1R
  533. ZR X7,MDY15 IF SPACE (NO TRUNCATION)
  534. EQ MDY19 TRUNCATE
  535. PSB SPACE 4,10
  536. ** PSB - PACK STRING BUFFER.
  537. *
  538. * ENTRY (B6) = INCOMING STRING ADDRESS.
  539. * (B7) = OUTGOING STRING ADDRESS.
  540. *
  541. * EXIT STRING IS CONVERTED.
  542. *
  543. * USES X - 1, 2, 6, 7.
  544. * A - 1, 6.
  545. * B - 4, 6, 7.
  546.  
  547.  
  548. PSB SUBR ENTRY/EXIT
  549. SB4 6 SHIFT VALUE
  550. BX6 X6-X6 CLEAR ASSEMBLY
  551. MX7 1 POSITION INDICATOR
  552. SX1 B0+ INITIALIZE FOR POSSIBLE BLANK LINE
  553. EQ PSB2 BEGIN CONVERSION
  554.  
  555. PSB1 LX7 6 SHIFT POSITION
  556. BX6 X6+X1 MERGE CHARACTERS
  557. PL X7,PSB2 IF NOT FULL WORD
  558. SA6 B7
  559. SB7 B7+B1
  560. BX6 X6-X6 CLEAR ASSEMBLY
  561. PSB2 BX2 X1
  562. SA1 B6 GET NEXT CHARACTER
  563. NG X1,PSB4 IF END OF BUFFER REACHED
  564. PSB3 LX6 6
  565. SB6 B6+B1
  566. EQ PSB1 CONTINUE
  567.  
  568. PSB4 SB6 B6-B1 RESET CHARACTER POINTER
  569. SA1 =40004000400040004000B
  570. SA6 B7
  571. BX2 X1*X7
  572. NZ X2,PSB5 IF ON BYTE BOUNDRY
  573. SX1 1R
  574. EQ PSB3 BLANK FILL TO BYTE BOUNDARY
  575.  
  576. PSB5 NG X7,PSBX IF WORD IS FULL, RETURN
  577. PSB6 LX7 12
  578. LX6 12
  579. PL X7,PSB6 IF NOT LEFT JUSTIFIED
  580. SA6 B7
  581. ZR X6,PSBX IF ASSURE A ZERO WORD, RETURN
  582. BX6 X6-X6
  583. SA6 A6+B1
  584. EQ PSBX RETURN
  585. RMC SPACE 4,15
  586. ** RMC - READ MODIFIED COMMAND.
  587. *
  588. * ENTRY (A0) = COMMAND LINE TO BE REENTERED.
  589. *
  590. * EXIT (LINE) = MODIFIED COMMAND.
  591. *
  592. * USES X - 2.
  593. * A - 0, 2.
  594. * B - 2, 6, 7.
  595. *
  596. * CALLS - ACT, MDY, PSB, USB.
  597. *
  598. * MACROS READ, READS, WRITEC.
  599.  
  600.  
  601. RMC SUBR ENTRY/EXIT
  602. SB6 DSTR
  603. SA2 GOFLAG
  604. NZ X2,RMC1 IF */GO* SPECIFIED
  605. WRITEC O,MLINE *MOD: *
  606. READ T
  607. READS T,DSTR,80
  608. RMC1 MX6 2
  609. SA6 B6 SET END OF LINE
  610.  
  611. * UNPACK THE ORIGINAL LINE.
  612.  
  613. SB2 A0
  614. SB3 B0 SELECT NORMAL MODE
  615. SB6 USBFL LENGTH OF UNPACK BUFFER
  616. RJ USB UNPACK TO STRING BUFFER
  617. MX6 59
  618. SA6 B7+B1 ADD END OF LINE TERMINATOR
  619. RJ MDY MODIFY ORIGINAL DATA
  620. SB6 USBB
  621. RJ ACT ADD COMMAND TERMINATOR
  622. SB7 LINE
  623. RJ PSB PACK STRING BUFFER
  624. EQ RMCX RETURN
  625. TSL SPACE 4,15
  626. ** TSL - TRIM SPACES OFF LINE (STRING BUFFER).
  627. *
  628. * ENTRY (A6) = FWA OF END OF LINE CHARACTER.
  629. * (X6) = MASK OF 2.
  630. *
  631. * EXIT LINE TRIMMED.
  632. * (ESTR-1) = NEW LINE LENGTH.
  633. *
  634. * USES X - 1, 6.
  635. * A - 1, 6.
  636. * B - 2.
  637.  
  638.  
  639. TSL SUBR ENTRY/EXIT
  640. SB2 A6
  641. TSL1 SB2 B2-B1 POSITION BACK TO NEXT CHARACTER
  642. LE B2,B6,TSL2 IF AT START OF LINE - 1
  643. SA1 B2
  644. SX1 X1-1R
  645. ZR X1,TSL1 IF CHARACTER WAS A BLANK
  646. TSL2 SA6 B2+B1 PUT NEW END CHARACTER
  647. SX6 B2-B6 GET NEW LENGTH
  648. SA6 B6+ SET NEW LENGTH
  649. EQ TSLX RETURN
  650. WOC SPACE 4,10
  651. ** WOC - WRITE OUT COMMAND.
  652. *
  653. * ENTRY (A0) = COMMAND WITH ZERO BYTE ON END.
  654. * (X2) = 6LXXXXXX PREFIX MESSAGE.
  655. *
  656. * USES X - 1, 2, 3, 4, 5, 6, 7.
  657. * A - 1, 3, 6.
  658. * B - 6.
  659. *
  660. * MACROS WRITEC.
  661.  
  662.  
  663. WOC SUBR ENTRY/EXIT
  664. SA1 GOFLAG
  665. NZ X1,WOCX IF */GO* SPECIFIED DO N0T DISPLAY
  666. SB6 B0
  667. SA3 A0
  668. MX7 36
  669. WOC1 MX4 -12
  670. BX5 -X4*X3 EXTRACT END OF LINE INDICATOR
  671. LX3 24
  672. BX4 -X7*X3
  673. BX6 X4+X2
  674. SA6 DLINE+B6
  675. SB6 B6+B1
  676. BX2 X7*X3
  677. SA3 A3+B1 NEXT WORD FROM LINE
  678. NZ X5,WOC1 IF NOT END OF LINE
  679. BX6 X2
  680. SA6 DLINE+B6
  681. WRITEC O,DLINE OUTPUT COMMAND LINE
  682. EQ WOCX RETURN
  683. SPACE 4,10
  684. * COMMON DECKS.
  685.  
  686. *CALL COMCCIO
  687. *CALL COMCRDC
  688. *CALL COMCRDS
  689. *CALL COMCRDW
  690. *CALL COMCSFM
  691. *CALL COMCSYS
  692. USBL$ EQU 1 SELECT EXTERNAL UNPACK BUFFER
  693. *CALL COMCUSB
  694. *CALL COMCWTC
  695. *CALL COMCWTW
  696. SPACE 4,10
  697. * BUFFERS.
  698.  
  699. USE BUFFERS FLUSH LITERALS
  700. TBUF EQU * TERMINAL INPUT BUFER
  701. IBUF EQU TBUF+IBUFL DAYFILE BUFFER
  702. OBUF EQU IBUF+BUFL OUTPUT BUFFER
  703. CBUF EQU OBUF+OBUFL SAVED TAIL OF DAYFILE
  704. TITLE PRESET.
  705. ** PRS - GET PARAMETER VALUE.
  706. *
  707. * ENTRY (CCDR)-(CCDR+7) = *REDO* COMMAND.
  708. *
  709. * EXIT (ARGV) = ARGUMENT VALUE.
  710. * (ARGM) = ARGUMENT MASK.
  711.  
  712.  
  713. PRS SUBR ENTRY/EXIT
  714. SB1 1
  715. SB2 CCDR AREA TO UNPACK
  716. SB6 USBFL LENGTH OF UNPACK BUFFER
  717. SB3 0 SELECT *NORMAL* CHARACTER SET
  718. RJ USB UNPACK TO STRING BUFFER
  719. MX6 59
  720. SA6 B7+B1 MARK END OF TEXT
  721. SA2 B7+
  722. SX1 X2-1R.
  723. NZ X1,PRS1 IF NOT A TERMINATOR
  724. SA2 A2-B1 BACK UP ONE
  725. PRS1 SA1 A2-B1
  726. LX1 6
  727. IX2 X1+X2
  728. SX2 X2-2RGO
  729. NZ X2,PRS2 IF CANNOT BE */GO*
  730. SA1 A1-B1
  731. SX2 X1-1R/
  732. NZ X2,PRS2 IF NOT */GO*
  733. SA6 A1+ CHOP OFF */GO*
  734. SA6 GOFLAG MARK *GO* SELECTED
  735. PRS2 SB6 USBB
  736. BX6 X6-X6
  737. MX7 0
  738. SB5 B0+
  739. SB3 54
  740. SB2 6
  741. PRS3 SA1 B6
  742. NG X1,PRS8 IF NO PARAMETERS
  743. SX2 X1-1R.
  744. ZR X2,PRS8 IF NO PARAMETERS
  745. SX2 X1-1R,
  746. ZR X2,PRS4 IF START OF PARAMETER
  747. SX2 X1-1R(
  748. ZR X2,PRS4 IF START OF PARAMETER
  749. SB6 B6+B1
  750. EQ PRS3 CONTINUE
  751.  
  752. PRS4 SB6 B6+B1
  753. SA1 B6
  754. NG X1,PRS7 IF REAL END OF COMMAND
  755. SX2 X1-1R.
  756. ZR X2,PRS6 IF POSSIBLE TERMINATOR
  757. SX2 X1-1R
  758. ZR X2,PRS4.1 IF A BLANK
  759. SX2 X1-1R*
  760. NZ X2,PRS5 IF NOT AN ASTERISK
  761. PRS4.1 NZ B5,PRS5 IF NOT LEADING
  762. SX7 1 MARK LEADING BLANKS ACCEPTABLE
  763. SA7 LBFLAG
  764. EQ PRS4 CONTINUE, IGNORING ASTERISK OR BLANK
  765.  
  766. PRS5 LX1 X1,B3
  767. BX6 X6+X1 COLLECT NEXT CHARACTER OF PARAMETER
  768. SB5 B5+B2
  769. SB3 B3-B2 DECREMENT SHIFT POSITION BY 6
  770. NG B3,PRS7 IF TEN CHARACTERS COLLECTED
  771. EQ PRS4 CONTIINUE
  772.  
  773. PRS6 SA3 B6+B1
  774. NG X3,PRS7 IF REAL TERMINATOR
  775. ZR X3,PRS7 IF REAL TERMINATOR
  776. SX3 X3-1R
  777. NZ X3,PRS5 IF FOLLOWED BY NON-BLANK, GO ON
  778.  
  779. * GET ARGUMENT AND BUILD ARGUMENT MASK.
  780.  
  781. PRS7 SB4 B5-1
  782. MX7 1
  783. AX7 X7,B4
  784. PRS8 SA7 ARGM SET UP ARGUMENT MASK
  785. SA6 ARGV SAVE ARGUMENT VALUE
  786. SA2 TIOPTR
  787. BX6 X2
  788. MX7 0
  789. SA6 ARGR SET UP RA+2 FILES LIST
  790. SA7 A6+1
  791. SYSTEM RPV,R,RPVBLK,1
  792.  
  793. * REPLACE *MLINE*, *OLD*, AND *NEW*.
  794.  
  795. SX2 00B
  796. SA1 CSMR
  797. NG X1,PRS9 IF 64 CHARACTER SET
  798. SX2 63B
  799. LX2 36
  800. PRS9 MX7 -6
  801. LX7 36
  802. SA1 MLINE CLEAR *MLINE*
  803. BX6 X7*X1
  804. BX6 X6+X2
  805. SA6 A1
  806. SA1 REDA CLEAR *OLD*
  807. BX6 X7*X1
  808. BX6 X6+X2
  809. SA6 A1
  810. SA1 REDB CEAR *NEW*
  811. BX6 X7*X1
  812. BX6 X6+X2
  813. SA6 A1
  814. SA2 JOPR CHECK ORGIN TYPE
  815. MX0 -12
  816. LX2 -24
  817. BX3 -X0*X2
  818. SX6 X3-IAOT
  819. ZR X6,PRSX IF INTERACTIVE JOB
  820. SA6 GOFLAG FORCE *GO* OPTION
  821. EQ PRSX RETURN
  822. SPACE 4,10
  823. LWA EQU *
  824. ARG= EQU * DEFINE ARG= ENTRY POINT
  825. SDM= EQU *
  826. RFL= EQU CBUF+BUFL
  827. ERRNG RFL=-LWA PRESET EXCEEDS BUFFERS
  828. SPACE 4,10
  829. END
cdc/nos2.source/opl871/redo.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator