User Tools

Site Tools


plato:source:plaopl:ecprt

Table of Contents

ECPRT

Table Of Contents

  • [00003] ECPRT ECS DUMP INTERPRETER
  • [00004] DEFINITIONS
  • [00039] LOCAL MACROS
  • [00077] INITIALIZATIONS
  • [00200] FORMAT AND PRINT ECS DUMP
  • [00389] OUTPUT ROUTINES
  • [00456] COMMON DECKS
  • [00471] STORAGE DEFINITIONS

Source Code

ECPRT.txt
  1. ECPRT
  2. IDENT ECPRT,111B,ECPRT
  3. TITLE ECPRT ECS DUMP INTERPRETER
  4. TITLE DEFINITIONS
  5. *
  6. * COMMENT COPYRIGHT CONTROL DATA CORP. 1978.
  7. *COMMENT ECPRT - PLATO ECS DUMP PRINTER.
  8. *
  9. * **************************************************
  10. *
  11. *
  12. * CONTROL CARD FORMAT -
  13. *
  14. * ECPRT(DUMP FILE,FWA,LWA)
  15. *
  16. *
  17. * THIS PROGRAM ASSUMES THE DUMP FILE HAS BEEN
  18. * DUMPED USING ECDMP OR THE CONTENTS CONSISTS
  19. * OF A SERIES OF 1000B WORD RECORDS WITH A
  20. * HEADER RECORD CONTAINING THE JOB NAME, DATE
  21. * AND TIME OF THE DUMP.
  22. *
  23. *
  24. * **************************************************
  25. *
  26. *
  27. ABS
  28. SST
  29. SYSCOM B1
  30. *
  31. *
  32. *CALL COMCMAC
  33. *
  34. *
  35. DDSIZ EQU 1000B DUMP FILE BLOCK SIZE (WORDS)
  36. DDSEC EQU DDSIZ/100B+1 BLOCK SIZE (SECTORS)
  37. CIOLTH EQU DDSIZ+1 DUMP FILE CIO BUFFER SIZE
  38. CIOLTH1 EQU 301B OUTPUT FILE CIO BUFFER SIZE
  39. TITLE LOCAL MACROS
  40. *
  41. *
  42. * OUTPUT - PRINT LINE OF OUTPUT
  43. *
  44. * P1 = ADDRESS OF STRING TO BE PRINTED
  45. *
  46. PURGMAC OUTPUT
  47. OUTPUT MACRO P1
  48. SB2 P1
  49. RJ WRITE
  50. ENDM
  51. *
  52. *
  53. * PACK - PACK CHARACTER BUFFER INTO WORD BUFFER
  54. *
  55. * P1 = ADDRESS OF CHARACTER BUFFER
  56. * P2 = ADDRESS OF WORD BUFFER
  57. *
  58. PURGMAC PACK
  59. PACK MACRO P1,P2
  60. SB2 P1
  61. SB3 P2
  62. RJ PACK
  63. ENDM
  64. *
  65. *
  66. * UNPACK - UNPACK WORD BUFFER INTO CHARACTER BUFFER
  67. *
  68. * P1 = ADDRESS OF WORD BUFFER
  69. * P2 = ADDRESS OF CHARACTER BUFFER
  70. *
  71. PURGMAC UNPACK
  72. UNPACK MACRO P1,P2
  73. SB2 P1
  74. SB3 P2
  75. RJ UNPACK
  76. ENDM
  77. TITLE INITIALIZATIONS
  78. *
  79. *
  80. *
  81. ORG 111B
  82. *
  83. ENTRY ECPRT
  84. ENTRY ARG= CRACK OWN CONTROL CARD
  85. ARG= EQU *
  86. *
  87. ECPRT SB1 1
  88. *
  89. * CRACK CONTROL CARD - IMAGE IS IN *CCDR*
  90. *
  91. UNPACK CCDR,CHARS
  92. *
  93. * ZERO ALL DELIMITING CHARACTERS SO PACK WILL WORK
  94. *
  95. SA1 CHARS-1
  96. SX2 1R(
  97. SX3 1R,
  98. SX4 1R.
  99. SX5 1R)
  100.  
  101. CCC1 SA1 A1+B1 GET NEXT CHARACTER
  102. ZR X1,CCCX END-OF-LINE
  103. IX6 X1-X4
  104. NZ X6,CCC3 NOT EOL DELIMITER
  105. CCC2 SA6 A1 CLEAR CHARACTER
  106. EQ CCCX
  107.  
  108. CCC3 IX6 X1-X5
  109. ZR X6,CCC2 IF EOL DELIMITER
  110. IX6 X1-X2
  111. ZR X6,CCC4 IF DELIMITER
  112. IX6 X1-X3
  113. ZR X6,CCC4 IF DELIMITER
  114. EQ CCC1 GET NEXT CHARACTER
  115.  
  116. CCC4 SA6 A1 CLEAR DELIMITER
  117. EQ CCC1 GET NEXT CHARACTER
  118.  
  119. CCCX PACK CHARS,WORK PACK UP STATEMENT NAME (*ECPRT*)
  120. SB2 B2+B1 ADVANCE CHARACTER POINTER
  121. PACK B2,ARGR PACK DUMP FILE NAME
  122. SB2 B2+B1
  123. PACK B2,ARGR+1 PACK FWA OF DUMP
  124. SB2 B2+B1
  125. PACK B2,ARGR+2 PACK LWA OF DUMP
  126. *
  127. * PROCESS 1ST ARGUMENT = DUMP FILE NAME
  128. *
  129. MX0 42 X0 = ARGUMENT MASK
  130. SA1 ARGR LOAD DUMP FILE ARGUMENT
  131. BX1 X0*X1
  132. ZR X1,ARGERR
  133. SA2 DFET
  134. BX2 -X0*X2 CLEAR OUT FILE NAME IN FET
  135. BX6 X1+X2
  136. SA6 A2 SET FILE NAME IN 1ST WD OF FET
  137. *
  138. * PROCESS 2ND ARGUMENT = FWA FOR PRINT
  139. *
  140. SA1 ARGR+1 LOAD FWA ARGUMENT
  141. MX0 48
  142. BX5 X0*X1
  143. SB7 B0 OCTAL DIGITS ONLY
  144. RJ DXB CONVERT TO OCTAL
  145. NZ X4,ARGERR IF CONVERSION ERROR
  146. NG X6,ARGERR IF BAD ADDRESS
  147. * MUST ROUND ADDRESS DOWN TO NEAREST 4 WORDS TO BE
  148. * SURE THAT BLOCK BOUNDARIES OCCUR AT END OF LINE
  149. AX6 2 ROUND TO 4 WORD BLOCK
  150. LX6 2
  151. SA6 DFWA SET FWA OF ECS PRINT
  152. *
  153. * PROCESS 3RD ARGUMENT = LWA OF PRINT
  154. *
  155. MX0 48
  156. SA1 ARGR+2 LOAD LWA ARGUMENT
  157. BX5 X0*X1
  158. SB7 B0 OCTAL DIGITS ONLY
  159. RJ DXB CONVERT TO OCTAL
  160. NZ X4,ARGERR IF CONVERSION ERROR
  161. NG X6,ARGERR IF BAD ADDRESS
  162. * MUST ROUND ADDRESS UP TO NEAREST 4 WORDS TO BE
  163. * SURE THAT BLOCK BOUNDARIES OCCUR AT END OF LINE
  164. SX1 3
  165. IX6 X6+X1
  166. AX6 2
  167. LX6 2
  168. SA6 DLWA SET LWA OF ECS PRINT
  169. SA1 DFWA
  170. IX1 X1-X6 CHECK LWA LEGAL
  171. PL X1,ARGERR
  172. *
  173. *
  174. * OPEN INPUT / OUTPUT FILES
  175. *
  176. OPEN DFET,READNR,RECALL
  177. RECALL DFET
  178. REWIND DFET MAKE SURE AT FIRST RECORD
  179. RECALL DFET
  180. READ DFET READ HEADER RECORD
  181. RECALL DFET
  182. OPEN OUTPUT,WRITENR,RECALL
  183. *
  184. SA1 DFWA SET CURRENT BLOCK NUMBER
  185. BX6 X1
  186. AX6 9
  187. SA6 DII
  188. SA1 DFWA SET WORD POINTER
  189. MX0 -9
  190. BX6 -X0*X1
  191. SA6 DJJ
  192. EQ PRT100
  193. *
  194. *
  195. ARGERR MESSAGE ARGMES,0,RECALL
  196. ENDRUN
  197. *
  198. ARGMES DIS ,*ARGUMENT ERROR*
  199. *
  200. TITLE FORMAT AND PRINT ECS DUMP
  201. *
  202. *
  203. *
  204. * FORMAT AND PRINT DUMP HEADER
  205. *
  206. PRT100 OUTPUT EJECT
  207. OUTPUT MARG
  208. UNPACK MARG,CHARS
  209. UNPACK HEADER1,B3
  210. UNPACK CIOBUFF,B3 SET JOB NAME
  211. UNPACK HEADER2,B3
  212. MX6 0
  213. SA6 WORK+1 INSURE END-OF-LINE
  214. SA1 CIOBUFF+1
  215. BX6 X1 SET DATE OF DUMP
  216. SA6 WORK
  217. UNPACK WORK,B3
  218. SA1 CIOBUFF+2
  219. BX6 X1 SET TIME OF DUMP
  220. SA6 WORK
  221. UNPACK WORK,B3
  222. PACK CHARS,LINE
  223. OUTPUT LINE
  224. OUTPUT MARG
  225. EQ PRT210
  226. *
  227. *
  228. * READ NEXT BLOCK FROM DUMP FILE
  229. *
  230. PRT200 SA1 DII INCREMENT CURRENT BLOCK NUMBER
  231. SX6 B1
  232. IX6 X1+X6
  233. SA6 A1
  234. MX6 0 RESET WORD POINTER
  235. SA6 DJJ
  236. *
  237. PRT210 MX0 42 SET UP CIO FET POINTERS
  238. SX7 CIOBUFF
  239. SA7 DFET+2 IN = CIO BUFFER
  240. SA7 A7+B1 OUT = CIO BUFFER
  241. SA1 DII CURRENT BLOCK NUMBER
  242. SX6 DDSEC SECTORS/DUMP BLOCK
  243. IX6 X1*X6
  244. SX1 2 SYSTEM AND HEADER SECTORS
  245. IX6 X6+X1
  246. SA6 DFET+6 SET RELATIVE SECTOR ADDRESS
  247. READ DFET,R READ BLOCK
  248. RECALL DFET
  249. SA1 DFET+2 CHECK FOR EMPTY RECORD
  250. SX2 X1-CIOBUFF
  251. ZR X2,PRT900 IF END OF RECORD/FILE ONLY
  252. *
  253. *
  254. * CHECK FOR ECS PARITY ERROR RECORD
  255. *
  256. SA1 CIOBUFF
  257. SA2 ERR
  258. BX1 X1-X2
  259. NZ X1,PRT230 IF NOT ECS ERROR RECORD
  260. SA1 A1+B1
  261. SA2 A2+B1
  262. BX1 X1-X2
  263. NZ X1,PRT230 IF NOT ECS ERROR RECORD
  264. OUTPUT ECSMES
  265. SX6 DDSIZ SKIP THIS BLOCK
  266. SA6 DJJ
  267. EQ PRT270
  268. *
  269. *
  270. ERR DIS ,/*** ECS ERROR ***/
  271. *
  272. *
  273. * FORMAT AND PRINT NEXT BLOCK OF DUMP FILE
  274. *
  275. PRT230 UNPACK FIRST,CHARS
  276. SB7 B3 B7 = POINTER TO NEXT CHARACTER
  277. SA1 DII CURRENT BLOCK NUMBER
  278. LX1 9 FWA OF CURRENT BLOCK
  279. SA2 DJJ COMPUTE CURRENT WORD ADDRESS
  280. SX0 X2-DDSIZ
  281. PL X0,PRT200 IF DONE WITHTHIS BLOCK
  282. SB6 X2 B6 = CURRENT WORD POINTER
  283. IX1 X1+X2
  284. RJ WOD CONVERT ADDRESS TO OCTAL
  285. MX0 48
  286. LX7 12 POSITION LAST 8 DIGITS
  287. BX7 X0*X7
  288. SA7 WORK
  289. UNPACK WORK,B7
  290. UNPACK MARG,B3
  291. SB7 B3 B7 = POINTER TO NEXT CHAR
  292. MX7 0
  293. SA7 WORK+2 INSURE END-OF-LINE
  294. SB5 4 B5 = END TEST WITHIN LINE
  295. *
  296. PRT240 SA1 B6+CIOBUFF
  297. BX6 X1
  298. SA6 B5+THIS-1 SAVE CURRENT LINE CONTENTS
  299. RJ WOD CONVERT NEXT WORD TO OCTAL
  300. SA6 WORK
  301. SA7 WORK+1
  302. UNPACK WORK,B7
  303. UNPACK FIRST,B3
  304. SB7 B3 B7 = POINTER TO NEXT CHARACTER
  305. SB6 B6+B1 ADVANCE WORD POINTER
  306. SB5 B5-B1
  307. NZ B5,PRT240
  308. UNPACK FIRST,B3
  309. SB5 4 RE-SET END-TEST
  310. SB6 B6-4 RE-SET WORD POINTER
  311. *
  312. PRT250 SA1 B6+CIOBUFF
  313. RJ ZTB CHANGE ZERO CODES TO BLANKS
  314. SA6 WORK+1
  315. UNPACK WORK+1,B3
  316. SB6 B6+B1 ADVANCE WORD POINTER
  317. SB5 B5-B1
  318. NZ B5,PRT250
  319. SX6 B6 UPDATE WORD POINTER
  320. SA6 DJJ
  321. PACK CHARS,LINE
  322. *
  323. *
  324. * COMPARE LAST LINE PRINTED AND CURRENT LINE TO
  325. * SEE IF WE SHOULD START/CONTINUE SKIPPING LINES
  326. *
  327. SA1 LINES
  328. ZR X1,PRT260 ALWAYS PRINT FIRST LINE
  329. SB2 3
  330. *
  331. PRT251 SA1 LAST+B2
  332. SA2 THIS+B2
  333. BX2 X1-X2
  334. NZ X2,PRT260 IF NOT SAME AS LAST LINE
  335. SB2 B2-B1
  336. PL B2,PRT251
  337. SA1 SKIP
  338. NZ X1,PRT270 IF ALREADY SKIPPING LINES
  339. SX6 B1 FLAG LINES BEING SKIPPED
  340. SA6 A1
  341. OUTPUT DUPMES
  342. EQ PRT270
  343. *
  344. PRT260 OUTPUT LINE OUTPUT NEXT LINE
  345. SA1 LINES INCREMENT LINE COUNT
  346. SX6 B1
  347. IX6 X1+X6
  348. SA6 A1
  349. SB2 3 MOVE THIS LINE TO LAST PRINTED
  350. *
  351. PRT261 SA1 THIS+B2
  352. BX6 X1
  353. SA6 LAST+B2
  354. SB2 B2-B1
  355. PL B2,PRT261
  356. MX6 0 NOT SKIPPING LINES
  357. SA6 SKIP
  358. *
  359. PRT270 SA1 DII COMPUTE CURRENT DUMP ADDRESS
  360. LX1 9
  361. SA2 DJJ
  362. IX6 X1+X2
  363. SA2 DLWA CHECK IF END OF SPECIFIED AREA
  364. IX0 X2-X6
  365. PL X0,PRT230
  366. *
  367. *
  368. * END OF PRINT - CLOSE INPUT/OUTPUT FILES
  369. *
  370. PRT900 OUTPUT MARG
  371. UNPACK MARG,CHARS
  372. SA1 LINES
  373. RJ WOD
  374. SA7 WORK
  375. MX6 0
  376. SA6 A7+B1
  377. UNPACK WORK,B3
  378. UNPACK LINMES,B3
  379. PACK CHARS,LINE
  380. OUTPUT LINE
  381. WRITER OUTPUT,RECALL
  382. CLOSE OUTPUT,NR,RECALL
  383. CLOSE DFET,NR,RECALL
  384. MESSAGE ENDMES,1,RECALL
  385. ENDRUN
  386. *
  387. ENDMES DIS ,*PRINT COMPLETE*
  388. *
  389. TITLE OUTPUT ROUTINES
  390. *
  391. *
  392. *
  393. * -WRITE- WRITE TO OUTPUT FILE
  394. * ON ENTRY - B2 = ADDRESS OF LINE TO OUTPUT
  395. *
  396. WRITE EQ *
  397. SA1 B2 CHECK FOR EMPTY LINE
  398. ZR X1,WRITE
  399. SX5 B2 X5 = ADDRESS OF LINE
  400. WRITEC OUTPUT,X5 WRITE LINE TO OUTPUT FILE
  401. EQ WRITE
  402. *
  403. *
  404. *
  405. * -UNPACK- UNPACK CHARACTERS
  406. * ON ENTRY - B2 = ADDRESS TO UNPACK FROM
  407. * B3 = ADDRESS TO UNPACK TO
  408. *
  409. UNPACK EQ *
  410. MX0 -6 X0 = MASK FOR NEXT CHARACTER
  411. *
  412. UNP10 SA1 B2 LOAD NEXT PACKED TEXT WORD
  413. SB2 B2+B1
  414. SB4 10 INITIALIZE CHARACTER COUNT
  415. *
  416. UNP20 SB4 B4-B1 CHECK CURRENT WORD EMPTY
  417. NG B4,UNP10
  418. LX1 6 POSITION NEXT CHARACTER
  419. BX6 -X0*X1
  420. SA6 B3 STORE NEXT CHARACTER
  421. ZR X6,UNP30 CHECK FOR END-OF-LINE
  422. SB3 B3+B1 ADVANCE OUTPUT POINTER
  423. EQ UNP20
  424. *
  425. UNP30 SA6 A6+B1 STORE END-OF-LINE
  426. SA6 A6+B1
  427. EQ UNPACK
  428. *
  429. *
  430. *
  431. * -PACK- PACK CHARACTERS
  432. * ON ENTRY - B2 = ADDRESS TO PACK FROM
  433. * B3 = ADDRESS TO PACK TO
  434. *
  435. PACK EQ *
  436. PCK10 SB4 60-6 INITIALIZE SHIFT COUNT
  437. MX6 0 INITIALIZE WORD BUILDING
  438. *
  439. PCK20 SA1 B2 LOAD NEXT CHARACTER
  440. ZR X1,PCK30
  441. SB2 B2+B1 ADVANCE INPUT POINTER
  442. LX1 X1,B4 POSITION CHARACTER
  443. BX6 X1+X6
  444. SB4 B4-6 DECREMENT SHIFT COUNT
  445. PL B4,PCK20
  446. SA6 B3 STORE PACKED WORD
  447. SB3 B3+B1 ADVANCE OUTPUT POINTER
  448. EQ PCK10
  449. *
  450. PCK30 SA6 B3 STORE LAST WORD
  451. MX6 0
  452. SA6 A6+B1 INSURE END-OF-LINE
  453. EQ PACK
  454. *
  455. *
  456. TITLE COMMON DECKS
  457. LIST -X
  458. *
  459. *CALL COMCSYS
  460. *CALL COMCCIO
  461. *CALL COMCWTW
  462. *CALL COMCRDW
  463. *CALL COMCWTC
  464. *CALL COMCWOD
  465. *CALL COMCDXB
  466. *CALL COMCZTB
  467. *
  468. LIST *
  469. *
  470. *
  471. TITLE STORAGE DEFINITIONS
  472. *
  473. *
  474. *
  475. DFWA BSS 1 FWA OF DUMP AREA
  476. DLWA BSS 1 LWA OF DUMP AREA
  477. DII BSS 1 CURRENT BLOCK NUMBER
  478. DJJ BSS 1 WORD POINTER
  479. *
  480. WORK BSSZ 100B
  481. *
  482. HEADER1 DIS ,* DUMP OF *
  483. HEADER2 DIS ,* DUMPED ON *
  484. ECSMES DIS ,* DATA LOST DUE TO ECS ERROR*
  485. DUPMES DIS ,* DUPLICATED LINES*
  486. LINMES DIS ,*B LINES PRINTED*
  487. EJECT DATA 1L1 PAGE EJECT
  488. FIRST DATA 1L FIRST CHARACTER OF EACH LINE
  489. MARG DATA 2L MARGIN
  490. CHARS BSSZ 200
  491. LINE BSSZ 20
  492. THIS BSSZ 4 CONTENTS OF THIS LINE
  493. LAST BSSZ 4 CONTENTS OF LAST LINE PRINTED
  494. SKIP BSSZ 1 NON-ZERO IF SKIPPING LINES
  495. LINES BSSZ 1 LINES PRINTED
  496. *
  497. DFET RFILEB CIOBUFF,CIOLTH,FET=14
  498. OUTPUT FILEB CIOBUF1,CIOLTH1,FET=14B
  499. *
  500. CIOBUFF BSS CIOLTH
  501. *
  502. CIOBUF1 BSS CIOLTH1
  503. *
  504. *
  505. *
  506. ENTRY RFL=
  507. *
  508. RFL= END
plato/source/plaopl/ecprt.txt ยท Last modified: 2023/08/05 18:54 by Site Administrator