plato:source:plaopl:account
โ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
- ACCOUNT
- * /--- FILE TYPE = E
- * /--- BLOCK IDENT 00 000 77/04/27 19.49
- IDENT ACCOUNT
- TITLE LESSON USAGE ACCOUNTING
- *
- CST
- *
- EXT ECSPRTY
- EXT CDD (IN PSYS)
- EXT ACCON (IN PINST)
- *
- *
- * /--- BLOCK COMMENTS 00 000 83/06/22 07.36
- TITLE COMMENTS
- *
- * DON'7T FORGET TO DOCUMENT CHANGES TO THE MESSAGES'.
- * THE BILLING FOLKS NEED TO BE NOTIFIED WELL IN AD-
- * VANCE SO THAT THEY CAN CHANGE THEIR PROGRAMS. SEE
- * PLATO FILE ',SUPDOC',, SECTION 8. ALSO, BE SURE TO
- * ADD THE SAME INFORMATION TO ',OPGUIDE',.
- *
- *
- * FORMAT OF STUDENT BANK WORD *TACCNT* -
- *
- * 1ST 1 BITS = ACCOUNTING ON/OFF FLAG
- * NEXT 1 = COMPLETION CLOCK RUNNING FLAG
- * NEXT 1 = LESSON COMPLETE ON ENTRY FLAG
- * NEXT 1 = ACCOUNT USER TOTAL INCREMENTED FLAG
- * NEXT 17 = UNUSED
- * NEXT 9 = LOGICAL SITE NUMBER
- * NEXT 15 = LESSON ACCOUNT NUMBER
- * NEXT 15 = USER ACCOUNT NUMBER
- *
- *
- *
- * FORMAT OF STUDENT RECORD WORD *TACCNT1* -
- *
- * 1ST 51 BITS = UNUSED
- * NEXT 9 = CUMULATIVE TIME TO COMPLETE LESSON
- *
- * /--- BLOCK -ACCIN- 00 000 80/06/17 15.54
- TITLE -ACCIN- INITIALIZE LESSON USE INFO
- *
- *
- *
- * -ACCIN-
- * INITIALIZE LESSON USE ACCOUNTING INFO
- *
- *
- ENTRY ACCIN
- ACCI90 SA1 TACCNT MARK USAGE ACCOUNTING INACTIVE
- SA2 TACCMSK
- MX6 1
- BX1 X1*X2 CLEAR APPROPRIATE FIELDS
- BX6 X1+X6
- SA6 A1
- ACCIN PS ENTRY/EXIT
- * TEST IF USAGE ACCOUNTING ACTIVE FOR THIS LESSON.
- SA1 LESSCM+LSTOUSE
- MX7 -15
- LX1 59-UACCF
- PL X1,ACCI90 IF ACCOUNTING NOT ACTIVE
- *
- * OBTAIN LESSON AND USER ACCOUNT NUMBERS
- *
- SA1 TACCNT LOAD STUDENT BANK ACCOUNT WORD
- SA2 TACCMSK
- BX6 X2*X1 CLEAR OUT APPROPRIATE AREAS
- SA1 LESSCM+LACCNT
- BX1 -X7*X1 GET LESSON ACCOUNT NUMBER
- LX1 15
- BX6 X1+X6 ATTACH LESSON ACCOUNT NUM
- *
- * OBTAIN LOGICAL SITE NUMBER
- *
- SA1 AALLOT
- SA2 STATION INDEX INTO *XALLOT* BUFFER
- IX0 X1+X2
- RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
- LX1 15
- BX1 -X7*X1 MASK OFF LOGICAL SITE INDEX
- PX1 X1
- NX1 X1 CONVERT TO FLOATING POINT
- SX2 SITEDIM
- PX2 X2
- NX2 X2
- FX1 X1/X2 COMPUTE LOGICAL SITE NUMBER
- UX1 X1,B1
- LX1 X1,B1 CONVERT BACK TO INTEGER
- MX0 -9
- BX1 -X0*X1
- LX1 15+15 POSITION LOGICAL SITE NUMBER
- BX6 X1+X6
- *
- * /--- BLOCK -ACCIN- 00 000 80/06/17 15.55
- *
- * OBTAIN LESSON COMPLETION INFO
- *
- MX0 5
- SA2 TBSCORE GET LESSON COMPLETED FLAG
- BX2 X0*X2
- LX2 5 POSITION COMPLETION FLAG
- SX1 X2-1 1 = LESSON COMPLETED
- MX2 0 X2 = COMPLETE ON ENTRY FLAG
- + NZ X1,*+1 CHECK IF LESSON COMPLETED
- MX2 1
- + LX2 60-2 POSITION COMPLETION BIT
- BX6 X2+X6
- *
- * CHECK IF LESSON COMPLETION CLOCK SHOULD BE RUNNING
- *
- NZ X2,ACCI60 JUMP IF LESSON COMPLETED
- MX0 -12
- SA1 TUNIT CHECK IF A RESTART UNIT SET
- BX1 X0*X1
- ZR X1,ACCI40
- BX4 X6 SAVE X6
- CALL RESTCK,TBLESAC
- BX0 X6 MOVE RETURN VALUE TO X0
- BX6 X4 RESTORE X6
- ZR X0,ACCI50 IF ENTERING RESTART LESSON
- CALL INROUTE
- NG X1,ACCI60 IF ENTERING ROUTER
- * /--- BLOCK -ACCIN- 00 000 80/01/25 21.25
- *
- ACCI40 MX7 0 CLEAR COMPLETION CLOCK
- SA7 TACCNT1
- *
- ACCI50 MX1 1 SET BIT TO MARK CLOCK RUNNING
- LX1 60-1
- BX6 X1+X6
- *
- ACCI60 SA6 TACCNT STORE ACCOUNTING WORD
- EQ ACCIN
- * /--- BLOCK -ACCOUT- 00 000 85/04/03 10.35
- TITLE -ACCOUT- OUTPUT LESSON USE INFO
- *
- *
- * -ACCOUT-
- *
- * OUTPUT LESSON USAGE RECORD TO NOS ACCOUNT FILE
- *
- * EXIT PL STSN LACCN/LESSONNAME/MIN CP/LACBITS
- * STSN = STATION NUMBER
- * LACCN = LESSON ACCOUNT NUMBER
- * LESSONNAME = LESSON NAME
- * MIN = NUMBER OF MINUTES IN LESSON
- * CP = CPU USAGE * 4
- * LACBITS = LESSON ACCESS CLASS BITS
- *
- * CALLS CDD
- *
- ENTRY ACCOUT
- ACCOUT EQ *
- SA1 ACCON CHECK IF NOS ACCOUNTING ON
- PL X1,ACCO90 IF NOT ON
- SA1 TACCNT X1 = STUDENT ACCOUNTING WORD
- NG X1,ACCO90
- SB1 1
- SA1 STATION STATION NUMBER AND ID
- RJ CDD
- MX0 -24
- BX7 -X0*X6
- SX1 2RPL
- LX1 48
- LX7 4*6
- BX7 X1+X7
- SA7 INFO
- SA1 TACCNT X1 = STUDENT ACCOUNTING WORD
- MX6 -15
- AX1 15 POSITION LESSON ACCOUNT NUMBER
- BX1 -X6*X1
- RJ CDD
- BX6 -X0*X6
- SA1 INFO ADD ACCOUNT NUM TO FIRST WORD
- BX6 X6+X1
- SA6 A1
- SA1 TBLESSN SET LESSON NAME
- CALL LJUST,0,1R
- BX6 X1
- SA6 INFO+1
- SB1 1
- *
- * COMPUTE ELAPSED TIME IN LESSON IN MINUTES
- *
- SA2 SYSCLOK
- SA3 TTIMARK COMPUTE ELAPSED TIME IN LESSON
- IX2 X2-X3
- PX2 X2 CONVERT TO FLOATING POINT
- NX2 X2
- SA3 =60000.0
- FX3 X2/X3 CONVERT ELAPSED TIME TO MINUTES
- SA4 =0.501
- FX4 X3-X4 CHECK IF MORE THAN 1/2 MINUTE
- NG X4,ACCO90
- SA4 =0.5
- FX1 X3+X4 ROUND
- NX1 X1
- UX1 X1,B2
- LX1 X1,B2 CONVERT BACK TO INTEGER
- MX0 -9
- BX4 X0*X1
- + ZR X4,*+1 CHECK IF WITHIN BOUNDS
- SX1 777B (ABOUT 8.5 HOURS)
- + BX5 X1 X5 = ELAPSED TIME IN MINUTES
- RJ CDD
- MX0 30
- BX7 -X0*X6
- LX7 30
- SA7 INFO+2
- * /--- BLOCK -ACCOUT- 00 000 85/04/03 10.33
- *
- * UPDATE COMPLETION CLOCK IF NECESSARY
- *
- SA1 TACCNT STUDENT ACCOUNTING WORD
- LX1 1 POSITION COMPLETION CLOCK FLAG
- PL X1,ACCO40 IF CLOCK NOT RUNNING
- MX0 -9
- SA1 TACCNT1 LESSON COMPLETION TIME
- BX7 -X0*X1
- BX1 X0*X1
- IX7 X7+X5 ADD CURRENT TIME IN LESSON
- BX7 -X0*X7
- BX7 X7+X1
- SA7 A1
- * /--- BLOCK -ACCOUT- 00 000 85/04/03 10.37
- *
- * COMPUTE CPU USAGE AS 4*(MSEC/SEC)
- *
- ACCO40 MX0 -30
- SA3 TTIMDTA LOAD INITIAL FORMTIM/TIMDATA
- BX7 -X0*X3 MASK OFF INITIAL *TIMDATA*
- AX3 30
- SA4 TIMDATA
- IX7 X4-X7 COMPUTE EXECUTOR CPU TOTAL
- SA4 FORMTIM
- IX4 X4-X3 COMPUTE FORMATER CPU TOTAL
- IX4 X4+X7
- PX4 X4 CONVERT TO FLOATING POINT
- NX4 X4
- SX2 60
- DX2 X2*X5 X2 = ELAPSED TIME IN SECONDS
- PX2 X2 CONVERT ELAPSED TIME TO FLOATING
- NX2 X2
- FX2 X4/X2 (MILLISECONDS CPU)/(SECONDS)
- UX2 X2,B2
- LX2 2 MULTIPLY BY 4
- LX1 X2,B2 CONVERT BACK TO INTEGER
- MX0 -12
- BX3 X0*X1 CHECK IF WITHIN BOUNDS
- + ZR X3,*+1
- SX1 7777B (1023 MSECS/SEC)
- + RJ CDD
- MX0 -30
- BX7 -X0*X6
- SA1 INFO+2 MERGE WITH ELAPSED TIME
- BX7 X7+X1
- SA7 A1
- *
- * ADD LIBRARY INFORMATION
- *
- SA1 TBTAB STORED HERE BY SIGNO
- MX0 30 ONLY USE LIBRARY BITS
- BX1 X1*X0
- SB2 10 NUMBER OF LOOPS
- MX0 -3 ONLY USE BOTTOM 3 BITS
- SX4 33B 33B = DISPLAY CODE FOR 0
- SX3 B0 INITIALIZE TO ZERO
- *
- ACCOLP BSS 0 LOOP FOR DISPLAY CHARS
- SB2 B2-1 DECREMENT COUNTER
- LX3 6 SHIFT OVER 1 DISPLAY CODE
- LX1 3 SHIFT OVER 1 OCTAL DIGIT
- BX2 -X0*X1 MASK OFF BOTTOM 3 BITS
- BX3 X3+X2 ADD THIS CHAR TO OTHERS
- IX3 X3+X4 ADD IN 0 CHARACTER
- NE B2,ACCOLP GO BACK TO TOP IF NOT DONE
- BX6 X3
- SA6 INFO+3 SAVE THIS AND THE EOL
- MX6 0
- SA6 INFO+4 STORE IN MESSAGE
- CALL S=LOG,INFO,5
- *
- ACCO90 SA1 TACCNT CLEAR OUT ALL BUT USER ACCOUNT
- SA2 TACCMSK AND USER COUNT FLAG
- BX6 X2*X1
- SA6 A1
- EQ ACCOUT
- * /--- BLOCK -ACCINC- 00 000 77/10/30 12.20
- TITLE -ACCINC- ALTER ACCOUNT USER COUNT
- *
- *
- *
- * -ACCINC- INCREMENT/DECREMENT USER COUNT
- *
- * ON ENTRY - B1 = +1 OR -1 FOR INCREMENT/DECREMENT
- * AS OF 7/80, THE INCREMENTING OF THE USER COUNT
- * IS DONE BY LESSON PLATO AND THE DECREMENTING IS
- * DONE BY THIS SUBROUTINE WHICH IS CALLED FROM
- * THE -LOGIC- COMMAND.
- *
- *
- ENTRY ACCINC
- ACCINC EQ *
- MX0 -15
- SA4 TACCNT LOAD STUDENT BANK WORD
- BX1 -X0*X4 MASK OFF ACCOUNT NUMBER
- ZR X1,ACCINC
- * SX0 X1-ACCNMAX CHECK IF LEGAL ACCOUNT NUMBER
- SX0 ACCNMAX CHECK IF LEGAL ACCOUNT NUMBER
- IX0 X1-X0
- PL X0,ACCINC
- SA2 AACCARN ADDRESS OF ACCESS RIGHT TABLE
- IX0 X1+X2
- RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
- MX2 -12
- BX3 -X2*X1 MASK OFF NUMBER ACCESS RIGHTS
- MX6 1 FORM MASK FOR INCREMENT FLAG
- * SHIFT COUNT ALSO USED AS CONSTANT IN UNIT
- * ACCCHK OF LESSON PLATO.
- LX6 41+15+1
- LX1 60-12 POSITION USER COUNT
- BX3 -X2*X1
- BX1 X2*X1 CLEAR OUT OLD COUNT
- NG B1,AINC10 JUMP IF DECREMENT
- BX7 X6*X4
- NZ X7,ACCINC CHECK IF ALREADY INCREMENTED
- BX6 X4+X6 SET INCREMENT BIT
- SA6 A4
- SX3 X3+1 INCREMENT COUNT
- BX6 X1+X3
- LX6 12 RE-POSITION WORD
- EQ AINC20
- *
- AINC10 BX7 X6*X4 CHECK IF EVER INCREMENTED
- ZR X7,ACCINC
- BX6 -X6*X4 CLEAR INCREMENT BIT
- SA6 A4
- SX3 X3-1 DECREMENT COUNT
- + PL X3,*+1
- SX3 0 PROTECT AGAINST 0
- + BX6 X1+X3 ATTACH NEW COUNT
- LX6 12 RE-POSITION WORD
- *
- AINC20 WX6 X0 (-WXX- 1 WD WRITE, MAY CHG *A6*)
- EQ ACCINC
- *
- *
- *
- TACCMSK VFD 3/0,1/1,41/0,15/77777B
- *
- *
- TITLE -ACCUSE- OUTPUT -USE- FILE ACCOUNTING
- ACCUSE SPACE 5,11
- *** ACCUSE - OUTPUT -USE- FILE ACCOUNTING
- *
- * ISSUE DAYFILE MESSAGES FOR UN-PUBLISHED LESSONS
- * THAT USE PUBLISHED LESSONS.
- *
- * ACCOUNT FILE MESSAGE FORMAT -
- *
- * PU T XXXXXXXXXXYYYYYYYYYY
- *
- * /--- BLOCK -ACCINC- 00 000 77/10/30 12.20
- * WHERE - T - MESSAGE LINK (P (FIRST), C(CONTINUE))
- * X - LESSON NAME
- * Y - PUBLISHED LESSON NAME
- *
- * ENTRY - (B1) = POINTER TO USE FILE LIST
- ENTRY ACCUSE
- ACCUSE PS
- SA1 ACCON
- PL X1,ACCUSE IF NOS ACCOUNTING IS OFF
- SA1 TBLESSN CHECK FOR PUBLISHED LESSON
- SX2 1R0
- LX2 -6
- MX0 6
- BX6 X1-X2
- BX6 X0*X6
- ZR X6,ACCUSE IF LESSON IS PUBLISHED
- SB7 B1 (B7) = POINTER TO USE INFO
- CALL LJUST,B0,1R
- BX6 X1
- SA6 INFO+1 SET LESSON NAME
- SA2 B7
- LX2 2
- SB6 X2 (B6) = USE FILE INDEX
- SA3 ACUA SET MESSAGE HEADER
- BX6 X3
- BX7 X7-X7
- SA6 INFO
- SA7 INFO+3 SET MESSAGE TERMINATOR
- ACU1 ZR B6,ACCUSE IF NO MORE -USE-D FILES
- SB6 B6-4 UPDATE COUNT
- SB1 B6+1+1 INDEX TO -USE- FILE NAME
- SA1 B7+B1 (X1) = USE-D FILE NAME
- MX0 6
- SX2 1R0
- LX2 -6
- BX6 X1-X2
- BX6 X0*X6
- NZ X6,ACU1 IF USE-D FILE IS NOT PUBLISHED
- CALL LJUST,B0,1R
- BX6 X1
- SA6 INFO+2
- CALL S=LOG,INFO,5 ISSUE ACCOUNT FILE MESSAGE
- SA1 ACUB SET CONTINUATION HEADER
- BX6 X1
- SA6 INFO
- EQ ACU1 PROCESS NEXT USE FILE
- ACUA DATA 10HPU P
- ACUB DATA 10HPU C
- END
plato/source/plaopl/account.txt ยท Last modified: 2023/08/05 18:54 by Site Administrator