Table of Contents

COND

Table Of Contents

  • [00010] NON-OVERLAYABLE ROUTINES
  • [00044] CMPGO - CENTRAL MICRO PLATO INITIATION.
  • [00206] ROD - RESTORE ORIGINAL DIRECTORY.
  • [00253] SOD - SAVE ORIGINAL DIRECTORY.
  • [00365] -ABORTC- ABORT CONDENSE
  • [00417] DISK I/O ROUTINES
  • [00432] CPF - CLOSE PLATO FILE
  • [00452] -MASREQ- ISSUE / WAIT FOR *MASTOR*.
  • [00537] CONDENSOR SUBROUTINES
  • [00539] -UNNAM- GET CURRENT UNIT NAME
  • [00599] -LJUST- LEFT JUSTIFY NAME
  • [00650] BIT TABLE MANIPULATION
  • [00684] RCTOXY
  • [00823] KEY LIST
  • [01203] EBH - ERROR BUFFER HEADER.
  • [01242] OVERLAY LOADING SUBROUTINES.
  • [01244] LLD - LOAD A LEVEL FROM DISK.
  • [01329] IOL - INITIALIZE FOR OVERLAY LOADING.
  • [01464] RMS - READ MASS STORAGE.
  • [01626] BLV - BEGIN LEVEL.
  • [01699] PCS - PROCESS CMP SUBOVERLAYS.
  • [01808] WCS - WRITE CMP SUBOVERLAYS TO EM.
  • [01895] PSO - PROCESS SUBOVERLAYS.
  • [02003] WSE - WRITE SUBOVERLAYS TO EM.
  • [02078] ELV - END LEVEL.
  • [02210] INITIALIZE COMINFO (THE HASH INFO TABLE)
  • [02371] ZEROSAV - SAVE REGISTERS USED BY *ZERO* MACRO
  • [02394] ZERORST - RESTORE REGISTERS USED BY *ZERO* MACRO

Source Code

COND.txt
  1. COND
  2. * /--- FILE TYPE = E
  3. * /--- BLOCK IDENT 00 000 81/07/14 07.27
  4. IDENT COND
  5.  
  6. SYSCOM
  7.  
  8. *CALL PLASIJP
  9.  
  10. TITLE NON-OVERLAYABLE ROUTINES
  11.  
  12. CST
  13. * /--- BLOCK VARS 00 000 81/07/28 01.29
  14. * FROM CONDC
  15. ENTRY OLDCMND
  16. OLDCMND VFD 60/55555555555555550000B HOLDS PREVIOUS COMMAND
  17. *
  18. *
  19. ENTRY CLINES
  20. CLINES DATA 0 COUNTER FOR LINES CONDENSED
  21.  
  22. * FROM GETLIN
  23. ENTRY ISTSAV,IENDSAV
  24. ISTSAV BSS 1
  25. IENDSAV BSS 1
  26. *
  27. * FROM CALCS
  28. *
  29. ENTRY CALCACT,NLABELS
  30. CALCACT BSS 1 -1 WHEN -CALC- IS ACTIVE
  31. NLABELS BSS 1 LENGTH OF LABEL TABLE
  32. * /--- BLOCK LEVEL 00 000 81/08/21 23.02
  33. ENTRY CONDENS
  34. CONDENS EQ *
  35. SB1 1 INITIAL ENTRY
  36. SX7 LEVEL0
  37. EQ LEXEC
  38.  
  39. ENTRY MTFIN
  40. MTFIN SB1 2 FINISH UP AFTER MICRO-TUTOR
  41. SX7 LEVEL0
  42. EQ LEXEC
  43. CMPGO SPACE 4,10
  44. ** CMPGO - CENTRAL MICRO PLATO INITIATION.
  45. *
  46. * LOAD AND EXECUTE THE CENTRAL MICRO PLATO OVERLAY.
  47. *
  48. * THE OVERLAY RETURNS CONTROL TO *CMPGOX* HERE WITH
  49. * (X5) = TERMINATION CONDITION.
  50. *
  51. * THE MICRO PLATO PORTION OF THE FILE THAT WAS JUST
  52. * CONDENSED IS TRANSLATED INTO AN EQUIVALENT TUTOR
  53. * LESSON IN FILE *S0CMPN* WHERE N = THE CONDENSOR ORDINAL.
  54. * IF THERE WERE NO ERRORS, *S0CMPN* IS CONDENSED.
  55. *
  56. * THE CONDENSOR COMMAND STATISTICS FLAG *TSCOMFG*
  57. * IS SAVED AND RESTORED. IT IS SET TO OFF DURING
  58. * THE CMP PHASE.
  59.  
  60.  
  61. ENTRY CMPGOX
  62.  
  63. * RESTORE THE CONDENSOR COMMAND STATISTICS FLAG.
  64.  
  65. CMPGOX SA1 CMPGOA
  66. BX6 X1
  67. SA6 TSCOMFG
  68.  
  69. * CHECK FOR ERRORS.
  70.  
  71. SA1 APLACOM
  72. SA5 CMPGOB+X5
  73. NZ X5,CMPGO1 IF ERRORS
  74.  
  75. * SUBSTITUTE THE TRANSLATED FILE FOR THE SOURCE FILE.
  76.  
  77. SX0 PC.SRCF
  78. SA0 CMP.OF ((A0)) = TRANSLATED FILE NAME.
  79. IX0 X0+X1
  80. + WE 1
  81. RJ =XECSPRTY
  82.  
  83. * SAVE THE USERS FILE DIRECTORY, TO BE RESTORED
  84. * AFTER THE CONDENSE.
  85.  
  86. RJ SOD
  87.  
  88. * USE THE CURRENT BINARY BUFFER EM FWA AND LENGTH FOR
  89. * THIS CONDENSE. IF THE ORIGINAL CONDENSE PRODUCED A
  90. * BINARY LONGER THAN 8K, A DIFFERENT BUFFER IS IN USE
  91. * NOW.
  92.  
  93. SA1 APLACOM
  94. SX0 PC.BADR
  95. SA0 CONBUFF ((A0)) = BINARY BUFFER EM FWA
  96. IX0 X0+X1
  97. + WE 1
  98. RJ =XECSPRTY
  99. SX0 PC.BLTH
  100. SA0 CBLTH ((A0)) = BINARY BUFFER LENGTH
  101. IX0 X0+X1
  102. + WE 1
  103. RJ =XECSPRTY
  104.  
  105. * MAKE S0CMP A SYSTEM LESSON.
  106.  
  107. MX6 60
  108. SX0 PC.SYS
  109. IX0 X0+X1
  110. WX6 X0
  111.  
  112. * CONDENSE *S0CMP*.
  113.  
  114. RJ =XCONDENS
  115.  
  116. * RESTORE THE USER'7S FILE DIRECTORY.
  117.  
  118. RJ ROD
  119.  
  120. ENTRY CMPGO
  121.  
  122. CMPGO PS ENTRY/EXIT
  123.  
  124. * CHECK IF CENTRAL EXECUTION SELECTED.
  125.  
  126. SA1 CMPF
  127. ZR X1,CMPGO RETURN IF NOT SELECTED
  128.  
  129. * CHECK IF THE MICRO PLATO CONDENSE WAS COMPLETED.
  130.  
  131. SA2 PLREQC
  132. * /--- BLOCK LEVEL 00 000 81/08/21 23.02
  133. SX2 X2-P.DONE
  134. NZ X2,CMPGO IF NOT COMPLETE
  135.  
  136. * CHECK FOR CONDENSE ERRORS.
  137.  
  138. SA2 ERRTOT
  139. NZ X2,CMPGO RETURN IF CONDENSE ERRORS
  140.  
  141. * SAVE AND CLEAR THE CONDENSOR COMMAND STATISTICS FLAG.
  142.  
  143. SA1 TSCOMFG
  144. BX7 X1
  145. SA6 A1
  146. SA7 CMPGOA
  147.  
  148. * LOAD AND EXECUTE THE PRIMARY CMP OVERLAY.
  149.  
  150. SA1 CMPOV10
  151. SB1 1
  152. SX1 X1
  153. BX6 -X1
  154. NG X1,CMPGO3 IF CMP OFF
  155. SX7 A1
  156. EQ LEXEC
  157.  
  158. * CHECK CMP ERROR TYPE.
  159.  
  160. CMPGO1 PL X5,CMPGO2 IF FATAL CMP ERROR
  161.  
  162. * NON-FATAL ERRORS HAVE OCCURRED DURING THE TRANSLATION
  163. * PHASE OF ACMP CONDENSE. RETURN TO PLATO WITH THE
  164. * THESE ERRORS IN THE ERROR BUFFER, WHICH WILL BE
  165. * DISPLAYED BY LESSON *CONDERR*.
  166.  
  167. SX0 PC.INF1
  168. SA0 ERRTOT
  169. IX0 X0+X1
  170. + WE 1
  171. RJ =XECSPRTY
  172. RJ EBH
  173. SX6 P.CMPER
  174. SA6 PLREQC
  175. EQ CMPGO RETURN
  176.  
  177. * A FATAL ERROR HAS OCCURRED DURING THE TRANSLATION
  178. * PHASE OF A CMP CODENSE. SET THE FATAL ERROR CODE,
  179. * WHICH WILL BE USED BY UNIT *FILERR* OF LESSON
  180. * *PLATO*, AND ABORT THE CONDENSE.
  181.  
  182. CMPGO2 SX6 X5+ (X6) = FATAL ERROR CODE
  183. CMPGO3 SA6 IOBUFF
  184. RJ ABORTC
  185. EQ CMPGO RETURN
  186.  
  187. CMPGOA BSS 1
  188.  
  189. * TABLE FOR CATAGORIZING THE CMP TERMINATION CODE.
  190. *
  191. * .LT. 0 - NON-FATAL ERRORS FOR DISPLAY BY LESSON *CONDERR*.
  192. * .EQ. 0 - NO ERRORS.
  193. * .GT. 0 - FATAL ERROR NUMBER FOR UNIT *FILERR* OF
  194. * LESSON *PLATO*.
  195.  
  196. CMPGOB DATA 0 NO ERRORS
  197. DATA 34 OUTPUT FILE OVERFLOW
  198. DATA 35 INPUT / OUTPUT ERROR
  199. DATA 36 ILLEGAL OUTPUT LINE LENGTH
  200. DATA 37 OUTPUT INITIALIZATION ERROR
  201. DATA 38 INPUT INITIALIZATION ERROR
  202. DATA 39 MISSING END OF OUTPUT LINE
  203. DATA -1 UNTRANSLATABLE LESSON
  204.  
  205. ROD SPACE 4,10
  206. ** ROD - RESTORE ORIGINAL DIRECTORY.
  207. *
  208. * ENTRY (ACMPDIR) = SAVED DIRECTORY EM FWA.
  209. *
  210. * EXIT NONE.
  211. *
  212. * USES A - 0, 1.
  213. * B - NONE.
  214. * X - 0, 1.
  215. *
  216. * CALLS ECSPRTY.
  217. *
  218. * MACROS NONE.
  219.  
  220.  
  221. ROD PS ENTRY/EXIT
  222.  
  223. * GET ADDRESS TO WRITE DIRECTORY.
  224.  
  225. SA1 APLACOM
  226. SX0 PC.DIR
  227. * /--- BLOCK LEVEL 00 000 81/08/21 23.02
  228. IX0 X1+X0
  229. SA0 RODA
  230. + RE 1
  231. RJ =XECSPRTY
  232.  
  233. * READ DIRECTORY.
  234.  
  235. SA1 ACMPDIR
  236. BX0 X1
  237. SA0 WORK
  238. + RE 64
  239. RJ =XECSPRTY
  240.  
  241. * WRITE DIRECTORY.
  242.  
  243. SA1 RODA
  244. BX0 X1
  245. + WE 64
  246. RJ =XECSPRTY
  247.  
  248. EQ ROD RETURN
  249.  
  250. RODA BSS 1 DIRECTORY EM FWA
  251.  
  252. SOD SPACE 4,10
  253. ** SOD - SAVE ORIGINAL DIRECTORY.
  254. *
  255. * ENTRY (ACMPDIR) = SAVED ORIGINAL DIRECTORY EM FWA.
  256. *
  257. * EXIT NONE.
  258. *
  259. * USES A - 0, 1.
  260. * B - NONE.
  261. * X - 0, 1.
  262. *
  263. * CALLS ECSPRTY.
  264. *
  265. * MACROS NONE.
  266.  
  267.  
  268. SOD PS ENTRY/EXIT
  269.  
  270. * READ DIRECTORY EM FWA.
  271.  
  272. SA1 APLACOM
  273. SX0 PC.DIR
  274. IX0 X0+X1
  275. SA0 SODA
  276. + RE 1
  277. RJ ECSPRTY
  278.  
  279. * READ DIRECTORY.
  280.  
  281. SA1 SODA
  282. BX0 X1
  283. SA0 WORK
  284. + RE 64
  285. RJ =XECSPRTY
  286.  
  287. * WRITE DIRECTORY.
  288.  
  289. SA1 ACMPDIR
  290. BX0 X1
  291. + WE 64
  292. RJ =XECSPRTY
  293.  
  294. EQ SOD RETURN
  295.  
  296. SODA BSS 1 EM DIRECTORY FWA
  297. MTLOAD SPACE 10,20
  298.  
  299. ENTRY MTLOAD
  300. MTLOAD SA1 MTREL GET RELEASE LEVEL
  301. SB1 1 MINIMUM LEVEL ALLOWED
  302. SB2 X1
  303. LT B2,B1,BADLEV IF LESS THAN MINIMUM ALLOWED
  304. SB3 B1+NLEVEL MAX LEVEL
  305. GE B2,B3,BADLEV IF LEVEL OUT OF RANGE
  306. SB1 B2-B1 OFFSET TO LOAD WORD
  307. SA1 LEVEL+B1
  308. SX1 X1
  309. NG X1,NOLEV IF THIS LEVEL NOT AVAILABLE
  310. SX7 A1
  311. SB1 1 SAME ENTRY FOR ALL LEVELS
  312.  
  313. * LOAD AND EXECUTE THE DESIRED LEVEL.
  314. * (X7) = FWA OF DESIRED OVERLAY INFORMATION WORD .
  315. * (B1) = WORD WITHIN LEVEL TO JUMP TO.
  316.  
  317. LEXEC RJ LLD
  318. SA2 CLEVEL
  319. RJ =XLOADOV
  320. SB2 B1+B2
  321. JP B2
  322.  
  323. * THE SELECTED LEVEL OF MICRO PLATO HAS BEEN
  324. * INTENTIONALLY INHIBITED ON THIS SYSTEM. ABORT
  325. * THIS CONDENSE. -(X1) = ERRO NUMBER FOR UNIT
  326. * FILERR OF LESSON PLATO.
  327.  
  328. NOLEV BX6 -X1 (X6) = ERROR CODE
  329. SA6 IOBUFF
  330. RJ ABORTC
  331. EQ CONDENS END THIS CONDENSE
  332.  
  333. BADLEV SX6 B2
  334. SA6 IOBUFF+1
  335. * /--- BLOCK LEVEL 00 000 78/11/16 00.02
  336. SX6 32
  337. SA6 IOBUFF
  338. RJ ABORTC
  339. EQ =XCONDENS
  340.  
  341.  
  342. ENTRY OVRLTAB,NOVRLYS
  343. OVRLTAB BSS 0
  344. CLEVEL BSSZ 1 ECS COPY OF RUNCFL DURING INITS
  345. SUBOV LEVEL0
  346. LEVEL SUBOV LEVEL1,44
  347. SUBOV LEVEL2
  348. SUBOV LEVEL3
  349. SUBOV LEVEL4
  350. SUBOV LEVEL5
  351. *
  352. * * * LOAD EXPERIMENTAL VERSION OF MICRO PLATO
  353. SUBOV LEVEL6 (WAS LEVEL6,41,DEV)
  354.  
  355. NLEVEL EQU *-LEVEL
  356. SUBOV CMPOV10 PRIMARY CMP OVERLAY OVERLAY
  357. * INFO WORD
  358. NOVRLYS EQU *-OVRLTAB
  359.  
  360. * LIBRARY FILE RANDOM INDEX TABLE.
  361.  
  362. RITAB BSS 0
  363. RIT HERE
  364. * /--- BLOCK -ABORTC- 00 000 81/07/21 01.49
  365. TITLE -ABORTC- ABORT CONDENSE
  366. *
  367. *
  368. * -ABORTC-
  369. * TERMINATES CONDENSE WITHOUT RETURNING A BINARY
  370. *
  371. * ON ENTRY - IOBUFF(0) = ERROR TYPE
  372. * IOBUFF(1) = ANY EXTRA INFORMATION
  373. *
  374. *
  375. ENTRY ABORTC
  376. ABORTC PS ENTRY/EXIT
  377. SA1 APLACOM
  378. SX0 PC.INFO
  379. IX0 X0+X1
  380. SA0 IOBUFF WRITE OUT ERROR INFO
  381. + WE 2
  382. RJ ECSPRTY
  383. SX6 P.ABORT SET PLATO REQUEST CODE
  384. SA6 PLREQC
  385. EQ ABORTC RETURN
  386. *
  387. * /--- BLOCK MASTOR 00 000 81/06/25 23.45
  388. *
  389. MACREF MASTOR$
  390. MASTOR MACRO BUF,REQ,RECALL,P1,P2,P3,P4,P5,P6
  391. MACREF MASTOR
  392. SX6 REQ
  393. SA6 BUF
  394. .P ECHO ,P=(P1,P2,P3,P4,P5,P6),N=(2,3,4,5,6,7)
  395. .N IFC NE,*P**
  396. .M MICRO 1,1, P
  397. .X IFC EQ,*".M"*X*
  398. BX6 P
  399. .X ELSE
  400. SA1 P
  401. BX6 X1
  402. .X ENDIF
  403. SA6 BUF+N
  404. .N ENDIF
  405. .P ENDD
  406. SX1 BUF
  407. RJ =XMASREQ
  408. IFC NE,*RECALL**,2
  409. SX1 BUF
  410. RJ =XMASWAIT
  411. ENDM
  412.  
  413. *
  414. *
  415. * /--- BLOCK CLOSE 00 000 81/07/14 07.12
  416. CLOSE SPACE 5,11
  417. TITLE DISK I/O ROUTINES
  418. *** CLOSE - CLOSE ANY OPEN FILES.
  419.  
  420. ENTRY CLOSE
  421. CLOSE EQ *
  422. SA1 LESNME CHECK IF ANY FILES NEED CLOSING
  423. ZR X1,CLOSE IF NO FILE
  424. SB2 FREQ
  425. RJ CPF CLOSE PLATO FILE
  426. SB2 UREQ
  427. SA1 B2+MS.RDIM+5
  428. ZR X1,CLOSE IF NO USE FILE
  429. RJ CPF CLOSE PLATO FILE
  430. EQ CLOSE EXIT
  431. CPF SPACE 5,11
  432. ** CPF - CLOSE PLATO FILE
  433. *
  434. * ENTRY - (B2) = FILE REQUEST BLOCK
  435.  
  436.  
  437. ENTRY CPF
  438. CPF EQ *
  439. SX1 B2 WAIT FOR PENDING REQUEST
  440. RJ MASWAIT
  441. SA2 B2+MS.RDIM+6 X2 = OPEN ERROR CODE
  442. SX2 X2-8 X2 = 8 IF ALREADY OPENED
  443. ZR X2,CPF10 IF NO NEED TO CLOSE FILE
  444. *
  445. MASTOR B2,MS.CPF,R,B2+MS.RDIM+5
  446. CPF10 BSS 0
  447. BX6 X6-X6 SHOW NO FILE OPEN
  448. SA6 B2+MS.RDIM+5
  449. SA6 B2+MS.RDIM+7 CLEAR THE BAD CODEWORD FLAG
  450. EQ CPF
  451. * /--- BLOCK MASREQ 00 000 81/07/14 07.13
  452. TITLE -MASREQ- ISSUE / WAIT FOR *MASTOR*.
  453. SPACE 5,11
  454. *** MASREQ - ISSUE *MASTOR* REQUEST
  455. *
  456. * ENTRY - (X1) - ADDRESS OF REQUEST BUFFER
  457.  
  458. ENTRY MASREQ
  459. MASREQ EQ *
  460. BX6 X0 SAVE X0, A0
  461. SA6 MASA
  462. SX6 A0
  463. SA6 MASA+1
  464.  
  465. * FIND A FREE MASTOR REQUEST SLOT IN ECS
  466.  
  467. SA2 MASFREE ECS FWA OF NEXT FREE SLOT
  468. SA0 A2
  469. BX0 X2
  470. NZ X2,MASR2 IF THERE IS A FREE SLOT
  471. SA2 400000B FATAL ERROR, NO FREE SLOT
  472. MASR2 RE 1 NEXT FREE ELEMENT TO *MASFREE*
  473. RJ ECSPRTY
  474. SA0 X1
  475. SA1 MASB INDEX IN POINTER BUFFER
  476. WE MS.RDIM WRITE REQUEST TO ECS
  477. RJ ECSPRTY
  478.  
  479. * PLACE A POINTER IN THE CIRCULAR REQUEST BUFFER
  480.  
  481. SX6 X1+1 INCREMENT INDEX
  482. SX0 X6-NMREQ
  483. NG X0,MASR4 IF NO OVERFLOW
  484. SX6 0 RESET
  485. MASR4 SA6 A1 STORE NEW INDEX VALUE
  486. BX6 X2 ECS FWA OF REQUEST
  487. SA6 A0+1 SAVE IN 2ND WORD OF CM COPY
  488. SA2 ACMASRQ
  489. IX0 X1+X2 ADDRESS FOR POINTER WORD
  490. WX6 X0 POST REQUEST TO MASTOR
  491.  
  492. SA1 MASA RESTORE A0/X0
  493. BX0 X1
  494. SA1 MASA+1
  495. SA0 X1
  496. EQ MASREQ
  497. * /--- BLOCK MASWAIT 00 000 81/07/14 11.49
  498. SPACE 5,11
  499. *** MASWAIT - WAIT FOR *MASTOR* REQUEST TO COMPLETE
  500. *
  501. * ENTRY - (X1) = REQUEST TO WAIT FOR
  502.  
  503.  
  504. * ADD RELEASED REQUEST AREA TO FRONT OF FREE CHAIN
  505.  
  506. MASW1A SA0 MASFREE
  507. BX6 X0 ECS FWA OF RELEASED REQ. AREA
  508. WE 1 WRITE OUT OLD *FIRST FREE*
  509. RJ ECSPRTY
  510. SA6 A0 NEW *FIRST FREE* POINTER
  511.  
  512. MASW1 SA0 X2 RE-STORE A0
  513.  
  514. ENTRY MASWAIT
  515. MASWAIT EQ *
  516. SX2 A0 SAVE A0
  517. SA0 X1
  518. SA1 X1+1 (X1) = ADDRESS OF ECS REQUEST
  519. ZR X1,MASW1 IF NO REQUEST
  520. BX0 X1
  521. MASW2 RE MS.RDIM
  522. RJ ECSPRTY
  523. SA1 A0 CHECK IF COMPLETE
  524. LX1 59-11
  525. NG X1,MASW1A IF COMPLETE
  526. CALL S=RCL
  527. EQ MASW2 CHECK AGAIN
  528.  
  529.  
  530. MASA DATA 0 STORAGE
  531. DATA 0
  532. MASB DATA 0 INDEX TO NEXT REQUEST AREA
  533.  
  534. ENTRY MASFREE
  535. MASFREE BSS 1 FREE CHAIN POINTER
  536. * /--- BLOCK CONSUB 00 000 81/07/25 15.11
  537. TITLE CONDENSOR SUBROUTINES
  538. *
  539. TITLE -UNNAM- GET CURRENT UNIT NAME
  540. *
  541. *
  542. *
  543. * -UNNAM-
  544. * ON EXIT - X1 = 0 IF VALID UNIT NAME
  545. * X6 = UNIT NAME (IF X1=0)
  546. * X1 = -1 IF BAD UNIT NUMBER
  547. * X6 = LAST NAME IN TABLE (IF X1=-1)
  548. *
  549. ENTRY UNNAM
  550. UNNAM EQ *
  551. SA5 UNUMON UNIT NUMBER
  552. BX6 X5 X6 = UNIT NUMBER
  553. RJ UNNAMX6 X6 = UNIT NAME
  554. EQ UNNAM
  555. *
  556. * -UNNAMX6-
  557. * ON ENTRY - X6 = UNIT NUMBER
  558. * ON EXIT - X1 = 0 IF VALID UNIT NAME
  559. * X6 = UNIT NAME (IF X1=0)
  560. * X1 = -1 IF BAD UNIT NUMBER
  561. * X6 = LAST NAME IN TABLE (IF X1=-1)
  562. *
  563. ENTRY UNNAMX6
  564. UNNAMX6 EQ *
  565. LX6 48 HIGH ORDER BYTE = UNIT NUMBER
  566. MX0 12
  567. SA3 UNUMIN NUMBER OF UNITS
  568. SB4 X3
  569. SB3 B0
  570. *
  571. UNN1 SA1 B3+UNAME LOAD ENTRY
  572. BX2 X0*X1 MASK OFF UNIT NUMBER
  573. BX2 X2-X6 CHECK IF UNIT BEING SEARCH FOR
  574. ZR X2,UNN2
  575. SB3 B3+1
  576. LT B3,B4,UNN1
  577. MX1 -1 FLAG INVALID UNIT NUMBER
  578. BX6 -X0*X1 USE LAST UNIT NAME
  579. EQ UNNAMX6
  580. *
  581. UNN2 BX6 -X0*X1 MASK OFF UNIT NAME
  582. MX1 0 INDICATE VALID UNIT NAME
  583. MX2 48
  584. SA3 KTUNIT CHECK FOR M-TUTOR UNIT
  585. BX2 X2*X6
  586. BX2 X3-X2
  587. NZ X2,UNNAMX6 EXIT IF CPU UNIT
  588. SX3 X6 PICK OFF M-TUTOR UNIT NUMBER
  589. ZR X3,UNNAMX6 EXIT IF CPU UNIT
  590. SA3 X3+UNITTAB LOAD M-TUTOR UNIT NAME
  591. AX3 12
  592. BX6 -X0*X3 X6 = UNIT NAME
  593. EQ UNNAMX6
  594. *
  595. KTUNIT VFD 12/0,30/5LTUNIT,6/0,12/0
  596. *
  597. *
  598. * /--- BLOCK LJUST 00 000 80/08/20 12.37
  599. TITLE -LJUST- LEFT JUSTIFY NAME
  600. *
  601. *
  602. * -LJUST-
  603. * LEFT JUSTIFIES THE NAME IN X1 CHANGING TYPE
  604. * OF FILL IF INDICATED
  605. *
  606. * B1 = OLD FILL CHARACTER
  607. * B2 = NEW FILL CHARACTER
  608. * USES X0,X1,X2,X3,X6,X7, B1,B2,B3
  609. *
  610. *
  611. ENTRY LJUST
  612. LJUST EQ *
  613. SX6 B1 PICK UP FILL CHARACTERS
  614. SX7 B2
  615. ZR X1,LJ1
  616. MX0 6 MASK FOR ONE CHARACTER
  617. SB3 10
  618. *
  619. LJ BX2 X0*X1 LEFT JUSFIFY NAME
  620. LX2 6
  621. BX3 X2-X6 SEE IF OLD FILL CHARACTER
  622. ZR X3,LJ0
  623. BX3 X2-X7 SEE IF NEW FILL CHARACTER
  624. NZ X3,LJ1
  625. LJ0 LX1 6 POSITION NEXT CHARACTER
  626. SB3 B3-1 END TEST
  627. PL B3,LJ
  628. *
  629. LJ1 EQ B1,B2,LJUST
  630. MX0 -6
  631. SB3 10 END TEST
  632. *
  633. LJ2 BX2 -X0*X1 MASK OFF NEXT CHARACTER
  634. BX3 X2-X7
  635. ZR X3,LJ3 JUMP IF NEW FILL CHARACTER
  636. BX3 X2-X6
  637. NZ X3,LJUST EXIT IF NOT OLD FILL TYPE
  638. BX1 X0*X1
  639. BX1 X1+X7 REPLACE CHARACTER
  640. *
  641. LJ3 LX0 6 POSITION MASK
  642. LX6 6 POSITION OLD FILL CHAR
  643. LX7 6 POSITION REPLACEMENT CHAR
  644. SB3 B3-1
  645. NZ B3,LJ2 END TEST
  646. EQ LJUST
  647. *
  648. *
  649. * /--- BLOCK SSETBIT 00 000 80/07/02 14.19
  650. TITLE BIT TABLE MANIPULATION
  651. *
  652. *
  653. *
  654. * -SSETBIT-
  655. * ON ENTRY - X1 = INDEX IN BIT TABLE
  656. * B1 = ADDRESS OF BIT TABLE
  657. *
  658. *
  659. ENTRY SSETBIT
  660. SSETBIT EQ *
  661. PX2 X1 CONVERT TO FLOATING POINT
  662. NX2 X2
  663. SA3 =0.01 AVOID ROUND-OFF ERROR
  664. FX2 X2+X3
  665. NX2 X2
  666. SA3 =60.0
  667. FX2 X2/X3 COMPUTE WORD COUNT
  668. UX2 X2,B2
  669. LX2 X2,B2 CONVERT BACK TO INTEGER
  670. SX3 60
  671. DX3 X2*X3 COMPUTE REMAINDER
  672. IX0 X1-X3
  673. SB2 59
  674. SB3 X0 COMPUTE SHIFT COUNT
  675. SB2 B2-B3
  676. SA2 X2+B1 LOAD PROPER WORD OF BIT TABLE
  677. SX6 1
  678. LX6 X6,B2 POSITION BIT
  679. BX6 X2+X6
  680. SA6 A2 STORE UPDATED WORD
  681. EQ SSETBIT
  682. *
  683. *
  684. TITLE RCTOXY
  685. * THIS ROUTINE CONVERTS AN INTEGER SPECIFYING A ROW-COLUMN
  686. * SCREEN POSITION TO ITS EQUIVALENT X AND Y SCREEN CO-ORDINATES.
  687. *
  688. * ON ENTRY -- X1 = ROW-COLUMN POSITION
  689. * ON EXIT -- X6 = X
  690. * X7 = Y
  691. *
  692. * THE FOLLOWING REGISTERS ARE USED--X2,X3,X4,X6,X7,B2.
  693. * THE CONTENTS OF X1 ARE PRESERVED AND NO A REGISTERS ARE USED.
  694. *
  695. *
  696. ENTRY RCTOXY
  697. *
  698. RCTOXY EQ *
  699. SX2 100
  700. PX2 X2 X2 = 100 IN FLOATING POINT FORMAT
  701. PX3 X1 X3 = PACKED ROW-COLUMN POSITION
  702. NX4 X2 NORMALIZE DIVISOR
  703. FX4 X3/X4 DIVIDE BY 100
  704. UX4 X4,B2
  705. LX4 X4,B2 X4 = QUOTIENT
  706. PX3 X4
  707. DX2 X2*X3 X2 = 100*QUOTIENT
  708. UX2 X2
  709. IX2 X1-X2 X2 = REMAINDER
  710. SX6 X2-1 SUBTRACT 1
  711. LX6 3 AND MULTIPLY BY 8 TO GET X CO-ORDINATE
  712. LX4 4 MULTIPLY BY 16
  713. SX2 512
  714. IX7 X2-X4 AND SUBTRACT FROM 512 TO GET Y CO-ORDINATE
  715. EQ RCTOXY
  716. *
  717. *
  718. * /--- BLOCK MVECS 00 000 81/06/25 04.50
  719. CONDEN
  720. *
  721. * -MVECS-
  722. * MOVE AN ECS BUFFER OF LENGTH (X3) FROM (X1)
  723. * TO (X2) THROUGH CM BUFFER OF LENGTH (B1)
  724. * AT (A0)
  725. *
  726. * USES X0-4, B1
  727. *
  728. ENTRY MVECS
  729. MVECS EQ *
  730. PL X3,NOTRAP
  731. SA4 -1
  732. NOTRAP BSS 0
  733. IX4 X1-X2 SOURCE-DESTINATION
  734. ZR X4,MVECS NO DISPLACEMENT
  735. *
  736. PL X4,MV10 IF MOVE TO LOWER ADDR
  737. *
  738. MX5 0
  739. SX4 -B1 INCREMENT
  740. IX1 X1+X3 END OF BUFFER + 1
  741. IX1 X1+X4 LAST PAGE OF BUFFER
  742. IX2 X2+X3 END OF BUFFER + 1
  743. IX2 X2+X4 LAST PAGE OF BUFFER
  744. EQ MV20
  745. *
  746. MV10 SX4 B1 INCREMENT
  747. *
  748. MV20 BSS 0
  749. SX0 B1 (X0) = ABS(INCREMENT)
  750. IX3 X3-X0 WORDS LEFT AFTER PAGE
  751. NG X3,MV30 IF PARTIAL PAGE LEFT
  752. *
  753. BX0 X1
  754. + RE B1 READ PAGE
  755. RJ ECSPRTY
  756. BX0 X2
  757. + WE B1 WRITE PAGE
  758. RJ ECSPRTY
  759. IX1 X1+X4 MOVE SOURCE
  760. IX2 X2+X4 MOVE DESTINATION
  761. EQ MV20
  762. *
  763. MV30 BSS 0
  764. PL X4,MV40 IF MOVING TO LOWER ADDR
  765. *
  766. IX1 X1-X3 REMAINDER SOURCE
  767. IX2 X2-X3 REMAINDER DESTINATION
  768. *
  769. MV40 BX0 X1
  770. SX3 X3+B1
  771. SB1 X3 LENGTH OF REMAINDER
  772. + RE B1 READ REMAINDER
  773. RJ ECSPRTY
  774. BX0 X2
  775. WE B1 WRITE REMAINDER
  776. RJ ECSPRTY
  777. EQ MVECS
  778. *
  779. ENDIF
  780. *
  781. * -MVECSD-
  782. *
  783. * MOVE ECS THROUGH DEFAULT BUFFER
  784. *
  785. * FOR REGISTER USAGE, SEE -MVECS-
  786. *
  787. ENTRY MVECSD
  788. MVECSD EQ *
  789. SA0 ECSMVBA ADDRESS OF ECS MOVE BUFFER
  790. SB1 ECSMVBL LENGTH OF ECS MOVE BUFFER
  791. RJ =XMVECS MOVE THROUGH A0/B1
  792. EQ MVECSD
  793. *
  794. * /--- BLOCK MVECS 00 000 75/10/04 10.28
  795. * -OPENECS-
  796. *
  797. * OPEN A HOLE IN AN ECS BUFFER ASSUMING
  798. * ALL UNUSED SPACE IS AT THE END OF THE BUFFER
  799. * ALSO MAY BE USED TO CLOSE A PREVIOUSLY OPENED
  800. * HOLE BY SETTING X2 < X1
  801. *
  802. * ON ENTRY
  803. * X1 = HOLE FWA
  804. * X2 = HOLE LWA + 1
  805. * X3 = NUMBER OF WORDS IN USE AFTER HOLE
  806. * X4 = BUFFER LWA + 1
  807. *
  808. * ON EXIT
  809. * X5 ^> 0 IF OPENED SUCCESSFULLY
  810. * < 0 IF NO ROOM TO OPEN HOLE
  811. *
  812. * USES X0-5, A0 AND B1
  813. *
  814. ENTRY OPENECS
  815. OPENECS EQ *
  816. IX5 X2+X3 LWA OF ECS IN USE + 1
  817. IX5 X4-X5 UNUSED WORDS AFTER OPENED
  818. NG X5,OPENECS IF NO ROOM TO OPEN
  819. *
  820. OPECS10 RJ =XMVECSD SHUFFLE BUFFER AROUND
  821. EQ OPENECS
  822. *
  823. TITLE KEY LIST
  824. *
  825. *
  826. ENTRY NKLIST
  827. ENTRY NKLEND
  828. * LIST OF KEYS WHICH CAN PLAY ROLE OF NEXT KEY TO
  829. * INITIATE JUDGING. THIS LIST IS USED BY CONDEN TO
  830. * CONDENSE THE -JKEY- COMMAND, AND BY LEX AS A LIST OF
  831. * SPECIAL NAMES AND ASSOCIATED KEY CODES.
  832. *
  833. * ** 'N'O'T'E '; CRUDELY DUPLICATED IN *LOGICX* FOR EXECUTOR. **
  834.  
  835. * ADDITIONAL KEY NAMES THAT ARE ALLOWED IN THE ',ZK',
  836. * FUNCTION ARE LISTED IN DECK ',LEX',.
  837.  
  838. *
  839. NKLIST VFD 42/6LFUNKEY,18/FUNKEY 200
  840. VFD 42/0,18/FUNKEY+1 201
  841. VFD 42/4LNEXT,18/NEXT 202
  842. VFD 42/5LNEXT1,18/NEXT1 203
  843. VFD 42/5LERASE,18/ERASE 204
  844. VFD 42/6LERASE1,18/ERASE1 205
  845. VFD 42/4LHELP,18/HELP 206
  846. VFD 42/5LHELP1,18/HELP1 207
  847. VFD 42/4LBACK,18/BACK 210
  848. VFD 42/5LBACK1,18/BACK1 211
  849. VFD 42/3LLAB,18/LAB 212
  850. VFD 42/4LLAB1,18/LAB1 213
  851. VFD 42/4LDATA,18/DATA 214
  852. VFD 42/5LDATA1,18/DATA1 215
  853. VFD 42/4LTERM,18/TERM 216
  854. VFD 42/3LANS,18/ANS 217
  855. VFD 42/4LCOPY,18/COPY 220
  856. VFD 42/5LCOPY1,18/COPY1 221
  857. VFD 42/4LEDIT,18/EDIT 222
  858. VFD 42/5LEDIT1,18/EDIT1 223
  859. VFD 42/5LMICRO,18/MICRO 224
  860. VFD 42/6LMICRO1,18/MICRO1 225
  861. VFD 42/4LSTOP,18/STOP 226
  862. VFD 42/5LSTOP1,18/STOP1 227
  863. VFD 42/3LTAB,18/TAB 230
  864. VFD 42/0,18/TAB+1 231
  865. VFD 42/0,18/TAB+2 232
  866. VFD 42/6LTIMEUP,18/TIMEUP 233
  867. VFD 42/0,18/TIMEUP+1 234
  868. VFD 42/7LCATCHUP,18/CATCHUP 235
  869. *
  870. * /--- BLOCK MVECS 00 000 75/10/04 10.28
  871. *
  872. * 'HOME,'HOME1,'END,'END1,'INS,'INS1,
  873. * 'DEL,'DEL1,'PG'UP,'PG'UP1,'PG'DN,'PG'DN1
  874. *
  875. VFD 42/70101715050000B,18/236B
  876. VFD 42/70101715053400B,18/237B
  877. VFD 42/70051604000000B,18/240B
  878. VFD 42/70051604340000B,18/241B
  879. VFD 42/70111623000000B,18/242B
  880. VFD 42/70111623340000B,18/243B
  881. VFD 42/70040514000000B,18/244B
  882. VFD 42/70040514340000B,18/245B
  883. VFD 42/70200770252000B,18/246B
  884. VFD 42/70200770252034B,18/247B
  885. VFD 42/70200770041600B,18/250B
  886. VFD 42/70200770041634B,18/251B
  887. *
  888. * 'RTARR, 'LFARR, 'UPARR, 'DNARR,
  889. * 'RTARR1, 'LFARR1, 'UPARR1, 'DNARR1
  890. *
  891. VFD 42/70222401222200B,18/252B
  892. VFD 42/70140601222200B,18/253B
  893. VFD 42/70252001222200B,18/254B
  894. VFD 42/70041601222200B,18/255B
  895. VFD 42/70222401222234B,18/256B
  896. VFD 42/70140601222234B,18/257B
  897. VFD 42/70252001222234B,18/260B
  898. VFD 42/70041601222234B,18/261B
  899. *
  900. * ','ICON',
  901. *
  902. VFD 42/70110317160000B,18/262B
  903. *
  904. *
  905. NKLEND BSS 1 TO PLANT SEARCH WORD
  906. * /--- BLOCK COND RJERR 00 000 81/07/28 02.34
  907. *
  908. * -RJERR2- (SPECIFY YOUR OWN HEADER INFO)
  909. *
  910. * FOUR ARGUMENTS (B1,B2,X1,X2)
  911. * B1 = ERROR NUMBER (VALUE > 2047)
  912. * B2 = ZERO IF BAD LINE IS TO BE SAVED
  913. * X1 = VALUE FOR SECOND HEADER WORD (IF 12 BITS
  914. * OR LESS THEN IT IS MERGED WITH COMMAND)
  915. * X2 = VALUE FOR THIRD HEADER WORD (IF 12 BITS
  916. * OR LESS THEN IT IS MERGED WITH UNIT NAME)
  917. *
  918. ENTRY RJERR2
  919. RJERR2 PS
  920. SB6 RJERR2
  921. EQ ERRGO JUMP INTO STANDARD ROUTINE
  922. *
  923. * -RJERRB- (SPECIFY YOUR OWN BUFFER)
  924. *
  925. * SIX ARGUMENTS (B1,B2,X1,X2,B3,B4)
  926. * B1,B2,X1,X2 = SAME AS FOR ERR2
  927. * B3 = ADDRESS OF SPECIAL BUFFER TO SAVE
  928. * B4 = BUFFER LENGTH
  929. ENTRY RJERRB
  930. RJERRB PS
  931. SB6 RJERRB B6 = RETURN ADDRESS
  932. SX6 1
  933. SA6 ZCONDOK SET ZCONDOK FLAG
  934. RJ PUTBUF STORE THE USER BUFFER
  935. EQ B2,ERRGO JUMP IF SAVING BAD LINE
  936. RJ FIXCU STORE 2ND AND 3RD HEADER WORDS
  937. EQ ERRGOH DONE IF NOT SAVING BAD LINE
  938. *
  939. ENTRY RJERNOZ
  940. RJERNOZ EQ *
  941. SB6 RJERNOZ SET RETURN ADDRESS
  942. SB2 B0 CLEAR OTHER ARGUMENTS
  943. SX1 B0
  944. SX2 B0
  945. EQ ERRNOZ
  946. *
  947. ENTRY RJERR
  948. RJERR PS
  949. SB6 RJERR B6 = RETURN ADDRESS
  950. SB2 B0 CLEAR OTHER ARGUMENTS
  951. SX1 B0
  952. SX2 B0
  953. * /--- BLOCK COND RJERR 00 000 81/07/28 01.25
  954. * OTHER ROUTINES ENTER HERE
  955. ERRGO SX6 1 SET ZCONDOK FLAG
  956. SA6 ZCONDOK
  957. ERRNOZ RJ FIXCU STORE 2ND AND 3RD HEADER WORDS
  958. SB4 B0 SET TO NO BUFFER TO STORE
  959. + NE B2,*+1 JUMP IF NOT SAVING THE BAD LINE
  960. RJ PACKTAG PACK UP TAG OF BAD LINE
  961. SB3 ERRBUF ADDRESS OF THAT LINE
  962. RJ PUTBUF STORE IN CEBUF AND SET HEADER
  963. ERRGOH SA4 LCEBUF NOW MOVE HEADER TO CEBUF
  964. SX0 3 THREE WORD HEADER
  965. IX6 X4-X0
  966. NG X6,ERRFULL
  967. SA6 A4
  968. SA4 ERRCNT INC COUNT OF ERRORS SAVED
  969. SX6 X4+1
  970. SA6 A4
  971. SA4 PCEBUF ECS ADR OF WHERE TO PUT HEADER
  972. IX6 X4+X0 NEW VALUE FOR PCEBUF
  973. SA6 A4
  974. BX0 X4
  975. SA0 HEAD
  976. + WE 3 WRITE HEADER
  977. RJ ECSPRTY
  978. ERRFULL SA4 ERRTOT INC TOTAL NUMBER OF ERRORS
  979. SX6 X4+1
  980. SA6 ERRTOT
  981. SX6 B0
  982. SA6 HEAD CLEAR FIRST HEADER WORD
  983. SA1 =XCALCACT
  984. ZR X1,ERRGOX EXIT IF NO CALC IS ACTIVE
  985. SA6 CALCACT DISCARD COMPILED CODE, IF ANY
  986. ERRGOX JP B6 EXIT
  987. * /--- BLOCK PUTBUF 00 000 81/06/25 04.50
  988. *
  989. * -PUTBUF-
  990. *
  991. * 'THIS ROUTINE STORES A BUFFER OF ERROR
  992. * INFO INTO THE END OF CEBUF. 'IT SETS UP
  993. * THE FIRST HEADER WORD WITH THE BUFFER LENGTH
  994. * AND A POINTER HOLDING THE DISPLACEMENT OF
  995. * THE BUFFER FROM THE FIRST WORD OF CEBUF.
  996. * 'IF B4 IS NEG. OR ZERO ON ENTRY, THEN THE HEADER
  997. * IS SET UP WITH ZERO FIELDS.
  998. *
  999. * ON ENTRY, (B3,B4) HOLD THE BUFFER ADR AND LENGTH
  1000. * (B1) HOLDS THE ERROR NUMBER
  1001. *
  1002. * PRESERVES REGISTERS B1,B2,X1,X2 (AND A5,B5..B7,X7)
  1003. *
  1004. PUTBUF DATA 0
  1005. LE B4,PUTBUFE JUST STORE HEADER IF NO BUFFER
  1006. SA4 LCEBUF SPACE LEFT IN CEBUF
  1007. SA0 B3 CM ADDRESS OF INFO
  1008. SB3 X4
  1009. GT B4,B3,ERRFULL EXIT IF NO ROOM
  1010. SX6 B3-B4 AMOUNT LEFT NOW
  1011. SA6 A4 UPDATE LCEBUF
  1012. SA4 PCEBUF POINTER INTO CEBUF (ABSOLUTE)
  1013. IX0 X4+X6 WHERE TO WRITE INFO
  1014. SA4 ACEBUF START OF CEBUF
  1015. IX6 X0-X4 REL DISPLACEMENT TO THIS BUFFER
  1016. + WE B4
  1017. RJ ECSPRTY
  1018. PUTBUFH LX6 12 RELATIVE BUFFER POINTER
  1019. SX4 B4 BUFFER LENGTH
  1020. BX6 X6+X4
  1021. LX6 12
  1022. SX4 B1 ERROR NUMBER
  1023. BX6 X6+X4
  1024. SA4 HEAD LINE AND BLOCK NUMBER, IF ANY
  1025. LX6 48
  1026. BX6 X6+X4 MERGE
  1027. SA6 HEAD
  1028. EQ PUTBUF
  1029. PUTBUFE SB4 B0 STORE ZEROS IF NO BUFFER
  1030. SX6 B0
  1031. EQ PUTBUFH
  1032. * /--- BLOCK FIXCU 00 000 81/07/28 02.05
  1033. *
  1034. * -FIXCU-
  1035. *
  1036. * 'THIS ROUTINE STORES THE INFO FOR
  1037. * THE SECOND AND THIRD HEADER WORDS.
  1038. *
  1039. * X1 = INFO FOR SECOND HEADER WORD. 'IT IS
  1040. * MERGED WITH THE BAD COMMAND NAME
  1041. * IF THE TOP 48 BITS ARE ZERO.
  1042. *
  1043. * X2 = INFO FOR THIRD HEADER WORD. 'IT IS
  1044. * MERGED WITH THE UNIT NAME IF THE TOP
  1045. * 48 BITS ARE ZERO.
  1046. *
  1047. * PRESERVES REGISTERS B1,B2 (AND A5,B5,X5,A7,B7,X7)
  1048. *
  1049. FIXCU DATA 0
  1050. BX6 X1 MOVE USER INFO
  1051. MX0 48 SEE IF MORE THAN 12 BITS
  1052. BX1 X0*X1
  1053. BX0 X0*X2
  1054. + NZ X1,*+1
  1055. SA1 COMMAND COMMAND THAT HAS ERROR
  1056. BX6 X1+X6 MERGE WITH COMMAND NAME
  1057. SA6 HEAD+1 STORE 2ND HEADER WORD
  1058. BX6 X2 MOVE 2ND WORD OF USER INFO
  1059. NZ X0,FIXCUX EXIT IF MORE THAN 12 BITS
  1060. * FIND THE UNIT NAME
  1061. SA3 PPTF CHECK IF CONDENSING PPT CODE
  1062. NZ X3,FU20
  1063. SA3 UNUMON UNIT NUMBER
  1064. MX0 12
  1065. LX3 48 PUT IN TOP 12 BITS
  1066. SA1 UNUMIN LENGTH
  1067. SB4 X1
  1068. SB3 B0
  1069. FULOOP SA1 B3+UNAME LOAD ENTRY
  1070. BX2 X0*X1 MASK OFF UNIT NUMBER
  1071. BX2 X2-X3 CHECK IF SAME UNIT NUMBER
  1072. ZR X2,FU JUMP IF YES
  1073. SB3 B3+1
  1074. LT B3,B4,FULOOP USE LAST UNIT NAME IF NOT FOUND
  1075. FU BX0 -X0*X1
  1076. LX0 12
  1077. BX6 X6+X0 MERGE WITH USER INFO
  1078. EQ FIXCUX
  1079. *
  1080. FU20 SA3 IUNUM LOAD CURRENT UNIT NUMBER
  1081. SA3 X3+UNITTAB LOAD UNIT NAME
  1082. MX0 -12
  1083. BX3 X0*X3 MASK OFF UNIT NAME
  1084. BX6 X3+X6 MERGE WITH USER INFO
  1085.  
  1086. FIXCUX SA6 HEAD+2 STORE 3RD HEADER WORD
  1087. EQ FIXCU
  1088. * /--- BLOCK PACKTAG 00 000 78/02/17 04.49
  1089. *
  1090. * -PACKTAG-
  1091. *
  1092. * 'THIS ROUTINE PACKS UP THE COMMAND TAG
  1093. * INTO THE CM BUFFER -ERRBUF-. 'RETURNS B4
  1094. * WITH THE NUMBER OF WORDS OF INFO (ALWAYS > 0).
  1095. * 'THE FIRST TWO CHARS OF THE FIRST WORD ARE
  1096. * SET TO WORDPT-TAG (I.E. COUNT FOR UNDERLINING).
  1097. *
  1098. * 'IF THE LINE CONTAINS HIDDEN CHARACTERS,
  1099. * BIT 49 IN THE FIRST HEADER WORD IS SET.
  1100. *
  1101. * 'THIS ROUTINE ALSO SAVES THE LINE AND BLOCK
  1102. * OF WHERE THE ERROR IS IN THE SOURCE.
  1103. *
  1104. * 'PRESERVES REGISTER B1 (AND A5,B5,X5,A7,B7,X7)
  1105. *
  1106. PACKTAG EQ *
  1107. SX4 0 X4 = ZERO IF NO HIDDEN CHARS
  1108. SA3 HIDDEN X3 = BITS SHOWING HIDDEN CHARS
  1109. SA1 COMMAND CHECK COMMAND FOR HIDDEN CHARS
  1110. MX0 54
  1111. BX1 X1*X0 TO INSURE ZERO AT END
  1112. HCMNDLP LX1 6
  1113. BX2 -X0*X1
  1114. ZR X2,HCMNDFIN
  1115. SB2 X2-4 E-O-L,A,B,C ARE NOT HIDDEN
  1116. LX2 X3,B2 SEE IF THIS CHAR IS HIDDEN
  1117. PL X2,HCMNDLP JUMP IF NOT
  1118. SX4 1 SET FLAG AND EXIT
  1119. *
  1120. HCMNDFIN SX0 B1+0 PRESERVE B1 IN X0
  1121. SB4 1 UNIVERSAL INCREMENT VALUE TO B4
  1122. SB2 B0
  1123. SX6 B0
  1124. SA6 TAG+TAGLTH GUARENTEE ZERO WORD AT END
  1125. SB3 8
  1126. SA1 ERRBUF-1 SET UP A6
  1127. BX6 X1
  1128. SA6 A1
  1129. SA1 WORDPT SET UP FIRST TWO CHARS
  1130. SX6 TAG
  1131. IX6 X1-X6
  1132. MX1 -12
  1133. BX1 X1*X6 CHECK WITHIN TAG BOUNDS
  1134. ZR X1,PCT10
  1135. SX6 0 INSURE LEGAL BIAS
  1136. PCT10 SX1 X6-TAGLTH
  1137. NG X1,PACKLOOP
  1138. SX6 0 INSURE LEGAL BIAS
  1139. * /--- BLOCK PACKTAG2 00 000 81/07/28 01.48
  1140. *
  1141. PACKLOOP SA1 TAG+B2 LOAD TAG CHARACTER
  1142. ZR X1,PACKOUT BRANCH IF END OF TAG
  1143. LX6 6
  1144. BX6 X6+X1
  1145. SB2 B2+B4 INCREMENT NO. TAG CHARS
  1146. SB3 B3-B4 DECREMENT CHAR/WORD
  1147. SB1 X1-4 E-O-L,A,B,C ARE NOT HIDDEN
  1148. LX1 X3,B1 SEE IF THIS CHAR IS HIDDEN
  1149. PL X1,PCKLOOPA JUMP IF NOT
  1150. SX4 1
  1151. PCKLOOPA NZ B3,PACKLOOP
  1152. SB3 10 CHARS/WORD RESET
  1153. SA6 A6+B4 STORE FULL WORD
  1154. MX6 0
  1155. EQ PACKLOOP
  1156. *
  1157. PACKOUT ZR B2,PACKO2 SENSE NO TAG
  1158. SA1 A1-1 CHECK FOR TRAILING SPACE
  1159. SX1 X1-1R
  1160. NZ X1,PACKO2
  1161. SX4 1 COUNT TRAIL SPACE AS HIDDEN
  1162. PACKO2 LX6 6
  1163. SB3 B3-B4
  1164. NZ B3,PACKO2 LEFT JUSTIFY LAST WORD
  1165. SA6 A6+B4 STORE LAST WORD
  1166. SB4 ERRBUF-1
  1167. SB4 A6-B4 B4 RETURNED WITH WORD COUNT
  1168. SA3 LINENUM SET LINE AND BLOCK NUMBER
  1169. LX3 24
  1170. LX4 11 POSITION FLAG FOR HIDDEN LINE
  1171. BX6 X3+X4 MERGE WITH LINE NUMBER
  1172. SA4 BLKNUM
  1173. LX4 36
  1174. BX6 X4+X6
  1175. SA6 HEAD STORE IN FIRST HEADER WORD
  1176. SB1 X0 RESTORE B1
  1177. EQ PACKTAG EXIT
  1178. *
  1179. *
  1180. ERRBFL SET TAGLTH+10
  1181. ERRBUF BSS ERRBFL/10 CM BUFFER FOR PACKED-UP TAG
  1182. *
  1183. HIDDEN DATA 00000000000000001716B
  1184. * /--- BLOCK UERRSET 00 000 81/07/28 01.49
  1185. *
  1186. * -UERRSET-
  1187. *
  1188. * 'THIS ROUTINE SETS THE BLOCK AND LINE
  1189. * NUMBER IN THE HEADER TO THE LAST UNIT COMMAND.
  1190. *
  1191. ENTRY UERRSET
  1192. UERRSET PS
  1193. SA1 ULINENM
  1194. SA2 UBLKNM
  1195. LX1 24
  1196. LX2 36
  1197. BX6 X1+X2
  1198. SA6 HEAD
  1199. EQ UERRSET
  1200. * /--- BLOCK END 00 000 81/07/14 11.49
  1201. *
  1202. EBH SPACE 4,10
  1203. ** EBH - ERROR BUFFER HEADER.
  1204. *
  1205. * BUILD THE ERROR BUFFER HEADER.
  1206. *
  1207. * FORMAT - 60/NUMBER OF ERRORS IN THE BUFFER.
  1208. * 60/ACCOUNT NAME.
  1209. * 60/LESSON NAME.
  1210. * 20/TOTAL ERRORS, 20/UNITS, 20/LESSON LENGTH.
  1211.  
  1212.  
  1213. ENTRY EBH
  1214.  
  1215. EBH PS ENTRY/EXIT
  1216. SA1 ERRTOT TOTAL NUMBER OF ERRORS
  1217. SA2 UNUMIN
  1218. SX2 X2-IEUNUM NUMBER OF REAL UNITS
  1219. SA3 CONDPNT LESSON LENGTH
  1220. LX1 40
  1221. LX2 20
  1222. BX6 X1+X2
  1223. BX6 X6+X3
  1224. SA6 MAINBUF+3
  1225. SA1 ACCOUNT COPY ACCOUNT AND FILE NAME TO ERROR HEADER
  1226. SA2 LESSON
  1227. BX6 X1
  1228. BX7 X2
  1229. SA6 MAINBUF+1 ACCOUNT NAME
  1230. SA7 MAINBUF+2 LESSON NAME
  1231. SA1 ERRCNT COUNT OF ERRORS SAVED IN CEBUF
  1232. BX6 X1
  1233. SA6 MAINBUF
  1234. SA1 ACEBUF WRITE HEADER TO ECS
  1235. BX0 X1
  1236. SA0 A6
  1237. + WE MAINHDL
  1238. RJ ECSPRTY
  1239. EQ EBH RETURN
  1240. *
  1241. * /--- BLOCK LLD 00 000 82/09/27 18.35
  1242. TITLE OVERLAY LOADING SUBROUTINES.
  1243. LLD SPACE 4,10
  1244. ** LLD - LOAD A LEVEL FROM DISK.
  1245. *
  1246. * LOAD LEVEL OVERLAYS FROM DISK INTO EM.
  1247. *
  1248. * ENTRY (X7) = ADDR OF REQUESTED OVERLAY INFO WORD.
  1249. * (B1) = WORD IN OVERLAY TO JUMP TO (KLUDGE).
  1250. * (CLEVEL) = ADDR OF CURRENT OVERLAY INFO WD.
  1251. *
  1252. * EXIT (X7) = SAME AS ENTRY.
  1253. * (B1) = SAME AS ENTRY.
  1254. *
  1255. * USES X - 1, 7.
  1256. * A - 1, 7.
  1257. * B - 1.
  1258. *
  1259. * CALLS IOL, RMS.
  1260. *
  1261. * MACROS NONE.
  1262.  
  1263.  
  1264. LLD PS ENTRY / EXIT
  1265.  
  1266. * SEE IF LEVELS ARE BEING LOADED FROM DISK.
  1267.  
  1268. SA1 CDISK
  1269. ZR X1,LLD IF NOT LOADING FROM DISK
  1270.  
  1271. * SEE IF THE DESIRED LEVEL IS ALREADY IN EM.
  1272.  
  1273. SA1 CLEVEL
  1274. IX1 X7-X1
  1275. ZR X1,LLD IF LEVEL ALREADY LOADED
  1276.  
  1277. * SAVE REGISTERS.
  1278.  
  1279. SA7 LLDA SAVE X7
  1280. SX7 B1
  1281. SA7 LLDB SAVE B1
  1282.  
  1283. * INCREMENT COUNT.
  1284.  
  1285. SB1 1
  1286. SA1 ACLSTAT
  1287. SX0 SCDISK
  1288. IX0 X0+X1 (X0) = STATS WORD EM FWA
  1289. RX1 X0
  1290. SX6 X1+B1
  1291. WX6 X0
  1292.  
  1293. * INITIALIZE FOR OVERLAY LOADING.
  1294.  
  1295. RJ IOL
  1296.  
  1297. * GET RANDOM INDEX FOR REQUESTED LEVEL.
  1298.  
  1299. SA1 LLDA (X1) = LEVEL TO LOAD
  1300. SA1 X1+RITAB-LEVEL0 (X1) = RANDOM INDEX
  1301.  
  1302. * READ MASS STORAGE. (X1) = RANDOM INDEX.
  1303.  
  1304. RJ RMS
  1305.  
  1306. * LOWER THE CM FL BACK TO THE FL NEEDED TO RUN.
  1307.  
  1308. SA1 =XRUNCFL
  1309. SX6 X1
  1310. LX6 30
  1311. SA6 CMFL
  1312. CALL S=CM,CMFL
  1313.  
  1314. * RESTORE REGISTERS.
  1315.  
  1316. SA1 LLDA
  1317. BX7 X1 RESTORE X7
  1318. SA1 LLDB
  1319. SB1 X1 RESTORE B1
  1320.  
  1321. EQ LLD RETURN
  1322.  
  1323. * DATA.
  1324.  
  1325. LLDA BSS 1 SAVED X7
  1326. LLDB BSS 1 SAVED B1
  1327.  
  1328. * /--- BLOCK IOL 00 000 82/09/27 18.35
  1329. ** IOL - INITIALIZE FOR OVERLAY LOADING.
  1330. *
  1331. * ENTRY (B1) = 1.
  1332. *
  1333. * EXIT LIBRARY FILE FET SET UP.
  1334. * LIBRARY FILE POSITIONED TO ULIB RECORD.
  1335. * (X1) = DATE OF NOGO.
  1336. * (X2) = TIME OF NOGO.
  1337.  
  1338.  
  1339. ENTRY IOL
  1340.  
  1341. IOL PS ENTRY / EXIT
  1342.  
  1343. * SET THE CM FL.
  1344.  
  1345. SA1 LOADFL
  1346. SX6 X1
  1347. LX6 30
  1348. SA6 CMFL
  1349. CALL S=CM,CMFL
  1350.  
  1351. * SET UP LIBRARY FILE FET.
  1352.  
  1353. * SET FILE NAME.
  1354.  
  1355. SA1 PGNR (X1) = LIBRARY / FILE NAME
  1356. MX0 42
  1357. BX1 X0*X1
  1358. SX6 B1
  1359. BX6 X6+X1
  1360. SA6 MASTER SET FILE NAME
  1361.  
  1362. * SET *FIRST*.
  1363.  
  1364. SA1 FIRST
  1365. SX6 X1
  1366. SA2 A6+B1
  1367. BX2 X0*X2
  1368. BX6 X2+X6
  1369. SA6 A2
  1370.  
  1371. * SET *IN*, *OUT*, AND *LIMIT.
  1372.  
  1373. SX6 X6
  1374. SA6 A6+B1 IN
  1375. SA6 A6+B1 OUT
  1376. SX6 X6+101B
  1377. SA6 A6+B1 LIMIT
  1378.  
  1379. * DETERMINE IF LOADING FROM LOCAL FILE OR SYSTEM.
  1380.  
  1381. STATUS MASTER
  1382. SA1 MASTER
  1383. SX2 7776B
  1384. BX2 X1*X2
  1385. NZ X2,IOL0 IF A LOCAL FILE EXISTS
  1386.  
  1387. * NO LOCAL FILE, SO LOADING FROM SYSTEM. ASSIGN IT.
  1388.  
  1389. ASSIGN MASTER,L
  1390. EQ IOL1
  1391.  
  1392. * LOADING FROM A LOCAL FILE. REWIND IT.
  1393.  
  1394. IOL0 REWIND MASTER,R
  1395.  
  1396. * /--- BLOCK IOL 00 000 82/09/27 18.35
  1397. * POSITION TO *ULIB* RECORD.
  1398.  
  1399. IOL1 SA1 MASTER+1 SET IN=OUT=FIRST
  1400. SX6 X1
  1401. SA6 A1+B1
  1402. SA6 A6+B1
  1403. READSKP MASTER,,R
  1404. SA1 MASTER
  1405. LX1 59-9
  1406. PL X1,IOL2 IF EOI NOT REACHED
  1407.  
  1408. CALL S=MSG,IOLA
  1409. CALL S=ABORT
  1410.  
  1411. IOL2 SA1 A1+B1
  1412. SA1 X1
  1413. SA3 A1+B1 (X3) = RECORD NAME
  1414. MX0 12
  1415. BX2 X1*X0
  1416. LX2 12
  1417. SX2 X2-7700B CHECK FOR IDENT TABLE
  1418. NZ X2,IOL1 IF NOT AN IDENT TABLE
  1419.  
  1420. SA2 MASTER CHECK FOR CORRECT RECORD NAME
  1421. BX2 X3-X2
  1422. MX6 42
  1423. BX2 X6*X2
  1424. NZ X2,IOL1 IF NOT CORRECT RECORD NAME
  1425.  
  1426. SA2 A1+7 CHECK FOR *ABS* RECORD TYPE
  1427. LX2 6
  1428. MX3 -6
  1429. BX2 -X3*X2
  1430. SX2 X2-1RA
  1431. NZ X2,IOL5 IF NOT *ABS* TYPE RECORD
  1432.  
  1433. * SAVE DATE / TIME OF NOGO.
  1434.  
  1435. SA3 A3+B1 (X3) = DATE OF NOGO
  1436. SA4 A3+B1 (X4) = TIME OF NOGO
  1437. BX6 X3
  1438. BX7 X4
  1439. SA6 IOLC
  1440. SA7 IOLD
  1441.  
  1442. IOL5 LX1 12
  1443. BX2 X1*X0 GET LENGTH OF TABLE
  1444. LX2 12
  1445. SB2 X2+B1 ACCOUNT FOR HEADER WORD
  1446. SA1 A1+B2
  1447. BX2 X0*X1
  1448. LX2 12
  1449. SX2 X2-7600B CHECK FOR *ULIB* TABLE
  1450. NZ X2,IOL1 IF NOT *ULIB* RECORD
  1451.  
  1452. * PASS DATE / TIME BACK TO CALLER.
  1453.  
  1454. SA1 IOLC
  1455. SA2 IOLD
  1456. EQ IOL RETURN
  1457.  
  1458. IOLA DATA C/ READOV - *ULIB* RECORD MISSING./
  1459. IOLB DATA 0
  1460. IOLC BSS 1 DATE OF NOGO
  1461. IOLD BSS 1 TIME OF NOGO
  1462. * /--- BLOCK RMS 00 000 82/09/27 18.35
  1463. RMS SPACE 5,11
  1464. ** RMS - READ MASS STORAGE.
  1465. *
  1466. * THE OVERLAYS ARE READ FROM THE LIBRARY AND
  1467. * WRITTEN TO EM.
  1468. *
  1469. * ENTRY (X1) = 30/RANDOM ADDRESS FOR READ, 30/0.
  1470. *
  1471. * EXIT NONE.
  1472. *
  1473. * USES X - 0, 1, 2, 3, 6.
  1474. * A - 1, 2, 6.
  1475. * B - 2, 3, 4, 6, 7.
  1476. *
  1477. * CALLS BLV, ELV, PCS, PSO, S=ABORT, S=MSG.
  1478. *
  1479. * MACROS CALL, READ, RFILEB, RJTAB, S=CM.
  1480.  
  1481.  
  1482. ENTRY RMS
  1483.  
  1484. RMS PS ENTRY / EXIT
  1485.  
  1486. * SET UP FET FOR READ.
  1487.  
  1488. * SET THE RANDOM REQUEST.
  1489.  
  1490. SA2 MASTER+6
  1491. MX0 31
  1492. BX6 X0*X2
  1493. BX6 X6+X1
  1494. SA6 A2
  1495.  
  1496. * SET LIMIT.
  1497.  
  1498. SX6 B0
  1499. SA6 RMSA
  1500. CALL S=CM,RMSA
  1501. SA1 RMSA
  1502. AX1 30
  1503. SX6 X1 (X6) = LIMIT
  1504. SA6 MASTER+4
  1505.  
  1506. * READ THE NEXT RECORD.
  1507.  
  1508. RMS1 SA1 MASTER+1 SET IN = OUT = FIRST
  1509. SX6 X1
  1510. SA6 A1+1
  1511. SA6 A6+1
  1512.  
  1513. * SAVE THE CURRENT RANDOM INDEX.
  1514.  
  1515. SA1 MASTER+6
  1516. MX0 30
  1517. BX6 X0*X1
  1518. LX6 29-59+60 POSITION CURRENT RANDOM INDEX
  1519. SA6 LEVRI
  1520.  
  1521. READ MASTER,R
  1522. SA1 MASTER
  1523. LX1 59-4
  1524. NG X1,RMS2 IF END-OF-RECORD READ
  1525.  
  1526. CALL S=MSG,RMSB *NOT ENOUGH CM*
  1527. CALL S=ABORT
  1528.  
  1529. RMS2 LX1 1
  1530. NG X1,RMS5 IF END OF FILE
  1531.  
  1532. SA1 MASTER+2 IN
  1533. SA2 MASTER+3 OUT
  1534. IX3 X1-X2 READ WORD COUNT
  1535. ZR X3,RMS5 IF EMPTY RECORD READ
  1536.  
  1537. SA1 X2 FIRST DATA WORD
  1538. MX2 6
  1539. BX2 X2*X1
  1540. LX2 6
  1541. SX2 X2-77B
  1542. NZ X2,RMS5 IF NO PREFIX TABLE
  1543.  
  1544. LX1 24 LENGTH OF PREFIX TABLE
  1545. SB2 X1+1
  1546. SA1 A1+B2 (A1) = FWA OF OVERLAY
  1547.  
  1548. * /--- BLOCK RMS 00 000 82/09/27 18.35
  1549.  
  1550. * GET RECORD TYPE.
  1551.  
  1552. RMS3 SB4 A1 (B4) = 54 TABLE FWA
  1553. MX2 12
  1554. BX2 X2*X1
  1555. LX2 12 (X2) = RECORD TYPE
  1556.  
  1557. SX6 X2-7000B
  1558. ZR X6,RMS5 IF *OPLD* RECORD
  1559.  
  1560. SX6 X2-5400B
  1561. NZ X6,RMS6 IF NOT 5400 TABLE
  1562.  
  1563. LX1 -18
  1564. SB3 X1 (B3) = ADDRESS OF HEADER
  1565.  
  1566. LX1 -18
  1567. SB6 X1-0100B (B6) = OVERLAY TYPE - (1,0)
  1568.  
  1569. SA2 A1+4 (X2) = ADDR OF 1ST ENTRY POINT
  1570. SB2 X2 (B2) = ADDR OF 1ST ENTRY POINT
  1571. SB3 B2-B3 (B3) = OFFSET FOR STARTING LOC.
  1572. SA1 A1+B3 (X1) = FIRST WORD OF OVERLAY
  1573.  
  1574. * JUMP TO THE APPROPRIATE ROUTINE.
  1575.  
  1576. SB7 3 LARGEST = (1,3)
  1577. NG B6,RMS6 IF OUT OF RANGE
  1578. GT B6,B7,RMS6 IF OUT OF RANGE
  1579. SB6 B6+B6
  1580. JP B6+RMSTAB
  1581.  
  1582. RMSTAB RJTAB
  1583. RJTAB 0,BLV,RMS1 (1,0) - LEVEL BEGIN
  1584. RJTAB 1,PSO,RMS1 (1,1) - PROCESS SUBOVERLAY
  1585. RJTAB 2,ELV,RMS4 (1,2) - LEVEL END
  1586. RJTAB 3,PCS,RMS1 (1,3) - PROCESS CMP SUBOV
  1587. RJTAB 3
  1588.  
  1589. * IF NOT INITIAL RUN-THROUGH, WE ARE DONE.
  1590.  
  1591. RMS4 SA1 OVEMFWA
  1592. NG X1,RMS1 LOOP
  1593.  
  1594. * ALL DONE. IF LOADING LEVELS FROM DISK, REQUEST
  1595. * THE MAX EM NEEDED. (MAXOVEM) = MAX EM NEEDED.
  1596.  
  1597. RMS5 SA1 CDISK
  1598. ZR X1,RMS IF NOT LOADING FROM DISK
  1599.  
  1600. SA1 OVEMFWA
  1601. PL X1,RMS IF NOT FIRST TIME THROUGH
  1602.  
  1603. SA1 MAXOVEM
  1604. SB1 1
  1605. SB3 X1 (B3) = EM REQUIRED
  1606. RJ =XREM
  1607.  
  1608. SA1 OVLECS
  1609. BX6 X1 (X6) = EM FWA
  1610. SA6 OVEMFWA
  1611.  
  1612. EQ RMS RETURN
  1613.  
  1614. RMS6 CALL S=MSG,RMSC *BAD OVERLAY FILE*
  1615. CALL S=ABORT
  1616.  
  1617. * DATA.
  1618.  
  1619. MASTER RFILEB 0,1,(FET=8)
  1620.  
  1621. RMSA VFD 30/0,30/0 MEM STATUS WORD
  1622. RMSB DIS 0,*INSUFFICIENT CM FOR OVERLAYS*
  1623. RMSC DIS 0,*BAD OVERLAY FILE*
  1624. * /--- BLOCK BLV 00 000 82/09/27 18.35
  1625. BLV SPACE 4,10
  1626. ** BLV - BEGIN LEVEL.
  1627. *
  1628. * RECEIVED (1,0) OVERLAY, INITIALIZE NEW LEVEL
  1629. * SET UP OFFSET POINTER, CHANGE I/O BUFFER POINTER
  1630. *
  1631. * ENTRY ((X1)) = OVERLAY INFORMATION WORD.
  1632. * (B2) = ADDRESS OF FIRST ENTRY POINT.
  1633.  
  1634.  
  1635. BLV PS ENTRY / EXIT
  1636.  
  1637. * CHECK FOR THIS LEVEL OFF.
  1638. * ((X1)) = OVERLAY INFORMATION WORD.
  1639.  
  1640. SA3 X1
  1641. SX3 X3
  1642. PL X3,BLV1 IF THIS LEVEL IS ON
  1643.  
  1644. * SET FLAG FOR SKIPPING THIS LEVEL.
  1645.  
  1646. SX6 -1
  1647. SA6 LVLOFF
  1648. EQ BLV RETURN
  1649.  
  1650. * SET FLAG TO LOAD THIS LEVEL.
  1651.  
  1652. BLV1 SX6 B0
  1653. SA6 LVLOFF
  1654.  
  1655. * SAVE THE RANDOM INDEX FOR THIS LEVEL IF THE FIRST
  1656. * TIME THROUGH.
  1657.  
  1658. SA2 OVEMFWA
  1659. PL X2,BLV2 IF NOT THE FIRST TIME THROUGH
  1660.  
  1661. SA2 LEVRI
  1662. BX6 X2 (X6) = RANDOM INDEX
  1663. SA6 X1-LEVEL0+RITAB
  1664.  
  1665. BLV2 SX1 B2 ADDRESS WHERE OVERLAY GOES
  1666. SX6 A1 LOCATION ADDRESS REALLY IS
  1667. SA6 LOC SAVE LOCATION OF OVERLAY
  1668. IX6 X6-X1 GET OFFSET TO SUBOV POINTERS
  1669. SA6 OFFSET USED TO PROCESS (1,1) OVERLAYS
  1670. SA1 MASTER+1 FIRST
  1671. SX6 X1
  1672. MX6 42
  1673. BX6 X6*X1
  1674. SA2 A1+1 NEXT FREE ADDRESS (IN)
  1675. BX6 X6+X2 SET FIRST
  1676. SA6 A1
  1677.  
  1678. * INITIALIZE THE EM REQUIRED FOR A LEVEL TO THE
  1679. * LENGTH OF THE 1,0 OVERLAY. (X6) = LWA + 1.
  1680.  
  1681. SA1 LOC (X1) = FWA
  1682. SX6 X6
  1683. IX6 X6-X1 (X6) = 1,0 OVERLAY LENGTH
  1684. SA6 OVEM
  1685.  
  1686. * SET THE WORD CONTAINING THE NEXT ADDRESS THAT
  1687. * A SUBOVERLAY WILL BE WRITTEN TO WHEN OVERLAYS
  1688. * ARE KEPT ON DISK TO THE FIRST WORD OF THE EM
  1689. * BUFFER. (X6) = 1,0 OVERLAY LENGTH.
  1690.  
  1691. SA1 OVEMFWA
  1692. IX6 X6+X1
  1693. SA6 OVLECS
  1694.  
  1695. EQ BLV RETURN
  1696.  
  1697. * /--- BLOCK PCS 00 000 82/09/27 18.35
  1698. PCS SPACE 5,10
  1699. ** PCS - PROCESS CMP SUBOVERLAYS.
  1700. *
  1701. * THE CMP OVERLAY STRUCTURE BEGINS WITH THE PRIMARY
  1702. * (1,0) CMP OVERLAY FOLLOWED BY THE (1,3) CMP
  1703. * SUBOVERLAYS AND IS TERMINATED BY A (1,2) DUMMY
  1704. * OVERLAY.
  1705. *
  1706. * THE CENTRAL MICRO PLATO SUBOVERLAYS ARE FOUND IN
  1707. * LEVEL (1,3) OVERLAYS. EACH SUBOVERLAY CORRESPONDS
  1708. * TO A CYBIL MODULE OR COMPASS IDENT. THESE MODULES
  1709. * AND IDENTS MAY CONTAIN MULTIPLE ENTRY POINTS.
  1710. *
  1711. * IN EACH SUBOVERLAY, THE TRANSFER ADDRESS POINTS TO
  1712. * A TABLE USED TO LINK THE SUBOVERLAY INFORMATION
  1713. * WORDS (SIW) FOUND IN IDENT -CMPILXO- WITH THE
  1714. * ENTRY POINTS IN THE SUBOVERLAY. EACH ENTRY IN
  1715. * THIS TABLE IS ONE WORD, AND THE TABLE IS
  1716. * TERMINATED BY A ZERO WORD. THE FORMAT OF EACH
  1717. * ENTRY IS -
  1718. *
  1719. * 24/0, 18/SIW ADDRESS, 18/ENTRY ADDRESS.
  1720. *
  1721. * ENTRY (B4) = OVERLAY 54 TABLE FWA.
  1722. *
  1723. * EXIT NONE.
  1724.  
  1725. * /--- BLOCK PCS 00 000 82/09/27 18.35
  1726.  
  1727. PCS PS ENTRY / EXIT
  1728.  
  1729. SA3 LVLOFF
  1730. NG X3,PCS IF CMP = OFF
  1731.  
  1732. SB1 1
  1733. SA1 B4 (X1) = 54 TABLE FWA
  1734.  
  1735. * GET SUBOVERLAY ENTRY POINT TABLE FWA = XFR ADDR.
  1736.  
  1737. SA2 A1+4 (X2) = 42/ENTRY PT, 18/XFR ADDR
  1738. SB6 X2 (B6) = TRANSFER ADDRESS
  1739.  
  1740. * COMPUTE OFFSET = CURRENT HEADER LOCATION -
  1741. * FWAS.
  1742.  
  1743. LX1 42 POSTITION FWAS
  1744. SB5 X1 (B5) = FWAS
  1745. SB2 A1-B5 (B2) = CODE OFFSET
  1746.  
  1747. * COMPUTE OVERLAY LENGTH. LENGTH = LWA+1 - FWAS.
  1748. * (B5) = FWAS.
  1749.  
  1750. SA2 B4+B1 (X2) = 42/STUFF, 18/LWA+1
  1751. SB3 X2 (B3) = LWA+1
  1752. SB3 B3-B5 (B3) = OVERLAY LENGTH
  1753.  
  1754. * CHECK IF OVERLAYS ARE TO BE WRITTEN TO EM, OR
  1755. * ARE TO STAY ON DISK.
  1756.  
  1757. SA1 CDISK
  1758. NZ X1,PCS2 IF TO STAY ON DISK
  1759.  
  1760. * SUBOVERLAYS ARE TO BE WRITTEN TO EXTENDED MEMORY.
  1761.  
  1762. PCS1 BSS 0
  1763.  
  1764. * MAKE SURE THERE IS ENOUGH CM TO HOLD THIS OVERLAY.
  1765. * (B5) = FWAS. (B3) = OVERLAY LENGTH.
  1766.  
  1767. RJ =XCCC
  1768.  
  1769. * REQUEST EXTENDED MEMORY. (B3) = OVERLAY LENGTH.
  1770.  
  1771. RJ =XREM
  1772.  
  1773. * WRITE SUBOVERLAYS TO EM.
  1774.  
  1775. RJ WCS
  1776.  
  1777. EQ PCS RETURN
  1778.  
  1779. * SUBOVERLAYS ARE TO STAY ON DISK, AND ONLY LOADED
  1780. *
  1781. * WHEN NECESSARY.
  1782.  
  1783. PCS2 BSS 0
  1784.  
  1785. * DETERMINE IF THIS IS THE INITIAL RUN-THROUGH.
  1786.  
  1787. SA1 OVEMFWA
  1788. PL X1,PCS3 IF NOT INITIAL RUN-THROUGH
  1789.  
  1790. * COMPUTE SUBOVERLAY CM REQUIREMENT.
  1791.  
  1792. RJ =XCCC
  1793.  
  1794. * COMPUTE SUBOVERLAY EM REQUIREMENT.
  1795.  
  1796. RJ =XCSE
  1797.  
  1798. EQ PCS RETURN
  1799.  
  1800. * WRITE SUBOVERLAY TO EM.
  1801.  
  1802. PCS3 RJ WCS
  1803.  
  1804. EQ PCS RETURN
  1805.  
  1806. * /--- BLOCK WCS 00 000 82/09/27 18.35
  1807. WCS SPACE 4,10
  1808. ** WCS - WRITE CMP SUBOVERLAYS TO EM.
  1809. *
  1810. * ENTRY (OVLECS) = EM FWA TO WRITE OVERLAYS.
  1811. * (B1) = 1.
  1812. * (B2) = CODE OFFSET.
  1813. * (B3) = OVERLAY LENGTH.
  1814. * (B4) = CURRENT CODE LOCATION
  1815. * (B5) = FWAS.
  1816. * (B6) = TRANSFER ADDRESS = POINTER TO
  1817. * ENTRY POINT TABLE.
  1818. *
  1819. * EXIT (OVLECS) = NEXT FREE EM ADDRESS.
  1820. * (B1) = SAME AS ENTRY.
  1821. * (B2) = SAME AS ENTRY.
  1822. * (B3) = SAME AS ENTRY.
  1823. * (B5) = SAME AS ENTRY.
  1824. *
  1825. * USES X - 0, 1, 2, 3, 6.
  1826. * A - 0, 1, 2, 6.
  1827. * B - 4, 6.
  1828. *
  1829. * CALLS NONE.
  1830. *
  1831. * MACROS NONE.
  1832.  
  1833.  
  1834. WCS PS ENTRY / EXIT
  1835.  
  1836. * WRITE OVERLAY TO EM. (OVLECS) = EM FWA.
  1837.  
  1838. SA1 OVLECS
  1839. BX0 X1 (X0) = EM FWA
  1840. SA0 B4 (A0) = CURRENT CODE LOCATION
  1841. + WE B3
  1842. RJ =XECSPRTY
  1843.  
  1844. * UPDATE NEXT EM LOCATION.
  1845.  
  1846. SX6 B3
  1847. IX6 X6+X1
  1848. SA6 A1
  1849.  
  1850. * PREPARE TO SET CMP OVERLAY TABLE ENTRIES.
  1851. * FORM SUB-OVERLAY INFORMATION WORD (SIW).
  1852. * (X1) = EM FWA.
  1853.  
  1854. SX0 B3 (X0) = OVERLAY LENGTH
  1855. LX1 18
  1856. BX3 X1+X0
  1857.  
  1858. SX0 B5 (X0) = FWAS
  1859. LX3 18
  1860. BX3 X3+X0 (X3) = SIW.
  1861.  
  1862. SA1 OFFSET
  1863. SB4 X1 (B4) = CODE OFFSET.
  1864.  
  1865. * SET CMP OVERLAY TABLE ENTRIES. (X3) = SIW.
  1866. * (B6) = TRANSFER ADDRESS = POINTER TO ENTRY
  1867. * POINT TABLE. (B4) = OFFSET.
  1868.  
  1869. WCS3 SA1 B6+B2
  1870. ZR X1,WCS IF NO MORE ENTRY POINTS
  1871.  
  1872. * SET WORD 2 -
  1873. * 30/JUMP TO XDCLED PROCEDURE, 30/0.
  1874.  
  1875. LX1 42
  1876. SX2 X1+B4 (X1) = OVERLAY TABLE ENTRY FWA
  1877. SA2 X2+B1 (X2) = OV TABLE WORD 2
  1878. MX0 18
  1879. BX6 X0*X1 (X6) = 18/XDCLED ENTRY PT
  1880. LX6 47-59+60
  1881. BX6 X6+X2 (X6) = 30/EQ XDCL
  1882. SA6 A2
  1883.  
  1884. * SET WORD 3 -
  1885. * SIW = 24/EM FWA, 18/LENGTH, 18/CM FWA.
  1886.  
  1887. BX6 X3 (X6) = SIW
  1888. SA6 A2+B1
  1889.  
  1890. SB6 B6+B1 INCREMENT ENTRY POINT TABLE PTR
  1891. EQ WCS3 LOOP
  1892.  
  1893. * /--- BLOCK PSO 00 000 82/09/27 18.35
  1894. PSO SPACE 5,11
  1895. ** PSO - PROCESS SUBOVERLAYS.
  1896. *
  1897. * IF OVERLAYS ARE TO STAY ON DISK AND THIS IS THE
  1898. * FIRST TIME THROUGH, COMPUTE THE CM/EM REQUIREMENTS
  1899. * AND RETURN.
  1900. *
  1901. * IF OVERLAYS ARE TO STAY ON DISK AND THIS IS NOT
  1902. * THE FIRST TIME THROUGH, WRITE THE SUBOVERLAY
  1903. * TO EM.
  1904. *
  1905. * IF OVERLAYS ARE NOT TO STAY ON DISK, REQUEST AN
  1906. * EM BUFFER AND WRITE THE SUBOVERLAY TO EM.
  1907. *
  1908. * ENTRY - (A1) - POINTER TO FIRST WORD OF OVERLAY
  1909. * (X1) - FIRST WORD OF OVERLAY
  1910. * (B2) - ADDRESS OF FIRST WORD
  1911.  
  1912.  
  1913. PSO PS ENTRY / EXIT
  1914.  
  1915. * IF THIS LEVEL IS OFF, DO NOTHING.
  1916.  
  1917. SA2 LVLOFF
  1918. NG X2,PSO IF THIS LEVEL IS OFF
  1919. ZR X1,PSO OVFILE LENGTH = 0 (FIRST WORD)
  1920. SB1 1
  1921.  
  1922. * GET LENGTH OF OVERLAY FILE AND SET POINTER TO
  1923. * FIRST SUBOVERLAY.
  1924.  
  1925. SB3 X1 (B3) = LENGTH OF OVERLAY FILE
  1926. SB4 A1+B1 (B4) = POINTER TO NEXT SUBOV
  1927.  
  1928. * SAVE B3, B4.
  1929.  
  1930. SX6 B4
  1931. LX6 18
  1932. IX6 X6+X1
  1933. SA6 PSOA
  1934.  
  1935. * CHECK IF OVERLAYS ARE TO BE WRITTEN TO EM, OR
  1936. * ARE TO STAY ON DISK.
  1937.  
  1938. SA1 CDISK
  1939. NZ X1,PSO2 IF TO STAY ON DISK
  1940.  
  1941. * SUBOVERLAYS ARE TO BE WRITTEN TO EXTENDED MEMORY.
  1942.  
  1943. PSO1 BSS 0
  1944.  
  1945. * REQUEST EXTENDED MEMORY FOR THE SUBOVERLAYS.
  1946.  
  1947. RJ =XREM
  1948.  
  1949. * COMPUTE SUBOVERLAY CM REQUIREMENT.
  1950.  
  1951. RJ =XCSC
  1952.  
  1953. * RESTORE B3, B4.
  1954.  
  1955. SA1 PSOA
  1956. SB3 X1
  1957. LX1 59-35+18
  1958. SB4 X1
  1959.  
  1960. * WRITE SUBOVERLAYS TO EM.
  1961.  
  1962. RJ WSE
  1963.  
  1964. EQ PSO RETURN
  1965.  
  1966. * SUBOVERLAYS ARE TO STAY ON DISK, AND ONLY LOADED
  1967. * WHEN NECESSARY.
  1968.  
  1969. PSO2 BSS 0
  1970.  
  1971. * DETERMINE IF THIS IS THE INITIAL RUN-THROUGH.
  1972.  
  1973. SA1 OVEMFWA
  1974. PL X1,PSO3 IF NOT INITIAL RUN-THROUGH
  1975.  
  1976. * COMPUTE SUBOVERLAY CM REQUIREMENT.
  1977.  
  1978. RJ =XCSC
  1979.  
  1980. * RESTORE B3, B4.
  1981.  
  1982. SA1 PSOA
  1983. SB3 X1
  1984. LX1 59-35+18
  1985. SB4 X1
  1986.  
  1987. * COMPUTE SUBOVERLAY EM REQUIREMENT.
  1988.  
  1989. RJ =XCSE
  1990.  
  1991. EQ PSO RETURN
  1992.  
  1993. * WRITE SUBOVERLAY TO EM.
  1994.  
  1995. PSO3 RJ WSE
  1996.  
  1997. EQ PSO RETURN
  1998.  
  1999. PSOA BSS 1 SAVED B3, B4
  2000.  
  2001. * /--- BLOCK WSE 00 000 82/09/27 18.35
  2002. WSE SPACE 4,10
  2003. ** WSE - WRITE SUBOVERLAYS TO EM.
  2004. *
  2005. * ENTRY (OVLECS) = EM FWA TO WRITE SUBOVERLAY.
  2006. * (B1) = 1.
  2007. * (B2) = FWA OF OVERLAY FILE.
  2008. * (B3) = LENGTH OF OVERLAY FILE.
  2009. * (B4) = POINTER TO NEXT SUBOV.
  2010. *
  2011. * EXIT (OVLECS) = NEXT FREE EM ADDRESS.
  2012. * (B1) = SAME AS ENTRY.
  2013. * (B2) = SAME AS ENTRY.
  2014. *
  2015. * USES X - 0, 1, 2, 3, 6.
  2016. * A - 0, 1, 2, 3, 6.
  2017. * B - 3, 4, 7.
  2018. *
  2019. * CALLS NONE.
  2020. *
  2021. * MACROS NONE.
  2022.  
  2023.  
  2024. WSE PS ENTRY / EXIT
  2025.  
  2026. * SEE IF THERE ARE ANY MORE SUBOVERLAYS TO PROCESS.
  2027.  
  2028. WSE1 ZR B3,WSE IF NO MORE SUBOVERLAYS
  2029.  
  2030. * GET SUBOVERLAY LENGTH.
  2031.  
  2032. SA1 B4
  2033. SB7 X1 (B7) = SUBOVERLAY LENGTH
  2034. SB3 B3-B7
  2035.  
  2036. * GET SUBOVERLAY NAME AND ADDRESS.
  2037.  
  2038. SA1 B4+B1
  2039. SA2 OFFSET
  2040. IX2 X1+X2 (X2) = PTR TO SUBOV INFO WORD
  2041. SA2 X2
  2042.  
  2043. * MAKE SURE THE SUBOVERLAY NAMES MATCH.
  2044.  
  2045. MX6 42
  2046. BX2 X2-X1
  2047. BX6 X2*X6
  2048. NZ X6,"CRASH" IF NAMES DO NOT MATCH
  2049.  
  2050. * WRITE SUBOVERLAY TO EM.
  2051.  
  2052. SA0 A1 (A0) = CURRENT CM ADDRESS
  2053. SA3 OVLECS (X3) = SUBOVERLAY EM FWA
  2054. BX0 X3
  2055. + WE B7
  2056. RJ =XECSPRTY
  2057.  
  2058. * UPDATE NEXT EM ADDRESS.
  2059.  
  2060. SX1 B7
  2061. IX6 X3+X1
  2062. SA6 A3
  2063.  
  2064. * FORM SUBOVERLAY INFO WORD.
  2065.  
  2066. SX6 B2 SUBOVERLAY CM FWA
  2067. LX1 18
  2068. BX6 X6+X1
  2069. LX0 18+18
  2070. BX6 X6+X0
  2071. SA6 A2
  2072.  
  2073. SB4 A1+B7 (B4) = POINTER TO NEXT SUBOV
  2074. EQ WSE1 LOOP
  2075.  
  2076. * /--- BLOCK ELV 00 000 82/09/27 18.35
  2077. ELV SPACE 4,10
  2078. ** ELV - END LEVEL.
  2079. *
  2080. * RECEIVED (1,2) OVERLAY, SIGNALLING
  2081. * END OF LEVEL, AND ALSO CONTAINS POINTERS TO
  2082. * THE COMMAND TABLE. IF POINTER IS ZERO, HASHING
  2083. * IS NOT DONE.
  2084.  
  2085.  
  2086. ELV PS ENTRY / EXIT
  2087.  
  2088. SA3 LVLOFF
  2089. NG X3,ELV IF THIS LEVEL OFF
  2090.  
  2091. ZR X1,ELV1 FIRST WORD MEANS TTUTOR
  2092. RJ HASHI
  2093.  
  2094. ELV1 SB1 1
  2095. SA2 LOC (X2) = FWA
  2096. SA1 X2 (X1) = NAME AND SUBOV ADDR
  2097. SA3 X1 (X3) = SUBOV INFORMATION WORD
  2098.  
  2099. * COMPUTE THE LENGTH OF THE 1,0 SUBOVERLAY.
  2100. * (X2) = FWA.
  2101.  
  2102. SA1 MASTER+3 LWA+1
  2103. IX6 X1-X2 AMOUNT OF ECS REQUIRED
  2104. SB3 X6 (B3) = LENGTH
  2105.  
  2106. * CHECK IF LOADING FROM DISK OR EM.
  2107.  
  2108. SA1 CDISK
  2109. ZR X1,ELV2 IF LOADING FROM EM
  2110.  
  2111. * LOADING FROM DISK - CHECK IF THIS IS THE FIRST
  2112. * TIME THROUGH.
  2113.  
  2114. SA1 OVEMFWA
  2115. BX0 X1 (X0) = EM FWA
  2116. PL X1,ELV3 IF NOT THE FIRST TIME THROUGH
  2117.  
  2118. * LOADING FROM DISK, AND THE FIRST TIME THROUGH.
  2119. * COMPUTE THE MAXIMUM AMOUNT OF EM REQUIRED.
  2120.  
  2121. SA1 OVEM (X1) = EM REQUIRED BY THIS LVL
  2122. SA2 MAXOVEM (X2) = MAX EM REQUIRED SO FAR
  2123. IX0 X2-X1
  2124. PL X0,ELV4 IF NOT LARGER THAN MAX SO FAR
  2125.  
  2126. BX6 X1
  2127. SA6 A2
  2128. EQ ELV4
  2129.  
  2130. * LOADING FROM EM - REQUEST EM FOR 1,0 OVERLAY.
  2131. * (B3) = 1,0 OVERLAY LENGTH.
  2132.  
  2133. ELV2 RJ =XREM
  2134.  
  2135. SA1 OVLECS
  2136. BX0 X1 (X0) = EM FWA
  2137.  
  2138. * WRITE 1,0 SUBOVERLAY TO EM. (X0) = EM FWA.
  2139. * (B3) = LENGTH.
  2140.  
  2141. ELV3 SA2 LOC (X2) = CM FWA
  2142. SA0 X2 (A0) = CM FWA
  2143. + WE B3
  2144. RJ =XECSPRTY
  2145.  
  2146. * FORM OVERLAY INFO WORD. (X0) = EM LOCATION.
  2147. * ((A3)) = SUBOV INFORMATION WORD.
  2148. * (X2) = FWA.
  2149.  
  2150. SA1 OFFSET
  2151. SX6 X2 LOCATION IT CURRENTLY IS
  2152. IX6 X2-X1 LOCATION IT SHOULD BE LOADED
  2153. SX1 B3
  2154. LX1 18
  2155. BX6 X6+X1 AND OVERLAY LENGTH
  2156. LX0 18+18
  2157. BX6 X6+X0 AND ECS ADDRESS
  2158. SA6 A3 STORE BACK IN SUBOV WORD
  2159.  
  2160. * RESTORE *FIRST*.
  2161.  
  2162. ELV4 SA1 FIRST
  2163. SA2 MASTER+1
  2164. MX6 42
  2165. BX6 X2*X6
  2166. BX6 X6+X1
  2167. SA6 A2 RESTORE FIRST
  2168.  
  2169. * /--- BLOCK ELV 00 000 82/09/27 18.35
  2170. EQ ELV RETURN
  2171.  
  2172. SPACE 4,10
  2173. ** OVERLAY LOADING SUBROUTINE DATA.
  2174.  
  2175. OFFSET BSS 1
  2176. LOC BSS 1
  2177. ENTRY FIRST
  2178. FIRST BSS 1 CIO BUFFER FWA
  2179. ENTRY OVLECS
  2180. OVLECS BSS 1
  2181. LVLOFF DATA 0
  2182. OVEMFWA DATA -1 OVERLAY LEVEL EM FWA
  2183. MAXOVEM DATA 0 MAX EM NEEDED BY LEVELS
  2184. ENTRY OVEM
  2185. OVEM DATA 0 EM NEEDED BY A PARTICULAR LEVEL
  2186. ENTRY MAXCM
  2187. MAXCM DATA 0 MAX CM FL REQUIRED
  2188. LEVRI DATA 0 LEVEL RANDOM INDEX
  2189. ENTRY LOADFL
  2190. LOADFL DATA 0 CM REQUIRED TO LOAD FROM DISK
  2191.  
  2192. * COMMON DECKS.
  2193.  
  2194. *CALL COMCLFM
  2195.  
  2196. *CALL COMCCIO
  2197.  
  2198. * SETUP SYSTEM INTERFACES TO USE INTERFACE IN
  2199. * IDENT *CSYS* ONLY.
  2200.  
  2201. EXT S=SYS
  2202. SYS= EQU S=SYS
  2203. EXT S=WNB
  2204. WNB= EQU S=WNB
  2205. EXT S=RCL
  2206. RCL= EQU S=RCL
  2207. EXT S=MSGX
  2208. MSG= EQU S=MSGX
  2209.  
  2210. TITLE INITIALIZE COMINFO (THE HASH INFO TABLE)
  2211. *CALL MACROS
  2212. ADR MICRO 1,,/A0/ DEFINE A0 TO BE START OF TABLE
  2213. COM MICRO 1,,/X3/ X3 SET TO COMINFO FOR FIND
  2214.  
  2215. * ENTER WITH (A1) POINTING TO FIRST POINTER
  2216. * (X1) CONTAINS VALUE
  2217. *
  2218.  
  2219. HASHI EQ * CALLED FROM -READOV- PROCESSING
  2220. SB1 1
  2221. SA2 OFFSET RELOCATION OFFSET
  2222. IX6 X1+X2 COMNAMS
  2223. SA6 COMNAMS
  2224. SA1 A1+B1
  2225. BX6 X1 COMNAML
  2226. SA6 A6+B1
  2227. SA1 A1+B1
  2228. IX6 X1+X2 COMINFO
  2229. SA6 A6+B1
  2230. SA1 A1+B1
  2231. BX6 X1 COMINFL
  2232. SA6 A6+B1
  2233. SA1 A1+B1
  2234. IX1 X1+X2 HASHCD
  2235. SA3 X1
  2236. BX6 X3 (HASHCD)
  2237. SA6 A6+B1
  2238. SA1 A1+B1
  2239. IX1 X1+X2 CALCNAM
  2240. SA3 X1
  2241. BX6 X3 (CALCNAM)
  2242. SA6 A6+B1
  2243. SA1 A1+B1
  2244. BX6 X1 LABELI
  2245. SA6 A6+B1
  2246. SA1 A1+B1
  2247. IX6 X1+X2 LABINFO
  2248. SA6 A6+B1
  2249. SA1 CMNDTBL
  2250. BX0 X1
  2251. SA1 COMNAMS
  2252. SA0 X1
  2253. SA1 COMNAML
  2254. SB1 X1
  2255. + WE B1 WRITE OUT COMMAND NAME TABLE
  2256. RJ ECSPRTY
  2257. SA1 COMINFO
  2258. SA0 X1 A0 = START OF COMINFO
  2259. SB1 1 B1 = CONSTANT *1*
  2260. * HASH EACH NAME AND MERGE WITH INFO IN COMINFO
  2261. SA1 COMNAML
  2262. SB3 X1 LENGTH OF NAME TABLE
  2263. * /--- BLOCK ELV 00 000 82/09/27 18.35
  2264. SB2 B0 COUNTER FOR END TEST
  2265. SB7 B0 B7 = NUMBER OF REAL COMMANDS
  2266. CINITA SA1 COMNAMS LOAD NEXT WORD OF NAME TABLE
  2267. SA1 X1+B2
  2268. MX0 6
  2269. BX2 X0*X1 GET FIRST CHAR
  2270. ZR X2,CINITAA IGNORE IF NOT A REAL COMMAND
  2271. HASH X1,X2,A3 X2 IS HASH NUMBER FOR THIS NAME
  2272. SB4 X2 MOVE TO B4
  2273. SA3 A0+B2 LOAD INFO FOR THIS COMMAND
  2274. PX3 X3,B2 COMMAND NUMBER
  2275. LX3 30
  2276. PX3 X3,B2 INDEX TO NAME TABLE
  2277. LX3 42 POSITION INFO WORD PROPERLY
  2278. PX6 X3,B4 MERGE WITH HASH NUMBER
  2279. SA1 COMNAMS SAVE TEMP IN NAME TABLE
  2280. SA6 X1+B7
  2281. SB7 B7+B1 INCREMENT REAL COMMAND COUNT
  2282. CINITAA SB2 B2+B1
  2283. LT B2,B3,CINITA
  2284. * INITIALIZE THE FREE CHAIN (ALL OF COMINFO)
  2285. SX0 B0 STORE ZERO IN LOWER 48 BITS
  2286. SB2 B0 POINTER FOR END TEST
  2287. SA1 COMINFL
  2288. SB6 X1-1 B6 = START OF FREE CHAIN
  2289. PX6 X0,B6 MAKE FIRST WORD POINT TO LAST
  2290. CINITB SA1 COMINFO STORE NEXT WORD OF CHAIN
  2291. SA6 X1+B2
  2292. PX6 X0,B2 NEXT WORD POINTS BACK ONE WORD
  2293. SB2 B2+B1 END TEST
  2294. LE B2,B6,CINITB
  2295. * CONSTRUCT THE ACTUAL HASH TABLE
  2296. SB2 0 B2 = POINTER TO NEXT COMMAND
  2297. CINITC SA1 A0+B6 LOAD FIRST WORD OF FREE CHAIN
  2298. UX6,B5 X1 B5 = ADDRESS OF NEXT FREE WORD
  2299. SA1 A0+B5 DELETE THIS WORD FROM CHAIN
  2300. UX1,B3 X1 GET POINTER TO THIRD WORD
  2301. PX6 X6,B3 MAKE FIRST WORD POINT TO THIRD
  2302. SA6 A0+B6 RESTORE FIRST FREE CHAIN WORD
  2303. SA2 COMNAMS NEXT COMMAND TO PROCESS
  2304. SA2 X2+B2
  2305. UX2,B3 X2 B3 = HASH CODE FOR THIS COMMAND
  2306. ADDLINK B3,B5,X2,B4,A1,A6 ADD NEXT LINK FOR THIS HASH CODE
  2307. SB2 B2+B1 END TEST
  2308. LT B2,B7,CINITC
  2309. * MAKE ALL REMAINING FREE WORDS INTO ONE WORD CHAINS
  2310. SB5 B6 CHANGE COMMAND WILL BE FASTER
  2311. CINITD SA1 A0+B5 LOAD NEXT FREE WORD
  2312. PX6 X1,B5 MAKE IT POINT TO ITSELF
  2313. SA6 A1 STORE
  2314. UX1,B5 X1 GET POINTER TO NEXT WORD
  2315. NE B5,B6,CINITD LOOP IF NOT BACK TO FIRST WORD
  2316. * SAVE THE INITIAL COMINFO TABLE IN ECS
  2317. SA1 CMNDINF
  2318. BX0 X1
  2319. SA1 COMINFL
  2320. SB7 X1
  2321. + WE B7 WRITE OUT HASHED INFO TABLE
  2322. RJ ECSPRTY
  2323.  
  2324. * GET TRUE COPY OF COMMANDS BACK INTO CM
  2325.  
  2326. SA1 CMNDTBL
  2327. BX0 X1
  2328. SA1 COMNAMS
  2329. SA0 X1
  2330. * /--- BLOCK ELV 00 000 78/12/15 23.21
  2331. SA1 COMNAML
  2332. SB7 X1
  2333. + RE B7 READ COMMAND NAME TABLE
  2334. RJ ECSPRTY
  2335. SA1 COMINFO
  2336. SA0 X1 RESTORE A0 FOR THE MACROS
  2337.  
  2338. * FIND THE INFO FOR THE -CALC- COMMAND
  2339. * A0 POINTS TO THE HASH TABLE AT THIS POINT
  2340. SA2 CALCNAM HOLERITH FOR -CALC-
  2341. HASH X2,X0,A1
  2342. SA3 COMNAMS X3 REFERENCED VIA -COM- MICRO
  2343. FIND X2,X0,CINITE,B1,X5,B5,B3,B4,A1
  2344. CALL S=ABORT CAN'7T HAPPEN
  2345. * COMPUTE CONTENTS OF -LABINFO-
  2346. CINITE SA1 LABELI WHERE STATEMENT LABEL JUMPS TO
  2347. MX6 -18
  2348. LX5 -12
  2349. BX5 X6*X5 CLEAR OLD JUMP VALUE
  2350. BX6 X5+X1 MERGE WITH ADDRESS -LABELI-
  2351. LX6 12
  2352. PX6 X6,B5 ATTACH TABLE INDEX
  2353. SA1 LABINFO
  2354. SA6 X1 STORE INFO FOR STATEMENT LABEL
  2355. EQ HASHI
  2356. *
  2357. * THIS LIST MATCHES WITH THE LIST IN IDENT -MARKER-
  2358. * THAT IS ASSEMBLED AT THE END OF CPU TUTOR OVERLAYS
  2359. *
  2360. COMNAMS BSS 1 RELOCATED
  2361. COMNAML BSS 1
  2362. COMINFO BSS 1 RELOCATED
  2363. COMINFL BSS 1
  2364. HASHCD BSS 1 RELOCATED
  2365. CALCNAM BSS 1 RELOCATED
  2366. LABELI BSS 1
  2367. LABINFO BSS 1 RELOCATED
  2368.  
  2369. * /--- BLOCK -ZERO- 00 000 79/01/03 13.35
  2370. ZEROSAV SPACE 5,11
  2371. ** ZEROSAV - SAVE REGISTERS USED BY *ZERO* MACRO
  2372. *
  2373. * SAVE *X4*, *A4*, *X7*, *A7*
  2374.  
  2375. ENTRY ZEROSAV
  2376.  
  2377. ZEROSAV PS
  2378.  
  2379. SA0 A4 HOLD *A4*
  2380. BX0 X4 HOLD *X4*
  2381. SA4 A7 GET WHATS STORED AT *A7*
  2382. SA7 ZBSAVX7 SAVE *X7*
  2383. BX7 X4 GET WHAT IS STORED AT *A7*
  2384. SA7 ZBSAVXX SAVE WHAT SHOULD BE THERE
  2385. SX7 A4 GET *A7* ADDRESS
  2386. SA7 ZBSAVA7 SAVE *A7*
  2387. BX7 X0 WRITE *X4* TO SAVE AREA
  2388. SA7 ZBSAVX4 SAVE *X4*
  2389. SX7 A0 WRITE *A4* TO SAVE AREA
  2390. SA7 ZBSAVA4 SAVE *A4*
  2391. EQ ZEROSAV RETURN
  2392.  
  2393. ZERORST SPACE 5,11
  2394. ** ZERORST - RESTORE REGISTERS USED BY *ZERO* MACRO
  2395. *
  2396. * RESTORE *X4*, *A4*, *X7*, *A7*
  2397.  
  2398. ENTRY ZERORST
  2399.  
  2400. ZERORST PS
  2401.  
  2402. SA4 ZBSAVA4 GET *A4*
  2403. SA0 X4 HOLD *A4* IN *A0*
  2404. SA4 ZBSAVX4 GET *X4*
  2405. BX0 X4 HOLD *X4* IN *X0*
  2406. SA4 ZBSAVXX GET WHAT IS STORED AT *A7*
  2407. BX7 X4 MOVE TO WRITE REGISTER
  2408. SA4 ZBSAVA7 GET *A7* ADDRESS
  2409. SA7 X4 SAVE ORIGINAL DATA, SET *A7*
  2410. SA4 ZBSAVX7 GET WHAT WAS IN *X7*
  2411. BX7 X4 RESET *X7*
  2412. SA4 A0 RESET *A4*
  2413. BX4 X0 RESET *X4*
  2414. EQ ZERORST RETURN
  2415. *
  2416. ZBSAVXX BSS 1
  2417. ZBSAVX7 BSS 1
  2418. ZBSAVA7 BSS 1
  2419. ZBSAVX4 BSS 1
  2420. ZBSAVA4 BSS 1
  2421. *
  2422. * /--- BLOCK ENDX 00 000 78/12/19 00.05
  2423.  
  2424. END