.TITLE ISUACCTG .IDENT \ISUQUOTA 2.9\ ARG_COUNT= 0 ARG_DAYTIME= 4 ARG_TYPE= 8 ARG_AFACTR= 12 ARG_QUAX= 16 ARG_COST= 20 ; THIS ROUTINE CALCULATES THE CHARGES FOR A JOB. THE ACCOUNTING FACTORS ; (RESOURCES CHARGED) ARE SUPPLIED IN A TABLE. THE ACCOUNTING RATES FOR EACH ; FACTOR ARE ALSO IN A TABLE. SINCE THE ROUTINE IS TABLE DRIVEN IT IS A ; RELATIVELY SIMPLE TASK TO CHANGE RATES, ADD/REMOVE ACCOUNTING FACTORS, OR ; HAVE DIFFERENT RATE TABLES FOR DIFFERENT TIMES OF DAY. ; IF ACCOUNTING FACTORS ARE ADDED THE CALLING PROGRAMS WILL HAVE TO BE ALTERED ; TO PROVIDE THE ADDITIONAL FACTORS. ; IF TIME BLOCK ACCOUNTING IS IMPLEMENTED THEN PROC_INIT MUST BE ALTERED TO ; SET THE ADDRESS OF THE APPROPRIATE RATE TABLE INTO REGISTER R11. ; NOTE: ; ISU DOES NOT CURRENTLY CHARGE FOR VAX USAGE. THE CODE HAS BEEN ; IMPLEMENTED WITH THE VIEW OF EITHER CHARGING "REAL" DOLLARS OR ; USING "HUMOROUS" DOLLARS IN LIEU OF THE CUMULATIVE QUOTAS ON ; ALL THOSE RESOURCES. ; ; ; ; CALL ISUACCTG (DAYTIME, TYPE, AFACTR, QUAX [,COST] ) ; ; WHERE ; DAYTIME - QUAD WORD CONTAINING ACCOUNTING TIME ; TYPE - TYPE OF PROCESS BEING ACCOUNTED ; AFACTR - TABLE OF ACCOUNTINING FACTORS IN LONG WORDS ; QUAX - QUAX RECORD ; COST - OPTIONAL TABLE OF COMPUTED COST FACTORS ; ; DAYTIME IS PROVIDED IN ORDER TO SUPPORT TIME-DEPENDENT RATE TABLES. IT IS ; NOT USED IN THIS IMPLEMENTATION. ; ; TYPE IS THE TYPE OF RECORD BEING PROCESSED, PRINT, INTERACTIVE, ETC. ; IT IS PROVIDED IN ORDER TO SUPPORT TYPE-DEPENDENT RATE TABLES. IT IS NOT ; USED IN THIS IMPLEMENTATION. ; ; AFACTR IS A TABLE OF THE FACTOR VALUES TO BE USED IN COMPUTING THE COSTS. ; FACTORS WHICH ARE NOT PRESENT, E.G., PAGES IN A NON-PRINT JOB, MUST BE ; ENTERED AS ZERO; THIS INCLUDES ALL UN-USED ENTRIES. ; ; QUAX IS THE QUAX RECORD TO BE UPDATED WITH COST AND USAGE. ; ; COST IS A TABLE PROVIDED BY THE CALLING PROGRAM TO CONTAIN THE COMPUTED ; COST OF EACH FACTOR AND THEIR CUMULATIVE COST. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ALL ISUQUOTA CHARGES ARE COMPUTED USING THIS SHAREABLE ROUTINE TO ; ASSURE UNIFORMITY. ; ; THE ROUTINE IS ENTIRELY TABLE DRIVEN. IN ORDER TO ADD ADDITIONAL FACTORS TO ; THE ACCOUNTING EQUATION IT IS ONLY NECESSARY TO INSERT THE APPROPRIATE ENTRY ; INTO THE RATE, QUAX COST OFFSET, AND QUAX USAGE OFFSET TABLES. ; ; THIS ROUTINE SUPPORTS ONLY A SINGLE RATE TABLE. IN ORDER TO HAVE MULTIPLE ; RATE TABLES, E.G., FUNCTION OF TIME, IT IS ONLY NECESSARY TO INSERT THE ; ADDITIONAL RATE TABLE(S) AND ALTER PROC_INIT TO SELECT THE PROPER RATE ; TABLE ADDRESS INTO REGISTER R11. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; REGISTER USAGE: ; R11 - ADDRESS RATE TABLE ; R10 - ADDRESS ACCOUNTING FACTOR TABLE (AFACTR) ; R9 - ADDRESS QUAX RECORD ; R8 - WORK REGISTER ; R7 - WORK REGISTER ; R6 - WORK REGISTER ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ANTHONY E. BIBLE ; 104 COMPUTER SCIENCE ; ISU COMPUTATION CENTER ; IOWA STATE UNIVERSITY ; AMES, IA 50011 ; ; 515-294-5659 ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .PAGE .SBTTL MACROS ACCOFFDEF QXOFF_$$ ACCOFFDEF QXOFF_USE ACCOFFDEF RATE ACCOFFDEF COST QUAXDEF .PAGE .SBTTL LOCAL READ-ONLY DATA .PSECT LCLRODATA,RD,NOWRT,NOEXE,LONG TAB_RATE: .FLOAT 0. ; FILLER .FLOAT 0. ; $ PER CPU TIC .FLOAT 0. ; $ PER DIO ACCESS .FLOAT 0. ; $ PER QIO ACCESS .FLOAT 0. ; $ PER GET COUNT .FLOAT 0. ; $ PER PAGE .FLOAT 0. ; $ PER CONNECT-SEC .BLKL .-TAB_RATE/4+N_RATE ; FILLER TAB_QXOFF_$$: .LONG 0 ; DUMMY .LONG QXR_$$_CPU_C .LONG QXR_$$_DIO_C .LONG 0 ; DUMMY .LONG 0 ; DUMMY .LONG QXR_$$_PAGE_C .LONG QXR_$$_CONN_C .LONG -1 ; END LIST .BLKL .-TAB_QXOFF_$$/4+N_QXOFF_$$ ; FILLER TAB_QXOFF_USE: .LONG 0 ; DUMMY .LONG QXR_U_CPU_C .LONG QXR_U_DIO_C .LONG 0 ; DUMMY .LONG 0 ; DUMMY .LONG QXR_U_PAGE_C .LONG QXR_U_CONN_C .LONG 0 .BLKL .-TAB_QXOFF_USE/4+N_QXOFF_USE .PAGE .SBTTL CODE .PSECT XFERVEC,RD,NOWRT,EXE,PIC,SHR,GBL,LONG .TRANSFER ISUACCTG .MASK ISUACCTG JMP L^ISUACCTG+2 .PSECT CODE,RD,NOWRT,EXE,PIC,SHR,LONG .ENTRY ISUACCTG,^M JSB PROC_INIT ; SET BASE REGS AND SELECT RATES MOVL #1,R6 ; LOOP INDEX LOOP: TSTL TAB_QXOFF_$$[R6] ; DO WHILE QUAX COST OFFSET NON_NEG BLSS RET_ISUACCTG ; END TABLE BEQL CONT_LOOP ; IGNORE DUMMY ENTRIES CVTLF (R10)[R6],R7 ; FLOAT ACCTG FACTOR MULF (R11)[R6],R7 ; COMPUTE FACTOR COST ADDL3 R9,TAB_QXOFF_$$[R6],R8 ; ADR QUAX COST FACTOR ADDF R7,(R8) ; ACCUMULATE QUAX FACTOR COST MOVL ARG_COST(AP),R8 ; ADR OPTIONAL COST TABLE BEQL 10$ MOVF R7,(R8)[R6] ; RETURN COST FACTOR AND ADDF R7,COST_TOTAL(R8) ; CUMULATIVE COST 10$: ADDF R7,QXR_U_DOLLARS(R9) ; ACCUMULATE TOTAL COST ADDL3 R9,TAB_QXOFF_USE[R6],R8 ; ADR QUAX USE FACTOR ADDL (R10)[R6],(R8) ; ACCUMULATE FACTOR USE CONT_LOOP: AOBLEQ #N_QXOFF_$$,R6,LOOP ; CONTINUE RET_ISUACCTG: RET .PAGE .SBTTL PROC_INIT PROC_INIT: MOVAL TAB_RATE,R11 ; ADR RATE TABLE MOVL ARG_AFACTR(AP),R10 ; ADR AFACTR TABLE MOVL ARG_QUAX(AP),R9 ; ADR QUAX RECORD MOVL ARG_COST(AP),R8 ; ADR OPTIONAL COST TABLE BEQL RSB_INIT MOVC5 #0,(R8),#0,#COST_L,(R8) ; ZERO-INITIALIZE COST TABLE RSB_INIT: RSB .PAGE .END