Table of Contents

ACCOUNT

Table Of Contents

  • [00005] LESSON USAGE ACCOUNTING
  • [00015] COMMENTS
  • [00043] -ACCIN- INITIALIZE LESSON USE INFO
  • [00143] -ACCOUT- OUTPUT LESSON USE INFO
  • [00299] -ACCINC- ALTER ACCOUNT USER COUNT
  • [00362] -ACCUSE- OUTPUT -USE- FILE ACCOUNTING

Source Code

ACCOUNT.txt
  1. ACCOUNT
  2. * /--- FILE TYPE = E
  3. * /--- BLOCK IDENT 00 000 77/04/27 19.49
  4. IDENT ACCOUNT
  5. TITLE LESSON USAGE ACCOUNTING
  6. *
  7. CST
  8. *
  9. EXT ECSPRTY
  10. EXT CDD (IN PSYS)
  11. EXT ACCON (IN PINST)
  12. *
  13. *
  14. * /--- BLOCK COMMENTS 00 000 83/06/22 07.36
  15. TITLE COMMENTS
  16. *
  17. * DON'7T FORGET TO DOCUMENT CHANGES TO THE MESSAGES'.
  18. * THE BILLING FOLKS NEED TO BE NOTIFIED WELL IN AD-
  19. * VANCE SO THAT THEY CAN CHANGE THEIR PROGRAMS. SEE
  20. * PLATO FILE ',SUPDOC',, SECTION 8. ALSO, BE SURE TO
  21. * ADD THE SAME INFORMATION TO ',OPGUIDE',.
  22. *
  23. *
  24. * FORMAT OF STUDENT BANK WORD *TACCNT* -
  25. *
  26. * 1ST 1 BITS = ACCOUNTING ON/OFF FLAG
  27. * NEXT 1 = COMPLETION CLOCK RUNNING FLAG
  28. * NEXT 1 = LESSON COMPLETE ON ENTRY FLAG
  29. * NEXT 1 = ACCOUNT USER TOTAL INCREMENTED FLAG
  30. * NEXT 17 = UNUSED
  31. * NEXT 9 = LOGICAL SITE NUMBER
  32. * NEXT 15 = LESSON ACCOUNT NUMBER
  33. * NEXT 15 = USER ACCOUNT NUMBER
  34. *
  35. *
  36. *
  37. * FORMAT OF STUDENT RECORD WORD *TACCNT1* -
  38. *
  39. * 1ST 51 BITS = UNUSED
  40. * NEXT 9 = CUMULATIVE TIME TO COMPLETE LESSON
  41. *
  42. * /--- BLOCK -ACCIN- 00 000 80/06/17 15.54
  43. TITLE -ACCIN- INITIALIZE LESSON USE INFO
  44. *
  45. *
  46. *
  47. * -ACCIN-
  48. * INITIALIZE LESSON USE ACCOUNTING INFO
  49. *
  50. *
  51. ENTRY ACCIN
  52.  
  53. ACCI90 SA1 TACCNT MARK USAGE ACCOUNTING INACTIVE
  54. SA2 TACCMSK
  55. MX6 1
  56. BX1 X1*X2 CLEAR APPROPRIATE FIELDS
  57. BX6 X1+X6
  58. SA6 A1
  59.  
  60. ACCIN PS ENTRY/EXIT
  61.  
  62. * TEST IF USAGE ACCOUNTING ACTIVE FOR THIS LESSON.
  63.  
  64. SA1 LESSCM+LSTOUSE
  65. MX7 -15
  66. LX1 59-UACCF
  67. PL X1,ACCI90 IF ACCOUNTING NOT ACTIVE
  68. *
  69. * OBTAIN LESSON AND USER ACCOUNT NUMBERS
  70. *
  71. SA1 TACCNT LOAD STUDENT BANK ACCOUNT WORD
  72. SA2 TACCMSK
  73. BX6 X2*X1 CLEAR OUT APPROPRIATE AREAS
  74. SA1 LESSCM+LACCNT
  75. BX1 -X7*X1 GET LESSON ACCOUNT NUMBER
  76. LX1 15
  77. BX6 X1+X6 ATTACH LESSON ACCOUNT NUM
  78. *
  79. * OBTAIN LOGICAL SITE NUMBER
  80. *
  81. SA1 AALLOT
  82. SA2 STATION INDEX INTO *XALLOT* BUFFER
  83. IX0 X1+X2
  84. RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
  85. LX1 15
  86. BX1 -X7*X1 MASK OFF LOGICAL SITE INDEX
  87. PX1 X1
  88. NX1 X1 CONVERT TO FLOATING POINT
  89. SX2 SITEDIM
  90. PX2 X2
  91. NX2 X2
  92. FX1 X1/X2 COMPUTE LOGICAL SITE NUMBER
  93. UX1 X1,B1
  94. LX1 X1,B1 CONVERT BACK TO INTEGER
  95. MX0 -9
  96. BX1 -X0*X1
  97. LX1 15+15 POSITION LOGICAL SITE NUMBER
  98. BX6 X1+X6
  99. *
  100. * /--- BLOCK -ACCIN- 00 000 80/06/17 15.55
  101. *
  102. * OBTAIN LESSON COMPLETION INFO
  103. *
  104. MX0 5
  105. SA2 TBSCORE GET LESSON COMPLETED FLAG
  106. BX2 X0*X2
  107. LX2 5 POSITION COMPLETION FLAG
  108. SX1 X2-1 1 = LESSON COMPLETED
  109. MX2 0 X2 = COMPLETE ON ENTRY FLAG
  110. + NZ X1,*+1 CHECK IF LESSON COMPLETED
  111. MX2 1
  112. + LX2 60-2 POSITION COMPLETION BIT
  113. BX6 X2+X6
  114. *
  115. * CHECK IF LESSON COMPLETION CLOCK SHOULD BE RUNNING
  116. *
  117. NZ X2,ACCI60 JUMP IF LESSON COMPLETED
  118. MX0 -12
  119. SA1 TUNIT CHECK IF A RESTART UNIT SET
  120. BX1 X0*X1
  121. ZR X1,ACCI40
  122. BX4 X6 SAVE X6
  123. CALL RESTCK,TBLESAC
  124. BX0 X6 MOVE RETURN VALUE TO X0
  125. BX6 X4 RESTORE X6
  126. ZR X0,ACCI50 IF ENTERING RESTART LESSON
  127. CALL INROUTE
  128. NG X1,ACCI60 IF ENTERING ROUTER
  129. * /--- BLOCK -ACCIN- 00 000 80/01/25 21.25
  130. *
  131. ACCI40 MX7 0 CLEAR COMPLETION CLOCK
  132. SA7 TACCNT1
  133. *
  134. ACCI50 MX1 1 SET BIT TO MARK CLOCK RUNNING
  135. LX1 60-1
  136. BX6 X1+X6
  137. *
  138. ACCI60 SA6 TACCNT STORE ACCOUNTING WORD
  139. EQ ACCIN
  140.  
  141.  
  142. * /--- BLOCK -ACCOUT- 00 000 85/04/03 10.35
  143. TITLE -ACCOUT- OUTPUT LESSON USE INFO
  144. *
  145. *
  146. * -ACCOUT-
  147. *
  148. * OUTPUT LESSON USAGE RECORD TO NOS ACCOUNT FILE
  149. *
  150. * EXIT PL STSN LACCN/LESSONNAME/MIN CP/LACBITS
  151. * STSN = STATION NUMBER
  152. * LACCN = LESSON ACCOUNT NUMBER
  153. * LESSONNAME = LESSON NAME
  154. * MIN = NUMBER OF MINUTES IN LESSON
  155. * CP = CPU USAGE * 4
  156. * LACBITS = LESSON ACCESS CLASS BITS
  157. *
  158. * CALLS CDD
  159. *
  160. ENTRY ACCOUT
  161. ACCOUT EQ *
  162. SA1 ACCON CHECK IF NOS ACCOUNTING ON
  163. PL X1,ACCO90 IF NOT ON
  164. SA1 TACCNT X1 = STUDENT ACCOUNTING WORD
  165. NG X1,ACCO90
  166. SB1 1
  167. SA1 STATION STATION NUMBER AND ID
  168. RJ CDD
  169. MX0 -24
  170. BX7 -X0*X6
  171. SX1 2RPL
  172. LX1 48
  173. LX7 4*6
  174. BX7 X1+X7
  175. SA7 INFO
  176. SA1 TACCNT X1 = STUDENT ACCOUNTING WORD
  177. MX6 -15
  178. AX1 15 POSITION LESSON ACCOUNT NUMBER
  179. BX1 -X6*X1
  180. RJ CDD
  181. BX6 -X0*X6
  182. SA1 INFO ADD ACCOUNT NUM TO FIRST WORD
  183. BX6 X6+X1
  184. SA6 A1
  185. SA1 TBLESSN SET LESSON NAME
  186. CALL LJUST,0,1R
  187. BX6 X1
  188. SA6 INFO+1
  189. SB1 1
  190. *
  191. * COMPUTE ELAPSED TIME IN LESSON IN MINUTES
  192. *
  193. SA2 SYSCLOK
  194. SA3 TTIMARK COMPUTE ELAPSED TIME IN LESSON
  195. IX2 X2-X3
  196. PX2 X2 CONVERT TO FLOATING POINT
  197. NX2 X2
  198. SA3 =60000.0
  199. FX3 X2/X3 CONVERT ELAPSED TIME TO MINUTES
  200. SA4 =0.501
  201. FX4 X3-X4 CHECK IF MORE THAN 1/2 MINUTE
  202. NG X4,ACCO90
  203. SA4 =0.5
  204. FX1 X3+X4 ROUND
  205. NX1 X1
  206. UX1 X1,B2
  207. LX1 X1,B2 CONVERT BACK TO INTEGER
  208. MX0 -9
  209. BX4 X0*X1
  210. + ZR X4,*+1 CHECK IF WITHIN BOUNDS
  211. SX1 777B (ABOUT 8.5 HOURS)
  212. + BX5 X1 X5 = ELAPSED TIME IN MINUTES
  213. RJ CDD
  214. MX0 30
  215. BX7 -X0*X6
  216. LX7 30
  217. SA7 INFO+2
  218. * /--- BLOCK -ACCOUT- 00 000 85/04/03 10.33
  219. *
  220. * UPDATE COMPLETION CLOCK IF NECESSARY
  221. *
  222. SA1 TACCNT STUDENT ACCOUNTING WORD
  223. LX1 1 POSITION COMPLETION CLOCK FLAG
  224. PL X1,ACCO40 IF CLOCK NOT RUNNING
  225. MX0 -9
  226. SA1 TACCNT1 LESSON COMPLETION TIME
  227. BX7 -X0*X1
  228. BX1 X0*X1
  229. IX7 X7+X5 ADD CURRENT TIME IN LESSON
  230. BX7 -X0*X7
  231. BX7 X7+X1
  232. SA7 A1
  233. * /--- BLOCK -ACCOUT- 00 000 85/04/03 10.37
  234. *
  235. * COMPUTE CPU USAGE AS 4*(MSEC/SEC)
  236. *
  237. ACCO40 MX0 -30
  238. SA3 TTIMDTA LOAD INITIAL FORMTIM/TIMDATA
  239. BX7 -X0*X3 MASK OFF INITIAL *TIMDATA*
  240. AX3 30
  241. SA4 TIMDATA
  242. IX7 X4-X7 COMPUTE EXECUTOR CPU TOTAL
  243. SA4 FORMTIM
  244. IX4 X4-X3 COMPUTE FORMATER CPU TOTAL
  245. IX4 X4+X7
  246. PX4 X4 CONVERT TO FLOATING POINT
  247. NX4 X4
  248. SX2 60
  249. DX2 X2*X5 X2 = ELAPSED TIME IN SECONDS
  250. PX2 X2 CONVERT ELAPSED TIME TO FLOATING
  251. NX2 X2
  252. FX2 X4/X2 (MILLISECONDS CPU)/(SECONDS)
  253. UX2 X2,B2
  254. LX2 2 MULTIPLY BY 4
  255. LX1 X2,B2 CONVERT BACK TO INTEGER
  256. MX0 -12
  257. BX3 X0*X1 CHECK IF WITHIN BOUNDS
  258. + ZR X3,*+1
  259. SX1 7777B (1023 MSECS/SEC)
  260. + RJ CDD
  261. MX0 -30
  262. BX7 -X0*X6
  263. SA1 INFO+2 MERGE WITH ELAPSED TIME
  264. BX7 X7+X1
  265. SA7 A1
  266. *
  267. * ADD LIBRARY INFORMATION
  268. *
  269. SA1 TBTAB STORED HERE BY SIGNO
  270. MX0 30 ONLY USE LIBRARY BITS
  271. BX1 X1*X0
  272. SB2 10 NUMBER OF LOOPS
  273. MX0 -3 ONLY USE BOTTOM 3 BITS
  274. SX4 33B 33B = DISPLAY CODE FOR 0
  275. SX3 B0 INITIALIZE TO ZERO
  276. *
  277. ACCOLP BSS 0 LOOP FOR DISPLAY CHARS
  278. SB2 B2-1 DECREMENT COUNTER
  279. LX3 6 SHIFT OVER 1 DISPLAY CODE
  280. LX1 3 SHIFT OVER 1 OCTAL DIGIT
  281. BX2 -X0*X1 MASK OFF BOTTOM 3 BITS
  282. BX3 X3+X2 ADD THIS CHAR TO OTHERS
  283. IX3 X3+X4 ADD IN 0 CHARACTER
  284. NE B2,ACCOLP GO BACK TO TOP IF NOT DONE
  285. BX6 X3
  286. SA6 INFO+3 SAVE THIS AND THE EOL
  287.  
  288. MX6 0
  289. SA6 INFO+4 STORE IN MESSAGE
  290.  
  291. CALL S=LOG,INFO,5
  292. *
  293. ACCO90 SA1 TACCNT CLEAR OUT ALL BUT USER ACCOUNT
  294. SA2 TACCMSK AND USER COUNT FLAG
  295. BX6 X2*X1
  296. SA6 A1
  297. EQ ACCOUT
  298. * /--- BLOCK -ACCINC- 00 000 77/10/30 12.20
  299. TITLE -ACCINC- ALTER ACCOUNT USER COUNT
  300. *
  301. *
  302. *
  303. * -ACCINC- INCREMENT/DECREMENT USER COUNT
  304. *
  305. * ON ENTRY - B1 = +1 OR -1 FOR INCREMENT/DECREMENT
  306. * AS OF 7/80, THE INCREMENTING OF THE USER COUNT
  307. * IS DONE BY LESSON PLATO AND THE DECREMENTING IS
  308. * DONE BY THIS SUBROUTINE WHICH IS CALLED FROM
  309. * THE -LOGIC- COMMAND.
  310. *
  311. *
  312. ENTRY ACCINC
  313. ACCINC EQ *
  314. MX0 -15
  315. SA4 TACCNT LOAD STUDENT BANK WORD
  316. BX1 -X0*X4 MASK OFF ACCOUNT NUMBER
  317. ZR X1,ACCINC
  318. * SX0 X1-ACCNMAX CHECK IF LEGAL ACCOUNT NUMBER
  319. SX0 ACCNMAX CHECK IF LEGAL ACCOUNT NUMBER
  320. IX0 X1-X0
  321. PL X0,ACCINC
  322. SA2 AACCARN ADDRESS OF ACCESS RIGHT TABLE
  323. IX0 X1+X2
  324. RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
  325. MX2 -12
  326. BX3 -X2*X1 MASK OFF NUMBER ACCESS RIGHTS
  327. MX6 1 FORM MASK FOR INCREMENT FLAG
  328. * SHIFT COUNT ALSO USED AS CONSTANT IN UNIT
  329. * ACCCHK OF LESSON PLATO.
  330. LX6 41+15+1
  331. LX1 60-12 POSITION USER COUNT
  332. BX3 -X2*X1
  333. BX1 X2*X1 CLEAR OUT OLD COUNT
  334. NG B1,AINC10 JUMP IF DECREMENT
  335. BX7 X6*X4
  336. NZ X7,ACCINC CHECK IF ALREADY INCREMENTED
  337. BX6 X4+X6 SET INCREMENT BIT
  338. SA6 A4
  339. SX3 X3+1 INCREMENT COUNT
  340. BX6 X1+X3
  341. LX6 12 RE-POSITION WORD
  342. EQ AINC20
  343. *
  344. AINC10 BX7 X6*X4 CHECK IF EVER INCREMENTED
  345. ZR X7,ACCINC
  346. BX6 -X6*X4 CLEAR INCREMENT BIT
  347. SA6 A4
  348. SX3 X3-1 DECREMENT COUNT
  349. + PL X3,*+1
  350. SX3 0 PROTECT AGAINST 0
  351. + BX6 X1+X3 ATTACH NEW COUNT
  352. LX6 12 RE-POSITION WORD
  353. *
  354. AINC20 WX6 X0 (-WXX- 1 WD WRITE, MAY CHG *A6*)
  355. EQ ACCINC
  356. *
  357. *
  358. *
  359. TACCMSK VFD 3/0,1/1,41/0,15/77777B
  360. *
  361. *
  362. TITLE -ACCUSE- OUTPUT -USE- FILE ACCOUNTING
  363. ACCUSE SPACE 5,11
  364. *** ACCUSE - OUTPUT -USE- FILE ACCOUNTING
  365. *
  366. * ISSUE DAYFILE MESSAGES FOR UN-PUBLISHED LESSONS
  367. * THAT USE PUBLISHED LESSONS.
  368. *
  369. * ACCOUNT FILE MESSAGE FORMAT -
  370. *
  371. * PU T XXXXXXXXXXYYYYYYYYYY
  372. *
  373. * /--- BLOCK -ACCINC- 00 000 77/10/30 12.20
  374. * WHERE - T - MESSAGE LINK (P (FIRST), C(CONTINUE))
  375. * X - LESSON NAME
  376. * Y - PUBLISHED LESSON NAME
  377. *
  378. * ENTRY - (B1) = POINTER TO USE FILE LIST
  379.  
  380.  
  381. ENTRY ACCUSE
  382.  
  383. ACCUSE PS
  384. SA1 ACCON
  385. PL X1,ACCUSE IF NOS ACCOUNTING IS OFF
  386. SA1 TBLESSN CHECK FOR PUBLISHED LESSON
  387. SX2 1R0
  388. LX2 -6
  389. MX0 6
  390. BX6 X1-X2
  391. BX6 X0*X6
  392. ZR X6,ACCUSE IF LESSON IS PUBLISHED
  393. SB7 B1 (B7) = POINTER TO USE INFO
  394. CALL LJUST,B0,1R
  395. BX6 X1
  396. SA6 INFO+1 SET LESSON NAME
  397. SA2 B7
  398. LX2 2
  399. SB6 X2 (B6) = USE FILE INDEX
  400. SA3 ACUA SET MESSAGE HEADER
  401. BX6 X3
  402. BX7 X7-X7
  403. SA6 INFO
  404. SA7 INFO+3 SET MESSAGE TERMINATOR
  405. ACU1 ZR B6,ACCUSE IF NO MORE -USE-D FILES
  406. SB6 B6-4 UPDATE COUNT
  407. SB1 B6+1+1 INDEX TO -USE- FILE NAME
  408. SA1 B7+B1 (X1) = USE-D FILE NAME
  409. MX0 6
  410. SX2 1R0
  411. LX2 -6
  412. BX6 X1-X2
  413. BX6 X0*X6
  414. NZ X6,ACU1 IF USE-D FILE IS NOT PUBLISHED
  415. CALL LJUST,B0,1R
  416. BX6 X1
  417. SA6 INFO+2
  418. CALL S=LOG,INFO,5 ISSUE ACCOUNT FILE MESSAGE
  419. SA1 ACUB SET CONTINUATION HEADER
  420. BX6 X1
  421. SA6 INFO
  422. EQ ACU1 PROCESS NEXT USE FILE
  423.  
  424. ACUA DATA 10HPU P
  425. ACUB DATA 10HPU C
  426. END