Table of Contents

ALLOT

Table Of Contents

  • [00005] ECS ALLOCATION
  • [00018] DEFINITIONS
  • [00055] -SSIGNI-
  • [00332] -SSIGNO-
  • [00385] -CSIGNO-
  • [00413] -RSIGNO-
  • [00453] -RLESO-
  • [00510] -ALLOT-
  • [00549] -ALLOTI-
  • [00574] -ALLOTR-
  • [00608] -ACHARGE-
  • [00801] -ARELEAS-
  • [00997] -AUTHC-
  • [01069] -READSIT-
  • [01125] -TSTSITE-
  • [01183] -SSENTER-
  • [01219] -SSEXIT-
  • [01238] -CHKECS-
  • [01284] -SSDELET-
  • [01359] -CLEAREC-
  • [01601] SITE USER COUNT MANIPULATION
  • [01688] BIT TABLE MANIPULATION

Source Code

ALLOT.txt
  1. ALLOT
  2. * /--- FILE TYPE = E
  3. * /--- BLOCK IDENT 00 000 78/10/15 16.08
  4. IDENT ALLOT
  5. TITLE ECS ALLOCATION
  6. *
  7. *
  8. CST
  9. *
  10. LIST F
  11. *
  12. LIST F
  13. *
  14. EXT ECSPRTY,ECSERR,XSHEADS
  15. *
  16. *
  17. * /--- BLOCK DEFINITION 00 000 78/10/14 20.15
  18. TITLE DEFINITIONS
  19. *
  20. *
  21. *
  22. INAME BSSZ 4 LESSON NAME BUFFER
  23. TMPROUT BSS 2 SCRATCH BUFFER FOR ROUTER NAME
  24. *
  25. *
  26. ILESNUM EQU INFO LESSON NUMBER
  27. ECNEED EQU ILESNUM+1 AMOUNT ECS REQUESTED
  28. ECFREE1 EQU ECNEED+1 AMOUNT ECS FOUND
  29. IROUTER EQU ECFREE1+1 INITIAL ENTRY TO ROUTER FLAG
  30. ISYSFLG EQU IROUTER+1 SPECIAL LESSON FLAG
  31. ISITE EQU ISYSFLG+1 LOGICAL SITE NUMBER
  32. IINDX EQU ISITE+1 INDEX TO LOGICAL SITE
  33. ISTATN EQU IINDX+1 STATION NUMBER
  34. IALLOT EQU ISTATN+1 CM COPY OF *XALLOT* ENTRY
  35. ISITTAB EQU IALLOT+1 CM COPY OF *SITTAB* ENTRY
  36. *
  37. ADELTA EQU ISITTAB+SITEDIM
  38. ATYPE EQU ADELTA+1
  39. AECS EQU ATYPE+1
  40. AECSLOC EQU AECS+1
  41. ASHIFT EQU AECSLOC+1
  42. AHLTH EQU ASHIFT+1
  43. ABIAS EQU AHLTH+1
  44. ALLOTA EQU ABIAS+1
  45. ATABLE EQU ALLOTA+3
  46. ALNUMB EQU ATABLE+SITEDIM
  47. ALTYPE EQU ALNUMB+1
  48. ALLTH EQU ALTYPE+1
  49. ACALL EQU ALLTH+1
  50. ABUFF EQU ACALL+1
  51. ABUFF1 EQU ABUFF+LESHEAD
  52. *
  53. *
  54. * /--- BLOCK SSIGNI 00 000 79/07/26 00.12
  55. TITLE -SSIGNI-
  56. *
  57. *
  58. *
  59. * -SSIGNI-
  60. * UPDATE ALLOCATION TABLES ON SIGN-IN TO LESSON
  61. *
  62. *
  63. ENTRY SSIGNI
  64. SSIGNI EQ *
  65. SA1 STATION CLEAR OVER ALLOTMENT BITS
  66. CALL CCLRBIT,OVRTAB1
  67. CALL ALLOTI INITIALIZATIONS
  68. MX6 0
  69. SA6 IROUTER INITIAL ENTRY TO ROUTER FLAG
  70. SA6 ISYSFLG SPECIAL LESSON FLAG
  71. SA6 TALLOT CLEAR STUDENT BANK WORD
  72. *
  73. * CHECK FOR INITIAL ENTRY TO ROUTER LESSON
  74. *
  75. CALL INROUTE
  76. PL X1,SI150 IF NOT ENTERING ROUTER
  77. SA1 TROUINF CHECK IF INITIAL ENTRY
  78. NG X1,SSIGNI EXIT
  79. MX6 1
  80. BX6 X1+X6 SET INITIAL ENTRY BIT
  81. SA6 A1
  82. SA6 IROUTER MARK INITIAL ENTRY TO ROUTER
  83. *
  84. * CHECK IF ENTERING SPECIAL SYSTEM LESSON
  85. *
  86. SI150 CALL AIDSLES CHECK FOR AIDS LESSON
  87. SX3 AUTHECS
  88. NG X1,SI152 CHARGE -AUTHECS- FOR AIDS
  89.  
  90. CALL SYSLES1,TBLESAC
  91. NG X3,SI200
  92. SI152 MX6 -1 MARK SPECIAL LESSON
  93. SA6 ISYSFLG
  94. BX6 X3 SAVE ECS CHARGE
  95. SA6 AECS
  96. *
  97. * CHARGE SITE BY AMOUNT SPECIFIED FOR SPECIAL LESSON
  98. *
  99. SA1 ILESUN SET UP LESSON NUMBER
  100. AX1 18
  101. SX6 X1
  102. SA6 ILESNUM
  103. CALL ACHARGE,1,ILESNUM,AECS
  104. EQ SI300 GO TO FINAL PROCESSING
  105. *
  106. * /--- BLOCK SSIGNI 00 000 79/10/28 19.26
  107. *
  108. * CHARGE SITE FOR ECS NEEDED FOR LESSON
  109. *
  110. SI200 SA1 ILESUN SET UP LESSON NUMBER
  111. AX1 18
  112. SX6 X1
  113. SA6 ILESNUM
  114. CALL ACHARGE,0,ILESNUM,LSITCNT
  115. *
  116. * CHARGE SITE FOR ECS NEEDED FOR COMMON
  117. *
  118. CALL ACHARGE,2,(LESSCM+LCOMUSE),LSITCNT
  119. SA1 LESSCM+LCOMUSE
  120. SX6 X1 SAVE COMMON LESSON NUMBER
  121. SA6 TALLOT
  122. *
  123. * CHARGE SITE FOR ECS NEEDED FOR STORAGE
  124. *
  125. SA1 TBXSTOR
  126. SX1 X1 CHECK IF STORAGE BLOCK EXISTS
  127. ZR X1,SI240
  128. CALL READLES,ABUFF,1
  129. SA1 ABUFF COMPUTE LENGTH OF STORAGE
  130. SB1 X1
  131. AX1 18
  132. SX6 X1+B1 TOTAL LENGTH OF STORAGE BLOCK
  133. SA6 AECS
  134. EQ SI250
  135. *
  136. SI240 SA1 LESSCM+LSTOUSE
  137. SX6 X1 CHECK IF ANY STORAGE REQUIRED
  138. ZR X6,SI241
  139. SX6 X6+LPRMLTH ADD FOR LENGTH OF HEADER
  140. *
  141. SI241 BX3 X1 X3 = NUMBER OF LVARS
  142. AX3 LVARSH
  143. MX2 -10
  144. BX3 -X2*X3
  145. ZR X3,SI242
  146. SB1 X3+LPRMLTH ADD FOR LTH OF HEADER
  147. SX6 X6+B1 ADD TO STORAGE
  148. *
  149. SI242 SA2 IROUTER
  150. ZR X2,SI245 CHECK IF ENTERING ROUTER
  151. AX1 18
  152. SX1 X1 X1 = NUMBER OF ROUTER VARS REQ.
  153. ZR X1,SI245 (IF ANY)
  154. SB1 X1+LPRMLTH ADD HEADER LENGTH
  155. SX6 X6+B1
  156. *
  157. SI245 ZR X6,SI300 SKIP IF NO STORAGE NEEDED
  158. SA6 AECS
  159. *
  160. SI250 CALL ACHARGE,3,AECS
  161. *
  162. * /--- BLOCK SSIGNI 00 000 77/11/25 13.57
  163. *
  164. * SET UP SPECIAL CHARGE FOR AUTHOR
  165. *
  166. SI300 CALL CHKUSER CHECK IF AUTHOR OR STUDENT
  167. PL X6,SI320
  168. MX0 -15
  169. SA1 IALLOT COMPUTE TOTAL ECS FOR AUTHOR
  170. BX6 -X0*X1 MASK OFF CHARGE FOR LESSON
  171. AX1 15
  172. BX2 -X0*X1
  173. IX6 X2+X6 ADD CHARGE FOR COMMON
  174. AX1 15
  175. BX2 -X0*X1
  176. IX6 X2+X6 ADD CHARGE FOR STORAGE
  177. SX2 X6-AUTHECS
  178. PL X2,SI310 JUMP IF CHARGE HIGH ENOUGH
  179. BX6 -X2
  180. SA6 AECS SET ADDITIONAL AMOUNT TO CHARGE
  181. CALL ACHARGE,3,AECS
  182. SA1 AECS GET AUTHOR ECS CHARGE
  183. LX1 18
  184. EQ SI315
  185. *
  186. SI310 SX1 0 AUTHOR ECS CHARGE = 0
  187. SI315 SA2 TALLOT
  188. BX1 X1+X2
  189. MX6 1 SET AUTHOR CHARGE BIT
  190. BX6 X1+X6
  191. SA6 A2 1/1,23/0,18/AUTH ECS,18/COM NUM
  192. *
  193. * /--- BLOCK SSIGNI 00 000 77/11/25 13.52
  194. *
  195. * SAVE *XALLOT* ENTRY FOR ROUTER IF INITIAL ENTRY
  196. *
  197. SI320 SA1 IROUTER CHECK INITIAL ENTRY TO ROUTER
  198. ZR X1,SI350
  199. SA1 IALLOT SAVE *XALLOT* ENTRY OF ROUTER
  200. BX6 X1
  201. SA6 TROUINF+1
  202. SA1 TALLOT
  203. SX1 X1 GET COMMON LESSON NUMBER
  204. LX1 12
  205. MX0 -18 FORM MASK FOR COMMON NUMBER
  206. LX0 12
  207. SA2 TROUINF+2
  208. BX2 X0*X2 CLEAR COMMON LESSON NUMBER
  209. BX6 X1+X2
  210. SA6 A2
  211. *
  212. * UPDATE ALLOCATION TABLES IN ECS
  213. *
  214. SI350 CALL ALLOTR RETURN INFO TO ECS
  215. SA1 IROUTER
  216. ZR X1,SI400 JUMP IF NOT INITIAL ENTRY
  217. MX0 15
  218. SA1 IALLOT
  219. BX6 X0*X1 STRIP OFF ALL BUT SITE INDEX
  220. SA1 STATION
  221. SA2 AALLOT INDEX INTO *XALLOT* BUFFER
  222. IX0 X1+X2
  223. WX6 X0 (-WXX- 1 WD WRITE, MAY CHG *A6*)
  224. *
  225. * /--- BLOCK SSIGNI 00 000 80/12/09 14.44
  226. *
  227. * CHECK IF LESSON SHOULD BE RESERVED AT THIS SITE
  228. *
  229. SI400 SA1 ISYSFLG CHECK FOR SPECIAL LESSON
  230. NZ X1,SSIGNI
  231. SA1 ILESUN BRING LESSON HEADER TO CM
  232. AX1 18
  233. SX1 X1 GET LESSON NUMBER
  234. BX6 X1
  235. SA6 ILESNUM SAVE LESSON NUMBER
  236. CALL READLES,ABUFF,LESHEAD
  237. SA1 ISITE LOGICAL SITE NUMBER
  238. CALL STSTBIT,(ABUFF+LSITTAB)
  239. NZ X6,SSIGNI EXIT IF LESSON ALREADY RESERVED
  240. SA1 ISITE
  241. CALL CHKBASE,ISITTAB
  242. IX5 X2-X1 X5 = WITHIN BASE ALLOTMENT FLAG
  243. BX4 X2 X4 = BASE ALLOTMENT
  244. SA1 ISITE
  245. SX2 2*NSRESV COMPUTE INDEX INTO TABLE
  246. DX1 X1*X2
  247. SA2 ASITRES ECS ADDRESS OF RESERVE TABLE
  248. IX0 X1+X2 INDEX TO THIS SITE
  249. SA0 WORK
  250. + RE 2*NSRESV BRING TABLE TO CM
  251. RJ ECSPRTY
  252. *
  253. SA1 TBLESSN SEARCH TABLE FOR LESSON
  254. SB1 NSRESV B1 = INDEX IN RESERVE LIST
  255. *
  256. SI420 SB1 B1-1 END TEST
  257. NG B1,SSIGNI EXIT IF LESSON NOT IN LIST
  258. SA2 B1+WORK
  259. IX2 X1-X2 CHECK IF LESSON IN LIST
  260. NZ X2,SI420
  261. *
  262. * CHECK IF SUFFICIENT ECS TO RESERVE LESSON
  263. *
  264. PL X5,SI460 JUMP IF WITHIN BASE ALLOTMENT
  265. MX5 0 INITIALIZE ECS RESERVED TOTAL
  266. MX7 -15
  267. SB2 NSRESV INITIALIZE INDEX IN LIST
  268. *
  269. SI430 SB2 B2-1 END TEST
  270. NG B2,SI440
  271. SA1 B2+WORK LOAD NEXT LESSON NAME
  272. ZR X1,SI430
  273. SA1 B2+WORK+NSRESV LOAD ALLOTMENT WORD
  274. BX2 -X7*X1 MASK OFF LENGTH OF LESSON
  275. IX5 X2+X5
  276. AX1 15
  277. BX1 -X7*X1 MASK OFF LENGTH OF COMMON
  278. IX5 X1+X5
  279. EQ SI430
  280. *
  281. SI440 SA1 IALLOT ADD CHARGE FOR THIS LESSON
  282. BX2 -X7*X1 LESSON LENGTH
  283. IX5 X2+X5
  284. AX1 15 COMMON LENGTH
  285. BX1 -X7*X1
  286. IX5 X1+X5
  287. IX1 X4-X5 CHECK IF AMOUNT OF RESERVED ECS
  288. NG X1,SSIGNI WITHIN BASE ALLOTMENT
  289. *
  290. * /--- BLOCK SSIGNI 00 000 76/12/11 14.22
  291. *
  292. * UPDATE LESSON RESERVATION TABLE
  293. *
  294. SI460 MX2 15 FORM MASK TO EXCLUDE STORAGE
  295. LX2 60-15
  296. SA1 IALLOT
  297. BX6 -X2*X1 PLANT ALLOTMENT WORD
  298. SA6 B1+WORK+NSRESV
  299. + WE 2*NSRESV UPDATE RESERVATION TABLE
  300. RJ ECSPRTY
  301. *
  302. * UPDATE LESSON HEADER TO MARK LESSON RESERVED
  303. *
  304. SA1 ISITE MARK LESSON IN USE AT SITE
  305. CALL SSETBIT,(ABUFF+LSITTAB)
  306. CALL ALTSC,ISITE,(ABUFF+LSITCNT),1
  307. SA1 ILESNUM
  308. CALL READLES,0,0 GET ECS ADDRESS OF LESSON
  309. SA0 ABUFF
  310. + WE LESHEAD RE-WRITE LESSON HEADER
  311. RJ ECSPRTY
  312. CALL IOLESSN,ILESNUM,40B MARK UN-DELETABLE
  313. *
  314. * UPDATE COMMON HEADER TO MARK COMMON RESERVED
  315. *
  316. SA1 TALLOT COMMON LESSON NUMBER
  317. SX1 X1
  318. ZR X1,SSIGNI EXIT IF NO COMMON
  319. CALL READLES,ABUFF,COMHEAD
  320. BX6 X0 SAVE ECS ADDRESS OF COMMON
  321. SA6 AECSLOC
  322. CALL ALTSC,ISITE,(ABUFF+LSITCNT),1
  323. SA1 AECSLOC
  324. BX0 X1 ECS ADDRESS OF COMMON
  325. SA0 ABUFF
  326. + WE COMHEAD RE-WRITE COMMON HEADER
  327. RJ ECSPRTY
  328. EQ SSIGNI
  329. *
  330. *
  331. * /--- BLOCK SSIGNO 00 000 77/10/26 05.56
  332. TITLE -SSIGNO-
  333. *
  334. *
  335. *
  336. * -SSIGNO-
  337. * UPDATE ALLOCATION TABLES ON EXIT FROM LESSON
  338. *
  339. *
  340. ENTRY SSIGNO
  341. SSIGNO EQ *
  342. SA1 STATION CLEAR OVER ALLOTMENT BITS
  343. CALL CCLRBIT,OVRTAB1
  344. CALL ROUTNAM,TMPROUT
  345. CALL FCOMPAR,TBLESAC,TMPROUT
  346. ZR X6,SSIGNO IF EXIT FROM ROUTER
  347.  
  348. CALL ALLOTI INITIALIZATIONS
  349. SA1 ILESUN
  350. AX1 18 SET UP LESSON NUMBER
  351. SX6 X1
  352. SA6 ILESNUM
  353. *
  354. * CHECK IF EXIT FROM SPECIAL SYSTEM LESSON
  355. *
  356. CALL SYSLES1,TBLESAC
  357. NG X3,SO200
  358. CALL ARELEAS,1,ILESNUM
  359. EQ SO300
  360. *
  361. * RELEASE STUDENT FROM LESSON CHARGE
  362. *
  363. SO200 CALL ARELEAS,0,ILESNUM,LSITCNT
  364. *
  365. * RELEASE STUDENT FROM COMMON CHARGE
  366. *
  367. CALL ARELEAS,2,TALLOT,LSITCNT
  368. *
  369. * RELEASE STUDENT FROM STORAGE CHARGE
  370. *
  371. MX0 -15
  372. SA1 IALLOT OBTAIN STORAGE CHARGE AMOUNT
  373. LX1 2*15
  374. BX6 -X0*X1
  375. SA6 AECS
  376. CALL ARELEAS,3,AECS
  377. *
  378. SO300 CALL ALLOTR RETURN INFO TO ECS
  379. MX6 0
  380. SA6 TALLOT CLEAR STUDENT BANK WORD
  381. EQ SSIGNO
  382. *
  383. *
  384. * /--- BLOCK CSIGNO 00 000 78/10/23 20.51
  385. TITLE -CSIGNO-
  386. *
  387. * -CSIGNO-
  388. *
  389. * UPDATE ALLOCATION TABLES WHEN EXITING FROM
  390. * STATIC COMMON (THAT IS, THE COMMON SET AT
  391. * CONDENSE TIME). THE COMMON NUMBER IS STORED
  392. * WHEN ATTACHED TO THE LESSON AT CONDENSE TIME
  393. * IN THE LOWER 18 BITS OF *TALLOT*.
  394. *
  395. *
  396. ENTRY CSIGNO
  397. *
  398. CSIGNO EQ *
  399. SA1 TALLOT USER ALLOCATION INFO
  400. SX1 X1 BOTTOM 18 BITS = COMMON NUMBER
  401. ZR X1,CSIGNO EXIT IF NO STATIC COMMON
  402. CALL ROUTNAM,TMPROUT
  403. CALL FCOMPAR,TBLESAC,TMPROUT
  404. ZR X6,CSIGNO IF EXIT FROM ROUTER
  405.  
  406. CALL ALLOT,-1,TALLOT,LSITCNT
  407. MX6 -18
  408. SA1 TALLOT INDICATE STATIC COMMON GONE
  409. BX6 X6*X1 BY ZEROING OUT COMMON NUMBER
  410. SA6 A1
  411. EQ CSIGNO
  412. * /--- BLOCK RSIGNO 00 000 77/11/25 14.00
  413. TITLE -RSIGNO-
  414. *
  415. *
  416. *
  417. * -RSIGNO-
  418. * FINAL EXIT FROM SYSTEM - SIGN OUT OF ROUTER LESSON
  419. *
  420. *
  421. ENTRY RSIGNO
  422. RSIGNO EQ *
  423. MX6 0 CLEAR LESSON NAME
  424. SA6 TBLESAC
  425. SA6 TBLESSN
  426. SA6 TTYPE CLEAR USER TYPE
  427. SA1 TROUINF
  428. SX6 X1 GET ROUTER LESSON NUMBER
  429. ZR X6,RSIGNO
  430. LX6 18 POSITION LESSON NUMBER
  431. SA6 ILESUN
  432. SA1 TROUINF+2
  433. LX1 60-12
  434. SX6 X1 SET COMMON LESSON NUMBER
  435. SA6 TALLOT
  436. MX0 -18
  437. BX6 X0*X1 CLEAR COMMON LESSON NUMBER
  438. LX6 12
  439. SA6 A1
  440. SA1 STATION
  441. SA2 AALLOT SET UP *XALLOT* ENTRY
  442. IX0 X1+X2
  443. SA0 TROUINF+1 SAVED *XALLOT* ENTRY
  444. + WE 1
  445. RJ ECSPRTY
  446. CALL SSIGNO SIGN OUT OF ROUTER LESSON
  447. MX6 0
  448. SA6 ILESUN CLEAR LESSON NUMBER
  449. SA6 TALLOT
  450. EQ RSIGNO
  451. *
  452. EJECT
  453. TITLE -RLESO-
  454. *
  455. * -RLESO-
  456. *
  457. * SIGN USER OUT OF CURRENT ROUTER, BUT CHECKS
  458. * FOR CURRENT LESSON .NE. CURRENT ROUTER.
  459. *
  460. ENTRY RLESO
  461.  
  462. RLESO EQ *
  463. SA1 TROUINF ROUTER VAR INFO WORD
  464. SA2 ILESUN CURRENT LESSON / UNIT
  465. SX1 X1 X1 = ROUTER LESSON NUMBER
  466. AX2 18 SHIFT CURRENT LESSON NUMBER
  467. SX2 X2 X2 = CURRENT LESSON NUMBER
  468. IX6 X1-X2 CHECK FOR SAME LESSON
  469. ZR X1,RLESO --- NO ROUTER TO LEAVE
  470. NZ X6,RLESO2 --- DIFFERENT LESSONS
  471. SA6 TLNUM CLEAR *ILESUN* SAVER
  472. SA6 TBLESAC CLEAR CURRENT LESSON
  473. SA6 TBLESSN
  474. EQ RLESO3 --- CONTINUE WITH SIGNOUT
  475.  
  476. RLESO2 SA2 A2 RESTORE *ILESUN*
  477. BX6 X2 AND SAVE IN TEMP. VAR
  478. SA6 TLNUM
  479.  
  480. RLESO3 LX1 18 SHIFT ROUTER LESSON NUMBER
  481. BX6 X1
  482. SA6 ILESUN MOVE TO *ILESUN* FOR -SSIGNO-
  483. SA1 TROUINF+2 ROUTER COMMON INFO WORD
  484. LX1 60-12
  485. SX6 X1 X6 = COMMON LESSON NUMBER
  486. SA6 TALLOT
  487. MX0 -18
  488. BX6 X0*X1 CLEAR COMMON LESSON NUMBER
  489. LX6 12
  490. SA6 A1
  491. SA1 STATION
  492. SA2 AALLOT SET UP *XALLOT* ENTRY
  493. IX0 X1+X2
  494. SA0 TROUINF+1 SAVED *XALLOT* ENTRY
  495. + WE 1
  496. RJ ECSPRTY
  497. * /--- BLOCK RSIGNO 00 000 77/11/25 14.00
  498. CALL SSIGNO SIGN OUT OF ROUTER LESSON
  499.  
  500. SA1 TLNUM RETRIEVE OLD *ILESUN*
  501. BX6 X1
  502. SX7 B0 CLEAR *TALLOT*
  503. SA6 ILESUN
  504. SA7 TALLOT
  505. EQ RLESO
  506.  
  507. TLNUM BSS 1 SAVE *ILESUN* OVER -SSIGNO-
  508. *
  509. * /--- BLOCK ALLOT 00 000 77/04/17 21.46
  510. TITLE -ALLOT-
  511. *
  512. *
  513. *
  514. * -ALLOT-
  515. * CHARGE SITE FOR ENTRY OR RELEASE SITE FROM ECS
  516. * CHARGE ASSOCIATED WITH ENTRY
  517. *
  518. * ON ENTRY - B1 = 0 = ADD CHARGE TO SITE TOTAL
  519. * -1 = RELEASE SITE FROM CHARGE
  520. * B2 = ADDRESS OF LESSON NUMBER
  521. * B3 = BIAS TO SITE TABLE IN HEADER
  522. *
  523. *
  524. ENTRY ALLOT
  525. ALLOT EQ *
  526. SX6 B1 SAVE ARGUMENTS
  527. SA6 ALLOTA
  528. SX6 B2
  529. SA6 ALLOTA+1
  530. SX6 B3
  531. SA6 ALLOTA+2
  532. MX6 -1 MARK *INFO* BUFFER USED
  533. SA6 JJSTORE
  534. CALL ALLOTI INITIALIZE VARIABLES
  535. SA1 ALLOTA+1 LOAD ARGUMENTS
  536. SA2 ALLOTA+2
  537. SA3 ALLOTA CHECK IF CHARGE OR RELEASE
  538. NG X3,ALLOT10
  539. CALL ACHARGE,2,X1,X2
  540. EQ ALLOT20
  541. *
  542. ALLOT10 CALL ARELEAS,2,X1,X2
  543. ALLOT20 CALL AUTHC ADJUST ECS CHARGE FOR AUTHOR
  544. CALL ALLOTR RETURN VARIABLES
  545. EQ ALLOT
  546. *
  547. *
  548. * /--- BLOCK ALLOTI/R 00 000 77/11/06 03.36
  549. TITLE -ALLOTI-
  550. *
  551. *
  552. *
  553. * -ALLOTI-
  554. * INITIALIZES VARIABLES FOR ECS ACCOUNTING ACTIONS
  555. *
  556. * ON EXIT - *IALLOT* = XALLOT ENTRY FOR STATION
  557. * *IINDX* = INDEX IN *SITTAB* TABLE
  558. * *ISITE* = LOGICAL SITE NUMBER
  559. * *ISITTAB* = *SITTAB* TABLE ENTRY
  560. * *ASCALE* = ALLOTMENT SCALE FACTOR
  561. *
  562. *
  563. ALLOTI EQ *
  564. GETX ASCALE GET ECS ALLOTMENT SCALE FACTOR
  565. SA1 STATION READ XALLOT/SITTAB ENTRIES
  566. CALL READSIT,ISITTAB,SITEDIM
  567. BX6 X1
  568. SA6 ISITE *ISITE* = LOGICAL SITE NUMBER
  569. BX6 X2
  570. SA6 IINDX *IINDX* = BIAS WITHIN *SITTAB*
  571. EQ ALLOTI EXIT
  572. *
  573. *
  574. TITLE -ALLOTR-
  575. *
  576. *
  577. *
  578. * -ALLOTR-
  579. * RETURNS TO ECS THOSE VARIABLES LOADED BY -ALLOTI-
  580. *
  581. * ON EXIT - *XALLOT* ENTRY = *IALLOT*
  582. * *SITTAB* = *ISITTAB*
  583. *
  584. *
  585. ALLOTR EQ *
  586. *
  587. * UPDATE XALLOT TABLE ENTRY
  588. *
  589. SA1 STATION
  590. SA2 AALLOT
  591. IX0 X1+X2 INDEX INTO XALLOT BUFFER
  592. SA0 IALLOT
  593. + WE 1 UPDATE *XALLOT*
  594. RJ ECSPRTY
  595. *
  596. * UPDATE SITETAB TABLE ENTRY
  597. *
  598. SA1 ASITTAB ADDRESS OF SITE ECS TABLE
  599. SA2 IINDX
  600. IX0 X1+X2
  601. SA0 ISITTAB
  602. + WE SITEDIM UPDATE *SITTAB*
  603. RJ ECSPRTY
  604. EQ ALLOTR EXIT
  605. *
  606. *
  607. * /--- BLOCK ACHARGE 00 000 78/10/14 19.51
  608. TITLE -ACHARGE-
  609. *
  610. *
  611. *
  612. * -ACHARGE-
  613. * ON ENTRY - B1 = ENTRY TYPE CODE
  614. * 0 = LESSON
  615. * 1 = SPECIAL LESSON
  616. * 2 = COMMON OR SIMILAR TYPE
  617. * 3 = STORAGE OR SIMILAR TYPE
  618. *
  619. * FOR LESSON/COMMON TYPE ENTRIES -
  620. * B2 = ADDRESS OF LESSON NUMBER
  621. * B3 = BIAS TO SITE TABLE IN HEADER
  622. *
  623. * FOR SPECIAL LESSON TYPE ENTRIES -
  624. * B2 = ADDRESS OF LESSON NUMBER
  625. * B3 = ADDRESS OF AMOUNT TO CHARGE
  626. * (CHARGE IS FOR EACH STATION)
  627. *
  628. * FOR STORAGE TYPE ENTRIES -
  629. * B2 = ADDRESS OF LENGTH OF STORAGE
  630. *
  631. *
  632. ACHARGE EQ *
  633. MX6 0
  634. SA6 ADELTA INITIALIZE CHANGE IN ECS USE
  635. SA6 ALNUMB INITIALIZE LESSON NUMBER
  636. SX6 B1 SAVE TYPE
  637. SA6 ATYPE
  638. JP B1+*+1 JUMP BY TYPE
  639. *
  640. + EQ AC100 LESSON
  641. + EQ AC200 SPECIAL LESSONS
  642. + EQ AC110 COMMON OR SIMILAR
  643. + EQ AC300 STORAGE OR SIMILAR
  644. *
  645. *
  646. * INITIALIZE FOR LESSON
  647. *
  648. AC100 MX6 0 SET SHIFT FOR LESSON
  649. SA6 ASHIFT
  650. EQ AC120
  651. *
  652. * INITIALIZE FOR COMMON OR SIMILAR ENTRY
  653. *
  654. AC110 SX6 15 SET SHIFT FOR COMMON
  655. SA6 ASHIFT
  656. *
  657. * /--- BLOCK ACHARGE 00 000 78/10/14 19.49
  658. *
  659. * OBTAIN HEADER FOR LESSON, COMMON OR SIMILAR ENTRY
  660. *
  661. AC120 SX6 B3 SAVE BIAS TO SITE TABLE
  662. SA6 ABIAS
  663. SA1 B2 X1 = LESSON NUMBER
  664. SX1 X1
  665. ZR X1,ACHARGE
  666. BX6 X1 SAVE LESSON NUMBER
  667. SA6 ALNUMB
  668. CALL READLES,ABUFF,LPRMLTH
  669. BX6 X0 SAVE ECS ADDRESS OF HEADER
  670. SA6 AECSLOC
  671. MX1 12
  672. SA2 ABUFF OBTAIN LESSON TYPE
  673. BX1 X1*X2
  674. LX1 12 POSITION LESSON TYPE CODE
  675. SA2 X1+XSHEADS LOAD LENGTH OF LESSON HEADER
  676. SB1 X2
  677. + RE B1 READ ENTIRE HEADER TO CM
  678. RJ ECSPRTY
  679. SX6 B1 SAVE LENGTH OF HEADER
  680. SA6 AHLTH
  681. *
  682. * COMPUTE LENGTH OF LESSON OR COMMON TYPE ENTRY
  683. *
  684. SA1 ABUFF
  685. SX6 X1 COMPUTE LENGTH OF ENTRY
  686. AX1 18
  687. SX1 X1
  688. IX6 X1+X6
  689. SA6 AECS
  690. SA1 ATYPE CHECK IF LESSON
  691. NZ X1,AC140
  692. *
  693. * /--- BLOCK ACHARGE 00 000 77/06/18 15.37
  694. *
  695. * MAKE ENTRY IN STATION BIT TABLE FOR LESSON
  696. *
  697. SA1 STATION SET BIT FOR THIS STATION
  698. CALL SSETBIT,(ABUFF+LBITTAB)
  699. *
  700. * INCREMENT USER COUNT BY THIS SITE AND CHECK IF
  701. * ENTRY ALREADY IN USE AT THIS SITE
  702. *
  703. AC140 SA1 ABIAS LOAD BIAS TO SITE TABLE
  704. CALL ALTSC,ISITE,X1+ABUFF,1
  705. SX0 X1-2 CHECK IF IN USE AT THIS SITE
  706. PL X0,AC150
  707. SA1 AECS SET CHANGE IN ECS ALLOTMENT
  708. BX6 X1
  709. SA6 ADELTA
  710. *
  711. AC150 SA1 AECSLOC GET ECS ADDRESS OF HEADER
  712. BX0 X1
  713. SA1 AHLTH GET LENGTH OF HEADER
  714. SB1 X1
  715. SA0 ABUFF
  716. + WE B1 RE-WRITE LESSON HEADER
  717. RJ ECSPRTY
  718. EQ AC500
  719. *
  720. * /--- BLOCK ACHARGE 00 000 80/09/04 03.55
  721. *
  722. * OBTAIN HEADER FOR SPECIAL LESSON ENTRY
  723. *
  724. AC200 SX6 2*15 SET SHIFT AS FOR STORAGE
  725. SA6 ASHIFT
  726. SA1 B3 SAVE AMOUNT TO CHARGE
  727. BX6 X1
  728. SA6 AECS
  729. SA6 ADELTA
  730. SA1 B2 X1 = LESSON NUMBER
  731. SX1 X1
  732. BX6 X1 SAVE LESSON NUMBER
  733. SA6 ALNUMB
  734. CALL READLES,ABUFF,LESHEAD
  735. BX6 X0 SAVE ECS ADDRESS OF HEADER
  736. SA6 AECSLOC
  737. *
  738. * INCREMENT USER COUNT BY THIS SITE
  739. *
  740. SA1 STATION SET BIT FOR THIS STATION
  741. CALL SSETBIT,(ABUFF+LBITTAB)
  742. CALL ALTSC,ISITE,(ABUFF+LSITCNT),1
  743. SA1 AECSLOC GET ECS ADDRESS OF HEADER
  744. BX0 X1
  745. SA0 ABUFF
  746. + WE LESHEAD RE-WRITE LESSON HEADER
  747. RJ ECSPRTY
  748. EQ AC500
  749. *
  750. *
  751. * SET ECS LENGTH AND CHANGE FOR STORAGE TYPE ENTRY
  752. *
  753. AC300 SX6 2*15 SET SHIFT FOR STORAGE
  754. SA6 ASHIFT
  755. SA1 B2 GET LENGTH OF STORAGE
  756. SX6 X1
  757. ZR X6,ACHARGE
  758. *
  759. SX1 77777B (X1) = MAX. POSSIBLE CHARGE
  760. IX1 X1-X6 SEE IF IN RANGE
  761. PL X1,AC310 --- IF OK
  762. SX6 77777B SET FOR MAX. POSSIBLE
  763. AC310 BSS 0
  764. *
  765. SA6 AECS
  766. SA6 ADELTA SET CHANGE IN ECS USAGE
  767. *
  768. * /--- BLOCK ACHARGE 00 000 78/10/14 19.53
  769. *
  770. * UPDATE AMOUNT OF ECS IN USE BY SITE (*ISITTAB*)
  771. *
  772. AC500 SA1 ADELTA X1 = CHANGE IN ECS USAGE
  773. ZR X1,AC510
  774. MX0 -24
  775. SA2 ISITTAB LOAD WORD CONTAINING ECS USAGE
  776. BX6 X0*X2
  777. BX2 -X0*X2 MASK OFF CURRENT TOTAL
  778. IX1 X1+X2 ADD TO ECS USE FOR SITE
  779. BX6 X1+X6
  780. SA6 A2
  781. *
  782. * UPDATE ECS USE FOR THIS STATION (*IALLOT*)
  783. *
  784. AC510 MX0 -15
  785. SA1 ASHIFT LOAD SHIFT COUNT
  786. SB1 X1 B1 = SHIFT WITHIN *IALLOT*
  787. SA1 IALLOT
  788. SA2 AECS ECS LENGTH OF THIS ENTRY
  789. LX0 X0,B1
  790. LX2 X2,B1
  791. BX6 X0*X1 MASK ALL BUT APPROPRIATE COUNT
  792. BX1 -X0*X1
  793. IX1 X1+X2 ADD TO APPROPRIATE TOTAL
  794. BX1 -X0*X1
  795. BX6 X1+X6 RE-COMBINE
  796. SA6 A1
  797. EQ ACHARGE
  798. *
  799. *
  800. * /--- BLOCK ARELEAS 00 000 78/10/14 19.54
  801. TITLE -ARELEAS-
  802. *
  803. *
  804. *
  805. * -ARELEAS-
  806. * ON ENTRY - B1 = ENTRY TYPE CODE
  807. * 0 = LESSON
  808. * 1 = SPECIAL LESSON
  809. * 2 = COMMON OR SIMILAR TYPE
  810. * 3 = STORAGE OR SIMILAR TYPE
  811. *
  812. * FOR LESSON/COMMON TYPE ENTRIES -
  813. * B2 = ADDRESS OF LESSON NUMBER
  814. * B3 = BIAS TO SITE TABLE IN HEADER
  815. *
  816. * FOR SPECIAL LESSON TYPE ENTRIES -
  817. * B2 = ADDRESS OF LESSON NUMBER
  818. *
  819. * FOR STORAGE TYPE ENTRIES -
  820. * B2 = ADDRESS OF LENGTH OF STORAGE
  821. *
  822. *
  823. ARELEAS EQ *
  824. MX6 0
  825. SA6 ADELTA INITIALIZE CHANGE IN ECS USE
  826. SA6 ALNUMB INITIALIZE LESSON NUMBER
  827. SX6 B1 SAVE TYPE
  828. SA6 ATYPE
  829. JP B1+*+1 JUMP BY TYPE
  830. *
  831. + EQ AR100 LESSON
  832. + EQ AR200 SPECIAL LESSONS
  833. + EQ AR110 COMMON OR SIMILAR
  834. + EQ AR300 STORAGE OR SIMILAR
  835. *
  836. *
  837. * INITIALIZE FOR LESSON
  838. *
  839. AR100 MX6 0 SET SHIFT FOR LESSON
  840. SA6 ASHIFT
  841. MX0 -15
  842. SA1 IALLOT OBTAIN LENGTH OF LESSON
  843. BX6 -X0*X1
  844. SA6 AECS
  845. SA1 B2 X1 = LESSON NUMBER
  846. SX1 X1
  847. NZ X1,AR120 CHECK IF LESSON STILL IN ECS
  848. EQ AR500
  849. *
  850. * INITIALIZE FOR COMMON OR SIMILAR ENTRY
  851. *
  852. AR110 SX6 15 SET SHIFT FOR COMMON
  853. SA6 ASHIFT
  854. *
  855. * /--- BLOCK ARELEAS 00 000 78/10/14 19.55
  856. *
  857. * OBTAIN HEADER FOR LESSON, COMMON OR SIMILAR ENTRY
  858. *
  859. AR120 SX6 B3 SAVE BIAS TO SITE TABLE
  860. SA6 ABIAS
  861. SA1 B2 X1 = LESSON NUMBER
  862. SX1 X1
  863. ZR X1,ARELEAS
  864. BX6 X1 SAVE LESSON NUMBER
  865. SA6 ALNUMB
  866. CALL READLES,ABUFF,LPRMLTH
  867. BX6 X0 SAVE ECS ADDRESS OF HEADER
  868. SA6 AECSLOC
  869. MX1 12
  870. SA2 ABUFF OBTAIN LESSON TYPE
  871. BX1 X1*X2
  872. LX1 12 POSITION LESSON TYPE CODE
  873. SA2 X1+XSHEADS LOAD LENGTH OF LESSON HEADER
  874. SB1 X2
  875. + RE B1 READ ENTIRE HEADER TO CM
  876. RJ ECSPRTY
  877. SX6 B1 SAVE LENGTH OF HEADER
  878. SA6 AHLTH
  879. *
  880. * COMPUTE LENGTH OF COMMON TYPE ENTRY
  881. *
  882. SA1 ASHIFT CHECK FOR LESSON
  883. ZR X1,AR140
  884. SA1 ABUFF
  885. SX6 X1 COMPUTE LENGTH OF ENTRY
  886. AX1 18
  887. SX1 X1
  888. IX6 X1+X6
  889. SA6 AECS
  890. *
  891. * DECREMENT USER COUNT BY THIS SITE AND CHECK IF
  892. * ENTRY STILL IN USE AT THIS SITE
  893. *
  894. *
  895. AR140 SA1 ATYPE CHECK IF LESSON
  896. NZ X1,AR145
  897. SA1 STATION CLEAR BIT FOR THIS STATION
  898. CALL CCLRBIT,(ABUFF+LBITTAB)
  899. *
  900. AR145 SA1 ABIAS LOAD BIAS TO SITE TABLE
  901. CALL ALTSC,ISITE,X1+ABUFF,-1
  902. NZ X1,AR150 CHECK IF STILL IN USE AT SITE
  903. SA1 AECS SET CHANGE IN ECS ALLOTMENT
  904. BX6 X1
  905. SA6 ADELTA
  906. *
  907. AR150 SA1 AECSLOC GET ECS ADDRESS OF HEADER
  908. BX0 X1
  909. SA1 AHLTH GET LENGTH OF HEADER
  910. SB1 X1
  911. SA0 ABUFF
  912. + WE B1 RE-WRITE LESSON HEADER
  913. RJ ECSPRTY
  914. EQ AR500
  915. *
  916. * /--- BLOCK ARELEAS 00 000 78/10/14 19.55
  917. *
  918. * OBTAIN HEADER FOR SPECIAL LESSON ENTRY
  919. *
  920. AR200 SX6 2*15 SET SHIFT AS FOR STORAGE
  921. SA6 ASHIFT
  922. MX6 -15
  923. SA1 IALLOT GET AMOUNT CHARGED FOR LESSON
  924. LX1 2*15
  925. BX6 -X6*X1
  926. SA6 AECS
  927. SA6 ADELTA
  928. SA1 B2 X1 = LESSON NUMBER
  929. SX1 X1
  930. ZR X1,AR500
  931. BX6 X1 SAVE LESSON NUMBER
  932. SA6 ALNUMB
  933. CALL READLES,ABUFF,LESHEAD
  934. BX6 X0 SAVE ECS ADDRESS OF HEADER
  935. SA6 AECSLOC
  936. *
  937. * DECREMENT USER COUNT BY THIS SITE
  938. *
  939. SA1 STATION CLEAR BIT FOR THIS STATION
  940. CALL CCLRBIT,(ABUFF+LBITTAB)
  941. CALL ALTSC,ISITE,(ABUFF+LSITCNT),-1
  942. SA1 AECSLOC GET ECS ADDRESS OF HEADER
  943. BX0 X1
  944. SA0 ABUFF
  945. + WE LESHEAD RE-WRITE LESSON HEADER
  946. RJ ECSPRTY
  947. EQ AR500
  948. *
  949. *
  950. * SET ECS LENGTH AND CHANGE FOR STORAGE TYPE ENTRY
  951. *
  952. AR300 SX6 2*15 SET SHIFT FOR STORAGE
  953. SA6 ASHIFT
  954. SA1 B2 GET LENGTH OF STORAGE
  955. SX6 X1
  956. ZR X6,ARELEAS
  957. SA6 AECS
  958. SA6 ADELTA SET CHANGE IN ECS USAGE
  959. *
  960. * /--- BLOCK ARELEAS 00 000 78/10/14 19.57
  961. *
  962. * UPDATE AMOUNT OF ECS IN USE BY SITE (*ISITTAB*)
  963. *
  964. AR500 SA1 ADELTA CHANGE IN ECS USAGE
  965. ZR X1,AR510
  966. MX0 -24
  967. SA2 ISITTAB LOAD WORD CONTAINING ECS USAGE
  968. BX6 X0*X2
  969. BX2 -X0*X2 MASK OFF CURRENT TOTAL
  970. IX1 X2-X1 DECREMENT ECS USE FOR SITE
  971. + PL X1,*+1
  972. SX1 0 DONT ALLOW NEGATIVE LENGTH
  973. + BX6 X1+X6
  974. SA6 A2
  975. *
  976. * UPDATE ECS USE FOR THIS STATION (*IALLOT*)
  977. *
  978. AR510 MX0 -15
  979. SA1 ASHIFT LOAD SHIFT COUNT
  980. SB1 X1 B1 = SHIFT WITHIN *IALLOT*
  981. SA1 IALLOT
  982. SA2 AECS ECS LENGTH OF THIS ENTRY
  983. LX0 X0,B1
  984. LX2 X2,B1
  985. BX6 X0*X1 MASK ALL BUT APPROPRIATE COUNT
  986. BX1 -X0*X1
  987. IX1 X1-X2 SUBTRACT FROM APPROPRIATE TOTAL
  988. + PL X1,*+1
  989. SX1 0 DONT ALLOW NEGATIVE TOTAL
  990. + BX1 -X0*X1
  991. BX6 X1+X6 RE-COMBINE
  992. SA6 A1
  993. EQ ARELEAS
  994. *
  995. *
  996. * /--- BLOCK AUTHC 00 000 77/11/20 15.54
  997. TITLE -AUTHC-
  998. *
  999. *
  1000. *
  1001. * -AUTHC-
  1002. * ADJUST ECS CHARGE FOR AUTHOR TO MAINTAIN MINIMUM
  1003. * CHARGE OF *AUTHECS*
  1004. *
  1005. AUTHC EQ *
  1006. SA1 TALLOT
  1007. PL X1,AUTHC CHECK IF ANY AUTHOR CHARGE
  1008. BX7 X1
  1009. LX7 60-18 X7 = *TALLOT*
  1010. SB1 X7
  1011. ZR B1,AHC210
  1012. SB1 B0-B1 B1 = CHANGE IN SITE ECS USAGE
  1013. *
  1014. * COMPUTE NEW AUTHOR ECS CHARGE
  1015. *
  1016. AHC210 MX0 -15 X0 = MASK
  1017. SA4 IALLOT X4 = *IALLOT*
  1018. LX4 15+15 POSITION STORAGE/AUTHOR CHARGE
  1019. BX5 -X0*X4
  1020. SX5 X5+B1 X5 = STORAGE CHARGE
  1021. LX4 15 POSITION COMMON CHARGE
  1022. BX2 -X0*X4
  1023. IX2 X2+X5 ADD TO TOTAL CHARGE
  1024. LX4 15 POSITION LESSON CHARGE
  1025. BX1 -X0*X4
  1026. IX2 X1+X2 X2 = TOTAL ECS CHARGE
  1027. MX3 0 X3 = AUTHOR CHARGE
  1028. SX1 X2-AUTHECS
  1029. PL X1,AHC260 JUMP IF OVER MINIMUM CHARGE
  1030. BX3 -X1 X3 = AUTHOR CHARGE
  1031. SB1 X3+B1 ADJUST CHANGE IN SITE ECS TOTAL
  1032. *
  1033. * UPDATE *XALLOT* ENTRY IMAGE FOR THIS AUTHOR
  1034. *
  1035. AHC260 IX5 X3+X5 COMPUTE STORAGE+AUTHOR CHARGE
  1036. LX4 15+15 POSITION STORAGE CHARGE FIELD
  1037. BX4 X0*X4
  1038. BX6 X4+X5 ATTACH NEW STORAGE CHARGE
  1039. LX6 15+15
  1040. SA6 A4 UPDATE *IALLOT*
  1041. *
  1042. * /--- BLOCK AUTHC 00 000 78/10/14 20.01
  1043. *
  1044. * UPDATE AUTHOR ECS CHARGE IN *TALLOT*
  1045. *
  1046. MX0 -18
  1047. BX7 X0*X7 CLEAR OUT OLD AUTHOR CHARGE
  1048. BX7 X3+X7 ATTACH NEW CHARGE
  1049. LX7 18
  1050. SA7 TALLOT UPDATE *TALLOT*
  1051. *
  1052. * UPDATE SITE ECS USAGE TOTAL IN *SITTAB*
  1053. *
  1054. MX0 -24
  1055. SA1 ISITTAB LOAD SITE ECS USAGE WORD
  1056. BX6 X0*X1
  1057. BX1 -X0*X1 MASK OFF CURRENT USAGE TOTAL
  1058. SX2 B1
  1059. IX1 X1+X2 ADJUST SITE ECS USEAGE TOTAL
  1060. + PL X1,*+1 DONT ALLOW NEGATIVE TOTAL
  1061. SX1 0
  1062. + BX6 X1+X6 MERGE NEW USAGE TOTAL
  1063. SA6 A1
  1064. EQ AUTHC
  1065. *
  1066. *
  1067. *
  1068. * /--- BLOCK READSIT 00 000 77/04/17 20.11
  1069. TITLE -READSIT-
  1070. *
  1071. *
  1072. *
  1073. * -READSIT-
  1074. * READ SITE TABLE FOR INDICATED STATION
  1075. *
  1076. * ON ENTRY - X1 = STATION NUMBER
  1077. * B1 = ADDRESS TO READ INTO
  1078. * B2 = NUMBER OF WORDS TO READ
  1079. *
  1080. * LEAVES X0, A0, *IALLOT* APPROPRIATELY SET
  1081. * RETURNS X1 = LOGICAL SITE NUMBER
  1082. * X2 = BIAS TO SITE IN *SITTAB*
  1083. *
  1084. * REGISTERS CHANGED';
  1085. * A'; 0,1,2,3
  1086. * X'; 0,1,2,3
  1087. * B'; NONE
  1088. *
  1089. *
  1090. ENTRY READSIT
  1091. READSIT EQ *
  1092. SA2 AALLOT
  1093. IX0 X1+X2
  1094. SA0 IALLOT
  1095. + RE 1 READ *XALLOT* ENTRY
  1096. RJ ECSPRTY
  1097. MX0 -15
  1098. SA1 A0 LOAD *XALLOT* ENTRY
  1099. LX1 15
  1100. BX2 -X0*X1 X2 = BIAS WITHIN *SITTAB*
  1101. SA3 ASITTAB
  1102. IX0 X2+X3 INDEX INTO LOGICAL SITE TABLE
  1103. SA0 B1 ADDRESS TO READ INTO
  1104. *
  1105. * CALCULATE LOGICAL SITE NUMBER BEFORE TEST/TRANSFER
  1106. *
  1107. PX1 X2
  1108. NX1 X1 CONVERT TO FLOATING
  1109. SX3 SITEDIM
  1110. PX3 X3
  1111. NX3 X3
  1112. FX1 X1/X3 X1 = LOGICAL SITE NUMBER
  1113. UX1 X1,B1
  1114. LX1 X1,B1
  1115. *
  1116. * TRANSFER REQUIRED NUMBER OF WORDS
  1117. *
  1118. LE B2,READSIT
  1119. + RE B2 READ REQUIRED LENGTH
  1120. RJ ECSPRTY
  1121. EQ READSIT
  1122. *
  1123. *
  1124. * /--- BLOCK TSTSITE 00 000 76/01/29 04.12
  1125. TITLE -TSTSITE-
  1126. *
  1127. *
  1128. *
  1129. * -TSTSITE-
  1130. * CHECK TO SEE IF A TIMED BACK-OUT IN EFFECT FOR
  1131. * THIS LOGICAL SITE
  1132. *
  1133. * ON RETURN - X6 = 0 NO BACKOUT
  1134. * -1 BACKOUT IN EFFECT
  1135. *
  1136. *
  1137. ENTRY TSTSITE
  1138. TSTSITE EQ *
  1139. SA1 AALLOT
  1140. SA4 STATION INDEX INTO *XALLOT* BUFFER
  1141. SX0 X4-LSTUD
  1142. ZR X0,TSTS1 CHECK FOR CONSOLE
  1143. IX0 X1+X4 SET ADDRESS TO *XALLOT* ENTRY
  1144. RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
  1145. MX0 15
  1146. BX1 X0*X1
  1147. LX1 15 POSITION INDEX IN SITE TABLE
  1148. PX1 X1
  1149. NX1 X1 CONVERT TO FLOATING POINT
  1150. SX2 SITEDIM
  1151. PX2 X2
  1152. NX2 X2
  1153. FX1 X1/X2 COMPUTE LOGICAL SITE NUMBER
  1154. UX1 X1,B1
  1155. LX1 X1,B1 CONVERT BACK TO INTEGER
  1156. SA2 ASLOCK
  1157. IX0 X1+X2 INDEX INTO SITE LOCK-OUT BUFFER
  1158. + RE 1 READ SITE LOCK-OUT TABLE
  1159. RJ ECSPRTY
  1160. SA1 A0
  1161. ZR X1,TSTS1 EXIT IF NO SITE BACK-OUT
  1162. MX7 18
  1163. BX2 X7*X1 MASK OFF BACK-OUT STATION NUM
  1164. BX1 -X7*X1 MASK OFF BACK-OUT TIME
  1165. LX2 18 CHECK IF THIS STATION INITIATED
  1166. IX2 X2-X4 BACK-OUT
  1167. ZR X2,TSTS1
  1168. SA2 SYSCLOK
  1169. IX1 X2-X1 CHECK IF BACK-OUT TIME ELAPSED
  1170. NG X1,TSTS2
  1171. SA0 =0
  1172. + WE 1 CLEAR OUT BACK-OUT TIME
  1173. RJ ECSPRTY
  1174. *
  1175. TSTS1 MX6 0 MARK NO BACK-OUT IN PROCESS
  1176. EQ TSTSITE
  1177. *
  1178. TSTS2 MX6 -1 MARK BACK-OUT IN PROCESS
  1179. EQ TSTSITE
  1180. *
  1181. *
  1182. * /--- BLOCK ENTER/EXIT 00 000 76/01/29 04.43
  1183. TITLE -SSENTER-
  1184. *
  1185. *
  1186. * -SSENTER-
  1187. * UPDATE ALLOCATION TABLES ON ENTRY TO -PLATO-
  1188. *
  1189. *
  1190. ENTRY SSENTER
  1191. SSENTER EQ *
  1192. SA1 SCSITES RELATIVE ADDRESS OF TABLE
  1193. SA3 STATION
  1194. IX0 X1+X3 INDEX INTO SITE/STATION TABLE
  1195. RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
  1196. MX0 -12
  1197. BX1 -X0*X1 MASK OFF LOGICAL SITE NUMBER
  1198. SX0 SITEDIM
  1199. DX1 X0*X1 COMPUTE INDEX IN SITE TABLE
  1200. MX0 -15
  1201. BX6 -X0*X1
  1202. LX6 60-15 POSITION INDEX IN SITE TABLE
  1203. SA6 IALLOT
  1204. SA2 AALLOT
  1205. IX0 X2+X3 INDEX INTO *XALLOT* (INIT)
  1206. WX6 X0 (-WXX- 1 WD WRITE, MAY CHG *A6*)
  1207. SA2 ASITTAB
  1208. IX0 X1+X2 INDEX INTO SITE TABLE
  1209. SA0 ISITTAB
  1210. + RE SITEDIM READ SITE TABLE ENTRY
  1211. RJ ECSPRTY
  1212. BX1 X3 SET BIT FOR THIS STATION
  1213. CALL SSETBIT,(ISITTAB+1)
  1214. + WE SITEDIM REWRITE SITE TABLE ENTRY
  1215. RJ ECSPRTY
  1216. EQ SSENTER
  1217. *
  1218. *
  1219. TITLE -SSEXIT-
  1220. *
  1221. *
  1222. * -SSEXIT-
  1223. * UPDATE ALLOCATION TABLES ON EXIT FROM -PLATO-
  1224. *
  1225. *
  1226. ENTRY SSEXIT
  1227. SSEXIT EQ *
  1228. CALL ALLOTI LOAD ALLOTMENT TABLES TO CM
  1229. MX6 0
  1230. SA6 IALLOT CLEAR *IALLOT* ENTRY
  1231. SA1 STATION CLEAR BIT FOR THIS STATION
  1232. CALL CCLRBIT,(ISITTAB+1)
  1233. CALL ALLOTR RETURN TABLES TO ECS
  1234. EQ SSEXIT
  1235. *
  1236. *
  1237. * /--- BLOCK CHKECS 00 000 78/02/21 18.57
  1238. TITLE -CHKECS-
  1239. *
  1240. *
  1241. *
  1242. * -CHKECS- -CHKBASE-
  1243. * GET ECS USEAGE AND ALLOCATION FOR THIS SITE
  1244. *
  1245. * ON RETURN - X1 = TOTAL ECS IN USE
  1246. * X2 = AMOUNT ALLOTED TO SITE
  1247. *
  1248. *
  1249. ENTRY CHKECS
  1250. CHKECS EQ *
  1251. CALL ALLOTI INITIALIZE VARIABLES
  1252. SA1 ISITE
  1253. CALL CHKBASE,ISITTAB GET BASE ALLOTMENT AND USE
  1254. SA3 ASCALE
  1255. ZR X3,CHKECS EXIT IF NO SCALE FACTOR
  1256. PX2 X2
  1257. NX2 X2 CONVERT TO FLOATING POINT
  1258. FX2 X2*X3
  1259. UX2 X2,B1 CONVERT SCALED ALLOTMENT
  1260. LX2 X2,B1
  1261. EQ CHKECS
  1262. *
  1263. *
  1264. * -CHKBASE- RETURNS THE BASE ECS ALLOTMENT IN X2
  1265. * ENTRY'; X1= LOGICAL SITE , B1= ADDRESS OF ECS SUM
  1266. * FOR THIS SITE FROM *SITETABLE*
  1267. * EXIT'; X1= CURRENT ECS IN USE
  1268. * X2= BASE ECS
  1269. *
  1270. *
  1271. ENTRY CHKBASE
  1272. CHKBASE EQ *
  1273. SA2 SCALLOT
  1274. IX0 X1+X2 INDEX INTO SITE ALLOTMENT TABLE
  1275. RX2 X0 (-RXX- 1 WD READ, MAY CHG *A2*)
  1276. MX0 -24
  1277. SA3 B1 LOAD TOTAL SITE ECS USE
  1278. BX1 -X0*X3 AMOUNT OF ECS IN USE
  1279. BX2 -X0*X2 TOTAL ECS ALLOCATED TO SITE
  1280. EQ CHKBASE
  1281. *
  1282. *
  1283. * /--- BLOCK SSDELET 00 000 80/02/22 23.36
  1284. TITLE -SSDELET-
  1285. *
  1286. *
  1287. *
  1288. * -SSDELET-
  1289. * CLEAN UP ALLOCATION TABLES FOR DELETED LESSON
  1290. *
  1291. * ON ENTRY - X1 = LESSON NUMBER
  1292. *
  1293. *
  1294. ENTRY SSDELET
  1295. SSDELET EQ *
  1296. SX6 X1 SAVE LESSON NUMBER
  1297. SA6 ALNUMB
  1298. CALL READLES,ABUFF,LESHEAD
  1299. ZR X0,SSDELET
  1300. SX1 3 INCREMENT TO WD 4 OF LESNAM
  1301. IX0 X0+X1
  1302. RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
  1303. MX0 12 MASK FOR LESSON TYPE
  1304. BX1 X0*X1 CHECK TYPE = TUTOR LESSON
  1305. NZ X1,SSDELET
  1306. *
  1307. * COMPUTE LENGTH OF LESSON
  1308. *
  1309. SA1 ABUFF
  1310. SX6 X1 COMPUTE TOTAL LENGTH OF LESSON
  1311. AX1 18
  1312. SX1 X1
  1313. IX6 X1+X6
  1314. SA6 AECS
  1315. SA6 ADELTA
  1316. *
  1317. * FIND ALL SITES REFERENCING THIS LESSON
  1318. *
  1319. MX6 -1 INITIALIZE SITE NUMBER
  1320. SA6 ISITE
  1321. *
  1322. SD200 SA1 ISITE INCREMENT SITE NUMBER
  1323. SX6 X1+1
  1324. SA6 A1
  1325. SX6 X6-XMAXSIT END TEST
  1326. PL X6,SSDELET
  1327. CALL GETSC,ISITE,(ABUFF+LSITCNT)
  1328. ZR X1,SD200 CHECK IF THIS SITE USING LESSON
  1329. *
  1330. * /--- BLOCK SSDELET 00 000 78/10/14 20.22
  1331. *
  1332. * READ *SITTAB* ENTRY FOR THIS SITE
  1333. *
  1334. SA1 ISITE LOGICAL SITE NUMBER
  1335. SX2 SITEDIM
  1336. DX1 X1*X2 COMPUTE INDEX WITHIN TABLE
  1337. SA2 ASITTAB
  1338. IX0 X1+X2 ECS ADDRESS OF *SITTAB* ENTRY
  1339. RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
  1340. *
  1341. * SUBTRACT LENGTH OF LESSON FROM SITE ECS USE TOTAL
  1342. *
  1343. MX7 -24 MASK FOR ECS USE TOTAL
  1344. BX6 X7*X1 MASK ALL BUT ECS TOTAL
  1345. BX1 -X7*X1
  1346. SA2 AECS
  1347. IX1 X1-X2 SUBTRACT FOR THIS LESSON
  1348. + PL X1,*+1
  1349. SX1 0 DONT ALLOW NEGATIVE TOTAL
  1350. + BX1 -X7*X1
  1351. BX6 X1+X6 RE-COMBINE
  1352. SA6 ISITTAB
  1353. WX6 X0 (-WXX- 1 WD WRITE, MAY CHG *A6*)
  1354. *
  1355. EQ SD200
  1356. *
  1357. *
  1358. * /--- BLOCK CLEAREC 00 000 77/06/09 18.27
  1359. TITLE -CLEAREC-
  1360. *
  1361. *
  1362. *
  1363. * -CLEAREC-
  1364. * OBTAIN ECS BY PRESSING -STOP1- ON AUTHORS AT THIS
  1365. * SITE WHO ARE USING MORE THAN *AUTHECS* WORDS
  1366. *
  1367. * ON ENTRY - *LESINF* = AMOUNT OF ECS TO OBTAIN
  1368. *
  1369. *
  1370. ENTRY CLEAREC
  1371. CLEAREC EQ *
  1372. SA1 LESINF
  1373. SX6 X1+5000 AMOUNT OF ECS DESIRED
  1374. SA6 ECNEED
  1375. MX6 0 INITIALIZE ECS FREE TOTAL
  1376. SA6 ECFREE1
  1377. CALL ALLOTI INITIALIZE SITE VARIABLES
  1378. *
  1379. * CHECK IF DELETION ENABLED AT THIS SITE
  1380. *
  1381. SA1 SCAUTH ADDRESS OF BIT TABLE IN ECS
  1382. BX0 X1
  1383. SA0 WORK
  1384. + RE LSITLTH BRING BIT TABLE TO CM
  1385. RJ ECSPRTY
  1386. SA1 ISITE CHECK BIT FOR THIS SITE
  1387. CALL STSTBIT,WORK
  1388. ZR X6,CLEAREC EXIT IF DELETION BIT NOT SET
  1389. *
  1390. * COMBINE SITE AND OVER ALLOTMENT TABLES
  1391. *
  1392. SB1 LBITLTH-1
  1393. *
  1394. CC10 SA1 B1+OVRTAB1 NEXT WORD OF OVER TABLE
  1395. SA2 B1+ISITTAB+1 WORD OF SITE TABLE
  1396. BX6 X1*X2 STATIONS FOR THIS SITE
  1397. SA6 B1+ATABLE
  1398. SB1 B1-1 END TEST
  1399. PL B1,CC10
  1400. *
  1401. * UP TO 3 PASSES TO FIND THE ECS
  1402. *
  1403. SX6 =XEDBND1 PASS 1 LOWER LIMIT
  1404. CALL CLEARIT
  1405. PL X1,CLEAREC FOUND ENOUGH
  1406. SX6 =XEDBND2 PASS 2 LOWER LIMIT
  1407. CALL CLEARIT
  1408. PL X1,CLEAREC NOW FOUND ENOUGH
  1409. SX6 =XEDBND3 PASS 3 LOWER LIMIT
  1410. CALL CLEARIT
  1411. EQ CLEAREC RETURN REGARDLESS
  1412. *
  1413. *
  1414. *
  1415. *
  1416. * -CLEARIT-
  1417. * LOOP THROUGH SITE AND PRESS STOP1 ON AUTHORS
  1418. * USING ABOVE CERTAIN ECS LIMITS
  1419. *
  1420. * ON ENTRY - X6 = LOWER ECS BOUNDARY
  1421. *
  1422. * ON EXIT - X1 = POSITIVE IF ENOUGH ECS OBTAINED
  1423. *
  1424. CLEARIT EQ *
  1425. SA6 LOWBND SAVE LOWER BOUNDARY
  1426. *
  1427. * SEARCH FOR AUTHORS TO DELETE
  1428. *
  1429. CALL IBIT,ATABLE
  1430. *
  1431. CCLP CALL NEXTBIT GET NEXT STATION NUMBER
  1432. NG X1,CLEARIT THIS PASS COMPLETE
  1433. SX6 X1 SAVE STATION NUMBER
  1434. SA6 ISTATN
  1435. CDCIF IFNE CDC,0
  1436. SA2 AALLOT
  1437. IX0 X6+X2 ECS ADDRESS FOR *XALLOT* ENTRY
  1438. RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
  1439. MX0 -15
  1440. * /--- BLOCK CLEAREC 00 000 79/04/06 12.29
  1441. BX7 -X0*X1 MASK OFF LENGTH OF LESSON
  1442. AX1 15
  1443. BX2 -X0*X1 MASK OFF LENGTH OF COMMON
  1444. IX7 X7+X2 COLLECT AMOUNT IN X7
  1445. AX1 15
  1446. BX1 -X0*X1 MASK OFF LENGTH OF STORAGE
  1447. IX7 X7+X1
  1448. SA2 LOWBND
  1449. IX2 X2-X7
  1450. PL X2,CCLP BELOW LOWER BOUNDARY
  1451. SX7 X7-AUTHECS SUBTRACT AMOUNT LEFT TO AUTHOR
  1452. SA7 ECSTOT SAVE TOTAL ECS OBTAINABLE
  1453. CDCIF ENDIF
  1454. CALL READSBK,INAME,ISTATN,(TBLESAC-SBSTART),2
  1455. *
  1456. *
  1457. * CHECK IF AUTHOR CAN BE BACKED OUT
  1458. *
  1459. SA2 INAME+1 SEE IF NON-DELETABLE LESSON
  1460. ZR X2,CCLP
  1461. CALL SYSLES,INAME (X3) = 0 IF NOT SYSTEM LESSON
  1462. * = 1 IF *D1* ATTRIBUTE
  1463. * = 2 IF *D2* ATTRIBUTE
  1464. * = 3 IF *D3* ACTIVE
  1465. *
  1466. ZR X3,CC15 IF NORMAL DELETION OK
  1467. SX3 X3-3
  1468. NG X3,CCLP IF DELETION-PROTECTED
  1469. SA1 KSYS2 (X1) = *SYS2KEY*
  1470. EQ CC18 GO PRESS KEY
  1471.  
  1472. CC15 SA1 KSYS1 (X1) = *SYS1KEY*
  1473. CC18 BX6 X1 (X6) = SPECIAL KEY NUMBER
  1474. SA6 KEYTYPE
  1475. CALL FINDLES,INAME,LESNUM
  1476. SA1 LESNUM SEE IF LESSON IN ECS
  1477. NG X1,CCLP
  1478. CALL READLES,ABUFF,LESHEAD
  1479. SB1 LBITLTH-1
  1480. *
  1481. * CHECK IF STUDENTS USING SAME LESSON AT THIS SITE
  1482. *
  1483. CDCIF IFEQ CDC,0
  1484. CC20 SA1 B1+ATABLE AUTHORS-IN-LESSON TABLE
  1485. SA2 B1+ABUFF+LBITTAB USERS IN LESSON
  1486. BX2 -X1*X2 MASK OUT AUTHORS
  1487. SA1 B1+ISITTAB+1 USERS IN THE SITE
  1488. BX2 X1*X2 IN SITE AND IN LESSON
  1489. NZ X2,CCLP STUDENTS IN SITE USING LESSON
  1490. SB1 B1-1
  1491. PL B1,CC20 END TEST
  1492. CDCIF ELSE
  1493. MX7 0
  1494. CC20 SA1 B1+ISITTAB+1 USERS IN THE SITE
  1495. SA2 B1+ABUFF+LBITTAB USERS IN LESSON
  1496. BX6 X1*X2 IN SITE AND IN LESSON
  1497. ZR X6,CC22
  1498. SA1 B1+ATABLE AUTHORS-IN-LESSON TABLE
  1499. BX2 -X1*X6 MASK OUT AUTHORS
  1500. NZ X2,CCLP STUDENTS IN SITE USING LESSON
  1501. CX6 X6
  1502. IX7 X6+X7 ADD TO USER COUNT
  1503. CC22 SB1 B1-1
  1504. PL B1,CC20 END TEST
  1505. SX7 X7-4
  1506. PL X7,CCLP 4 OR MORE USERS
  1507. CDCIF ENDIF
  1508. CALL PRESKEY,KEYTYPE,ISTATN
  1509. SA1 DELCNT
  1510. SX6 X1+1 INCREMENT NUMBER OF DELETIONS
  1511. SA6 A1
  1512. CDCIF IFNE CDC,0
  1513. * /--- BLOCK CLEAREC 00 000 79/04/06 12.29
  1514. *
  1515. * ISSUE ACCOUNT FILE INFORMATION ABOUT USER DELETED
  1516. *
  1517. SA1 ISTATN STATION NUMBER
  1518. SB1 1 RESTORE B1 FOR CDD
  1519. CALL CDD
  1520. MX5 6*6
  1521. BX5 -X5*X6
  1522. LX5 4*6 POSITION
  1523. SX1 2RPD ADD PD AS FIRST 2 CHARACTERS
  1524. LX1 8*6
  1525. BX5 X1+X5 PD + STSN
  1526. SA1 ISITE LOGICAL SITE NUMBER
  1527. CALL CDD
  1528. MX7 6*6
  1529. BX6 -X7*X6
  1530. BX6 X6+X5
  1531. SA6 CDCMSG PD + STSN + LSIT
  1532. SA1 INAME+1 LESSON NAME
  1533. CALL LJUST,0,1R
  1534. BX6 X1
  1535. SA6 CDCMSG+1
  1536. SA1 ECSTOT TOTAL ECS USE
  1537. * /--- BLOCK CLEAREC 00 000 80/03/17 22.09
  1538. SB1 1 RESTORE B1 FOR CDD
  1539. CALL CDD
  1540. SA6 CDCMSG+2
  1541. CALL BALLOT X1 GETS BASE ALLOTMENT
  1542. SB1 1 RESTORE B1 FOR CDD
  1543. CALL CDD ITOA X1,X6
  1544. SA6 CDCMSG+3
  1545. CALL TMALLOT X1 GETS CURRENT ALLOTMENT
  1546. SB1 1 RESTORE B1 FOR CDD
  1547. CALL CDD ITOA X1,X6
  1548. SA6 CDCMSG+4
  1549. CALL TMUSE X1 GETS CURRENT USEAGE
  1550. SB1 1 RESTORE B1 FOR CDD
  1551. CALL CDD ITOA X1,X6
  1552. SA6 CDCMSG+5
  1553. SA1 EMAVL X1 GETS TOTAL ECS AVAILABLE
  1554. SB1 1 RESTORE B1 FOR CDD
  1555. CALL CDD ITOA X1,X6
  1556. SA6 CDCMSG+6
  1557. SA1 CLEAREC X1 GETS RJ PLANTED EQ ADDR
  1558. LX1 30 RIGHT JUSTIFY ADDRESS
  1559. MX2 -18
  1560. BX1 -X2*X1 ISOLATE RETURN ADDRESS
  1561. CALL S=OTOA OTOA X1,X6
  1562. SA7 CDCMSG+7 ONLY BOTTOM 18/3 DIGITS NEEDED
  1563. CALL S=LOG,CDCMSG,5
  1564. EQ BYMSG
  1565. *
  1566. CDCMSG BSS 8
  1567. *
  1568. BYMSG BSS 0
  1569. CDCIF ENDIF
  1570. *
  1571. * ADD TO AMOUNT OF ECS OBTAINED
  1572. *
  1573. CDCIF IFEQ CDC,0
  1574. SA1 ABUFF
  1575. SX6 X1 LENGTH OF LESSON
  1576. CDCIF ELSE
  1577. SA1 ECSTOT TOTAL ECS OBTAINED
  1578. BX6 X1
  1579. CDCIF ENDIF
  1580. SA1 ECFREE1
  1581. IX6 X1+X6 UPDATE TOTAL ECS OBTAINED
  1582. SA6 A1
  1583. SA2 ECNEED
  1584. IX2 X6-X2 SEE IF HAVE ENOUGH ECS NOW
  1585. NG X2,CCLP
  1586. EQ CLEARIT
  1587. *
  1588. *
  1589. * KSYS1 VFD 60/SYS1KEY
  1590. KSYS1 VFD 60/ADELKEY
  1591. KSYS2 VFD 60/SYS2KEY
  1592. KEYTYPE BSS 1 KEY TO BE PRESSED FOR DELETION
  1593. LOWBND BSS 1 CURRENT DELETION PASS LIMIT
  1594. ECSTOT BSS 1 ECS OBTAINABLE BY DELETING USER
  1595. *
  1596. ENTRY DELCNT
  1597. DELCNT DATA 0 COUNT OF AUTHORS DELETED
  1598. *
  1599. *
  1600. * /--- BLOCK SITE COUNT 00 000 76/01/27 18.45
  1601. TITLE SITE USER COUNT MANIPULATION
  1602. *
  1603. *
  1604. *
  1605. * -ALTSC-
  1606. * INCREMENTS OR DECREMENTS USER COUNT BY SITE
  1607. *
  1608. * ON ENTRY - B1 = ADDRESS OF LOGICAL SITE NUMBER
  1609. * B2 = ADDRESS OF USER COUNT TABLE
  1610. * B3 = INCREMENT OR DECREMENT
  1611. *
  1612. * ON EXIT - X1 = NEW USER COUNT
  1613. *
  1614. *
  1615. ENTRY ALTSC
  1616. ALTSC EQ *
  1617. SA1 B1 LOAD LOGICAL SITE NUMBER
  1618. SB1 B2 SAVE ADDRESS OF COUNT TABLE
  1619. CALL SCINDEX
  1620. MX0 -9
  1621. SA1 X2+B1 LOAD PROPER WORD OF TABLE
  1622. LX1 X1,B2 POSITION COUNT FOR THIS SITE
  1623. BX6 X0*X1
  1624. BX1 -X0*X1 MASK OFF THIS COUNT
  1625. SX1 X1+B3 INCREMENT OR DECREMENT
  1626. + PL X1,*+1
  1627. SX1 0 DONT ALLOW NEGATIVE COUNT
  1628. + BX1 -X0*X1
  1629. BX6 X1+X6 RE-COMBINE
  1630. SB1 60
  1631. SB1 B1-B2 COMPUTE SHIFT COUNT
  1632. LX6 X6,B1
  1633. SA6 A1
  1634. EQ ALTSC
  1635. *
  1636. * /--- BLOCK SITE COUNT 00 000 76/01/30 16.49
  1637. *
  1638. *
  1639. *
  1640. * -GETSC-
  1641. * OBTAINS COUNT OF USERS FOR THIS SITE AND LESSON
  1642. *
  1643. * ON ENTRY - B1 = ADDRESS OF LOGICAL SITE NUMBER
  1644. * B2 = ADDRESS OF USER COUNT TABLE
  1645. *
  1646. * ON EXIT - X1 = USER COUNT
  1647. *
  1648. *
  1649. GETSC EQ *
  1650. SA1 B1 LOAD LOGICAL SITE NUMBER
  1651. SB1 B2 SAVE ADDRESS OF COUNT TABLE
  1652. CALL SCINDEX
  1653. MX0 -9
  1654. SA1 X2+B1 LOAD PROPER WORD OF TABLE
  1655. LX1 X1,B2 POSITION COUNT FOR THIS SITE
  1656. BX1 -X0*X1 MASK OFF THIS COUNT
  1657. EQ GETSC
  1658. *
  1659. *
  1660. *
  1661. * -SCINDEX-
  1662. * ON ENTRY - X1 = LOGICAL SITE NUMBER
  1663. *
  1664. * ON EXIT - X2 = WORD COUNT
  1665. * B2 = SHIFT COUNT
  1666. *
  1667. *
  1668. SCINDEX EQ *
  1669. PX2 X1
  1670. NX2 X2 CONVERT TO FLOATING POINT
  1671. SA3 =6.0
  1672. FX2 X2/X3 COMPUTE WORD INDEX
  1673. SA3 =0.01
  1674. FX2 X2+X3 AVOID ROUND-OFF ERROR
  1675. NX2 X2
  1676. UX2 X2,B2
  1677. LX2 X2,B2 CONVERT BACK TO INTEGER
  1678. SX3 6
  1679. DX3 X2*X3
  1680. IX3 X1-X3 COMPUTE REMAINDER
  1681. SB2 X3+9
  1682. LX3 3 COMPUTE SHIFT COUNT
  1683. SB2 X3+B2
  1684. EQ SCINDEX
  1685. *
  1686. *
  1687. * /--- BLOCK BIT TABLES 00 000 76/01/27 17.03
  1688. TITLE BIT TABLE MANIPULATION
  1689. *
  1690. *
  1691. *
  1692. * -SSETBIT-
  1693. * ON ENTRY - X1 = INDEX IN BIT TABLE
  1694. * B1 = ADDRESS OF BIT TABLE
  1695. *
  1696. * MUST NOT DESTROY A0,X0
  1697. *
  1698. *
  1699. ENTRY SSETBIT
  1700. SSETBIT EQ *
  1701. RJ SSINDEX GET INDEX IN BIT TABLE
  1702. SA2 X2+B1 LOAD PROPER WORD OF TABLE
  1703. SX6 1
  1704. LX6 X6,B2 POSITION BIT
  1705. BX6 X2+X6
  1706. SA6 A2 STORE TABLE WORD WITH BIT SET
  1707. EQ SSETBIT
  1708. *
  1709. *
  1710. *
  1711. * -CCLRBIT-
  1712. * ON ENTRY - X1 = INDEX IN BIT TABLE
  1713. * B1 = ADDRESS OF BIT TABLE
  1714. *
  1715. * MUST NOT DESTROY A0,X0
  1716. *
  1717. *
  1718. ENTRY CCLRBIT
  1719. CCLRBIT EQ *
  1720. RJ SSINDEX COMPUTE INDEX IN BIT TABLE
  1721. SA2 X2+B1 LOAD PROPER WORD
  1722. MX6 -1
  1723. LX6 X6,B2 POSITION BIT
  1724. BX6 X6*X2
  1725. SA6 A2 STORE WITH BIT CLEARED
  1726. EQ CCLRBIT
  1727. *
  1728. *
  1729. *
  1730. * -STSTBIT-
  1731. * ON ENTRY - X1 = INDEX IN BIT TABLE
  1732. * B1 = ADDRESS OF BIT TABLE
  1733. *
  1734. * ON EXIT - X6 = -1 IF BIT SET
  1735. * 0 IF BIT NOT SET
  1736. *
  1737. *
  1738. ENTRY STSTBIT
  1739. STSTBIT EQ *
  1740. RJ SSINDEX GET INDEX IN BIT TABLE
  1741. SA2 X2+B1 LOAD PROPER WORD OF TABLE
  1742. SX6 1
  1743. LX6 X6,B2 POSITION BIT
  1744. BX6 X2*X6 MASK PROPER BIT
  1745. ZR X6,STSTBIT
  1746. MX6 -1 MARK BIT SET
  1747. EQ STSTBIT
  1748. *
  1749. *
  1750. * /--- BLOCK BIT TABLES 00 000 78/02/27 20.40
  1751. *
  1752. *
  1753. * -SSINDEX-
  1754. * ON ENTRY - X1 = INDEX IN BIT TABLE
  1755. *
  1756. * ON EXIT - X2 = WORD COUNT
  1757. * B2 = SHIFT COUNT
  1758. *
  1759. *
  1760. ENTRY SSINDEX
  1761. SSINDEX EQ *
  1762. PX2 X1
  1763. NX2 X2 CONVERT TO FLOATING POINT
  1764. SA3 =60.0
  1765. FX2 X2/X3 COMPUTE WORD INDEX
  1766. SA3 =0.01
  1767. FX2 X2+X3 AVOID ROUND-OFF ERROR
  1768. NX2 X2
  1769. UX2 X2,B2
  1770. LX2 X2,B2 CONVERT BACK TO INTEGER
  1771. SX3 60
  1772. DX3 X2*X3
  1773. IX3 X1-X3 COMPUTE REMAINDER
  1774. SB2 X3
  1775. EQ SSINDEX
  1776. *
  1777. *
  1778. *
  1779. * -TABLTST-
  1780. * LOGICAL AND OF TWO BIT TABLES
  1781. *
  1782. * ON ENTRY - B1 = ADDRESS OF 1ST BIT TABLE
  1783. * B2 = ADDRESS OF 2ND BIT TABLE
  1784. *
  1785. * ON RETURN - X6 = 0 IF LOGICAL PRODUCT WAS ZERO
  1786. * -1 IF LOGICAL PRODUCT NON-ZERO
  1787. *
  1788. *
  1789. ENTRY TABLTST
  1790. TABLTST EQ *
  1791. MX6 0 PRE-SET
  1792. SB3 LBITLTH-1
  1793. *
  1794. TBTLP SA1 B3+B1 LOAD NEXT TABLE 1 ENTRY
  1795. SA2 B3+B2 LOAD NEXT TABLE 2 ENTRY
  1796. BX1 X1*X2
  1797. BX6 X1+X6
  1798. SB3 B3-1 END TEST
  1799. PL B3,TBTLP
  1800. NG X6,TBTX1 SEE IF LOGICAL PRODUCT ZERO
  1801. ZR X6,TABLTST
  1802. *
  1803. TBTX1 MX6 -1
  1804. EQ TABLTST
  1805. *
  1806. *
  1807. *
  1808. *
  1809. * -IBIT- INITIALIZES FOR -NEXTBIT-
  1810. * ON ENTRY - B1 = ADDRESS OF BIT TABLE
  1811. *
  1812. *
  1813. ENTRY IBIT
  1814. IBIT EQ *
  1815. SX6 B1 SET TABLE ADDRESS
  1816. SA6 NA
  1817. MX6 0
  1818. SA6 NS CLEAR WORD/SHIFT COUNTS
  1819. SA6 NW
  1820. EQ IBIT
  1821. *
  1822. *
  1823. *
  1824. *
  1825. ENTRY NA,NS,NW USED BY -SITE- IN EXEC8
  1826. NA BSS 1
  1827. NS BSS 1
  1828. NW BSS 1
  1829. *
  1830. *
  1831. * /--- BLOCK BIT TABLES 00 000 78/12/31 03.29
  1832. *
  1833. *
  1834. *
  1835. * -NEXTBIT-
  1836. * FINDS NEXT LIT BIT OF STATION BIT TABLE
  1837. *
  1838. * ON ENTRY - *NA* = ADDRESS OF BIT TABLE
  1839. * *NS* = SHIFT COUNT
  1840. * *NW* = WORD COUNT
  1841. *
  1842. * ON RETURN - X1 = NEXT STATION NUMBER
  1843. * -1 IF END OF BIT TABLE
  1844. *
  1845. ENTRY NEXTBIT
  1846. *
  1847. NEXTBIT EQ *
  1848. SA1 NA SET TABLE ADDRESS
  1849. SA0 X1
  1850. SA1 NS SET SHIFT COUNT
  1851. SB1 X1
  1852. SA1 NW SET WORD BIAS
  1853. SB2 X1
  1854. NG B2,NEND
  1855. SX0 1 INITIALIZE MASK
  1856. SB3 60 END TEST
  1857. *
  1858. NWLP SA1 A0+B2 LOAD NEXT WORD OF BITS
  1859. NG X1,NBLP
  1860. ZR X1,NWLP1 JUMP IF NO BITS
  1861. NBLP LX2 X0,B1
  1862. BX2 X2*X1 MASK OFF NEXT BIT
  1863. NZ X2,NFND
  1864. SB1 B1+1 INCREMENT SHIFT COUNT
  1865. LT B1,B3,NBLP
  1866. NWLP1 SB1 B0 RE-INITIALIZE SHIFT COUNT
  1867. SB2 B2+1 INCREMENT WORD COUNT
  1868. SX1 B2-LBITLTH
  1869. NG X1,NWLP
  1870. *
  1871. NEND MX1 -1 RETURN -1 FOR END OF TABLE
  1872. NEND1 SX6 -1
  1873. SA6 NW
  1874. EQ NEXTBIT
  1875. *
  1876. NFND SX0 B2 STATION NUMBER = 60*B2+B1
  1877. SX1 B3
  1878. DX0 X0*X1
  1879. SX1 X0+B1 RETURN X1 = STATION NUMBER
  1880. SB1 B1+1 INCREMENT SHIFT COUNT
  1881. LT B1,B3,NFND1
  1882. SB1 B0 RE-INITIALIZE SHIFT COUNT
  1883. SB2 B2+1 ADVANCE TO NEXT WORD
  1884. SB3 B2-LBITLTH
  1885. NG B3,NFND1
  1886. EQ NEND1
  1887. *
  1888. NFND1 SX6 B1 SAVE SHIFT COUNT
  1889. SA6 NS
  1890. SX6 B2 SAVE WORD COUNT
  1891. SA6 NW
  1892. EQ NEXTBIT
  1893. *
  1894. *
  1895. END