 TITLE '*** A N A L Y Z E   O V E R L A Y   S E V E N   D 0 0 ***'
*
DATA     CSECT    0
PP       CSECT    1
*
*
UTSPROC  SET      1
         SYSTEM   UTS
*
         PAGE
         REF      TITEL             ANLZ'S NEW PAGE ROUTINE (LO)
         REF      JITBUF
         REF      J:JIT
         REF      USERLIMS          VALID CLM PAIR OF USER NUMBERS
         REF      GETLIST
         REF      DCTLIMS           VALID DCT INDICES
         REF      BRKHIT            >>0 SAYS IGNORE BREAKS FROM USER
         REF      MB:SDI
         REF      DCT22
         CLOSE    OBUF
         CLOSE    PTR
         REF      MB:GAM6
         REF      NSPT
         REF      NSPC              # OF SECTORS PER CYLINDER
         SREF     S:DP
         SREF     UB:C#             USER'S CYLINDER NUMBER
         REF      J:CPPO
         REF      J:TRAP
         REF      J:INTER
         REF      SMUIS,NEWQ
         REF      UB:SWAPI,MB:GPT,UH:JIT,MB:GAM5
         REF      J:ACCN            ACCOUNT # SLOT IN J:JIT
         REF      J:UNAME           USER NAME SLOT IN J:JIT
         REF      USER              WORD IN ROOT OF ANLZ FOR U #
         REF      BLANK1
         REF      DPACCESS          DISC PACK ACCESS SLOT IN JIT
         REF      LPART             LENGTH OF PARTITION TABLES
         REF      SETR6             IN MAIN ANLZ--CONVERT STATE TO TXT
         REF      HGP               INCORE TABLE OF GRANULE POOLS
         REF      PLB:USR           USER # TABLES FOR BATCH
         REF      PLH:SID           JOB ID TABLES FOR BATCH
         REF      J:CALCNT          CAL COUNTER IN JIT
         REF      VIRPAGE1          IN ANLZ
         REF      UB:PRIO
         REF      UB:PRIOB
         REF      STACK
         REF      PATCH
         REF      UH:FLG,UX:JIT
         REF      J:CCBUF           CONTROL CARD BUFFER IN JIT
         REF      SNULL
         REF      UB:US
         REF      OBUF
         REF      SPACES
         REF      MSG
         REF      SCANNER
         REF      MBB,MB,TBB,BUFOUT,TRANSSZ,TRANS,PTR
         REF      FIELD1,FIELD2,FIELD3
         REF      GETHEX,FIELD#,FIELDS
         REF      JB:PNR,M:UC,J:MRT,J:UTIME,J:PTIME
         REF      UB:PCT,JB:VLH,DCACCESS,TPACCESS
         REF      SB:GJOBUN,S:GJOBTBL,MAXG
         REF      JB:PRIV
         REF      GETADDR
         DEF      SPY
         REF      DCT23             TELLS IF DISC DEVICE
         REF      DISCLIMS          TABLE OF VALID SECTOR NUMBERS
         REF      DCTSIZ            LENGTH  OF  DCT TABLES
         REF      DUMPSOME          DUMP ROUTINE IN ROOT OF ANLZ
         REF      DUMP:DIR          PASSING OWN BUF ADDRS FLAG
         REF      MTBB              MSG/TRANSSZ/BUFOUT/BLANK1
         PAGE
TICS%PER%SEC EQU  500
TICS%PER%MIN EQU  30000
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6
R7       EQU      7
R8       EQU      8
R9       EQU      9
R10      EQU      10
R11      EQU      11
R12      EQU      12
R13      EQU      13
R14      EQU      14
R15      EQU      15
         PAGE
ENTER    CNAME
         PROC
         PSW,R11  STACK
         PEND
         SPACE    2
RETURN   CNAME    1
RETURNSK CNAME    2
         PROC
LF(1)    PLW,R11  STACK
         DO       NAME=1
         B        *R11
         ELSE
         AI,R11   1
         B        *R11
         FIN
         PEND
         PAGE
HEX      EQU      0               PROC FOR GENERATING
TEXT     EQU      1                TABLES OF ACTIONS AND
DEC      EQU      2                 TABS. IF THE ACTION IS
         SPACE    2
TYPETAB  CSECT    1                  A LOAD, THE TYPE OF VARIABLE
OPTAB    CSECT    1                   IS SUPPLIED IN ANOTHER TABLE
TABTAB   CSECT    1
         SPACE    2
LOP      CNAME    1
BOP      CNAME    2
         PROC
A        SET      %
         USECT    OPTAB
         DO       NAME=1
         LI,R6    AF(1)
         ELSE
         DO       NAME=2
         B        AF(1)
         FIN
         FIN
TABMAX   SET      %-OPTAB
         USECT    TABTAB
         DATA,1   AF(2)
         USECT    TYPETAB
         DATA,1   AF(3)
         USECT    A
         PEND
         PAGE
*
*        STATIC DISPLAY DRIVER TABLES
*
         BOP      PRINT%USER,0
         BOP      PRINT%ACN,5
         BOP      PRINT%NAME,14
         BOP      PRINT%PRIV,27
         BOP      PRINT%PRIO,30
         BOP      PRINT%PRIOB,34
         BOP      PRINT%LINE,38
         BOP      PRINT%STATE,46
         BOP      MAX%SIZE,53
         BOP      CURRENT%SIZE,58
         BOP      PRINT%CCBUF,62
STATMAX  SET      TABMAX-1
         PAGE
*
*        DYNAMIC DISPLAY DRIVER TABLES
*
DYBASE   SET      TABMAX
*
         BOP      PRINT%USER,0
         BOP      PRINT%ACN,5
         BOP      PRINT%NAME,14
         BOP      TIME%USED,27
         BOP      TIME%LEFT,32
         BOP      PRINT%CALS,39
         BOP      DISC%ACCESS,46
         BOP      TAPE%ACCESS,54
         BOP      IO%RATE,62
         BOP      CAL%RATE,66
         BOP      PRINT%POUT,70
DYTOP    SET      TABMAX-1
*
         PAGE
*
*
         USECT    PP
PROMPTX  GEN,8,24 X'2C','-'         PROMPT CHARACTER
GETPAGE  GEN,8,24 8,1
FREEPAGE GEN,8,24 9,1
*
*
PRINT    GEN,8,24 1,0
         PZE      *0                P1
         PZE      *R1               BUF ADDRS IN R1
         PAGE
         USECT    DATA              GENERATE PROGRAM DATA
*
*        ARGS FOR NEWQ CALLS
*
NEWQARG  EQU      %
         DATA     X'F10A00'
IOBUFFER DATA     0                 GETS FILLED IN W/PAGE BYTE ADDRS
         DATA     X'800'
SEEK     DATA     0
EA       DATA     0
EAI      DATA     'SPYR'
*
         BOUND    8
FROM     DATA     0
TO       DATA     0
SCREEN   DATA     0
SCREEN1  DATA     0
COUNT    DATA     512/16
SNAPFLAG DATA     0                 >0 SAYS TO DUMP OUT JIT
STATFLAG PZE
SWAP     DATA     0                 >0 SAYS WE READ THE SWAPPER
SREADS   DATA     0                 >0  SAYS TO READ SWAPPER ONLY
OPTIONS  DATA     0                 SET IF WE DOING OPTIONS
DYNFLAG  PZE
SYSID    EQU      USER              SLOT IN ANLZ FOR USER NUMBER.
HEADFLAG PZE
JITPAGE  DATA     0                 PAGE WE GOT A JIT FROM
USER#    DATA     0                 USER # WE GOT JIT FOR
TIME     DATA     0
         BOUND    8
ACCUM    DATA     0,0,0
         PAGE
*
*        ENTRY FROM ANLZ--GET A PAGE FOR CVM IF WE DONT HAVE ONE
*
         USECT    PP                GENERATE PROGRAM PROCEDURE
SPY      EQU      %
         BAL,R5   ZIP%OPS           CLEAR OPTION CELLS
         MTW,0    VIRPAGE1          ALREADY GOT A WINDOW PAGE
         BGZ      SPY0              YUP...JUMP
         CAL1,8   GETPAGE           GET A VIRTUAL PAGE
         LW,R6    R9                MOVE FOR FVP
         CAL1,8   FVP               AND FREE IT
         STW,9    VIRPAGE1        SAVE FOR CVM CALS
SPY0     EQU      %
         LW,R1    FIELD2            ANY OPTIONS
         BNEZ     ONLINE            YUP--GO DECODE EM
FULLDISP EQU      %
         BAL,R11  FULLSTAT
         BAL,R11  FULLDYN
ALL%DONE EQU      %
         BAL,R0   SL1               RETURN TO SLAVE MODE NOW...
         B        SCANNER           AND RETURN TO ROOT
TEN      DATA     10
ACCUM%SAVE DATA   X'40404040',X'40404040'
         PAGE
*
*        RESET ALL OPTION  FLAGS
*
ZIP%OPS  EQU      %
         LI,R0    0
         STW,R0   STATFLAG
         STW,R0   DYNFLAG
         STW,R0   OPTIONS
         STW,R0   SREADS
         STW,R0   SNAPFLAG
         STW,R0   SCREEN            SET TO LOOK AT ALL TYPES OF USERS
         B        0,R5              AND  RETURN
         PAGE
*
*        SCAN FOR COMMAND--DO ALL IF NONE FOUND
*
ONLINE   EQU      %
         LI,R2    3
         CW,R1    MODES,R2          SEE IF TYPE OF USER SET
         BE       SCRENEM           YES
         BDR,R2   %-2
         LH,R1    FIELD2            FIRST TWO BYTES OF SECOND FIELD
         LI,R2    #COMMANDS         NUMBER OF COMMANDS WE KNOW ABOUT
         CH,R1    COMMANDS,R2       SCAN DOWN LIST FOR MATCH
         BE       VECTOR,R2         GOTCHA
         BDR,R2   %-2               KEEP LOOKING
         LW,R2    FIELD2            DID HE SAY 'SPY #'
         BEZ      FULLDISP          DO ALL
         MTW,1    STATFLAG
         MTW,1    DYNFLAG           SET BOTH FLAGS
         B        DISPUSR           AND MERGE..
         PAGE
*
*        USER SAID TO SHOW MESELF
*
SPY%ME   EQU      %
         LI,R2    X'FFF'
         AND,R2   J:JIT             EXTRACT OUR USER #
         MTW,1    STATFLAG
         MTW,1    DYNFLAG           SET FOR BOTH DISPLAYS
         B        DISPUSR01         AND MERGE
         PAGE
*
*        SAID TO LOOK AT CERTAIN TYPES OF USERS
*
SCRENEM  EQU      %
         STW,R2   SCREEN            SET FLAG
*
*        R2 = 3   GHOSTS ONLY
*             2   ONLINE ONLY
*             1   BATCH
*
         B        STATUS0           MERGE
*
         PAGE
*
*        SET 'ALL' OPTIONS AND GO LOOK FOR POSSIBLE STARTING
*        USER NUMBER
*
SET%ALL  EQU      %
         MTW,1    STATFLAG
         MTW,1    DYNFLAG
         B        STATUS0           AND MERGE
*
*        SET FLAG TO  READ SWAPPER ONLY
*
RD%ONLY  EQU      %
         MTW,7    SREADS            SET FLAG
         B        SET%ALL           AND MERGE
         PAGE
*
*        COMMAND TEXTS
*
COMMANDS EQU      %
         DATA,2   'XX'              NULL ZERO ENTRY
         DATA,2   'ST'              STATUS
         DATA,2   'DY'              DYNAMIC STUFF
         DATA,2   'AL'              ALL OF IT
         DATA,2   'ME'              SPY ON ME
         DATA,2   'SW'              READ SWAPPER ONLY
         DATA,2   'SN'              DUMP JIT ONLY
#COMMANDS EQU     HA(%)-HA(COMMANDS)-1
         BOUND    4
*
*
VECTOR   EQU      %
         B        SCANNER    ** NULL
         B        STATUS     ** STATIC DATA ONLY
         B        DYNAMIC    ** DYNAMIC DATA
         B        SET%ALL    ** ALL WITH POSSIBLE USER #
         B        SPY%ME     ** SPY MESELF (IMPLIED ALL)
         B        RD%ONLY           READ SWAPPER ONLY
         B        SN%ONLY           SNAP JIT ONLY
*
MODES    EQU      %-1
         TEXT     'BATC'
         TEXT     'ONLI'
         TEXT     'GHOS'
*
*
         PAGE
*
*        SET STATUS FLAG
*
STATUS   EQU      %
         MTW,7    STATFLAG
STATUS0  EQU      %
         LI,R1    2                 ASSUME OPTION
         MTW,0    FIELD3            AN OPTION PRESENT...
         BNEZ     DISPUSR0          YUP
         LI,R2    1                 NO--START AT # 1
         B        DISPUSR2          MERGE
*
*
DYNAMIC  EQU      %
         MTW,1    DYNFLAG
         B        STATUS0
*
*
SN%ONLY  EQU      %
         MTW,1    SNAPFLAG          SET GATE..
         B        STATUS            AND MERGE
         PAGE
*
*        DISPLAY SPECIFIED USER
*
DISPUSR  EQU      %
         LI,R1    1                 USER # IN FIELD2 ENTRY
DISPUSR0 EQU      %                 OR COME HERE WITH R1 LOADED
         BAL,R0   GETHEX
DISPUSR01 EQU     %
         CI,R2    0                 DID WE PICK UP AN INITIAL OPTION
         BEZ      %+2               NOPE--WEILL DO ALL USERS
         MTW,7    OPTIONS           OTHERWISE SET DOING OPTIONS FLAG
DISPUSR1 EQU      %
         CI,R2    0                 DID WE GET A GOOD VALUE
         BGZ      %+2               YUP
         LI,R2    1                 OTHERWISE START AT USER # ONE
         STW,R2   SYSID             SAVE IT
DISPUSR2 EQU      %
         LW,R1    FIELD#            GET AND HOLD CURRENT FIELD #
         LW,R0    STATFLAG          FIRST LETS CHECK TO SEE
         AW,R0    DYNFLAG           IF ANY THING WAS SET
         BEZ      FULLDISP          NEITHER FLAG--DO ALL BY THE NUMBERS
         MTW,0    STATFLAG          WANTS STATIC DATA
         BEZ      DISPUSR3          NO
         BAL,R11  FULLSTAT          THEN SHOW IT TO EM
DISPUSR3 EQU      %
         STW,R1   FIELD#            REPLACE FIELD # IN CASE OF OPTIONS
         MTW,0    DYNFLAG           WANTS DYNAMIC DATA
         BEZ      ALL%DONE          NO--NOTHING TO DO
         BAL,R11  FULLDYN           THEN SHOW IT
         B        ALL%DONE
         PAGE
*
*        WRITE MSG
*
WRITE%LINE EQU    %               GENERAL WRITE ROUTINE
         LW,R0    R11               XFER LINK
         B        BUFOUT            AND PRINT AOBUF
         PAGE
*
*        SEND MSG
*
MESSAGE  EQU      %               PRINTS A MESSAGE ON M:LO
         LW,R1    R8                MSG WORD ADDRESS
         BAL,R0   MBB               WRITE IT OUT
         B        *R11              AND RETURN
         PAGE
*
*        HERES WHERE WE GRAB THE JIT--WE WILL EITHER;
*
*        READ THE SWAPPER IF USER SAID TO ALWAYS READ IT OR
*
*        GRAB THE JIT FROM INCORE IF IT STAYS IN ONE PLACE LONG
*        ENUFF TO GRAB IT...IF IT MOVED WHILE WE MOVED IT WE
*        WILL READ IT OFF THE SWAPPER.
*
*
GET%JIT  EQU      %               ONE WAY OR ANOTHER,
         LCI      0
         PSM,R0   STACK             SAVE ALL IN CASE WE DO I/O
         BAL,R11  PHYS%TO%REL       GRAB THE JIT
         B        JIT%ERROR         ** ERROR RETURN **
         STW,8    SEEK              STORE CONVERTED RELATIVE DISC ADDRS
         LI,R6    3
         STB,R5   NEWQARG,R6      **STORE DEVICE INDEX AWAY
         BAL,R5   MASTER            INSURE NOW IN MASTER MODE
         LCI      6                HIS JIT IS MOVED TO PAGE;
         LM,12    NEWQARG           OTHERWISE, IT IS READ
         BAL,R11   NEWQ              IN FROM THE SWAP DEVICE
         NOP      %                 IGNORE ERROR RETURNS
         MTW,1    SWAP              INDICATE WE READ THE SWAPPER
GOTJIT   EQU      %
         BAL,R0   SL1               BACK TO SLAVE MODE
         LCI      0
         PLM,0    STACK
         AI,R11   1                 GOOD RETURN
         B        *R11
         PAGE
*
*        SOME KIND OF AN ERROR OCCURED
*
JIT%ERROR EQU     %
         BAL,R0   SL1               BACK TO SLAVE MODE
         LCI      0
         PLM,R0   STACK
         B        *R11              AND RETURN
         PAGE
*
*        CONVERT USER'S PHYSICAL DISC ADDRESS TO RELATIVE
*        DISC ADDRESS FOR NEWQ I/O
*
*        R2       USER #
*        R5       SWAPPER DCT INDEX
*        R6       USER SWAPPER TABLE INDEX VALUE
*        R7       INDEX TO DISC ADDRESS CONVERT TABLES
*        R8       OUTPUT--RELATIVE DISC ADDRESS IN FORM OF;
*
*     0---------------------15------------------------31
*     * DCT INDEX           *  RELATIVE SECTOR #      *
*     *-----------------------------------------------*
*
*        NOTE THATTHE USER CAN SAY TO ALWAYS READ THE SWAPPER
*        OR WE CAN RETURN HERE TO READ THE SWAPPER IF THE INCORE
*        GRAB FAILED BECAUSE THE JIT MOVED.
*
PHYS%TO%REL EQU   %
         LB,R14   JB:PRIV           GET USER'S  PRIV
         CI,R14   X'C0'             IS  HIGH ENUFF
         BGE      READ%JIT          YUP
         LI,R14   UB:US             LETS GET THE STATE TABLE
         BAL,R0   GETADDR           FIRST
         LB,R14   *R15,R2           TO SEE IF SOMEONE THERE
         BEZ      *R11              NO ONE
         CI,R14   SNULL             IS NULL
         BE       *R11              YUP
         LI,R14   UH:FLG            NOW FOR FLAGS
         BAL,R0   GETADDR
         LI,R7    X'FFFF'
         LH,R14   *R15,R2           GET FLAGS
         CI,R14   X'200'            JIT IN CORE
         BANZ     MOVE%IT%IN        GRAB IT
         BDR,R7   %-3               KEEP CHECKING
         B        *R11              AND THEN GIVE UP
READ%JIT EQU      %
         LW,R10   JITBUF            GET THE PAGE WORD ADDRESS
         BEZ      ALL%DONE          ****DISASTER****
         SLS,R10  2                 INTO A BYTE ADDRS
         STW,R10  IOBUFFER          AND SET IT UP FOR NEWQ ARGS..
         BAL,R5   MASTER            GO MASTER MODE
         CI,R10   NEWQ              DID WE GET LOADED W/MONSTK OK
         BNE      NOT%HERE          NOPE
         LB,R4    UB:US,R2          GET USER'S STATE
         BEZ      *R11              NO ONE  THERE....
         CI,R4    SNULL             ANYBODY THERE
         BE       *R11              RETURN NOT SKIPPING
         MTW,0    SREADS            DID HE SAY TO READ SWAPPER ONLY
         BNEZ     RD%JIT            YUP--JUMP TO READ IT
         LH,R4    UH:FLG,R2         GET  HIS FLAGS
         CI,R4    X'200'            IS JIT IN CORE
         BANZ     MOVE%IT%IN        YUP--DO A CORE MOVE
RD%JIT   EQU      %                 POSSIBLE RETURN FROM MOVE IT
         LB,R6    UB:SWAPI,R2       GET SWAP TABLE INDEX
         LB,R5    MB:SDI,R6         GET DCT INDEX
         BEZ      *R11              ****ERROR****
         CLM,R5   DCTLIMS           IS VALID DCT INDEX
         BCS,R9   *R11              ****ERROR****
         LB,R7    DCT22,R5          GET CONVERT TABLE INDEX
         BEZ      *R11              NOT A DISC/RAD DEVICE
         LH,R9    UH:JIT,R2         GET PHYSICAL ADDRS OF JIT
         BEZ      *R11              ****ERROR****
         MTW,0    S:DP              IS THIS A DISC PACK SWAPPER
         BNEZ     DP%SWAPPER        YUP---JUMP
         LB,R8    MB:GAM6,R6        SECTOR MASK
         AND,R8   9                 EXTRACT SECTOR #
         LB,R10   MB:GAM5,R6        SHIFT FACTOR
         SLS,R9   *R10              SHIFT TO TRACK #
         MW,R9    NSPT,R7           MULTIPLY INTO TOTAL SECTORS
         AW,R8    R9                ADD TO ORIG SECTORS
CVVT     EQU      %
         CI,R8    0                 IS VALID SECTOR
         BEZ      *R11              NOPE
         CW,R8    DISCLIMS,R7       IS VALID FOR END OF  DEVICE
         BGE      *R11              NOPE--NO I/O ALLOWED
         STH,R5   R8                ADD DCT INDEX
         AI,R11   1                 RETURN SKIPPING
         B        *R11              AND RETURN
DP%SWAPPER EQU    %
         LI,R8    UB:C#
         BEZ      *R11              NOPE---S:DP WAS CLOBBERED....
         LI,R8    X'FF'             SECTOR # MASK
         AND,R8   R9                SELECT SECTOR # OUT OF D/A
         LB,R3    UB:C#,R2          GET CYL FOR THIS USER
         MW,R3    NSPC,R7           CYLINDER * SECTORS PER CYLINDER
         AW,R8    R3                ADD ON TO ORIG SECTOR #
         LI,R3    2                 ASSUME CYLINDER#0
         MTB,0    UB:C#,R2          IS TRUE
         BEZ      %+2               YES-> HOP
         LI,R3    -2                NOT CYLINDER ZERO
         AW,R8    R3                CORRECT THE JIT DISC ADDRESS
         B        CVVT              GO READ IT
         PAGE
*
*        GET INTO MASTER MODE
*
MASTER   EQU      %
         LW,R10   NEWQ%ADR          LOAD R10 IN CASE WE'RE ALREADY THERE
         MTW,0    MODE              ARE WE IN MASTER MODE
         BNEZ     0,R5              YUP
         MTW,7    BRKHIT            SETUP FOR IGNORE BREAK KEYS
         CAL1,6   =X'08000000'      WELL THEN GO INTO MASTER MODE
         BCS,8    0,R5              CANT GET  INTO MASTER MODE
         WD,0     X'37'             *** DISABLE ***
         STW,R10  NEWQ%ADR          SAVE NEWQ'S ADDRESS
         STW,R5   MODE              SET MODE
         B        0,R5              AND RETURN
         USECT    DATA
MODE     DATA     0
NEWQ%ADR DATA     NEWQ
         USECT    PP
         PAGE
*
*        PROGRAM AS LOADED DOES NOT MATCH RUNNING MONITOR
*
NOT%HERE EQU      %               HERE IF THE MONITOR ISN'T
         BAL,R0   SL1              WHAT WE EXPECT
         LI,R8    NOT%HERE%MSG
         BAL,R11  MESSAGE
         B        ALL%DONE          AND EXIT
NOT%HERE%MSG TEXTC 'PROGRAM DOES NOT MATCH SYSTEM',;
                   ', RELOAD WITH CORRECT MONSTK'
         PAGE
*
*        DRIVE DISPLAYS
*
GET%VAL  EQU      %               DRIVER FOR THE TABLE ROUTINES
         LCI      6
         PSM,R2   STACK             SAVE R2 THRU R8
         LW,R12   R2                XFER USER # TO HEX REGISTER
         LB,R1    TABTAB,R3
         BAL,R0   SPACES
         EXU      OPTAB,R3
         LB,R7    TYPETAB,R3
         BAL,R11  CONVERT,R7
G1       EQU      %
         LCI      6
         PLM,R2   STACK
         B        0,R5              RETURN
         PAGE
*
*        CHECK TO SEE IF WE WANT TO SCREEN TYPES OF USERS
*
SCRNCHK  EQU      %
         LI,R0    0
         STW,R0   SCREEN1           CLEAR FLAG
         LW,R0    OPTIONS           DOING OPTIONS
         BEZ      1,R6              NO-> RETURN TO USE THIS USER#
         PSW,R6   STACK             SAVE RETURN LI^K
         LW,R1    FIELD#            GET CURRENT FIELD#
         AI,R1    1                 BUMP
         LW,R4    FIELDS,R1         ANY MORE
         BEZ      ALL%DONE
         MTW,0    0,R4              AN OPTION THERE
         BEZ      ALL%DONE          NO MORE OPTIONS-QUIT NOW
         BAL,R6   GETLIST           GET NEXT ITEM IN LIST
         BAL,R0   GETHEX            GO MAKE IT HEX
         CLM,R2   ULIM              IS VALID
         BCR,9    %+2               YUP
         BAL,R5   CHK%BATCH         COULD BE BATCH JOB
SCRNCHK0 EQU      %                 USER # IN R2
         LI,R6    0
         STW,R6   SCREEN1           CLEAR FLAG
         LI,R14   UH:FLG
         BAL,R0   CHK%MODE          GET UH:FLG
         NOP
         LH,R6    *R15,R2           GET FLAGS FOR THIS USER
         CI,R6    X'100'            IS JOB BATCH
         BANZ     SCRNCHK1          YES
         LI,R14   SB:GJOBUN         GHOST JOB USER # TABLE
         BAL,R0   CHK%MODE          GET IT
         NOP
         LI,R7    MAXG              MAX LENGHT OF IT
         CB,R2    *R15,R7           SEE IF IN THAT TABLE
         BE       SCRNCHK2          GOTCHA
         BDR,R7   %-2
         LI,R6    2                 MUST BE ONLINE USER
         B        SCRNCHK3          MERGE
SCRNCHK1 EQU      %
         LI,R6    1                 BATCH FLAG
         B        SCRNCHK3          MERGE
SCRNCHK2 EQU      %
         LI,R6    3                 GHOST FLAG
SCRNCHK3 EQU      %
         STW,R6   SCREEN1           STORE TYPE OF USER HE IS
         MTW,0    SCREEN            DO WE WANT TO SCREEN OUT TYPES
         BEZ      SCRNCHK4          NOPE--> DONT CARE
         CW,R6    SCREEN            DOES THIS TYPE MATCH KIND WE WANT
         BNE      SCRNCHK5          NO
SCRNCHK4 EQU      %
         PLW,R6   STACK
         B        1,R6              RETURN TO USE THIS USER #
SCRNCHK5 EQU      %
         PLW,R6   STACK
         B        0,R6              RETURN TO NOT USE THIS USER #
         PAGE
*
*        COPY INCORE JIT TO OUR BUFFER
*
*        IF THE JIT MOVES DURING OUR MOVE OF IT WE WILL GO BACK
*        AND READ IT OFF THE SWAPPER
MOVE%IT%IN EQU    %               MOVE A USER'S JIT WHICH
         LI,R14   UX:JIT
         BAL,R0   CHK%MODE          SEE PROPER MODE
         NOP      %
         LOAD,R7  *R15,R2           AND EXTRACT USER JIT PAGE #
         STW,R7   JITPAGE           REMEMBER JIT PAGE #
         STW,R2   USER#             AND USER #
         LI,R14   UH:FLG            LETTS GET
         BAL,R0   CHK%MODE          THE USER'S FLAGS BEFORE MOVEING
         NOP      0
         LH,R4    *R15,R2           GET EM
         STW,R4   SEEK              REMEMBER EM
         CI,R4    X'200'            STILL JIC
         BAZ      JIT%ERROR         NOPE
         SLS,R7   9
         LI,R6    512/16
         STW,R6   COUNT
         LW,R5    JITBUF
         STW,R5   TO
         LW,R6    VIRPAGE1          GET OUR VIRTUAL CVM PAGE
         STW,R6   FROM              SOURCE WORD ADDRS
         CAL1,8   CVM               MAP ONTO THAT PHYSICAL PAGE
         BCS,8    CVM%ERROR         PROBLEM
MOVE%LOP EQU      %
         LCI      0
         LM,R0    *FROM
         STM,R0   *TO
         LD,R0    FROM
         AI,R0    16
         AI,R1    16
         STD,R0   FROM
         MTW,-1   COUNT
         BGZ      MOVE%LOP
         LW,R2    USER#             RESTORE USER #
         LI,R14   UX:JIT
         BAL,R0   CHK%MODE          GO SEE IF OK
         NOP      0
         LOAD,R7  *R15,R2           GET USER'S CURRENT JIT PAGE #
         LI,R14   UH:FLG             AND HIS
         BAL,R0   CHK%MODE
         NOP      0
         LH,R4    *R15,R2           NEW FLAGS
         CW,R4    SEEK              SAME FLAGS AS WHEN WE STARTED
         BNE      JIT%ERROR         NOPE--> NO JIT
         CW,R7    JITPAGE           AND IS JIT PAGE THE SAME
         BNE      JIT%ERROR         NOPE--> NO JIT
         LI,R7    JB:PRIV-J:JIT     DISPLACEMENT INTO THE JIT FOR PRIV
         SLS,R7   2                 BYTE DISP
         LB,R7    *JITBUF,R7        GET HIS PRIVILEGE LEVEL
         BEZ      JIT%ERROR         SCREEN THESE OUT...
         LI,R7    1                 IS PROBABLY NOT OK..LETS CHK NAME
         MTW,0    *JITBUF,R7        TEST ACCOUNT # FIRST
         BEZ      JIT%ERROR         NOPE--> FILTER THIS ONE OUT
         B        GOTJIT            EXIT NORMALLY
         PAGE
*
*        IF PRIVILEGE LEVEL LESS  THAN X'C0'  MAP ONTO ADDRESS
*
CHK%MODE EQU      %
         PSW,R0   STACK             SAVE LINK
         MTW,0    MODE              R N MASTER MODE NOW
         BNEZ     CHK%MODE1         YUP--> FETCH DIRECTLY FROM MON.
         BAL,R0   GETADDR           NO--MAP ONTO TARGET ADDRESS
         PLW,R0   STACK
         AI,R0    1
         B        *R0               AND RETURN SKIPPING
CHK%MODE1 EQU     %
         LW,R15   R14               MOVE REQUESTED ADDRESS
         PLW,R0   STACK
         B        *R0               AND RETURN NOTSKIPPING
         PAGE
*
*        CVM FAILED WHILE TRYING TO MAP ONTO THE JIT
*
CVM%ERROR EQU     %
         LI,R1    CVM%ERRMSG
         BAL,R0   MBB
         B        ALL%DONE          AND EXIT
CVM%ERRMSG TEXTC  '** MAP CAL FAILED--CANNOT CONTINUE'
         PAGE
*
*        RETURN TO SLAVE MODE
*
SL1      EQU      %               RETURN TO MASTER CALLER SLAVE
         MTW,0    MODE              ARE WE IN MASTER MODE
         BEZ      *R0               NOPE--EXIT
         LI,R15   0
         STW,R15  MODE              SET IT TO SLVE MODE
         STW,R15  BRKHIT            ALLOW BREAK KEYS AGAIN
         LPSD,0   SL2              NOTE USES Z AS LINK
SLAVER   EQU      %                 RETURN  FROM LPSD...
         B        *R0
*
*
FVP      GEN,1,7,24  1,5,R6         VIRTUAL PAGE INR7
*
CVM      GEN,1,7,24 1,7,R7          REAL ADDRESS TO MAP ONTO IN R7
         GEN,1,7,24 1,0,R6          AND VIRTUAL PAGE ADDRS INR 6
         BOUND    8
SL2      GEN,12,20 X'C',SLAVER
         DATA     0
ULIM     EQU      USERLIMS          IN ROOT MODULE
         PAGE
*
*        USER SAID TO SNAP OUT A JIT
*
DUMPJIT  EQU      %
         BAL,R11  GET%JIT           GET THE JIT
         B        STAT1             DIDNT GET  EM....
         BAL,R0   BLANK1
         LI,R1    JIT%MSG
         LW,R3    R2
         BAL,R0   MTBB              PUT OUT MSG + USER #
         LW,R8    JITBUF            BUFFER WORD ADDRS
         LI,R7    512               SIZE OF A USER JIT
         MTW,2    DUMP:DIR          ENABLE OWN BUF ADDRS FLAG
         BAL,R0   DUMPSOME          DUMP OUT THE JIT
         B        STAT1             AND REJOIN
JIT%MSG  TEXTC    '**** JIT OF USER # '
SNAP#TIT TEXTC    '*'
         PAGE
*
*        DRIVE FULL STATIC DATA DISPLAY
*
FULLSTAT EQU      %
         ENTER
         LW,R2    USER              WAS A USER # GIVEN...
         BGZ      %+2               YUP
         LI,R2    1                 ELSE START AT USER # 1
         LI,R1    SNAP#TIT          TITLE IF DUMPING JITS
         MTW,0    SNAPFLAG          WANTS TO DUMP IT...
         BGZ      %+2               YEP..GO THERE
         LI,R1    STHEADER          LOAD TITLE LINE
         BAL,R0   TITEL             AND PUT IT OUT
STAT2    EQU      %
         BAL,R6   SCRNCHK           SEE IF THIS ONE GETS USED
         B        STAT0             NO
         MTW,0    SNAPFLAG          SHOULD WE JUST DUMP IT OUT
         BGZ      DUMPJIT           YEP..GO THERE
         BAL,R11  STATDISP          PUT OUT STATIC INFO
STAT1    EQU      %
STAT0    EQU      %
         AI,R2    1                 ELSE INCREMENT USER #
         CI,R2    SMUIS             AT END OF ALL POSSIBLE USERS
         BLE      STAT2             NOT YET
         RETURN
         PAGE
*
*        DYNAMIC DISPLAY
*
FULLDYN  EQU      %
         ENTER
         LI,R1    DYHEADER
         BAL,R0   TITEL
DYN1     EQU      %
         LW,R2    USER              ANY OPTION
         BGZ      %+2               YEP
         LI,R2    1
DYN2     EQU      %
         BAL,R6   SCRNCHK           SEE IF WE SHOULD DO HIM
         B        DYN3              SAID TO SKIP THIS ONE
         BAL,R11  DYNDISP
DYN3     EQU      %
         AI,R2    1
         CI,R2    SMUIS
         BLE      DYN2
         RETURN
         PAGE
*
*        CHECK USER # IN R2 FOR A BATCH SYS ID - CAUSE IT SURE
*        ISNT A USER TABLE INDEX
*
CHK%BATCH EQU     %
         LI,R14   PLH:SID
         BAL,R0   CHK%MODE          GET ADDRESS
         NOP      %
         LI,R7    LPART             LENGTH OF PARTITION TABLES
         CH,R2    *R15,R7           SEE IF IT IS IN PARTITION TABLES
         BE       GOT%BATCH         YUP
         BDR,R7   %-2               KEEP LOOKING
         B        USER%BAD          BAD NUMBER
GOT%BATCH EQU     %
         LI,R14   PLB:USR
         BAL,R0   CHK%MODE          GO GET ADDRESS
         NOP      %
         LB,R2    *R15,R7           GET THE REAL USER #
         B        0,R5              AND RETURN TO CALLER
         PAGE
*
*        USER # IN R2 IS INVALID OR UNKNOWN BATCH SYS ID
*
USER%BAD EQU      %
         LI,R0    0
         STW,R0   PTR
         LW,R3    R2                MOVE USER #
         BAL,R0   TRANSSZ           PUT IT OUT
         LI,R1    USER%MSG
         BAL,R0   MBB
         B        ALL%DONE          AND EXIT
USER%MSG TEXTC    ' IS AN INVALID USER #'
         PAGE
*
*        MOVE USER # TO PRINT LINE
*
PRINT%USER  EQU   %
         LI,R6    BATCH
         LC       *JITBUF           GET USER'S MODE
         BCR,8    %+3
         LI,R6    ON%LINE
         B        %+3
         BCR,4    %+2
         LI,R6    GHOST
         BAL,R11  CONVERT%TEXT      MOVE TYPE OF JOB
         MTW,1    PTR
         LW,R3    R2                USER #
         BAL,R0   TRANSSZ           OUT
         LI,R3    0
         XW,R3    SWAP              DID WE READ JIT FROM THE SWAPPER
         BEZ      G1                NO
         LI,R1    ASTMSG            YES
         LI,R0    G1                SET RETURN
         B        MSG               AND FLAG FACT ON LISTING
         PAGE
*
*        DISPLAY STATIC DATA
*
STATDISP EQU      %
         ENTER
         BAL,R11  GET%JIT
         B        STDISPX
         LI,R3    0
         LI,R0    0
         STW,R0   PTR
STDISP1  EQU      %
         BAL,R5   GET%VAL
         AI,R3    1
         CI,R3    STATMAX
         BLE      STDISP1
         BAL,R11  WRITE%LINE
STDISPX  EQU      %
         RETURN
ASTMSG   TEXTC    '*'               ON LINE SAYS WE DID I/O FOR JT
         PAGE
*
*        DISPLAY USER'S DYNAMIC DATA
*
DYNDISP  EQU      %
         ENTER
         BAL,R11  GET%JIT
         B        DYDISPX
         LI,R3    DYBASE
         LI,R0    0
         STW,R0   PTR
DYDISP1  EQU      %
         BAL,R5   GET%VAL
         AI,R3    1
         CI,R3    DYTOP             AT TOP OF LIST YET
         BLE      DYDISP1
         BAL,R11  WRITE%LINE
DYDISPX  EQU      %
         RETURN
         PAGE
*
*        PRINT USER'S ACCOUNT #
*
PRINT%ACN EQU     %
         LI,R11   G1
         LI,R5    8
         LI,R6    J:ACCN-J:JIT
         AW,R6    JITBUF
         SLS,R6   2                 AND ALL INTO A BA
         B        CT1
         PAGE
*
*        PRINT USER'S NAME
*
PRINT%NAME EQU    %               PRINT HIS NAME OR
         LI,R6    J:UNAME-J:JIT
         LW,R6    *JITBUF,R6
         BEZ      PN2               JOB GOING MASTER MODE
PN1      EQU      %
         LI,R5    12
         LI,R11   G1
         LI,R6    J:UNAME-J:JIT
         AW,R6    JITBUF
         SLS,R6   2
         B        CT1
PN2      EQU      %
         LC       *JITBUF
         BCR,4    G1
         LI,R5    MAXG
         LI,R14   SB:GJOBUN
         BAL,R0   CHK%MODE
         NOP      %
         CB,R2    *R15,R5           FIND USER # IN GHOST TABLES
         BE       %+2
         BDR,R5   %-2
         LI,R14   S:GJOBTBL
         BAL,R0   CHK%MODE
         NOP      %
         LD,R6    *R15,R5           PICK UP GHOST NAME
         SLD,R6   8
         AI,R7    X'40'
         LI,R5    J:UNAME-J:JIT
         LCI      2
         STM,R6   *JITBUF,R5
         LW,R6    ACCUM%SAVE
         AI,R5    2
         STW,R6   *JITBUF,R5      **BLANK OUT LAST WORD OF NAME
         B        PN1
         PAGE
*
*        PRINT USER NUMBER IF GHOST, LINE # IF ONLINE OR SYS ID AND
*        PARTITION NUMBER IF BATCH
*
PRINT%LINE EQU    %               PRINTOBUFNUMBER
         LC       *JITBUF
         BCS,8    LINE1             FOR BATCH. GHOST
         LI,R12   X'FFFF'
         AND,R12  *JITBUF           PICK IT UP
         B        PL1
LINE1    EQU      %
         LI,R12   X'FF'
         LI,R6    M:UC-J:JIT+1
         AND,R12  *JITBUF,R6        GET LINE NUMBER
         B        COMMONX           GO PRINT NUMBER
PL1      EQU      %
         LW,R3    R12               MOVE LINE/SYS ID
         BAL,R0   TRANSSZ           PUT IT OUT
         LI,R14   PLB:USR
         BAL,R0   CHK%MODE          GET ADDRESS
         NOP      %
         LI,R7    LPART
         CB,R2    *R15,R7           SEE IF IN TABLE
         BE       GOT%PART
         BDR,R7   %-2
         B        G1                ITS NOT A BATCH JOB
GOT%PART EQU      %
         LI,R1    DASHMSG
         BAL,R0   MSG
         LW,R12   R7                MOVE PARTITION # TO HEX REG.
         B        COMMONX           AND MERGE
DASHMSG  TEXTC    '-'
         PAGE
*
*        CALCULATE TIME LEFT TO RUN
*
TIME%LEFT EQU     %
         LI,R6    J:MRT-J:JIT
         LW,R13   *JITBUF,R6      *LOAD TIME LEFT(0=ONLINE)
         B        MIN%SEC
         PAGE
*
*        PRINT USER'S PRIVILEGE LEVEL
*
PRINT%PRIV  EQU   %
         LI,R6    JB:PRIV-J:JIT
         SLS,R6   2                 BYTE INDEX
         LB,R12   *JITBUF,R6        FETCH HIS PRIVILEGE
         B        COMMONX           MERGE
         PAGE
*
*        GET USER'S PRIORITY CURRENTLY
*
PRINT%PRIO EQU    %
         LI,R14   UB:PRIO
COMM%ENTRY EQU    %
         BAL,R0   CHK%MODE          GET ADDRESS
         NOP      %
         LB,R12   *R15,R2           GET CURRENT PRIORITY LEVEL
         B        COMMONX           MERGE
         PAGE
*
*        GET USER'S PRIORITY BASE
*
PRINT%PRIOB EQU   %
         LI,R14   UB:PRIOB
         B        COMM%ENTRY
         PAGE
*
*        PRINT USER'S STATE
*
PRINT%STATE EQU   %
         LI,R14   UB:US
         BAL,R0   CHK%MODE          GET ADDRESS
         NOP      %
         LB,R6    *R15,R2           GET VALUE
         BAL,R0   SETR6             AND MOVE IT INTO PRINT LINE
         B        G1                EXIT
         PAGE
*
*        PRINT USER CAL COUNT
*
PRINT%CALS EQU    %
         LI,R6    J:CALCNT-J:JIT
         LW,R13   *JITBUF,R6        FETCH CAL COUNTER
         B        MEAN2             DISPLAY IN DECIMAL
         PAGE
*
*        PRINT USER'S DISC ACCESSES
*
DISC%ACCESS EQU   %
         LI,R6    DCACCESS
         LW,R13   *JITBUF,R6        FETCH VALUE
         LI,R6    DPACCESS
         AW,R13   *JITBUF,R6        ADD DISC PACK ACCESSES
         B        MEAN2
         PAGE
*
*        PRINT USER'S TAPE ACCESSES
*
TAPE%ACCESS EQU   %
         LI,R6    TPACCESS
         LI,R13   X'FFFF'
         AND,R13  *JITBUF,R6        SELECT TAPE IO FIELD IN JIT
         B        MEAN2
         PAGE
*
*        PRINT USER'S CONTROL COMMAND BUFFER
*
PRINT%CCBUF EQU   %
         LI,R6    J:CCBUF-J:JIT
         AW,R6    JITBUF            BUFFER WINDOW
         SLS,R6   2                 BYTE ADDRESS
         LI,R0    ' '
         LI,R5    13                13 BYTE LOOP
         LW,R4    R6                COPY BA TO R4
SCANCCBUF EQU     %
         LB,R12   0,R4              GET A BYTE
         BEZ      CLRCCBUF          PROBLEM THERE...
         CI,R12   ' '               IS PRINTABLE
         BG       %+2               MAYBE OK
CLRCCBUF EQU      %
         STB,R0   0,R4              ELSE SET IT TO A BLANK
         AI,R4    1
         BDR,R5   SCANCCBUF
         LI,R5    13                13 BYTES MAX PRINT OUT
         LI,R11   G1                RETURN POINT.....****
         B        CT1               AND MOVE IT TO PRINT LINE
         PAGE
*
*        COMMON ENTRY TO HEX BUST ROUTINE
*
COMMONX  EQU      %
         LI,R11   G1                SET RETURN ADDRESS
         B        CONVERT%HEX       AND CONVERT VALUE TO EBCDIC
         PAGE
*
*        CALCULATE TIME IN CORE
*
TIME%USED EQU     %
         LI,R6    J:UTIME-J:JIT
         LI,R7    J:PTIME-J:JIT
         LW,R13   *JITBUF,R6        UTIME WORD ONE
         AI,R6    1
         AW,R13   *JITBUF,R6        UTIME WORD ONE PLUS WORD TWO
         AW,R13   *JITBUF,R7        PLUS PTIME WORD ONE
         AI,R7    1
         AW,R13   *JITBUF,R7        PLUS PTIME WORD TWO
         STW,R13  TIME
         B        MIN%SEC
*
ON%LINE  TEXTC    'O'
BATCH    TEXTC    'B'
GHOST    TEXTC    'G'
         PAGE
*
*        CONVERT TOTAL TICS TO TOTAL SECONDS
*
MIN%SEC  EQU      %
         LI,R12   0
         DW,R12   =TICS%PER%SEC     INTO RATE PER SECOND
         CW,R12   =TICS%PER%SEC     CHECK FOR ROUNDING
         BL       %+2
         AI,R13   1                 ROUND UPWARDS
MEAN2    EQU      %
         LI,R11   G1
         B        CONVERT%DEC
         PAGE
*
*        CALCULATE MAX CORE SIZE
*
MAX%SIZE EQU      %               JB:PEAK, IF YOU HADN'T GUESSED
         LI,R6    JB:VLH-J:JIT
         SLS,R6   2                 INTO A BYTE INDEX
         AI,R6    1                 FOR BYTE ONE
         LB,R13   *JITBUF,R6        FETCH JB:PEAK FROM HIS JIT
         B        MEAN2
         PAGE
*
*        CALCULATE # OF PAGES USER HAS PRINTED
*
PRINT%POUT EQU    %
         LI,R13   0                 CLEAR COUNTER
         LI,R4    3                 LOAD LOOP COUNTER REGISTER
POUT1    EQU      %
         LW,R5    SLOTS,R4          GET DISP INTO JIT
         LW,R3    =X'FFFE0000'
         LS,R3    *JITBUF,R5        GET THE FIELD
         SLS,R3   -17               NORMALIZE IT
         AW,R13   R3                ADD EM UP
         BDR,R4   POUT1             FINISH UP
         B        MEAN2             MERGE W/COMMON PATH
*
SLOTS    EQU      %-1
         DATA     J:CPPO-J:JIT      PROCESSOR PAGE COUNT
         DATA     J:TRAP-J:JIT+1    USER PAGE COUNT
         DATA     J:INTER-J:JIT     USER DO PAGE COUNT
         PAGE
*
*        OBTAIN CURRENT SIZE IN CORE
*
CURRENT%SIZE EQU  %
         LI,R14   UB:PCT
         BAL,R0   CHK%MODE          GET ADDRESS
         NOP      %                 I
         LB,R13   *R15,R2           FETCH PAGE COUNT FROM INCORE TABLE
         B        MEAN2
         PAGE
*
*        CALCULATE CAL RATE PER SECOND
*
CAL%RATE EQU      %
         LI,R6    J:CALCNT-J:JIT    DISP INTO THE JIIT
         LW,R13   *JITBUF,R6        FETCH CAL COUNTER BUCKET
         BGZ      CAL%RATE0         IS DOING CALS OK...
         LI,R13   0                 ELSE
         B        MEAN2             SKIP CALCULATION
CAL%RATE0 EQU     %
         LI,R12   0                 CLEAR FOR DIVISION
         MI,R13   TICS%PER%SEC      FACTOR IT UP FIRST
         DW,R12   TIME              CALCNT/TICS = CALS PER SECOND
         CW,R12   TIME              CHECK FOR ROUNDING
         BL       %+2
         AI,R13   1                 ROUND UP
         B        MEAN2             GO PUT IT OUT IN DECIMAL
         PAGE
*
*        LOAD DISC/TAPE ACCESS COUNTERS
*
IO%RATE  EQU      %               CPU TIME/ACCESSES
         LI,R5    DCACCESS
         LI,R6    TPACCESS
         LI,R7    DPACCESS          DISC PACK ACCESSES
         INT,R13  *JITBUF,R6        GET TAPE I/O COUNTER
         AW,R13   *JITBUF,R5        ADD RAD ACCESSES
         AW,R13   *JITBUF,R7        ADD PAK ACCESSES
         BGZ      IO%RATE0          OK IF POSITIVE > ZERO NUMBER
         LI,R13   0                 ELSE SET IT TO ZERO
         B        MEAN2             AND SKIP THE DIVISION
IO%RATE0 EQU      %
         LI,R12   0
         MI,R13   TICS%PER%SEC      CONVERT TO SOMETHING LIKE SECONDS..
         DW,R12   TIME              ACCESSES/TIME = ACCESSES PER SECOND
         B        MEAN2
         PAGE
*
*
*
*
CONVERT  EQU      %
         B        CONVERT%HEX
         B        CONVERT%TEXT
         B        CONVERT%DEC
         PAGE
*
*        CONVERT VALUE IN R12 TO HEX IN PRINTOBUF
*
CONVERT%HEX EQU   %
         PSW,R3   STACK             SAVE R3
         LW,R3    R12               MOVE HEX VALUE
         BAL,R0   TRANSSZ           PUT IT IN W/O LEADING ZEROS
         PLW,R3   STACK
         B        *R11              AND RETURN
         PAGE
*
*        MOVE TEXT TO PRINTOBUF
*
CONVERT%TEXT EQU  %               IN:  R6 CONTRINS THE ADDRESS
         LW,R1    R6                COPY WA OF MSG
         BAL,R0   MSG               MOVE IT
         B        *R11              AND RETURN
         PAGE
*
*        MOVE STRING TO PRINT BUF USING BA IN R7
*
CT1      EQU      %
         LI,R7    BA(OBUF)          DESTINATION BA
         AW,R7    PTR               ADD CURRENT DISP INTO BUFFER
         AWM,R5   PTR               UPDATE BUF POINTER
         STB,R5   R7                STORE COUNT
         MBS,R6   0                 MOVE INTO PLACE
         B        *R11              AND RETURN
         PAGE
*
*        CONVERT HEX NUMBER IN R13 TO DECIMAL ON PRINT LINE
*
CONVERT%DEC EQU   %               IN:  AGAIN, R6 CONTAINS THE
         ENTER
         LD,R4    ACCUM%SAVE           TO BE TRANSLATED TO
         STD,R4   ACCUM                DECIMAL, SUPPRESSING
         LI,R5    0                    LEADING ZEROS
         LI,R4    BA(ACCUM)+7
         LW,R7    R13               ALL NUMBERS ARE IN R13
CD1      EQU      %
         LI,R6    0
         DW,R6    TEN
         AI,R6    X'F0'
         STB,R6   0,R4
         AI,R5    1
         CI,R7    0
         BE       CD2
         BDR,R4   CD1
CD2      EQU      %
         LW,R6    R4
         BAL,R11  CT1               MOVE IT TO PRINT  LINE
         RETURN                     AND RETURN TO CALLER
         PAGE
*
*        TITLE LINES
*
STHEADER EQU      %
  TEXTC 'USER ACCOUNT  NAME        PRV PRI PRB LN/ID   ',;
                  'STATE  PSIZ PCT CCBUF '
*
DYHEADER EQU      %
         TEXTC    'USER ',;
                  'ACCOUNT  ',;
                  'NAME         ',;
                  'CSEC ',;
                  'RSEC   ',;
                  'CALS   ',;
                  'DISCAC  ',;
                  'TAPEAC  ',;
                  'APS ',;
                  'CPS ',;
                  'LOPAGES'
         END      SPY

