User Tools

Site Tools


plato:source:plaopl:autload

AUTLOAD

Table Of Contents

  • [00005] AUTOLOAD
  • [00020] -CSINIT- INITIALIZATIONS
  • [00073] -CSLOAD- LOAD RVARS,LVARS,NCVARS,JBUFFS
  • [00136] -LOADCS- LOAD COMMON/STORAGE
  • [00434] ECSERRS
  • [00476] RLOAD
  • [00540] -CSULOAD- UNLOAD RVARS,LVARS,NCVARS,JBUFFS
  • [00581] -ULOADCS- UNLOAD COMMON AND STORAGE
  • [00812] LESADD
  • [00833] -RESVREL-
  • [00895] NOJBUF
  • [00919] GJBUF - ALLOCATE A JUDGE BUFFER
  • [00995] RJBUF - RETURN JUDGE BUFFER TO POOL
  • [01055] NJBMSG - ISSUE ERROR MESSAGE AND ABORT.

Source Code

AUTLOAD.txt
  1. AUTLOAD
  2. * /--- FILE TYPE = E
  3. * /--- BLOCK AUTLOAD 00 000 79/01/04 09.05
  4. IDENT AUTLOAD
  5. TITLE AUTOLOAD
  6. *
  7. * GET COMMON SYMBOL TABLE
  8. *
  9. CST
  10. *
  11. *
  12. EXT ECSPRTY
  13. EXT ECSERRB
  14. EXT LSNADDR
  15. *
  16. LOADFLG BSSZ 1
  17. *
  18. *
  19. * /--- BLOCK CSINIT 00 000 79/02/09 13.53
  20. TITLE -CSINIT- INITIALIZATIONS
  21. *
  22. *
  23. * -CSINIT-
  24. * INITIALIZE STORAGE/COMMON LOADING
  25. *
  26. *
  27. ENTRY CSINIT
  28. CSINIT EQ *
  29. MX6 0 PRE-SET
  30. SA6 TCOMSET
  31. SA6 TCOMSET+1
  32. SA6 TCOMSET+2
  33. SA6 TSTOSET
  34. SA6 TSTOSET+1
  35. SA6 TSTOSET+2
  36. CALL INROUTE
  37. PL X1,CSINIT0 IF NOT IN ROUTER LESSON
  38. SA1 TBRVNUM
  39. ZR X1,CSINIT1 JUMP IF NO ROUTER VARIABLES
  40. MX6 1
  41. BX6 X1+X6 SET ROUTER VARIABLE LOAD BIT
  42. SA6 A1
  43. EQ CSINIT1
  44. *
  45. CSINIT0 MX6 1 CLEAR ROUTER VARIABLE LOAD BIT
  46. SA1 TBRVNUM
  47. BX6 -X6*X1
  48. SA6 A1
  49. *
  50. CSINIT1 SA1 TBCOMLS
  51. ZR X1,CSINIT JUMP IF NO COMMON
  52. NG X1,CSINIT JUMP IF NO AUTO-LOADING
  53. SX1 X1
  54. CALL READLES,WORK,1
  55. SA2 WORK
  56. SX2 X2 GET LENGTH OF COMMON
  57. * WHEN NC VAR LIMIT WAS CHANGED FROM 1500 TO 3000, HAD TO
  58. * KEEP THE ORIGINAL VALUE 1500 SINCE PREVIOUS LESSONS
  59. * DEPENDED ON THAT VALUE FOR LOADING COMMON AND STORAGE.
  60. * IF THIS CHECK WAS NOT CHANGED, LESSONS USING 1501-3000
  61. * WORD COMMONS WOULD AUTOLOAD, WHEN THEY WERE DESIGNED
  62. * NOT TO AUTOLOAD (BECAUSE AT THAT TIME THE LIMIT WAS
  63. * 1500). CHECK 1500 INSTEAD OF *NCVRLIM*. CMH 08/02/94
  64. SB1 X2-1500-1
  65. PL B1,CSINIT JUMP IF TOO LONG TO LOAD
  66. LX2 18+18
  67. SX6 NCVRBUF STARTING ADDRESS FOR NCVARS
  68. BX6 X2+X6 FORM *TCOMSET* ENTRY
  69. SA6 TCOMSET
  70. EQ CSINIT
  71. *
  72. * /--- BLOCK CSLOAD 00 000 79/01/04 14.32
  73. TITLE -CSLOAD- LOAD RVARS,LVARS,NCVARS,JBUFFS
  74. *
  75. *
  76. * -CSLOAD-
  77. * AUTOMATIC LOADING OF RVARS, LVARS, AND NCVARS
  78. * ALSO LOADS JUDGING BUFFERS IF NEEDED
  79. *
  80. * USES'; A0,A1,A2,A3,A6,A7
  81. * X0,X1,X2,X3,X4,X6,X7
  82. * B1,B2,B3
  83. *
  84. *
  85. *
  86. ENTRY CSLOAD
  87. CSLOAD EQ *
  88. SX6 -1 SET CSU LOADED
  89. SA6 LOADFLG
  90. IFNE DDEBUG,0,1
  91. SA6 =XCSFLG
  92. *
  93. SA1 TBRVNUM ROUTER VARIABLES LESSON NUMBER
  94. PL X1,LLOAD SIGN BIT = IN-ROUTER FLAG
  95. SX2 X1 GET LESSON NUMBER
  96. SX3 2 BIAS FOR HEADER
  97. CALL LESSADD
  98. AX1 18 GET NUMBER OF VARIABLES
  99. SB1 X1
  100. BX0 X7 ECS ADDRESS OF VARIABLES
  101. SA0 RVARBUF
  102. + RE B1 LOAD ROUTER VARIABLES
  103. RJ ECSR
  104. *
  105. LLOAD SA1 TLVLESS LOCAL VAR LESSON WORD
  106. ZR X1,CLOAD IF NO LOCALS
  107. * THE NEXT 5 LINES MAY BE UNNECESSARY SINCE THEY
  108. * ARE DONE IN PINITX
  109. AX1 18 MOVE LESSON NUMBER
  110. SX2 X1 STRIP LESSON NUMBER
  111. SX3 LVHEAD HEADER LENGTH
  112. RJ LESSADD GET ADDRESS INTO X7
  113. SA7 =XLVECSAD
  114. CALL LVLOAD,1 LOAD LOCAL VARS FOR THIS UNIT
  115. *
  116. CLOAD MX6 0 ZERO MAX NC VARS LOADED
  117. SA6 MAXLOAD
  118. CALL LOADCS LOAD COMMON/STORAGE
  119. SA1 MAXLOAD SEE IF ANY COM/STO LOADED
  120. ZR X1,CSJUDG IF NONE LOADED, DONT CHANGE
  121. BX6 X1
  122. SA6 LASTUSE UPDATE LAST USED WORD COUNT
  123. *
  124. CSJUDG CALL LOADJDG LOAD JUDGE BUFF TO CM/RELEASE
  125. *
  126. EQ CSLOAD -- EXIT
  127. *
  128. *
  129. ENTRY MAXLOAD
  130. MAXLOAD BSS 1 MAXIMUM NC VARS LOADED ON SLICE
  131. *
  132. ENTRY LASTUSE
  133. LASTUSE BSS 1 MAX NC VARS LAST USED
  134. *
  135. * /--- BLOCK LOADCS 00 000 79/02/16 20.44
  136. TITLE -LOADCS- LOAD COMMON/STORAGE
  137. *
  138. *
  139. * -LOADCS-
  140. * AUTOMATIC LOADING OF COMMON AND STORAGE
  141. *
  142. ENTRY LOADCS
  143. LOADCS EQ * ENTRY/EXIT
  144. *
  145. SA1 TCOMSET
  146. ZR X1,SLOAD JUMP IF NO COMMON AUTO-LOAD
  147. SA3 TBCOMLS
  148. SX2 X3 PICK OFF LESSON NUMBER
  149. ZR X2,SLOAD JUMP IF NO COMMON
  150. SX3 COMHEAD
  151. CALL LESSADD GET ADDRESS OF COMMON LESSON
  152.  
  153. * TEMPORARY TRAP TO VERIFY COMMON ASSIGNED TO
  154. * THIS EXECUTOR
  155.  
  156. SX3 COMHEAD-LCMLOC
  157. IX0 X7-X3
  158. RX2 X0
  159. SA3 EXID
  160. AX2 18
  161. SX2 X2
  162. BX2 X2-X3
  163. NZ X2,"CRASH" IF COMMON NOT ON THIS EXECUTOR
  164.  
  165. * END OF TRAP
  166.  
  167. *
  168. * X1 = 6/0, 18/LENGTH, 18/ECS, 18/CM
  169. * X7 = ECS ADDRESS
  170. * IN LINE TO SAVE TIME
  171. *
  172. CALL LOADCOM
  173. *
  174. SA1 TCOMSET+1
  175. ZR X1,SLOAD JUMP IF NO MORE COMMON LOADS
  176. *
  177. CALL LOADCOM
  178. *
  179. SA1 TCOMSET+2
  180. ZR X1,SLOAD JUMP IF NO MORE COMMON LOADS
  181. *
  182. CALL LOADCOM
  183. *
  184. * /--- BLOCK LOADCS 00 000 79/09/14 10.06
  185. SLOAD SA1 TSTOSET
  186. ZR X1,LOADCS -- EXIT IF NO STORAGE TO LOAD
  187. SA2 TBXSTOR STORAGE LESSON NUMBER
  188. ZR X2,LOADCS -- EXIT IF NO STORAGE TO LOAD
  189. SX3 2 BIAS FOR STORAGE HEADER
  190. CALL LESSADD
  191. *
  192. CALL LOADSTO
  193. *
  194. SA1 TSTOSET+1
  195. ZR X1,LOADCS -- EXIT IF NO MORE LOADS
  196. *
  197. CALL LOADSTO
  198. *
  199. SA1 TSTOSET+2
  200. ZR X1,LOADCS -- EXIT IF NO THIRD LOAD
  201. *
  202. CALL LOADSTO
  203. *
  204. EQ LOADCS --- EXIT
  205. *
  206. ***
  207. *
  208. * LOADCOM - LOAD COMMON MEMORY
  209. *
  210. LOADCOM EQ * ENTRY/EXIT
  211. CALL LOADSET
  212. + RE B1
  213. RJ ECSC
  214. EQ LOADCOM -- EXIT
  215. *
  216. ***
  217. *
  218. * LOADSTO - LOAD STORAGE MEMORY
  219. *
  220. LOADSTO EQ * ENTRY/EXIT
  221. CALL LOADSET
  222. + RE B1
  223. RJ ECSS
  224. EQ LOADSTO -- EXIT
  225. ***
  226. *
  227. * LOADSET - SET COMMON/STORAGE MEMORY POINTERS
  228. *
  229. LOADSET EQ * ENTRY/EXIT
  230. SA0 X1 PICK OFF CM ADDRESS
  231. AX1 18
  232. SX2 X1 PICK OFF ECS BIAS
  233. AX1 18
  234. SB1 X1 PICK OFF LENGTH TO LOAD
  235. IX0 X2+X7
  236. SX2 A0+B1 FIND LAST NC WORD IN BUFFER
  237. SX6 NCVRBUF START OF NC WORD BUFFER
  238. IX6 X2-X6 FIND TRUE LAST NC WORD
  239. SA1 MAXLOAD SEE IF MAX NC VAR LOADED
  240. IX2 X1-X6 LARGER'/
  241. PL X2,LOADSET BRIF -- IF NO CHANGE, EXIT
  242. SA6 A1 SAVE NEW SIZE
  243. *
  244. EQ LOADSET -- EXIT
  245. *
  246. * /--- BLOCK LOADJDG 00 000 79/02/14 00.13
  247. *
  248. *********************************************** LOADJDG
  249. * RETURN ECS JUDGE BUFFER TO POOL AND SET CENTRAL
  250. * MEMORY JUDGING BUFFERS FROM IT.
  251. *
  252. ENTRY LOADJDG
  253. LOADJDG EQ * ENTRY/EXIT
  254. *
  255. SA1 TJUGBUF SEE IF HAVE AN ECS JUDGE BUFFER
  256. SX1 X1
  257. ZR X1,LOADJDG --- EXIT IF NONE
  258. PL X1,RETJ1
  259. *
  260. SX6 0
  261. SA6 TJUGBUF
  262. EQ LOADJDG --- EXIT
  263.  
  264. RETJ1 BSS 0
  265. *
  266. * RESTORE ALL BUFFERS SAVED IN ECS
  267. *
  268. SX6 0 FIRST, CLEAN LOTS OF FLAGS
  269. SA6 JUDGE THEY MAY BE RESET BY FOLLOWING
  270. SA6 JJSBUFA
  271. SA6 JJCONPK
  272. SA6 JJFBUF
  273. SX7 -1
  274. SA7 JJSTORE MUST SET HERE FOR CHAR COUNT=0
  275. *
  276. SA1 TJUGBUF X1 HOLDS THE BUFFER ASSIGNED
  277. SA2 XJBANKS GET ECS ADDRESS OF START OF BUFFER
  278. SX1 X1-1 NOW CALCULATE STARTING ECS ADDRESS OF BUF
  279. SX3 JBXSAVE
  280. IX0 X1*X3 RELATIVE START
  281. IX0 X2+X0 ABSOLUTE START
  282. *
  283. SA1 TJCOUNT CHARACTER COUNT
  284. ZR X1,RETJBO IF ZERO, SKIP LOADING BUFFERS
  285. *
  286. JTOTAL SET 0
  287. *
  288. SX7 1 X7 = CONSTANT 1
  289. *
  290. SA0 JUDGE GET CHARACTERS INTO CM
  291. SB1 X1
  292. SX2 X1-JJALIM-1 SEE IF CAN DO WITHOUT UNPACKING
  293. PL X2,RETPACK
  294. *
  295. ****************************************************** JUDGE
  296. *
  297. + RE B1 READ-IN JUDGE CHARACTERS
  298. RJ ECSPRTY
  299. IX0 X0+X1
  300. *
  301. MX6 0
  302. SA6 B1+JUDGE ZERO OUT EXTRA CHARACTER
  303. * /--- BLOCK RETJBUF 00 000 76/05/26 15.51
  304. *
  305. ***************************************************** JJCHAR
  306. *
  307. RET3 SA0 JJCHAR READ IN COUNT CORRESPONDENCE
  308. + RE B1
  309. RJ ECSPRTY
  310. IX0 X0+X1
  311. EQ RETBEST
  312. *
  313. *
  314. ****************************************************** JUDGE
  315. *
  316. JTOTAL SET JTOTAL+JJALIM
  317. RETPACK SX3 10 10 CHARACTERS PACKED PER WORD
  318. SB2 0 INDEX INTO -JUDGE-
  319. SB3 0 PACKED WORD IN -WORK-
  320. SX2 B1-1 NUMBER OF CHARACTERS MINUS 1
  321. MX4 54 6 BIT MASK
  322. *
  323. SA0 JJHBUF READ IN THE PACKED BUFFER
  324. + RE JJALIM MAXIMUM POSSIBLE LENGTH
  325. RJ ECSPRTY
  326. *
  327. SA1 A0 BRING UP FIRST 10 CHARS
  328. *
  329. RETP1 LX1 6
  330. BX6 -X4*X1 GET 6-BIT CHARACTER
  331. SA6 JUDGE+B2 STORE THIS CHARACTER
  332. SB2 B2+X7 ADD ONE
  333. IX3 X3-X7 SUBTRACT ONE
  334. NZ X3,RETP1 DO 10 AT ONCE
  335. *
  336. SB3 B3+X7 ADD ONE
  337. SX3 10
  338. IX2 X2-X3
  339. SA1 JJHBUF+B3 GET NEXT 10 CHARACTERS
  340. PL X2,RETP1
  341. *
  342. SX1 B3
  343. IX0 X0+X1
  344. *
  345. MX6 0
  346. SA6 B1+JUDGE ZERO OUT EXTRA CHARACTER
  347. *
  348. *
  349. ***************************************************** JJCHAR
  350. *
  351. JTOTAL SET JTOTAL+JJCLIM
  352. RET4 SX3 6 6 COUNTS PACKED PER WORD
  353. SB2 0 INDEX INTO -JJCHAR-
  354. SB3 0 PACKED COUNTS IN -WORK-
  355. SX2 B1-1 NUMBER OF CHARACTERS MINUS 1
  356. MX4 51 9 BIT MASK
  357. *
  358. SA0 JJHBUF
  359. + RE JJCLIM MAXIMUM POSSIBLE LENGTH
  360. RJ ECSPRTY
  361. *
  362. SA1 A0 BRING UP FIRST 6 COUNTS
  363. LX1 6 GET FIRST COUNT TO TOP
  364. *
  365. RETP2 LX1 9
  366. BX6 -X4*X1 GET 6-BIT CHARACTER
  367. SA6 JJCHAR+B2 STORE THIS COUNT
  368. SB2 B2+X7 ADD ONE
  369. IX3 X3-X7 SUBTRACT ONE
  370. NZ X3,RETP2 DO 6 AT ONCE
  371. *
  372. SB3 B3+X7 ADD ONE
  373. SX3 6
  374. IX2 X2-X3
  375. SA1 JJHBUF+B3 GET NEXT 6 COUNTS
  376. LX1 6 AND FIRST TO TOP
  377. PL X2,RETP2
  378. *
  379. SX1 B3
  380. IX0 X0+X1
  381. * /--- BLOCK RETJBUF 00 000 79/02/09 10.05
  382. *
  383. *
  384. **************************************************** JJSBUFA
  385. *
  386. JTOTAL SET JTOTAL+JJINF
  387. JTOTAL SET JTOTAL+JJSENB
  388. RETBEST SA0 JJSBUFA SET BEST JUDGING BUFFER
  389. + RE JJINF+JJSENB
  390. RJ ECSPRTY
  391. *
  392. SX1 JJINF+JJSENB
  393. IX0 X0+X1
  394. *
  395. *
  396. ******************************************************* JJXY
  397. *
  398. JTOTAL SET JTOTAL+JJSENB
  399. SA0 JJXY SET TO WORD-CHARACTER COUNT
  400. + RE JJSENB
  401. RJ ECSPRTY
  402. SX1 JJSENB
  403. IX0 X0+X1
  404. *
  405. *
  406. **************************************************** JJSTORE
  407. *
  408. JTOTAL SET JTOTAL+1
  409. RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
  410. BX6 X1
  411. SA6 JJSTORE
  412. IX0 X0+X7 ADD ONE
  413. * CHECK FOR -2, IN WHICH CASE IT CAN NOT BE COMPILED
  414. SX2 X1-2
  415. ZR X2,RETJBO THEN LEAVE IT -2
  416. SX6 -1 ELSE SET IT TO UN-COMPILED
  417. SA6 A6 RE-STORE *JJSTORE*
  418. *
  419. *
  420. *
  421. IFGE JTOTAL,JBXSAVE,1 SEE IF NOT ENOUGH SPACE IN ECS BUFR
  422. ERR
  423. * IF THE ABOVE ERROR OCCURS, YOU MUST INCREASE
  424. * THE LENGTH PARAMETER *JBXSAVE* IN FILE PLATXT.
  425. *
  426. *
  427. RETJBO SA1 TJUGBUF
  428. CALL RJBUF RETURN JUDGE BUFFER
  429. MX6 59 FLAG MIGHT NEED BUFFER AGAIN
  430. SA6 TJUGBUF
  431. *
  432. EQ LOADJDG --- EXIT
  433. * /--- BLOCK ECSX 00 000 76/05/26 16.20
  434. TITLE ECSERRS
  435. *
  436. * ECS PARITY ERROR HANDLING -
  437. *
  438. ECSR EQ * ERROR IN ROUTER VARIABLES
  439. RJ ECSERRB MUST IMMEDIATELY FOLLOW ECSR
  440. SA1 TBRVNUM
  441. EQ ECSX
  442. *
  443. ECSC EQ * ERROR IN ROUTER VARIABLES
  444. RJ ECSERRB MUST IMMEDIATELY FOLLOW ECSR
  445. SA1 TBCOMLS ERROR IN COMMON VARIABLES
  446. EQ ECSX
  447. *
  448. ECSS EQ * ERROR IN ROUTER VARIABLES
  449. RJ ECSERRB MUST IMMEDIATELY FOLLOW ECSR
  450. SA1 TBXSTOR ERROR IN STORAGE VARIABLES
  451. EQ ECSX
  452. *
  453. *
  454. ECSX MX6 0 CLEAR OUT POINTER TO LESSON
  455. SA6 A1
  456. SX6 X1 PICK UP LESSON NUMBER
  457. SA6 LESNUM
  458. CALL IOLESSN,LESNUM,0400B PIN LESSON IN ECS
  459. SA1 LESNUM
  460. CALL LSNADDR GET ECS ADDR OF *LESNAM* ENTRY
  461. SA0 ECSNAM
  462. + WE 2 DESTROY LESSON NAME
  463. RJ ECSPRTY
  464. MX6 0 CLEAR LESSON / ROUTER FLAGS
  465. SA6 ILESUN
  466. SA6 TROUINF
  467. SA6 TROUINF+2
  468. CALL FAIL,3 ABORT THIS STUDENT
  469. *
  470. *
  471. ECSNAM DATA 10L//ECSERR//
  472. DATA 10L//ECSERR//
  473. *
  474. *
  475. * /--- BLOCK RLOAD 00 000 78/12/18 20.47
  476. TITLE RLOAD
  477. *
  478. *
  479. * -RLOAD- LOAD ROUTER VARIABLES
  480. *
  481. * CALLED FROM ONE PLACE IN -LESSONS-
  482. *
  483. *
  484. ENTRY RLOAD
  485. RLOAD EQ *
  486. ZERO RVARBUF,RVARLIM PRE-ZERO BUFFER
  487. SA1 TBRVNUM ROUTER VARIABLES LESSON NUMBER
  488. SX2 X1 GET LESSON NUMBER
  489. ZR X2,RLOAD
  490. SX3 2 BIAS FOR HEADER
  491. CALL LESSADD
  492. AX1 18 GET NUMBER OF VARIABLES
  493. SB1 X1
  494. BX0 X7 ECS ADDRESS OF VARIABLES
  495. SA0 RVARBUF
  496. + RE B1 LOAD ROUTER VARIABLES
  497. RJ ECSR
  498. EQ RLOAD
  499. *
  500. *
  501. * /--- BLOCK + LVLOAD 00 000 85/11/20 07.51
  502. *
  503. * -LVLOAD- LOAD LOCAL VARIABLES
  504. *
  505. * ENTER'; B1 = -1 UNLOAD, 1 LOAD
  506. * EXIT'; X2 = 0 IF NONE LOADED, ELSE UNDEFINED
  507. * CALLED FROM CSLOAD, CSULOAD, JOIN, UNJOIN
  508. *
  509. ENTRY LVLOAD
  510. *
  511. LVLOAD EQ *
  512. SA1 TLVLESS LOAD LOCAL VAR LESSON NUMBER
  513. SA2 LVUCNT NUMBER IN CURRENT UNIT
  514. ZR X2,LVLOAD1 SKIP ERR CHK IF NO LVARS IN UNIT
  515. ZR X1,BADLV ERROR IF NO LOCALS BUFFER
  516. LVLOAD1 SB2 X2 B2 = NUMBER OF LVARS IN UNIT
  517. SX6 X1 X6 = CURRENT STACK POINTER
  518. ZR X2,LVLOAD QUIT IF NO LVARS IN UNIT
  519. SA2 =XLVECSAD GET ECS ADDRESS OF LV BUFFER
  520. IX0 X2+X6 ECS ADDR OF CURRENT UNITS LVARS
  521. SA0 LVARBUF CM LOCAL VARS BUFFER
  522. NG B1,LVULOAD UNLOAD IF B1 = -1
  523. + RE B2 LOAD LOCAL VARS
  524. RJ ECSPRTY
  525. EQ LVLOAD
  526. *
  527. LVULOAD WE B2 UNLOAD LOCAL VARS
  528. RJ ECSPRTY
  529. EQ LVLOAD
  530. *
  531. BADLV SA1 ILESUN GET CURRENT UNIT INFO
  532. SA2 ECSULOC X2 = ECS ADDR. OF -ULOC- TABLE
  533. SX1 X1 X1 = UNIT NUMBER ONLY
  534. IX0 X1+X2 X0 = ECS ADDR. OF THIS -ULOC- ENTRY
  535. RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
  536. BX6 X1
  537. SA6 =XWORK SAVE IT FOR LATER
  538. EXECERR 45 LOCALS SI, STACK NO
  539. * /--- BLOCK CSULOAD 00 000 79/01/04 14.33
  540. TITLE -CSULOAD- UNLOAD RVARS,LVARS,NCVARS,JBUFFS
  541. *
  542. *
  543. * -CSULOAD-
  544. * AUTOMATIC UNLOADING OF RVARS,LVARS, AND NCVARS
  545. *
  546. * USES'; A0,A1,A2,A3,A6
  547. * X0,X1,X2,X3,X6,X7
  548. * B1,B2,B3
  549. *
  550. *
  551. ENTRY CSULOAD
  552. CSULOAD EQ *
  553. SX6 0 CLEAR LOADED FLAG
  554. SA6 LOADFLG
  555. IFNE DDEBUG,0,3
  556. SA1 =XCSFLG
  557. ZR X1,"CRASH" IF CONSECUTIVE UNLOADS
  558. *
  559. + SA1 TBRVNUM ROUTER VARIABLES LESSON NUMBER
  560. PL X1,LULOAD SIGN BIT = IN-ROUTER FLAG
  561. SX2 X1 GET LESSON NUMBER
  562. SX3 2 BIAS FOR HEADER
  563. CALL LESSADD
  564. AX1 18 GET NUMBER OF VARIABLES
  565. SB1 X1
  566. BX0 X7 ECS ADDRESS OF VARIABLES
  567. SA0 RVARBUF
  568. + WE B1 UNLOAD ROUTER VARIABLES
  569. RJ ECSPRTY
  570. *
  571. LULOAD SA1 TLVLESS LOCAL VAR LESSON WORD
  572. ZR X1,CULOAD IF NO LOCALS
  573. CALL LVLOAD,-1 UNLOAD LOCAL VARIABLES
  574. *
  575. CULOAD CALL ULOADCS UNLOAD COMMON AND STORAGE
  576. CSUJUDG CALL SAVEJDG SAVE JUDGE BUFFERS (IF ANY)
  577. *
  578. EQ CSULOAD -- EXIT
  579. *
  580. * /--- BLOCK ULOADCS 00 000 79/02/14 11.50
  581. TITLE -ULOADCS- UNLOAD COMMON AND STORAGE
  582. *
  583. *
  584. * -CSULOAD-
  585. * AUTOMATIC UNLOADING OF COMMON AND STORAGE
  586. *
  587. ENTRY ULOADCS
  588. ULOADCS EQ * ENTRY/EXIT
  589. *
  590. SA1 TCOMSET
  591. ZR X1,SULOAD JUMP IF NO COMMON AUTO-LOAD
  592. SA3 TBCOMLS
  593. SX2 X3 PICK OFF LESSON NUMBER
  594. ZR X2,SULOAD JUMP IF NO COMMON
  595. LX3 1
  596. NG X3,SULOAD JUMP IF READ-ONLY COMMON
  597. SX3 COMHEAD
  598. CALL LESSADD GET ADDRESS OF COMMON LESSON
  599. *
  600. * IN LINE FOR SPEED
  601. *
  602. CALL UNLOAD
  603. *
  604. SA1 TCOMSET+1
  605. ZR X1,SULOAD
  606. *
  607. CALL UNLOAD
  608. *
  609. SA1 TCOMSET+2
  610. ZR X1,SULOAD
  611. *
  612. CALL UNLOAD
  613. *
  614. SULOAD SA1 TSTOSET
  615. ZR X1,ULOADCS -- EXIT IF NO STORAGE TO LOAD
  616. SA2 TBXSTOR STORAGE LESSON NUMBER
  617. ZR X2,ULOADCS -- EXIT IF NO STORAGE
  618. SX3 2 BIAS FOR STORAGE HEADER
  619. CALL LESSADD
  620. *
  621. CALL UNLOAD
  622. *
  623. SA1 TSTOSET+1
  624. ZR X1,ULOADCS -- EXIT IF NO SECOND LOAD
  625. *
  626. CALL UNLOAD
  627. *
  628. SA1 TSTOSET+2
  629. ZR X1,ULOADCS -- EXIT IF NO THIRD LOAD
  630. *
  631. CALL UNLOAD
  632. *
  633. EQ ULOADCS --- EXIT
  634. *
  635. ***
  636. *
  637. * UNLOAD - UNLOAD COMMON/STORAGE MEMORY
  638. *
  639. UNLOAD EQ * ENTRY/EXIT
  640. SA0 X1 PICK OFF CM ADDRESS
  641. AX1 18
  642. SX2 X1 PICK OFF ECS BIAS
  643. AX1 18
  644. SB1 X1 PICK OFF LENGTH TO UNLOAD
  645. IX0 X2+X7
  646. + WE B1
  647. RJ ECSPRTY
  648. EQ UNLOAD -- RETURN
  649. *
  650. * /--- BLOCK SAVEJDG 00 000 79/02/14 00.12
  651. *
  652. ************************************************* SAVEJDG
  653. * GET ECS JUDGE BUFFER AND SAVE CENTRAL MEMORY
  654. * JUDGING BUFFERS IN IT.
  655. *
  656. *
  657. ENTRY SAVEJDG
  658. SAVEJDG EQ *
  659. SA1 TJUGBUF SEE IF NEED TO SAVE JUDGE BUFFS
  660. SX1 X1
  661. ZR X1,SAVEJDG NO NEED FOR ECS JUDGE BUFFERS
  662. PL X1,GETJBX ALREADY HAVE A BUFFER
  663. CALL GJBUF ALLOCATE A JUDGE BUFFER
  664. NG X6,NJBMSG IF NONE AVAILABLE
  665. SA6 TJUGBUF SET STUDENT BANK FLAG
  666. SX1 X6 PUT BUFFER NUMBER INTO X1
  667. *
  668. *
  669. * SEND ALL BUFFERS TO BE SAVED TO ECS
  670. * X1 HOLDS BUFFER ASSIGNED FOR USE
  671. *
  672. * THE OPERATIONS IN THIS PART OF GETJBUF MUST BE
  673. * DUPLICATED IN REVERSE IN RETJBUF (IN THIS FILE)
  674. *
  675. GETJBX SA2 XJBANKS GET ECS ADDR OF START OF BUFFER
  676.  
  677.  
  678. *********************************************
  679. * TRAP A FAULTY JUDGE BUFFER NUMBER
  680.  
  681. SX3 JBANKS NUMBER OF BUFFERS
  682. IX3 X3-X1
  683. NG X3,"CRASH" NUMBER .GT. MAX ALLOWED
  684. *********************************************
  685.  
  686.  
  687. SX1 X1-1 NOW CALC STARTING ECS ADDR
  688. SX3 JBXSAVE
  689. IX0 X1*X3 RELATIVE START
  690. IX0 X2+X0 ABSOLUTE START
  691. *
  692. SA1 TJCOUNT CHARACTER COUNT
  693. ZR X1,SAVEJDG --- EXIT IF ZERO, NOTHING TO DO
  694. *
  695. * JUST IN CASE PAUSE DOES NOT OCCUR NEED TO KILL
  696. * ALL BUFFERS SINCE JJHBUF MIGHT BE DESTROYED
  697. *
  698. SX6 0
  699. SA6 JJFBUF
  700. * /--- BLOCK GETJBUF 00 000 76/05/26 15.56
  701. *
  702. *
  703. SX7 1 X7 = CONSTANT 1
  704. SA0 JUDGE SEND CHARACTERS OUT
  705. SB1 X1
  706. SX2 X1-JJALIM-1 SEE IF CAN DO WITHOUT PACKING
  707. PL X2,GETPACK
  708. *
  709. ****************************************************** JUDGE
  710. *
  711. + WE B1 WRITE JUDGE CHARACTERS TO ECS
  712. RJ ECSPRTY
  713. IX0 X0+X1
  714. *
  715. *
  716. ***************************************************** JJCHAR
  717. *
  718. SA0 JJCHAR SEND OUT COUNT CORRESPONDENCE
  719. + WE B1
  720. RJ ECSPRTY
  721. IX0 X0+X1
  722. EQ GETBEST
  723. *
  724. *
  725. ****************************************************** JUDGE
  726. *
  727. GETPACK MX6 0 PACK UP THE JUDGE CHARACTERS
  728. SX3 10 PACK UP 10 CHARACTERS PER WORD
  729. SB2 0 INDEX INTO -JUDGE-
  730. SB3 0 PACKED WORD IN -WORK-
  731. SX2 B1-1 NUMBER OF CHARACTERS MINUS 1
  732. *
  733. GETP1 LX6 6
  734. SA1 JUDGE+B2 GET NEXT CHARACTER
  735. BX6 X6+X1 PACK
  736. SB2 B2+X7 ADD ONE
  737. IX3 X3-X7 SUBTRACT ONE
  738. NZ X3,GETP1 DO 10 AT ONCE
  739. *
  740. SA6 JUDGE+B3 PUT AWAY PACKED CHARS IN WORK BUFFER
  741. SB3 B3+X7 ADD ONE
  742. MX6 0
  743. SX3 10
  744. IX2 X2-X3
  745. PL X2,GETP1
  746. *
  747. SA0 JUDGE
  748. + WE B3 PUT INTO ECS
  749. RJ ECSPRTY
  750. SX1 B3
  751. IX0 X0+X1
  752. *
  753. *
  754. ***************************************************** JJCHAR
  755. *
  756. MX6 0 PACK UP THE JJCHAR COUNT
  757. SX3 6 PACK UP 6 9-BIT COUNTS PER WORD
  758. SB2 0 INDEX INTO -JJCHAR-
  759. SB3 0 PACKED WORD IN -WORK-
  760. SX2 B1-1 NUMBER OF CHARACTERS MINUS 1
  761. *
  762. GETP2 LX6 9 SHIFT 9 BITS
  763. SA1 JJCHAR+B2 GET NEXT COUNT
  764. BX6 X6+X1 PACK
  765. SB2 B2+X7 ADD ONE
  766. IX3 X3-X7 SUBTRACT ONE
  767. NZ X3,GETP2 DO 6 AT ONCE
  768. *
  769. SA6 JUDGE+B3 PUT AWAY PACKED CHARS IN WORK BUFFER
  770. SB3 B3+X7 ADD ONE
  771. MX6 0
  772. SX3 6
  773. IX2 X2-X3
  774. PL X2,GETP2
  775. *
  776. + WE B3 PUT INTO ECS
  777. RJ ECSPRTY
  778. SX1 B3
  779. IX0 X0+X1
  780. * /--- BLOCK GETJBUF 00 000 79/02/09 10.13
  781. *
  782. *
  783. **************************************************** JJSBUFA
  784. *
  785. GETBEST SA0 JJSBUFA SEND OUT JUDGING BUFFER
  786. *
  787. GETB2 WE JJINF+JJSENB
  788. RJ ECSPRTY
  789. SX1 JJINF+JJSENB
  790. IX0 X0+X1
  791. *
  792. *
  793. ******************************************************* JJXY
  794. *
  795. SA0 JJXY SET TO WORD-CHARACTER COUNT
  796. + WE JJSENB
  797. RJ ECSPRTY
  798. SX1 JJSENB
  799. IX0 X0+X1
  800. *
  801. *
  802. **************************************************** JJSTORE
  803. *
  804. SA1 JJSTORE SAVE STORE FLAG
  805. WX1 X0 (-WXX- 1 WD WRITE, MAY CHG *A6*)
  806. IX0 X0+X7 ADD ONE
  807. *
  808. *
  809. EQ SAVEJDG --- EXIT
  810. * /--- BLOCK LESSADD 00 000 78/02/20 23.59
  811. *
  812. TITLE LESADD
  813. * ON ENTRY - X2 = LESSON NUMBER
  814. * X3 = BIAS WITHIN LESSON
  815. *
  816. * ON EXIT - X7 = ECS ADDRESS
  817. *
  818. ENTRY LESSADD
  819. *
  820. LESSADD EQ *
  821. LX2 2 LESSON NUMBER
  822. SX0 X2+3 BIAS TO ECS ADDRESS
  823. SA2 ALESNAM
  824. IX0 X0+X2 INDEX INTO *LESNAM*
  825. RX2 X0 (-RXX- 1 WD READ, MAY CHG *A2*)
  826. MX7 -24
  827. BX7 -X7*X2 MASK OFF ECS ADDRESS
  828. ZR X7,"CRASH" -- TRAP FOR EM ADDR = 0
  829. IX7 X7+X3 ELSE, ADD BIAS
  830. EQ LESSADD -- EXIT SUBROUTINE
  831. *
  832. * /--- BLOCK RESVREL 00 000 76/05/26 15.53
  833. TITLE -RESVREL-
  834. *
  835. *
  836. *
  837. * -RESVREL-
  838. * CLEAR LESSON AND COMMON INITIALIZATION FLAGS AND
  839. * COMMON RESERVATION FLAG IF SET TO THIS STATION
  840. *
  841. *
  842. ENTRY RESVREL
  843. RESVREL EQ *
  844. SA1 STATION GET STATION NUMBER
  845. SX5 X1+1
  846. SA1 ILESUN
  847. AX1 18 POSITION LESSON NUMBER
  848. ZR X1,RVR300
  849. CALL READLES,INFO,(LINTLOK+1)
  850. SA1 INFO+LINTLOK
  851. SX2 X1 PICK OFF STATION NUMBER
  852. ZR X2,RVR300
  853. IX2 X2-X5 CHECK IF THIS STATION
  854. NZ X2,RVR300
  855. MX6 -18
  856. BX6 X6*X1 CLEAR LESSON INITIALIZATION
  857. SA6 A1
  858. SX1 LINTLOK BIAS TO INTERLOCK WORD
  859. IX0 X0+X1
  860. * RE-WRITE INTERLOCK WORD
  861. WX6 X0 (-WXX- 1 WD WRITE, MAY CHG *A6*)
  862. *
  863. RVR300 SA2 TBCOMLS
  864. SX1 X2 GET COMMON LESSON NUMBER
  865. ZR X1,RESVREL
  866. CALL READLES,INFO,(LINTLOK+1)
  867. MX7 0
  868. SA1 INFO+LINTLOK
  869. SX2 X1 PICK OFF STATION NUMBER
  870. ZR X2,RVR350
  871. IX2 X2-X5 CHECK IF THIS STATION
  872. NZ X2,RVR350
  873. MX7 -18
  874. BX1 X7*X1 CLEAR LESSON INITIALIZATION
  875. *
  876. RVR350 BX2 X1 GET INTERLOCK WORD
  877. AX2 18
  878. SX2 X2 GET STATION NUMBER
  879. ZR X2,RVR400
  880. IX2 X2-X5 CHECK IF THIS STATION
  881. NZ X2,RVR400
  882. MX7 -18 SET UP MASK FOR RESERVE FLAG
  883. LX7 18
  884. BX1 X7*X1 CLEAR COMMON RESERVATION FLAG
  885. *
  886. RVR400 ZR X7,RESVREL EXIT IF NO CHANGES
  887. BX6 X1
  888. SA6 A1
  889. SX1 LINTLOK BIAS TO INTERLOCK WORD
  890. IX0 X0+X1
  891. * RE-WRITE INTERLOCK WORD
  892. WX6 X0 (-WXX- 1 WD WRITE, MAY CHG *A6*)
  893. EQ RESVREL
  894. * /--- BLOCK NOJBUF 00 000 76/05/26 15.53
  895. TITLE NOJBUF
  896. *
  897. * MAKE FOR NO ECS JUDGE BUFFER
  898. *
  899. * USES A - 1,6
  900. * X - 1,6
  901. * B - NONE
  902. *
  903. * CALLS - RJBUF.
  904. *
  905. *
  906. ENTRY NOJBUF
  907. *
  908. NOJBUF EQ *
  909. SA1 TJUGBUF GET BANK FLAG
  910. SX1 X1
  911. ZR X1,NOJBUF
  912. NG X1,NOJBUF1
  913. CALL RJBUF RETURN JUDGE BUFFER TO POOL
  914. NOJBUF1 MX6 0
  915. SA6 TJUGBUF SET FOR NO JUDGE BUFFER
  916. EQ NOJBUF
  917. * /--- BLOCK GJBUF 00 000 83/07/27 09.22
  918. GJBUF SPACE 5,11
  919. ** GJBUF - ALLOCATE A JUDGE BUFFER
  920. *
  921. * USES A - 0,1,2,6
  922. * X - 0,1,2,6
  923. * B - 1,2
  924. *
  925. * EXIT - (X6) = JUDGE BUFFER ALLOCATED
  926. * -1 IF NONE AVAILABLE
  927. *
  928. * ANOTHER USE OF THE NORMALIZING BIT-TABLE ALGOR.
  929. *
  930. * NOTE THAT ALTHOUGH THE MAX NUMBER OF BUFFERS IS
  931. * 48 IN /PLATXT/, THIS GIZMO IS BUILT TO HANDLE
  932. * A MULTI-WORD TABLE ENDING WITH A ZERO WORD.
  933. *
  934.  
  935. ENTRY GJBUF
  936.  
  937. GJBUF PS
  938. INTLOK X,I.JUDG,W
  939. SA1 AJBUFFU (X1) = EM FWA OF JBUFF USE BITS
  940. BX0 X1
  941. SA0 JBUFBIT
  942. + RE JBITLEN
  943. RJ ECSPRTY
  944. SA1 AJBSTAT READ STATISTICS WORDS TOO
  945. BX0 X1
  946. SA0 JBUFCNT
  947. + RE 4
  948. RJ ECSPRTY
  949. SA1 JBUFBIT (X1) = BITS OF ALLOCATED BUFFER
  950.  
  951. * SEARCH FOR AVAILABLE BUFFER
  952.  
  953. GET2 BSS 0
  954. NG X1,"CRASH" -- SHOULD NEVER HAVE NEG. ENTRY
  955. NX2 X1 FIND FIRST FREE BUFFER
  956. NZ X2,GET3 IF AVAILABLE BUFFERS
  957. SA1 A1+1 GET NEXT 48 BITS
  958. NZ X1,GET2 IF MORE WORDS IN TABLE
  959. INTCLR X,I.JUDG
  960. MX6 -1 SET RETURN TO *NONE FOUND*
  961. EQ GJBUF
  962.  
  963. GET3 UX2,B2 X2 UNPACK NORMALIZED FORM
  964. * (B2) = JUDGE BUFFER NUMBER
  965. UX2,B1 X1 UNPACK UNNORMALIZED FORM
  966. * (B1) = UNSHIFTED EXPONENT
  967. SB1 B1-B2 (B1) = SHIFT COUNT
  968. MX6 1 1/1, 59/0
  969. LX6 48 12/0, 1/1, 47/0
  970. AX6 B1,X6 SHIFT 1 TO BUFFER POSITION
  971. BX2 X6*X1 SAVE CURRENT STATUS OF BUFFER
  972. BX6 -X6*X1 CLEAR OUT THIS BIT
  973. SA6 A1 STORE UPDATED FLAGS
  974. ZR X2,"CRASH" -- BUFFER WAS ALREADY ON LOAN
  975. SA1 JBUFCNT INCREMENT PEOPLE JUDGING
  976. SA2 JMAXBUF
  977. SX6 X1+1
  978. SA6 A1
  979. IX2 X2-X6
  980. PL X2,GET4 IF NOT NEW MAXIMUM
  981. SA6 A2
  982. GET4 WE 4 UPDATE STATISTICS WORDS
  983. RJ ECSPRTY
  984. SA1 AJBUFFU UPDATE BIT MAP WORD(S)
  985. BX0 X1
  986. SA0 JBUFBIT
  987. + WE JBITLEN
  988. RJ ECSPRTY
  989. INTCLR X,I.JUDG MUST SAVE B2
  990. SX6 B2 (X6) = BUFFER NUMBER
  991. EQ GJBUF EXIT
  992. *
  993. * /--- BLOCK RJBUF 00 000 78/12/15 08.33
  994. RJBUF SPACE 5,11
  995. ** RJBUF - RETURN JUDGE BUFFER TO POOL
  996. *
  997. * USES A - 0,1,2,6
  998. * X - 0,1,2,6
  999. * B - 1,2
  1000. *
  1001. * ENTRY - (X1) = JUDGE BUFFER TO RETURN
  1002.  
  1003.  
  1004. ENTRY RJBUF
  1005.  
  1006. RJBUF PS
  1007. SX7 X1 SAVE JUDGE BUFFER NUMBER
  1008. NG X7,"CRASH"
  1009. ZR X7,"CRASH"
  1010. INTLOK X,I.JUDG,W MUST SAVE X7
  1011. SX1 X7 RESTORE JUDGE BUFFER NUMBER
  1012. SA2 AJBUFFU
  1013. BX0 X2 (X0) = EM FWA OF JBUFF USE BITS
  1014. SA0 JBUFBIT (A0) = CM FWA OF JBUFF USE BITS
  1015. + RE JBITLEN GET JBUFF ALLOCATED BITS
  1016. RJ ECSPRTY
  1017. SA2 AJBSTAT READ STATISTICS WORDS TOO
  1018. BX0 X2
  1019. SA0 JBUFCNT
  1020. + RE 4
  1021. RJ ECSPRTY
  1022. SA2 JBUFCNT DECREMENT PEOPLE JUDGING
  1023. SX6 X2-1
  1024. NG X6,"CRASH" -- OOPS, GAINED A BUFFER
  1025. SA6 A2
  1026.  
  1027. * SET JBUFBIT TO INDICATE BUFFER RETURNED
  1028.  
  1029. SB1 B0
  1030. RET1 SX1 X1-49 SEE WHAT WORD BIT IS IN
  1031. NG X1,RET2
  1032. SB1 B1+1
  1033. SX1 X1+1
  1034. EQ RET1
  1035.  
  1036. RET2 SB2 X1+49 GET SHIFT COUNT
  1037. MX6 1
  1038. LX6 B2,X6 SHIFT BIT
  1039. SA1 JBUFBIT+B1 LOAD BIT WORD
  1040. BX2 X1*X6 SAVE CURRENT STATUS OF BIT
  1041. BX6 X1+X6 THEN SET THE BIT
  1042. SA6 A1 AND STORE
  1043. + WE 4 UPDATE STATISTICS WORDS
  1044. RJ ECSPRTY
  1045. SA1 AJBUFFU UPDATE BIT MAP
  1046. BX0 X1
  1047. SA0 JBUFBIT
  1048. + WE JBITLEN GET JBUFF ALLOCATED BITS
  1049. RJ ECSPRTY
  1050. INTCLR X,I.JUDG MUST SAVE X2
  1051. NZ X2,"CRASH" -- WE ALREADY HAD THIS BUFFER
  1052. EQ RJBUF EXIT
  1053. *
  1054. SPACE 3
  1055. ** NJBMSG - ISSUE ERROR MESSAGE AND ABORT.
  1056.  
  1057. ENTRY NJBMSG
  1058.  
  1059. NJBMSG CALL S=MSG,NJBMSGA
  1060. EXECERR 54 SYSTEM ERROR - NO JUDGE BUFFER
  1061. *
  1062. NJBMSGA DIS ,*NO JUDGE BUFFERS AVAILABLE.*
  1063. *
  1064. * /--- BLOCK ENDX 00 000 78/12/15 08.33
  1065.  
  1066. END
plato/source/plaopl/autload.txt ยท Last modified: 2023/08/05 18:54 by Site Administrator