*M*      ANALZO1  <<<FIRST OVERLAY OF THE ANALZYE LOAD MODULE>>>
*P*
*P*      THIS OVERLAY EXISTS SOLELY TO CONTAIN ROUTINES THAT DO NOT
*P*      REQUIRE CONSTANT CORE RESIDENCY. IT CONTAINS ROUTINES THAT
*P*      ARE DISPATCHED BY EITHER USER COMMAND OR BY THE GHOST/BATCH-
*P*      ONLINE 'ALL' DRIVER. THE FOLLOWING ROUTINES CAN BE FOUND
*P*      IN THIS MODULE;
*P*
*P*
*P*      ROUTINE                  DESCRIPTION
*P*      ------------             ---------------------------
*P*
*P*      QFREELIST                  RUNS THE FREE QUEUE CHAIN
*P*      IODISPLAY                  RUNS THE I/O CHANNEL DISPLAY
*P*      RBBREA                     ERROR RETURN FROM RBBAT RCVRY FILE
*P*                                 READ (KEYED READ ERR)
*P*      SWAPLIST                   RUNS THE OUTSWAP USER LIST DISPLAY
*P*      USERS                      RUNS THE USER TABLE DISPLAY
*P*      RBTDISP                    RUNS THE RBT DISPLAY
*P*      TPWP                       RUNS THE TRANS. PROC. DISPLAY
*P*      PAGEDISP                   PERFORMS PHYSICAL PAGE DUMPS
*P*      VIR:PAGE                   PERFORMS VIRTUAL PAGE DUMPS
*P*      REPLACEMENT                PERFORMS LOC=VALUE COMMAND
*P*      COMPARE                    PERFORMS DUMP FILE .VS. CORE COMPARE
*P*      PARTITIONS                 RUNS PARTITION DISPLAYS
*P*      ADAMDUMP                   CAN DUMP ADAM'S MEMORY
*P*      COCODE                     DISPLAYS COC TABLES
*P*      SYMBIONTS                  DUMPS THE RBBAT RCVRY FILE
*P*      SWAP                       DISPLAYS SWAP/SCHEDULER CELLS
*P*      PROCS                      DISPLAYS THE PROCESSOR TABLES
*P*      ALLYTABL                   DISPLAYS ALLYCAT'S TABLES
*P*      RA:TABL                    DISPLAYS THE READ-AHEAD TABLES
*P*
*P*      THE VARIOUS ROUTINES IN THIS OVERLAY ARE CALLED BY ONE
*P*      OF TWO METHODS; EITHER BY DIRECT USER COMMAND, OR BY
*P*      ANLZ RUNNING BATCH/ONLINE/GHOST 'ALL' MODE IN WHICH CASE
*P*      ANLZ DISPATCHES EACH OF THE ROUTINES TO DISPLAY ITS TABLES
*P*
*
 TITLE '*** A N A L Y Z E   O V E R L A Y   O N E     D 0 0 ***'
         PAGE
*
*        DECLARE PROCEDURE AND DATA CONTROL SECTION SWITCHING NAMES
*
         CSECT    1
PP       EQU      %
         CSECT    0
DATA     EQU      %
*
*        DECLARE REGISTER ASSIGNMENTS
*
R0       EQU      0                                                          A00
R1       EQU      1                                                          A00
R2       EQU      2                                                          A00
R3       EQU      3                                                          A00
R4       EQU      4                                                          A00
R5       EQU      5                                                          A00
R6       EQU      6                                                          A00
R7       EQU      7                                                          A00
R8       EQU      8                                                          A00
R9       EQU      9                                                          A00
R10      EQU      10                                                         A00
R11      EQU      11                                                         A00
R12      EQU      12                                                         A00
R13      EQU      13                                                         A00
R14      EQU      14                                                         A00
R15      EQU      15                                                         A00
         PAGE
*
*        DECLARE SYSTEM UTS REQUIREMENTS
*
UTSPROC  SET      1
MONPROC  SET      0
UFLAGS   SET      1
S69PROC  SET      1
         SYSTEM   UTS
         PAGE
*
*
*        ANALYZE LOAD MODULE INTERNAL REFERENCES
*
*
         REF      #R16            * X'0000FFFF' DATA CELL
         REF      #STATES         * LENGTH OF STATE TABLES
         REF      ATMSG           * ALLYCAT TABLE TITLE LINE
         REF      BATOQ:TIT         OUTPUT QUEUE TITLE LINE
         REF      BATIQ:TIT         INPUT QUEUE TITLE LINE
         REF      BALL            * FLAG SET SAYS DOING ALL MODE
         REF      BLANK1          * BLANK LINE OUT ROUTINE
         REF      BMBB            * BLANK/MSG/BUFOUT/BLANK ROUTINE
         REF      BUFOUT          * PUTS OUT PRINT BUF ROUTINE
         REF      CITLIMS           CLM PAIR FOR CIT LEGAL INDICES
         REF      CLOSEDCB          * CLOSES DCB IN R7 ROUTINE
         REF      CMMSG             *
         REF      COCMSG          * COC TABLE TITLE LINE
         REF      COLPT           * POINTS TO CURRENT COLUMN
         REF      CURADRSS        * CLM PAIR OF CURRENT WA'S IN BUF
         REF      DDMSG             *
         REF      DISP:PP         * DISP'S PAGE # / PAGE WA
         REF      DUMP:DIR        * SET SAYS DUMP WITH RELATIVE ADDRESSING
         REF      DUMPSOME        * ROUTINE TO DUMP SPECIFIC AREA
         REF      FIELD#          * CONTAINS CURRENT WORKING FIELD #
         REF      FIELDS          * POINTS TO FIELD BUCKETS
         REF      FIELD3          * COMMAND FIELD THREE
         REF      FREEIT          * FREE VIRTUAL PAGE FPT
         REF      FREEQS          * FREE QUEUE TITLE LINE
         REF      GETADDR         * FETCHES ADDRS IN R14
         REF      GETHEX          * RETURNS VALUE IN FIELD REQUESTED
         REF      GETLIST         * CHECKS FOR LISTED ITEMS IN COMMAND
         REF      GET1ADDR        * GET JUST ONE PAGE/# IN R1
         REF      IODISMSG        * I/O CHAN TITLE LINE
         REF      IVMSG
         REF      IOQLIMS           CLM PAIR OF VALID IOQ INDICES..
         REF      JITSTAT         * READING JIT STATUS WORD
         REF      LASTLOC         * LAST WA WE DUMPED OUT
         REF      LOCLOC          * ROUTINE TO GET LOC TO LOC COMMAND
         REF      LOOKING         * SET SAYS NO ERR MSG - JUST LOOKIN..
         REF      M:EI            * DUMP INPUT DCB FOR ANALZ
         REF      MAPFLAG         * INDICATES MAPPED/NOT MAPPED
         REF      MB              * MOVE MSG AND PRINT IT ROUTINE
         REF      MBB             * PUTS OUT MSG/BLANK ROUTINE
         REF      MONFLAG         * SET SAYS LOOKING AT CORE
         REF      MSG             * ROUTINE TO MOVE TEXTC MSG
         REF      MSG%OUT         * BLANK/MSG/PRINT/BLANK ROUTINE
         REF      MSG1            * ROUTINE TO MOVE TEXT  MSG
         REF      NEXTLOC         * RETURNS NEXT FIELD VALUE
         REF      NOFILMSG        * MSG TO SAY ' NO FILE OPEN ' ETC..
         REF      NOGOT           * 'PRIV LOW' MSG OUT ROUTINE
         REF      NOSADPAGE       * 'CANT GET SAD BUF' ROUTINE
         REF      NOTRACE         * ROUTINE TO SAY 'DOES NOT EXIST'
         REF      OBUF            * PRINT BUFFER IN ROOT
         REF      OLDPAGE         * LAST PHYSICAL PAGE WE READ
         REF      PAGEBUF         * POINTS TO NORMAL DUMP INPUT BUF
         REF      PAGERR0         * 'NO FILE OPEN' ROUTINE
         REF      PAGETABLE       * POINTS TO CORE MATRIX TABLE
         REF      PARTABMSG       * PARTITION DISP TITLE LINE
         REF      PARTRES           * TITLE LINE FOR PARTITION LIMITS
         REF      PG:MODE         * OWNER OF PAGE INDICATOR
         REF      PREMEM            * REMEMBER PAGE # ROUTINE IN ROOT
         REF      PROCNAME        * DBL-WORD SLOT FOR PROC NAMES
         REF      PROTMSG         * PROCESSOR INSWAP TITLE LINE
         REF      PTR             * POINTS TO CURRENT SPACE COLUMN
         REF      PUSHMSG         * ROUTINE TO PRINT MSG/GO TO SCANNER
         REF      RA:TITE         * READ AHEAD TABLE TITLE LINE
         REF      RBTBUFTM          * RBT BUF TITLE MSG
         REF      RBTITLE         * RBT TITLE LINE
         REF      REPFLAG         * SET IF EQUAL SIGN FOUND IN COMMAND
         REF      RERR1             * SNAPS I/O ERROR ROUTINE
         REF      RES:BUF         * RESTORE CVM BUFFERS
         REF      RES:JIT5        * 'INVALID USER #' ROUTINE
         REF      RESETM          * CRASH ALL POINTERS ROUTINE
         REF      SADCAL1         * SAD CAL FPT FOR COMPARISON
         REF      SCANNER         * PARSES ALL COMMANDS
         REF      SDMSG             *
         REF      SETR6           * ROUTINE TO PUT STATE TEXT MSG IN R6
         REF      SPACES          * SPACES OVER THE PRINT LINE
         REF      SPACE2          * TWO SPACES ROUTINE
         REF      STACK           * ANLZ'S PUSH DOWN STACK
         REF      SWAPMSG         * SWAPPER TABLE TITLE LINE
         REF      SYMTAB          * RBBAT RECOVERY FILE TITLE LINE
         REF      TATTLE            * TELLS OPERATOR ABOUT CORE CHANGE
         REF      TITEL           * PRINT TITLE LINE W/NEW PAGE
         REF      TPHDR           * TRANS/PROCESSING TITLE LINE
         REF      TRANS           * TRANS W/O LEAD ZEROES ROUTINE
         REF      TRANSSZ         * TRANS W/LEAD ZEROS
         REF      TPHDR2            * TP PAGES TITLE LINE
         REF      ULSTSIZE          * LENGTH OF USERLIST TABLE
         REF      USER            * CONTAINS USER NUMBER
         REF      USERLIMS        * CLM PAIR OF VALID USER NUM'S
         REF      USERLIST        * BYTE TABLE SMUIS LONG
         REF      USRTMSG         * USER TABLES TITLE LINE
         REF      U2:TITE         * ADDITIONAL USER TABLE TITLE LINE
         REF      VIRPAGE1        * SAD CAL FPT FOR DUMP COMPARISONS
         REF      X1FF            * CONTAINS X'000001FF' - PAGE X MASK
         PAGE
*
*    MONITOR REFERENCES
*
         SREF     #SWAP%DEV       *# OF SWAPPER DEVICES
         SREF     ADJSTCNT        * #GRANULES ALLYCAT GAVE/TOOK
         SREF     ARSZ            * CURRENT READ SIZE
         SREF     BOTTOM          * POINTER TO BOT OF ALLYCAT'S BUF
         SREF     BUFCNT          *##BUFS IN USE FOR LINE
         SREF     BUFLAGS         * ALLYCAT BUFFER FLAGS
         SREF     CBAHD           *HEAD OF ALLYCATS COMBUF CHAIN
         SREF     CBFHD           *HEAD OF ALLYCATS FREE CHAIN
         SREF     CITSIZ          * LENGTH OF CIT TABLES
         SREF     CIT1            * FORWARD LINK CHAN TABLE
         SREF     CIT2            * BACK LINK CHAN TABLE
         SREF     CIT3            * CHANNEL FLAGS CHAN TABLE
          SREF    COC             *BASE ADDRS OF COC HANDLERS
         SREF     COCII           * INSERT INDEX FOR LINE INPUT
         SREF     COCIR           * CURRENT REMOVE POINT FOR INPUT
         SREF     COCOC           * REMAINING CHARS TO GO OUT
         SREF     COCOI           * INSERT POINT FOR OUTPUT
         SREF     COCOR           * CURRENT REMOVE POINT FOR OUTPUT
         SREF     COCTERM         * TERMINAL TYPE THIS LINE
         SREF     COMBUF          *START ADDRS OF ALLYCAT BUFFERS
         SREF     CPI             * INITIAL CARRAIGE POSITION READ
         SREF     CPOS            * CARRAGE POSITION
         SREF     DCTSIZ          * SIZE OF DCT TABLES
         SREF     DCT1            * DEVICE ADDRESS
         SREF     DCT12           * SIO STAT/OR REAL TIME END ACTION
         SREF     DCT13           * TDV STAT DBL-WORD
         SREF     DCT16           * CANNED DEVICE TEXT MSG
         SREF     DCT2            * CIT INDEX
         SREF     DCT3            * DEVICE FLAGS
         SREF     DCT5            * ADDITIONAL DEVICE FLAGS
         SREF     DCT6            * QUEUE HEAD POINTER (IOQS)
          SREF    DID%IO          *FLAG INDICATING SWAPPER RUNNING MODE
         SREF     EOMTIME         * ACTIVATION TIME TABLE
         SREF     GRAVAIL         * GRANULES OF THAT TYPE REMAINING
         SREF     IOQ1            * FWD LINK IOQ TABLE
         SREF     IOQ10           * # OF RETRIES AS REQUESTED
         SREF     IOQ11           * # OF RETRIES LEFT
         SREF     IOQ12           * PHYSICAL RAD/DISC ADDRESS
         SREF     IOQ13           * END ACTION ADDRS/INFO
         SREF     IOQ14           * I/O PRIORITY
         SREF     IOQ15           * USER'S NUMBER
         SREF     IOQ16           * ECB ADDRESS
         SREF     IOQ2            * BAK LINK "   "   "
         SREF     IOQ3            * IOQ FLAGS
         SREF     IOQ4            * ORIGINAL FUNCTION STEP IOQ TABLE
         SREF     IOQ5            * CURRENT FUNCTION STEP "   "  "
         SREF     IOQ6            * DCB SLOT IN IOQ TABLES
         SREF     IOQ7            * CLIST ADDRS
         SREF     IOQ8            * #CDW'S / OR BYTE COUNT
         SREF     IOQ9            * BA OF BUF / OR CLIST DA
         SREF     JB:PRIV         *PRIVELEGE LEVEL CELL IN JIT
         SREF     LB:UN           *CCOC USER NUMBER
          SREF    LNOL            *NO. OF COC LINES IN SYSTEM
         SREF     LPART           * LENGTH OF PARTITION TABLES
         SREF     LSWAP           *LENGTH OF SWAPPER DEVICE TABLES
         SREF     M:CLBGN         *BEGIN OF CLIST ADDRS TABLE
         SREF     M:SWAPD         *SWAP DEVICE TABLE
         SREF     MB:#RTRY        * #OF RETRIES LEFT TO PERFORM
         SREF     MB:SDI          *SWAP DEVICE INDEX TABLES
         SREF     MB:SFC          * SWAPPER FUNCTION CODE
         SREF     MH:CLEND        *END OF CLIST TABLE
         SREF     MODE            * VARIOUS COC FLAGS
         SREF     MODE2           * VARIOUS COC FLAGS
         SREF     MODE3           * VARIOUS COC FLAGS
         SREF     MODE4           * VARIOUS COC FLAGS
         SREF     MODE5
         SREF     MODE6
         SREF     P:NAME          *PROC NAME TABLE
         SREF     P:SA            *PROC START ADDRESS TABLE
         SREF     P:TCB           *PROC'S TCB ADDRESS
         SREF     PB:C#           *PROCESSOR PROCEDURE CYLINDER #
         SREF     PB:DC#          *PROC DATA CYLINDER # IF DP SWAPPER
         SREF     PB:DCBSZ        *PROC DCB SIZE TABLE
         SREF     PB:DSZ          *PROC DATA SIZE TABLE
         SREF     PB:HVA          *
          SREF    PB:LCT          * PROC LOCKED IN CORE TABLE
         SREF     PB:LNK          *LINK TO PROC'S OVERLAY
         SREF     PB:PSZ          *PROC PROCEDURE SIZE TABLE
         SREF     PB:PVA          *PROC'S VIRTUAL PAGE # START
         SREF     PB:UC           *PROC USE COUNTER
         SREF     PH:DDA          *PROC DATA DISC ADDRS
         SREF     PH:PDA          *PROC DATA DISC ADDRS
         SREF     PLB:MAX         *"   "   "   "   "  "MAX RESOURCES
         SREF     PLB:MIN         *PARTITION TABLE FOR MIN RESOURCES
         SREF     PLB:USR         * USER NUMBER OF JOB IN THIS PART.
         SREF     PLD:ACT         * ACCOUNT # OF JOB IN THIS PART.
         SREF     PLH:CUR         * CURRENT #OF JOBS SELECTED TO RUN HERE
         SREF     PLH:FLG         * PARTITION FLAGS
         SREF     PLH:QN          * QUANTUM IN THIS PARTITION
         SREF     PLH:SID         * SYMBIONT SYSTEM ID # IN PARTITION
         SREF     PLH:TL          * UPPER TIME LIMIT FOR PARTITION
         SREF     PLH:TOL         * #JOBS HAVE RUN IN THIS PARTITION
         SREF     PLH:TU          * LOWER TIME LIMIT FOR PARTITION
         SREF     PNAMEND         * LENNGTH OF SHORT PROC'S TABLES
         SREF     PPROCS          *MAX LENGTH OF PROCESSOR TABLES
         SREF     PWPEND          *END OF WORK PAGE TABLE FOR T.P.
         SREF     PWPTABLE        *WORK PAGE TABLE FOR TRANS/PROC.
         SREF     PX:HPP          *PROC HEAD PAGE # TABLE
         SREF     PX:TPP          *PROC TAIL PAGE # TABLE
         SREF     QFREE           * POINTS TO HEAD OF FREE IOQ CHAIN
         SREF     RA:DA           * DISC ADDRESS
         SREF     RAB:BLINK       * LINK TO NEXT OLDEST ENTRY
         SREF     RAB:FLINK       * LINK TO NEXT NEWEST ENTRY
         SREF     RAB:USER        * USER NUMBER OF THIS ENTRY
         SREF     RAH:DCB         * 16 BITS OF DCB ADDRESS
         SREF     RAH:TIME        * ENTRY GOTTEN TIME
         SREF     RASIZE          * LENGTH OF RA TABLES
         SREF     RAX:PAGE        * PHYSICAL PAGE FOR BUF
         SREF     RB:BUF          * ADDRESS OF CONTEXT AREA FOR IRBT
         SREF     RB:FLAG         * RBT FLAGS
         SREF     RBB:BCB         * EXPECTED BCB COUNT ON IRBT LINE
         SREF     RBB:CPZ         * 7670/2780 RECORD LENGTHS
         SREF     RBB:HFE         * FREE CHAIN POINTER
         SREF     RBB:HIN         * INPUT CHAIN POINTER
         SREF     RBB:HOU         * OUTPUT CHAIN POINTER
         SREF     RBB:ID          * BYTE TABLE OF RBID'S
         SREF     RBB:LPZ         * 7670/2780 RECORD LENGTHS
         SREF     RBB:SFC         * 7670 FLAGS
         SREF     RBB:SPC         * 7670 PRINT FORMAT FLAGS
         SREF     RBD:WSN         * WORK STATION NAME FOR IRBT
         SREF     RBH:ACK         * BUF FOR SHORT MSGS
         SREF     RBLIMS          * CLM PAIR OF RBT DCTX'S
         SREF     RSZ             * USER REQUESTED MSG SIZE
         SREF     S:ACORE         * ABS CORE AVAIL
          SREF    S:BFIS          * BATCH FILES IN SYSTEM
         SREF     S:BUIS          * BATCH USERS IN SYSTEM
         SREF     S:CUIS          *CURRENT USERS IN SYSTEM
         SREF     S:CUN           *CURRENT USER'S USER #
          SREF    S:CUP           *CURRENT USER'S PRIORITY
         SREF     S:EVF           *EVENT OCCURED FLAG FOR SCHED
         SREF     S:FSEVF         *SCHEDULER SAVE CELL
          SREF    S:GUIS          * GHOSTS CURRENTLY IN SYSTEM
         SREF     S:HIR           * HIGH PRIORITY EVENT OCCURED
         SREF     S:ISUN          *INSWAP USERS USER NUM
         SREF     S:ISUNF         *S:ISUN SAVE CELL FOR SWAP SCHED
         SREF     S:LCORE         * LOCKED UP CORE
         SREF     S:OPC           *OVERLAY PROTECT COUNTER
         SREF     S:OSS           * SWAP SCHEDULER CELL
          SREF    S:OUIS          * ONLINE USER IN SYSTEM
         SREF     S:PCORE         * CORE AVAIL FOR USERS
         SREF     S:PCT           *# PAGES REQUIRED FOR SWAP
          SREF    S:PFNI          * FREE PROC LIST TABLE
         SREF     S:PRPC          *PROCESSOR PROTECT COUNTER
         SREF     S:RTCORE        * REAL TIME CORE COUNTER
         SREF     S:SEVF          *S:EVF MATCHUP CELL FOR SCHED
         SREF     S:SIP           *FLAG SET SAYS SWAPPER RUNNING
         SREF     S:STL#          * STOLEN PAGE COUNT
         SREF     S:STLC          * STOLEN PAGE COUNTER
         SREF     SB:FPL          *FREE PROCESSOR LIST TABLE
         SREF     SB:NP           * INSWAP PROC. LIST
         SREF     SB:OSN          * OUTSWAP USER LIST
         SREF     SH:RNM          * RESOURCE NAME TABLE
         SREF     SL:BIMF         * UNBLOCK MF COUNT FOR BATCH
         SREF     SL:BXMF         * BLOCK MF COUNT FOR BATCH
         SREF     SL:CORE         * SYSGENED CORE
         SREF     SL:OIMF         * UNBLOCK MF COUNT FOR ONLINE
         SREF     SL:OPC          * OVERLAY PROTECTION COUNTER
         SREF     SL:OXMF         * BLOCK MF COUNT ONLINE
         SREF     SL:QMIN         * MIN USER QUANTUM
         SREF     SL:QUAN         * MAX USER QUANTUM
         SREF     SL:RSVP         * RESERVED PAGE COUNT
         SREF     SL:SQUAN        * QUANTUM TILL CHOSEN FOR SWAP
         SREF     SL:STLM         * STOLEN PAGE MAX COUNT
          SREF    SMAXOUT         * MAX USERS OUT VALUE
         SREF     SMUIS           *MAX USER IN SYSTEM FROM SYSGEN
         SREF     SPDBASE         *SHARED PROC DATA BASE ADDRESS
         REF      SPOOL             * SYMBIONT WORK PAGE WA CELL
         SREF     SV:RSIZ         * LENGTH OF RESOURCE TABLES
         SREF     TEMPBOT         * TEMPORARY BOTTOM WHILE CAT CHANGES BUF
         SREF     TL              * LINK TO INPUT BUF FOR RUBOUT
         SREF     TOP             * POINTER TO TOP OF ALLYCAT'S BUF
         SREF     U:MISC          *USER TABLE OF SLP VALUES
         SREF     UB:ACP          *USER ASSOCIATED PROC TABLE
         SREF     UB:MPFLG          MULTI-PROCESSING TABLE
         SREF     UB:CALR           "   DITTO     "
         SREF     UB:APO          *ASSOCIATED PROC OVERLAY TABLE
         SREF     UB:APR          *ASSOCIATED PROC TABLE
         SREF     UB:ASP          *ASSOCIATED SHARED PROCESSOR TABLE
         SREF     UB:BL           *BAK LINK TO USER IN SAME STATE
         SREF     UB:C#           *USER PROCEDURE CYL NUM
         SREF     UB:DB           *ASSOCIATED DEBUGGER TABLE
         SREF     UB:FL           *FWD LINK TO USER IN SAME STATE
         SREF     UB:MF           *# OF I/O'S OUTSTANDING TABLE
         SREF     UB:NECB         * USER TABLE FOR DO-LIST STUFF
         SREF     UB:OV           *ASSOCIATED OVERLAY TABLE
         SREF     UB:PCT          *USER PAGE COUNT  TABLE
         SREF     UB:PRIO         *USER PRIORITY TABLE
         SREF     UB:PRIOB        *USER PRIORITY BASE TABLE
         SREF     UB:SWAPI        *SWAP TABLE INDEX USER TABLE
         SREF     UB:US           *USER'S STATE TABLE
         SREF     UH:AJIT         *USER'S AJIT TABLE OF DISC ADDRSS
         SREF     UH:DL           *USER DO LIST POIINTER
         SREF     UH:FLG          *FIRST USER FLAGS TABLE
         SREF     UH:FLG2         *SECOND USER FALGS TABLE
         SREF     UH:JIT          * USER JIT DISC ADDRESS TABLE
         SREF     UH:WL           *WORK LIST POINTER
         SREF     UX:JIT          *USER JIT PAGE # TABLE
         SREF     U:CALC            CAL COUNTER IN MP SYSTEMS
         SREF     WORDCNT         * #OF DISC ADDRS'S IN ALLYCAT'S BUF
         PAGE
*
*        INTERNAL DEFS
*
         DEF      ADAMDUMP        * DUMPS ADAM IF IN SYSTEM
         DEF      ALLYTABL        * DUMPS ALLYCAT'S TABLES
         DEF      COCODE          * DUMPS COC TABLES
         DEF      COMPARE         * DUMP FILE .VS. CORE COMPARISON
         DEF      IODISPLAY       * RUNS THE I/O CHAN DISP.
         DEF      PAGEDISP        * RUNS PHYSICAL PAGE DUMP
         DEF      PARTITIONS      * DUMPS PARTITION TABLES
         DEF      PROCS           * DUMPS PROCESSOR TABLES
         DEF      QFREELIST       * RUNS THE FREE QUEUE LIST
         DEF      RA:TABL         * DUMPS READ AHEAD TABLES
         DEF      RBBREA          * ERR RETURN FROM RBBAT FILE READ
         DEF      RBTDISP         * RUNS RBT TABLE DISP.
         DEF      REPLACEMENT     * RUNS CHANGE LOC ROUTINE
         DEF      SWAP            * DUMPS SWAPPER TABLES
         DEF      SWAPLIST        * RUNS USER SWAP LIST
         DEF      SYMBIONTS       * DUMPS RBBAT RCVRY FILE
         DEF      TPWP            * RUNS TRANS. PROC. TABLES
         DEF      USERS           * RUNS USER TABLE DISP.
         DEF      VIR:PAGE        * RUNS VIRTUAL PAGE DUMP
*
*
*
         PAGE
*
*    PROC FOR PARTITION TABLES
*
PARTAB   DSECT    1
LIPART   DSECT    1
LWPART   DSECT    1
PNUM     SET      0
PTAB     CNAME    1
PTAH     CNAME    2
PTAW     CNAME    3
         PROC
         LOCAL    A
A        SET      %
         USECT    LIPART
         LI,14    AF(1)
         USECT    LWPART
         DO       NAME=1
         LB,3     *15,5
         ELSE
         DO       NAME=2
         LH,3     *15,5
         ELSE
         LW,3     *15,5
         FIN
         FIN
         USECT    PARTAB
         DATA,1   AF(2)
PNUM     SET      PNUM+1
         USECT    A
         PEND
         PAGE
*
*F*
*F*    NAME:           PARTITIONS
*F*
*F*    PURPOSE:        TO DISPLAY ALL OR A SELECTED LIST OF PARTITIONS.
*F*
*F*    DESCRIPTION:    SCANNER PARSES THE COMMAND LINE - DISCOVERS
*F*                    THE DISPLAY PARTITIONS COMMAND AND COMES
*F*                    HERE WITH A RETURN LINK IN R1.
*F*                    PARTITIONS WILL UTILIZE THE 'GETLIST' ROUTINE
*F*                    TO DISPLAY THE SELECTED LIST - OR DISPLAY ALL
*F*                    IF NO OPTIONS WERE GIVEN.
*F*
*
*        COMMAND FORMAT.
*
*        DI(SPLAY)  PA(RTITION) 1(,2)(,3)(,4)(,5)
*
*        LIST OF NUMBERS IS OPTIONAL - NO LIST IMPLIES TO DISPLAY
*        ALL OF THE PARTITIONS
*
         USECT    PP                GENERATE PROCEDURE
PARTITIONS  EQU   %                *
         LI,R1    0               * RESET THE OPTION INDICATOR
         STW,R1   CURR%STATE      * BEFORE DOING ANYTHING
         LH,R1    FIELD3          * CHECK FIRST
         AND,R1   #R16            * FOR LIMITS REQUEST
         CI,R1    'LI'            * USER WANT TO SEE PARTITON LIMITS
         BE       PAR:LIMS          * YES-SHOW THEM
         LI,1     PARTABMSG        *
         BAL,0    TITEL            *SHOVE OUT TITLE LINE
         LI,1     PARTMSG          *HEADER
         BAL,R0   MB              * MSG/BUFOUT
         LI,R1    PARTMSG1        * OTHER PART OF HEADING
         BAL,R0   MBB             * OUTPUT
         LI,1     2                *CHECK FOR SECOND FIELD
PARTITI0 EQU      %                *
         LI,R6    LPART            *ASSUME WE WILL DO THEM ALL
         BAL,R0   GETHEX           *CHECK FOR AN OPTION FIELD
         LW,R5    R2               *IS THERE AN OPTION PRESENT
         BEZ      PARTITI1         *NO - DO ALL PARTITIONS
         CI,R5    LPART            *IS VALID PARTITION NUMBER
         BG       SCANNER          *NO - STOP NOW
         MTW,1    CURR%STATE      * SET OPTIONS COMING IN FLAG
         AI,R5    -1               *CORRECT FOR BUMP AT PARTITI2
         LI,R6    1                *SET FOR ONE LOOP THRU TABLES
PARTITI1 EQU      %                *
         LI,R4    0                *INDEX INTO INTERNAL TABLES
         LI,R7    #OFPARTS         *LENGTH OF INTERNAL TABLES
PARTITI2 EQU      %                *
         AI,R5    1                *POINT TO 'NEXT' PARTITION ROW
         LW,R3    R5               *MOVE PART # FOR TRANSLATION
         BAL,R0   TRANSSZ          *TRANSLATE IT
PARTITI3 EQU      %                *
         LB,R1    PARTAB,R4        *GET SPACING
         BAL,0    SPACES           *PUT SPACING OUT
         EXU      LIPART,R4        *GET ADDRESS OF PART TABLE
         BAL,R0   GETADDR          *AND FETCH IT
         CI,R4    0                *ON ACCOUNT # TABLE
         BGZ      PARTITI4         *NO
         LD,R8    *R15,R5          *GET ACCOUNT NUMBER FROM TABLE
         BEZ      PARTITI6         *NONE - SKIP
         LI,R2    8                *COUNT OF CHARS IN ACN
         LI,R1    8                *ADDRESS OF ACN
         BAL,R0   MSG1             *PUT ACN INTO PRINT LINE
         B        PARTITI6         *AND JUMP TO MERGE
PARTITI4 EQU      %                *
         EXU      LWPART,R4        *PICK UP VALUE FROM PART TABLE
         EXU      PART:ACT,R4      *PERFROM CLEANUP ON HALF WORDS
PARTITI5 EQU      %                *
         BAL,R0   TRANSSZ          *PUT INTO PRINT LINE
PARTITI6 EQU      %                *
         AI,R4    1                *NEXT INDEX INTO INTERNAL TABLES
         BDR,R7   PARTITI3         *FINISH THIS ROW OF PRINT
         BAL,R0   BUFOUT           *AND PRINT EVERYTHING
         BDR,R6   PARTITI1         *DO NEXT PARTITION
         LW,R1    FIELD#          * GET CURRENT FIELD #
         LW,R2    FIELDS,R1       * GET FIELD BUCKET ADDRESS
         BEZ      PAR:RES         * AT END - BRANCH
         LW,R2    0,R2            * GET VALUE
         BEZ      PAR:RES         * NONE - GO
         LI,R6    PARTITI0        * SET RETURN
         B        GETLIST         * AND GO CHECK FOR LIST OF ITEMS
         PAGE
*
*        TABLES TO DRIVE PARTITION DISPLAY
*
         PTAW     PLD:ACT,3       * 0
         PTAB     PLB:USR,12      * 1
         PTAH     PLH:FLG,19      * 2
         PTAH     PLH:QN,24       * 3
         PTAH     PLH:TOL,29      * 4
         PTAH     PLH:CUR,35      * 5
         PTAH     PLH:TL,44       * 6
         PTAH     PLH:TU,49       * 7
         PTAH     PLH:SID,55      * 8
         PTAB     UB:APR,64       * 9
*
PART:ACT EQU      %
         NOP                      * 0
         STW,R3   USER            * 1
         B        HALF:PART       * 2
         B        HALF:PART       * 3
         B        HALF:PART       * 4
         B        HALF:PART       * 5
         B        HALF:PART       * 6
         B        HALF:PART       * 7
         B        HALF:PART       * 8
         B        USERAPR         * 9
#OFPARTS EQU      %-PART:ACT
*
HALF:PART EQU     %
         AND,R3   #R16              MASK HALF-WORD ENTRIES
         B        PARTITI5          REJOIN MAIN PATH.....
*
*
PARTMSG EQU       %
 TEXTC '#  ACCOUNT  USER   FLAG QUAN JOBS  JOBS       TIME',;
                  '     SYSTEM  PROCESSOR'
PARTMSG1 EQU      %
 TEXTC '            #                TOL   CURRENT  LOW  HIGH',;
                  '  ID      IN USE'
*
#MSG     TEXTC    '#'
RES:SPC  EQU      %
         DATA,1 1,7,14,21,28,35,42,49,56,63,70,77,84,91,98,105,112
         BOUND    4
#MSG1    TEXTC    '-'
*
BYTEX    CNAME    18
BYTE     CNAME    X'F2'
ZIP      CNAME    0
HALF     CNAME    X'D2'
WORD     CNAME    X'B2'
DWORD    CNAME    X'92'
         PROC
         DO       SCOR(CF(1),BYTEX)
         GEN,1,1,1,5    1,1,1-:BIG,NAME
         ELSE
         GEN,8    NAME
         FIN
         PEND
*
         PAGE
*
*        CHECK TO SEE IF USER IS ASSOCIATED WITH A PROCESSOR
*
USERAPR  EQU      %
         LW,R2    USER              DID PARTITION HAVE A USER #
         BEZ      PARTITI6          NO - GO ON
         CI,R2    SMUIS             IS VALID #
         BG       PARTITI6          NO - GO ON
         LB,R3    *R15,R2           GET USER'S UB:APR ENTRY
         BEZ      PARTITI6          NONE - GO ON
         LI,R14   P:NAME            GOT ONE
         BAL,R0   GETADDR           FETCH PROCESSOR NAME TABLE
         LD,R14   *R15,R3           GET THE PROCESSOR NAME
         AND,R14  =X'07FFFFFF'      LIMIT NAME TO 7 CHARACTERS
         STD,R14  PROCNAME          SAVED
         LI,R1    PROCNAME          POINT TO IT
         BAL,R0   MSG               FOR MSG TO MOVE IT
         B        PARTITI6          AND GO PRINT THE WHOLE THING
         PAGE
*
*        RUN THE PARTITIONS RESOURCE LIMITS DISPLAY
*
PAR:RES  EQU      %
         MTW,0    BALL              DOING ALL OPTIONS
         BEZ      SCANNER           NOPE
         MTW,0    CURR%STATE      * DID WE DO ALL PARTITIONS
         BNEZ     SCANNER         * NO - RETURN TO SCANNER
PAR:LIMS EQU      %
         LI,R1    PARTRES         * MSG ADDRS
         BAL,R0   TITEL           * OUTPUT
         LI,R1    #MSG
         BAL,R0   MSG             *
         LI,R4    1               * INDEX INTO SH:RNM
         LI,R5    SV:RSIZ         * LENGTH OF RESOURCE TABLES
         BEZ      SCANNER         * NONE
         LI,R2    1               * INDEX INTO SPACING TABLE
PAR:RES0 EQU      %               *
         LB,R1    RES:SPC,R2      * GET NEXT SPACING
         BAL,R0   SPACES          * OUTPUT
         LI,R14   SH:RNM          * NAME TABLE ADDRESS
         BAL,R0   GETADDR         * PICK IT UP
         LH,R15   *R15,R4         * GET A NAME FROM TABLE
         AND,R15  #R16            * CLEAR SIGN EXTENSION
         SLS,R15  8               * POSITION TO INSERT
         OR,R15   =X'02000000'    * A BYTE COUNT
         STW,R15  PROCNAME        * STORE THE MSG
         LI,R1    PROCNAME        * POINT MSG'S POINTER TO IT
         BAL,R0   MSG             * AND PUT OUT RESOURCE NAME
         AI,R2    1               *
         AI,R4    1               * NEXT RESOURCE NAME INDEX
         BDR,R5   PAR:RES0        * GET IT
         BAL,R0   BUFOUT          * PRINT EM ALL
         BAL,R0   BLANK1          * BLANK A LINE HERE
         LI,R7    1               * INITIAL PARTITION NUMBER
PAR:RES1 EQU      %               *
         LW,R5    R7              * MOVE PARTITON NUMBER TO CALUCLATE
         MI,R5    SV:RSIZ+1       * INDEX INTO SH:RNM TABLE
         LW,R3    R7              * MOVE PARTITON #
         BAL,R0   TRANSSZ         * AND PUT IT OUT
         LI,R4    SV:RSIZ         * LOAD LOOP COUNTER
         LI,R2    1               * LOAD INDEX INTO SPACING TABLE REG.
PAR:RES2 EQU      %               *
         AI,R5    1               * NEXT INDEX
         LI,R14   PLB:MIN         *
         BAL,R0   GETADDR         * PICK UP MAX RESOURCE TABLE
         LB,R1    RES:SPC,R2      * NEXT SPACING
         BAL,R0   SPACES          * OUT
         LB,R3    *R15,R5         * GET FIRST VALUE
         BAL,R0   TRANSSZ         * PUT OUT
         LI,R14   PLB:MAX         * NOW MAX TABLE
         BAL,R0   GETADDR         * GET IT
         LI,R1    #MSG1           * PUT A DASH BETWEEN EM
         BAL,R0   MSG             *
         LB,R3    *R15,R5         * GET MIN VALUE
         BAL,R0   TRANSSZ         * OUT
         AI,R2    1               *
         BDR,R4   PAR:RES2        * GET NEXT ENTRY
         BAL,R0   BUFOUT          * PRINT THE ENTIRE LINE
         AI,R7    1               * STEP TO NEXT PARTITION NUMBER
         CI,R7    LPART           * HAVE WE DONE ALL OF THEM YET
         BLE      PAR:RES1        * NOT YET
         B        SCANNER         * YES - ALL DONE
         PAGE
*
*F*
*F*    NAME:           SYMBIONTS
*F*
*F*    PURPOSE:        TO PRODUCE A DUMP OF THE RBBAT RECOVERY INFO
*F*                    THAT HAS BEEN MOVED INTO THE MONDMP FILE BY
*F*                    FIX.
*F*
*F*    DESCRIPTION:    SYMBIONTS WILL ATTEMPT TO READ EACH OF THE
*F*                    POSSIBLE KEYED RECORDS AND DUMP THE DATA
*F*                    IF THE RECORD IS THERE.
*F*                    ONCE EACH OF THE RECORDS HAS BEEN DUMPED
*F*                    SYMBIONTS RETURNS TO THE SCANER.
*F*
*F*                    NOTE THAT SYMBIONTS USES A BUFFER IT GETS
*F*                    VIA M:GP'S. IT IS POSSIBLE IN SOME SYSTEMS
*F*                    TO NOT BE ABLE TO GET ENUFF PAGES TO DUMP THE
*F*                    LARGEST RBBAT RCVRY FILE RECORD.
*F*
*
*        COMMAND FORMAT.
*
*        DI(SPLAY)   SY(MBIONT)
*
SYMBIONTS EQU     %
         MTW,0    RVRBUF            ALREADY HAVE A BUFFER
         BGZ      SYMBIONTS1        YES JUMP
         LW,R7    FPGSCOPY          INIT
         STW,R7   FPGS              THE FREE PAGE FPT TO ZERO
         LI,R7    2048
         STW,R7   RDVC              INIT THE READ SIZE TO ONE PAGE
         LI,R7    0
         STW,R7   DID:RVR           ZAP I/O FLAG
         BAL,7    GETONE            GET A PAGE TO READ FILE WITH
         BCS,8    NOBUF             CANT GET ONE
         MTW,1    FPGS              KEEP PAGE COUNT RIGHT
         STW,9    RVRBUF            SET UP CAL FPT
         AI,R9    511               BOOST TO PAGE UPPER LIMIT
         STW,R9   RVRBUF+1          AND CREATE CLM PAIR
         MTW,0    MONFLAG           ARE WE  IN MONITOR DISPLAY MODE
         BNEZ     ASK:RBBAT         YEP--GO GOOSE  RBBAT
SYMBIONTS1 EQU    %
         LI,4     4
SYMBLOOP EQU      %
         LW,1     KEYS,4
*
*
SYMBLOOP1 LCFI    1                 SET FLAG
         STCF     JITSTAT           IN CASE OF KEY ERROR
         CAL1,1   RDRVR             READ A RECORD
         MTW,1    DID:RVR           INDICATE WE READ SOMETHING
         PSW,R4   STACK             SAVE CURRENT INDEX
         EXU      SROUTE,R4         DISPATCH PROPER ROUTINE
SYMBLOOP2 EQU     %
         PLW,R4   STACK             RESTORE INDEX
         LW,R1    RBBMSGS,R4        GET ADDRESS OF TITLE LINE
         BAL,R0   TITEL             AND PUT IT OUT
         MTW,1    DUMP:DIR          SET FLAG TO DUMP FROM MY MEMORY
         LW,8     RVRBUF            GOT IT,SVET ADDRS OF BUF
         LW,R7    M:EI+13                                                    A00
         AI,7     3
         SLS,7    -2
         BAL,0    DUMPSOME
SYMOUT   BDR,4    SYMBLOOP
SYMOUT1  EQU      %
         LI,R7    0                 ERASE
         STW,R7   RVRBUF            THE BUFFER POINTER
         STW,R7   RVRBUF+1          AND THE UPPER LIMIT POINTER
         CAL1,8   FPGS              FREE UP PAGES
         LI,R1    0                 CHECK
         XW,R1    DID:RVR           IF WE  DID  ANYTHING
         BNEZ     SCANNER           YUP
         LI,R1    SYMTAB            BETTER PUT OUT A TITLE LINE
         BAL,R0   TITEL             ..
         LI,R1    0                 NOPE
         XW,R1    RBMSG             ANY  MSG TO TELL
         BEZ      %+2               NO
         BAL,R0   MBB               YUP
         LI,R10   0                 ANY I/O ERRORS
         XW,R10   RBIOERR
         BEZ      SCANNER           NOPE
         LI,R2    SCANNER           YUP
         B        RERR1             TELL USER  BOUT I/O ERROR
         PAGE
*
*F*      NAME:    RBBREA
*F*      PURPOSE: TO RECEIVE THE RETURN FROM THE ROOT FILE READ ERROR
*F*               ROUTINE. THIS ROUTINE DETERMINES WHAT IF ANY ACTION
*F*               SHOULD BE TAKEN ON THE ERROR. NOTE THAT IT IS
*F*               POSSIBLE FOR THE RECORD JUST NOT TO HAVE BEEN IN
*F*               THE RBBAT RCVRY FILE.
*
RBBREA   EQU      %
         LH,R3    M:EI              GET DCB FIRST 16 BITS
         CI,R3    X'0020'           IS THE DCB OPEN NOW....
         BAZ      M:EI%NOT%OPEN     NOPE - COMPLAIN ABOUT IT
         LI,R3    1                 SET FLAG IF DCB OPEN
         LB,2     10                EXTRACT MAJOR I/O CODE
         CI,2     7                 IS LOST DATA
         BE       MORPAGE           YES - GET ANOTHER PAGE
         LI,1     RBNFL             SET ERR MSG
         CI,2     3                 IS A 'NO FILE'
         BE       OUTARND           YES - SAY NO FILE THERE
         LI,1     BADIOM            SET OTHER MSG
         CI,2     X'43'             IS KEYED READ ERR
         BE       SYMOUT            YEP--CONTINUE
         B        SYMOUT            CONTINUE TO NEXT KEY
OUTARND  EQU      %
         STW,R10  RBIOERR           SAVE I/O ERROR WORD
         B        SYMOUT1           AND GIVE UP
*
*        GET MORE PAGES TO READ THE RECORD
*
MORPAGE  BAL,7    GETONE            TRY FOR ANOTHER PAGE
         BCS,8    NOBUF             CANT GET IT
         MTW,1    FPGS              BUMP PAGE COUNT
         LI,R7    512
         AWM,R7   RVRBUF+1          BUMP CLM PAIR UP ONE PAGE
         LI,7     2048              INCREMENT READ SIZE
         AWM,7    RDVC              FOR NEXT CAL
         B        SYMBLOOP1
GETONE   CAL1,8   GETPAGE
         B        0,7
         PAGE
*
*        FPTS TO OPEN :RBBRVR FILE THAT  RBBAT WILL WRITE OUT
*
OPNRBR   GEN,8,24 20,M:EI
         DATA     X'C7400001'
         DATA     RBBREA1,RBBREA1   ERROR/ABNORMAL ADDRESSES
         DATA     2,2,1,2           KEYED,DIRECT,IN,SAVE
         DATA     X'01000202'
         TEXTC    ':RBBRVR'
         DATA     X'02010202'
         TEXT     ':SYS '
*
CALL:RBBAT GEN,8,24 X'1A',0
           DATA     X'80004000'     P18 GETS STATIC  DATA DUMPED
           DATA     'P1'            PHONY STREAM NAME
           DATA     1
*
         PAGE
*
*        MONITOR DISPLAY MODE--ASK RBBAT TO DUMP HIS STATIC DATA
*
ASK:RBBAT EQU     %
         CAL1,8   CALL:RBBAT        ASK HIM
         BCS,8    RBBREA2           RBBAT SAID AN ERROR OCCURED
         CAL1,1   OPNRBR            OPEN THE FILE
         LI,R4    2                 SET UP REGISTERS TO ENTER
         LW,R1    KEYS1,R4          THE MAIN ROUTINE
         B        SYMBLOOP1         ENTER MAIN PATH
*
         PAGE
*
*        ERROR RETURN FROM TRYING TO OPEN/READ RBBAT'S FILE
*
RBBREA1  EQU      %
         LB,R2    R10               GET  I/O CODE
         CI,R2    3                 FILE DOESNT EXIST
         BNE      RBBREA2           NOT THAT ONE
         LI,R1    RBNFL
         STW,R1   RBMSG             STORE MSG ADDRESS
         B        %+2
RBBREA2  STW,R10  RBIOERR           STORE I/O ERROR CODE
         LI,R7    M:EI
         LH,R0    M:EI              SEE IF THE DCB GOT OPENED
         CI,R0    X'0020'           CHECK THE OPEN BIT
         BAZ      %+2               DID NOT GET OPEN
         BAL,R0   CLOSEDCB          CLOSE THE DCB UP
         NOP      %                 LEAVE ROOM FOR A  PATCH
         B        SYMOUT1           MERGE W/COMMON EXIT
*
KEYS1    EQU      %-1
         DATA     DDKEY1
         DATA     SDKEY1
         DATA     IVKEY1
         DATA     CMKEY1
*
CMKEY1   TEXTC    'RBBATC0'
IVKEY1   TEXTC    'RBBATI0'
SDKEY1   TEXTC    'RBBATS0'
DDKEY1   TEXTC    'RBBATD0'
*
*
         PAGE
*
*        DCB IS NOT OPEN - THEREFORE WE ARE PROBABLY LOOKING AT
*        THE MONITOR IN CORE AS OPPOSED TO THE DUMP FILE.
*
M:EI%NOT%OPEN  EQU  %               DCB NOT OPEN
         LI,R1    NOFILMSG          LOAD ERROR MSG
         STW,R1   RBMSG             STORE MSG
         B        SYMOUT1           AND GIVE UP
*
*        IF WE CAN'T  GET ENUFF PAGES  TO READ THE RECORD--GIVE UP
*
NOBUF    EQU      %
         LI,R1    BUF:MSG
         STW,R1   RBMSG             STORE THE MSG ADDRESS
         B        SYMOUT1           AND GIVE UP
         PAGE
*
*        DATA/FPTS/CONSTANTS TO READ THE RBBAT RCVRY DATA
*
GETPAGE  GEN,8,24 8,1
         USECT    DATA
FPGS     GEN,8,24 9,0
*
*        RVRBUF IS BOTH THE BUFFER POINTER AND THE BUFFER IN LIMITS
*        CLM PAIR
*
         BOUND    8
RVRBUF   DATA     0
         DATA     0
CUR:PRI  DATA     0                 CURRENT PRIORITY
CUR:HEAD DATA     0                 CURRENT HEAD
CUR:TAIL DATA     0                 CURRENT TAIL
CUR:STEP DATA     0                 CURRENT CHAIN WE'RE ON
#OUT     DATA     0                 LENGTH OF OUTPUT QUEUE
#IN      DATA     0                 LENGTH OF INPUT QUEUE
RDVC     DATA     2048              INITIAL READ SIZE
DID:RVR  DATA     0                 >0 SAYS WE READ A RECORD
RBIOERR  DATA     0                 CONTAINS R10 IF I/O ERROR OCCURS
RBMSG    DATA     0                 CONTAINS ERROR MSG ADDRESS
         USECT    PP                BACK TO PROCEDURE
FPGSCOPY GEN,8,24 9,0               REFRESHER FOR FREE PAGE FPT
RDRVR    EQU      %
         GEN,8,24 X'10',M:EI                                                 A00
         DATA     X'F8000010'
         DATA     RBBREA
         DATA     RBBREA
         PZE      *RVRBUF           BUFFER POINTER
         PZE      *RDVC
         PZE      *1
         USECT    PP
RBBMSGS  EQU      %-1
         DATA     DDMSG
         DATA     SDMSG
         DATA     IVMSG
         DATA     CMMSG
KEYS     EQU      %-1
         DATA     DDKEY
         DATA     SDKEY
         DATA     IVKEY
         DATA     CMKEY
BUF:MSG TEXTC 'CANNOT OBTAIN BUFFER TO READ RBBAT FILE'
*
SROUTE   EQU      %-1
         B        SYMBLOOP2
         B        RBBOUT            FOR STATIC DATA
         B        SYMBLOOP2
         B        SYMBLOOP2
CMKEY    TEXTC    'RBBATCM'
IVKEY    TEXTC    'RBBATIV'
SDKEY    TEXTC    'RBBATSD'
DDKEY    TEXTC    'RBBATDD'
RBNFL    TEXTC    '*** :RBBRVR DOES NOT EXIST ***'
NONEM    TEXTC    '**NONE**'
BADIOM   TEXTC    '**COULD NOT FIND RBBAT RECOVERY DATA'
         PAGE
*
*        DISPLACEMENTS IN RBBAT RECOVERY STATIC DATA RECORD
*
INFIL    EQU      3
OUTFIL   EQU      4
BB:COPY  EQU      5
BB:DEV   EQU      6
BB:PI    EQU      7
BB:RID   EQU      8
BD:ACCT  EQU      9
BH:HPRI  EQU      10
BH:LINK  EQU      11
BH:PART  EQU      12
BH:SID   EQU      13
BH:SLNK  EQU      14
BH:TIME  EQU      15
BH:TPRI  EQU      16
BH:XLNK  EQU      17
BW:FORM  EQU      18
BW:SDA   EQU      19
B4W:RES  EQU      20
BB:JDE   EQU      21                NO LONGER IN USE
BW:FOVL  EQU      22                # ..DITTO..."
BH:GRAN  EQU      23
RB:MFAD  EQU      24
RB:SPMF  EQU      25
RBH:MFX  EQU      26
RBB:DSM  EQU      27
RBB:MXP  EQU      28
RBB:SMD  EQU      29
STW:FORM EQU      30
STB:DPD  EQU      31
STB:JDE  EQU      32
STH:NM   EQU      33
STW:FOV  EQU      34
RCVLOC   EQU      35
*
*
*        FETCH TABLE FOR RBBAT OUTPUT TABLES
*
*
OUTLOAD  EQU      %
         DATA,1   BH:LINK,;         0
                  BH:SID,;          1
                  BB:COPY,;         2
                  BB:DEV,;          3
                  BB:RID,;          4
                  BW:FORM,;         5
                  BW:SDA,;          6
                  BH:GRAN,;         7
                  BH:LINK           8
#OUTLOAD EQU      BA(%)-BA(OUTLOAD)-1
         BOUND    4
*
*
*
OUTFETCH EQU      %
         HALF     0
         HALF     1
         BYTE     2
         BYTE     3
         BYTE     4
         WORD     5
         WORD     6
         HALF     7
         ZIP      8
         BOUND    4
*
*
OUTRANS  EQU      %
         DATA,1   0,;               0
                  0,;               1
                  0,;               2
                  0,;               3
                  0,;               4
                  1,;               5
                  1,;               6
                  0,;               7
                  0                 8
         BOUND    4
*
*
OUTSPACS EQU      %
         DATA,1   5,10,15,20,24,28,37,46,51,55
         BOUND    4
*
*
OUTSHDR  EQU      %
 TEXTC '#    LINK SID  COPY DEV RID FORM     SDA      GRAN PRI'
*      *0123456789*123456789*123456789*123456789*123456789*123456789*
RBB:BADMSG TEXTC '**RBBAT STATIC DATA HAS BEEN DESTROYED'
         PAGE
*
*        DISPLAY THE BATCH OUTPUT QUEUE
*
RBBOUT   EQU      %
         LI,R1    BATOQ:TIT
         BAL,R0   TITEL
         LI,R1    OUTSHDR
         BAL,R0   MBB               PUT OUT THE HEADER LINE
         LI,R3    RCVLOC            AND THEN LETS CHK
         LW,R3    *RVRBUF,R3        TO SEE IF STATIC DATA IS OKAY
         CW,R3    =X'8A814A40'      IS OK
         BE       RBBOUT0           YUP
         LI,R1    RBB:BADMSG
         B        PUSHMSG           ABORT DISPLAY
RBBOUT0  EQU      %
         LI,R6    0                 INITIALIZE
         STW,R6   CUR:PRI           INITIALIZE PRIORITY LEVEL
         LI,R5    OUTFIL            AND THEN
         LW,R5    *RVRBUF,R5        GET THE LENGTH OF THE OUTPUT QUEUE
         BLEZ     BADSTAT           ERROR
         STW,R5   #OUT              SAVED...
         LI,R6    X'11'             FIRST ENTRY IN OUTPUT QUEUE
RBBOUT01 EQU      %
         STW,R6   CUR:STEP          SAVED
         BAL,R0   GET:STEP          GET FIRST ENTRY IN QUEUE
         B        RBBOUT3           NONE
RBBOUT1  EQU      %
         LI,R4    0                 INTERNAL INDEXING REGISTER
         LW,R3    R6                MOVE INTERNAL INDEX
         BAL,R0   TRANSSZ           PUT OUT INDEX
RBBOUT2  EQU      %
         LB,R7    OUTLOAD,R4        GET DISPLACEMENT VALUE
         LW,R7    *RVRBUF,R7        FETCH ADDRESS DISPLACEMENT
         AW,R7    RVRBUF            MAKE R7 DIRECT ADDRESS
         CLM,R7   RVRBUF            POINTER IN LIMITS
         BCS,9    BADSTAT           NOPE
         LW,R3    CUR:PRI           LOAD CURRENT PRI
         LB,R0    OUTFETCH,R4       GET OPCODE
         BEZ      RBBOUT21          CORRECT--> JUMP
         BAL,R1   RUNTAB            FETCH CONTENTS
         DATA     X'3C0007'
RBBOUT21 EQU      %
         LB,R1    OUTSPACS,R4       GET CORRECT SPACSING
         BAL,R0   SPACES
         LB,R1    OUTRANS,R4        GET FLAG
         LW,R1    TRANSL,R1         GET LOC
         BAL,R0   0,R1              AND DISPATCH IT
         AI,R4    1                 NEXT TABLE ENTRY INTERNALLY
         CI,R4    #OUTLOAD          AT TOP OF TABLE
         BLE      RBBOUT2           NOT YET
         BAL,R0   BUFOUT            PRINT THE ENTIRE LINE
         BAL,R0   NXT:STEP          GET NEXT ENTRY
         B        RBBOUT3           JUMP--AT TAIL OF LEVEL
         B        RBBOUT1           DO NEXT ROW
RBBOUT3  EQU      %
         MTW,1    CUR:PRI           STEP THE PRIORITY UP
         LW,R6    CUR:STEP          GET CURRENT PRIORITY LEVEL
         AI,R6    1                 STEP TO NEXT LEVEL
         CI,R6    X'21'             AT TOP
         BGE      RBBIN             YUP--DO INPUT QUEUE
         B        RBBOUT01          DO NEXT LEVEL
         PAGE
*
*        START OFF A LEVEL OF CHAIN
*
GET:STEP EQU      %
         LI,R7    BH:HPRI           DISP TO HEAD TABLE
         LW,R7    *RVRBUF,R7        GET DISP INTO TABLE
         AW,R7    RVRBUF            ADD LOF OF TABLE
         CLM,R7   RVRBUF            TEST ADDRESS
         BCS,9    BADSTAT           ERROR
         LI,R5    BH:TPRI           DISP TO TAIL TABLE
         LW,R5    *RVRBUF,R5        GET INTERNAL DISP
         AW,R5    RVRBUF            MAKE IT A DIRECT ADDRS
         CLM,R5   RVRBUF
         BCS,9    BADSTAT           BAD ADDRESS
         LH,R6    *R7,R6            GET HEAD OF CHAIN
         LH,R9    *R5,R6            GET TAIL OF CHAIN
         STW,R6   CUR:HEAD          STORE THE HEAD
         STW,R9   CUR:TAIL          STORE THE TAIL
         CI,R6    0                 ANY CHAIN THERE
         BEZ      *R0               NOPE
         AI,R0    1                 OK TO RUN THIS ONE
         B        *R0
         PAGE
*
*        GET NEXT ENTRY ON CURRENT CHAIN
*
NXT:STEP EQU      %
         LW,R6    CUR:HEAD          GET CURRENT HEAD
         CW,R6    CUR:TAIL          JUST DISPLAY THE LAST ENTRY
         BE       *R0               YUP
         LI,R7    BH:LINK           DISP
         LW,R7    *RVRBUF,R7        GET DISP INTO TABLES
         AW,R7    RVRBUF            MAKE IT A DIRECT ADDRS
         CLM,R7   RVRBUF            IS OK
         BCS,9    BADSTAT           NOPE
         LH,R6    *R7,R6            GET NEXT ON THIS CHAIN
         BEZ      *R0               NO MORE
         STW,R6   CUR:HEAD          STORE AS CURRENT HEAD
         AI,R0    1
         B        *R0               GO RUN NEXT ENTRY
         PAGE
*
*        RBBAT INPUT TABLES DISPLAY TABLES
INSHDR   EQU      %
 TEXTC '#    ACCOUNT  PI RID LINK PART SID  SLNK TIME XLNK',;
*      *0123456789*123456789*123456789*123456789*123456789
                  ' SDA       RES      PRI '
*                  *123456789*123456789*123456789
*
INPSPACS EQU      %
         DATA,1   5,14,17,21,26,31,36,41,46,51,61,70,73,84
         BOUND    4
*
*
INLOAD   EQU      %
         DATA,1   BD:ACCT,;         0
                  BB:PI,;           1
                  BB:RID,;          2
                  BH:LINK,;         3
                  BH:PART,;         4
                  BH:SID,;          5
                  BH:SLNK,;         6
                  BH:TIME,;         7
                  BH:XLNK,;         8
                  BW:SDA,;          9
                  B4W:RES,;         10
                  BB:PI             11
#INLOAD  EQU      BA(%)-BA(INLOAD)-1
         BOUND    4
*
*
INGET    EQU      %
         ZIP      0                 DOUBLE-WORD
         BYTE     1
         BYTE     2
         HALF     3
         HALF     4
         HALF     5
         HALF     6
         HALF     7
         HALF     8
         WORD     9
         BYTE     10
         ZIP      11                PRIO
         BOUND    4
*
*
INTRANS  EQU      %
         DATA,1   3,;               0
                  0,;               1
                  0,;               2
                  0,;               3
                  0,;               4
                  0,;               5
                  0,;               6
                  0,;               7
                  0,;               8
                  1,;               9
                  4,;               10
                  0                 11
         BOUND    4
*
INACCT   EQU      %
         LD,R10   *R7,R6            PICK UP THE ACCOUNT #
         BNEZ     %+2               GOT ONE
         LD,R10   BLANKS            ELSE GET SOME BLANKS
         STD,R10  PROCNAME          SAVE NAME OF ACCOUNT
         LI,R1    PROCNAME
         LI,R2    8
         BAL,R0   MSG1              PUT TEXT STRING INTO PRINT LINE
         B        RBBIN2            REJOIN
         PAGE
*
*        RBBAT STATIC DATA HAS BEEN DESTROYED
*
BADSTAT  EQU      %
         LI,R1    STATMSG
         B        PUSHMSG
STATMSG  TEXTC    '**RBBAT STATIC DATA HAS BEEN DESTROYED'
*
*
         PAGE
*
*        DISPLAY THE BATCH INPUT QUEUE
*
RBBIN    EQU      %
         LI,R1    BATIQ:TIT
         BAL,R0   TITEL             PUT OUT THE TITLE LINE
         LI,R1    INSHDR
         BAL,R0   MBB
         LI,R5    INFIL
         LW,R5    *RVRBUF,R5        GET SIZE OF INPUT TABLES
         BLEZ     BADSTAT           ***ERROR***
         STW,R5   #IN               SAVE LENGTH OF INPUT QUEUE
         LI,R6    0                 FIRST PRIORITY IN INPUT QUEUE
         STW,R6   CUR:PRI           INITIALIZE CURRENT PRIORITY
RBBIN0   EQU      %
         STW,R6   CUR:STEP          SAVE CURRENT PRIORRITY LEVEL
         BAL,R0   GET:STEP          INITIALIZE CHAIN POINTERS
         B        RBBIN3            NONE TO GET
RBBIN01  EQU      %
         LI,R4    0                 INDEX TO INTERNAL TABLES
         LW,R3    R6                INDEX TO RBBAT TABLES
         BAL,R0   TRANSSZ           GET NUMBER ONTO PRINT LINE
RBBIN1   EQU      %
         LB,R7    INLOAD,R4         LOAD DISPLACEMENT VALUE
         LW,R7    *RVRBUF,R7        GET DISP IN RBBAT STATIC DATA
         AW,R7    RVRBUF            R7 NOW DIRECT ADDRESS
         CLM,R7   RVRBUF            IS POINTER IN LIMITS
         BCS,9    BADSTAT           NOPE---ERROR
         LW,R3    CUR:PRI           ASSUME PRI ENTRY
         LB,R0    INGET,R4          GET OPCODE
         BEZ      RBBIN101          NONE
         BAL,R1   RUNTAB
         DATA     X'3C0007'
RBBIN101 EQU      %
         LB,R1    INPSPACS,R4       GET NEXT SPACING
         BAL,R0   SPACES
         LB,R1    INTRANS,R4        GET POINTER
         LW,R1    TRANSL,R1         GET ADDRESS
         BAL,R0   0,R1              DISPATCH ROUTINE
RBBIN2   EQU      %
         AI,R4    1                 NEXT ENTRY
         CI,R4    #INLOAD           DONE YET
         BLE      RBBIN1            NOPE
         BAL,R0   BUFOUT            PRINT ENTIRE LINE
         BAL,R0   NXT:STEP          CHECK FOR NEXT ENTRY THIS PRI
         B        RBBIN3            NONE
         B        RBBIN01           DO NEXT ENTRY THIS PRIORITY
RBBIN3   EQU      %
         MTW,1    CUR:PRI           STEP TO NEXT PRIORITY
         LW,R6    CUR:STEP          GET CURRENT LEVEL
         AI,R6    1                 BUMP TO NEXT ENTRY
         CI,R6    X'11'             DONE W/INPUT QUEUE
         BGE      SYMBLOOP2         YUP
         B        RBBIN0            NOT DONE YET
*
*
RBBIN4   EQU      %
         LW,R14   R6                CURRENT WA INDEX
         SLS,R14  4                 CALCULATE INDEX INTO B4:RES
         LW,R15   R7                CURRENT WORD ADDRESS OF TABLE
         SLS,R15  2                 INTO BA
         AW,R14   R15               CREATES THE SBA
         LI,R15   12                DEST BA
         LI,R5    4                 COUNT I WANT
         STB,R5   R15
         MBS,R14  0                 MOVE FIRST 4 BYTES OF RESOURCES
         BAL,R0   TRANS             MOVE VALUE TO PRINT BUF
         B        RBBIN2            AND REJOIN
         PAGE
*
*F*
*F*    NAME:           ALLYTABL
*F*
*F*    PURPOSE:        TO PRODUCE A FORMATTED DISPLAY OF THE
*F*                    RAD/PACK ALLOCATION TABLES.
*F*
*F*    DESCRIPTION:    EACH OF THE ALLOCATION TABLES IS TAKEN AND
*F*                    FORMATTED ONTO THE PRINT LINE.
*F*
*F*                    ONCE THE TABLES HAVE BEEN DISPLAYED THE
*F*                    ALLYCAT COMMUNICATION BUFFERS ARE DISPLAYED.
*F*
*
*        COMMAND FORMAT.
*
*        DI(SPLAY)  AT(ABLES)
*
ALLYTABL EQU      %
         LI,R1    ATMSG
         BAL,R0   TITEL             TITLE LINE OUT
         LI,R1    ATMSG1
         BAL,R0   MSG%OUT           MESSAGE HEADING
         LI,R4    0
ALLYTABL0 LI,R7   7
         LI,R1    1
         BAL,R0   SPACES
         LW,R1    ATABL4,R4
         BAL,R0   MSG
ALLYTABL1 LB,R1   ATABL3,R7
         BAL,R0   SPACES
         LH,R14   ATABL1,R7         LOAD ADDRESS OF TABLE
         AND,R14  #R16              BE SURE....
         BAL,R0   GETADDR
         EXU      ATABL2,R7
         CI,R7    1
         BE       %+2
ALLYTABL2 AND,R3  #R16
ALLYTABL3 BAL,R0  TRANSSZ
         BDR,R7   ALLYTABL1
         BAL,R0   BUFOUT
         BAL,R0   BLANK1
         AI,R4    1
         CI,R4    4
         BL       ALLYTABL0
         B        GHOST:COM
         PAGE
*
*        ALLYCAT TABLE DISPLAY DATA
*
ATABL1   EQU      %
         DATA,2   0,;               0
                  GRAVAIL,;         1
                  ADJSTCNT,;
                  BUFLAGS,;
                  TEMPBOT,;
                  WORDCNT,;
                  BOTTOM,;
                  TOP
         BOUND    4
*
ATABL2   EQU      %-1
         LW,R3    *R15,R4
         DO1      6
         LH,R3    *R15,R4
ATABL3   DATA,1   69,60,50,41,33,24,16,11
*
*
         BOUND    4
ATABL4   DATA     RADMSG,PACKMSG,PERMSG,CYLMSG
*
*
RADMSG   TEXTC    'RAD'
PACKMSG  TEXTC    'PACK'
PERMSG   TEXTC    'SYMB'
CYLMSG   TEXTC    'CYL'
*
*
*
ATMSG1   TEXTC    '          TOP  BOTTOM  WORDCNT  TEMPBOT  ',;
                  'BUFLAGS  ADJSTCNT  GRANULES AVAIL'
*
*
         PAGE
*
*        READ - AHEAD TABLE DATA
*
RA:ADDRS EQU      %
         DATA,2   RAB:USER,;
                  RAB:BLINK,;
                  RAB:FLINK,;
                  RAX:PAGE,;
                  RAH:TIME,;
                  RAH:DCB,;
                  RA:DA
         BOUND    4
*
RA:LOAD  EQU      %
         BYTE
         BYTE
         BYTE
         BYTEX                      **LOAD ITEM FROM RAX:PAGE
         HALF
         HALF
         WORD
         BOUND    4
RA:SHFTS EQU      %
         DATA,1   0,0,0,0,0,1,0
         BOUND    4
*
RA:HEAD  TEXTC    ;
 'ENTRY  USER  BL  FL  PAGE  TIME  DCB    DISK ADDRESS'
*
RA:SPACES DATA,1    7,13,17,21,27,33,40,52
         BOUND    4
*
         PAGE
*
*F*
*F*    NAME:           RA:TABL
*F*
*F*    PURPOSE:        TO PRODUCE A FORMATTED DISPLAY OF THE FILE
*F*                    MANAGEMENT READ AHEAD TABLES.
*F*
*F*    DESCRIPTION:    EACH OF THE TABLES IS BROKEN DOWN AND PLACED
*F*                    INTO THE PRINT LINE.
*F*
*
*        COMMAND FORMAT.
*
*        DI(SPLAY)  RA (1)(,2)(,3)(,4)
*
*        NOTE THAT LIST IS OPTIONAL - LACK OF LIST IMPLIES TO DISPLAY
*        ALL OF THE ENTRIES
*
RA:TABL  EQU      %               *
         LI,R1    RA:TITE         *
         BAL,R0   TITEL           * PUT OUT TITLE LINE
         LI,R1    RA:HEAD         * PUT
         BAL,R0   MSG%OUT         * HEADING
         LI,R5    RASIZE+1          * LENGTH OF READ-AHEAD TABLES
         LI,R1    2               * MUST LOOK FOR AN OPTIONAL FIELD
RA:TABL0 EQU      %               *
         BAL,R0   GETHEX          * GO LOOK FOR IT
         STW,R2   USER            * SAVE NUMBER OR ZERO
RA:TABL1 LI,R4    0               * INDEX TO INTERNAL TABLES
         LW,R3    R2              * PUT
         BAL,R0   TRANSSZ         * OUT INDEX TO RA TABLES
RA:TABL2 LB,R1    RA:SPACES,R4    * GET
         BAL,R0   SPACES          * SPACING
         LH,R14   RA:ADDRS,R4       GET ADDRESS OF TABLE
         AND,R14  #R16
         BAL,R0   GETADDR         * GET ADDRESS
         LB,R0    RA:LOAD,R4        OPCODEPART OF INSTRUCTION
         BAL,R1   RUNTAB            FETCH CONTENTS
         DATA     X'34000F'         REMAINDER OF INST
         CI,R4    3               * JUST LOAD PAGE
         BNE      RA:TABL3        * NO
         PSW,R4   STACK           *
         LCFI     7               *
         STCF     PG:MODE         * STORE OWNER'S CODE
         LW,R4    R3              * XFER PAGE #
         BEZ      %+2             * NONE
         BAL,R0   PAGETABLE       * INSERT IT INTO MATRIX
         PLW,R4   STACK           *
RA:TABL3 EQU      %
         MTB,0    RA:SHFTS,R4       * TEST FOR SHFIT
         BEZ      %+2               * NO
         SLS,R3   1                 * YES
         BAL,R0   TRANSSZ         * PUT IT OUT
         AI,R4    1               *
         CI,R4    7               *
         BL       RA:TABL2        * DO NEXT ONE
         BAL,R0   BUFOUT          * PRINT ENTIRE LINE
         MTW,0    USER            * DID WE DO ONE PARTICUALR #
         BNEZ     RA:TABL4        * YEP - ALL DONE HERE
         AI,R2    1               * NEXT ENTRY
         BDR,R5   RA:TABL1        * DO NEXT ROW
RA:TABL4 EQU      %               * JUMP POINT FOR NEXT LIST LOOK..
         LI,R6    RA:TABL0        * RETURN IF THERE IS A LIST
         B        GETLIST         * GO CHECK FOR IT
         PAGE
*
*F*
*F*    NAME:           SWAP
*F*
*F*    PURPOSE:        TO PRODUCE A DISPLAY OF THE CELLS USED BY
*F*                    BOTH THE SWAP SCHEDULER/SWAPPER IN SWAPPING.
*F*
*F*    DESCRIPTION:    SWAP USES A BUILT IN LIST TO FETCH THE CELLS
*F*                    AND DISPLAY THEIR CONTENTS.
*F*
*F*               CALCULATING WHO GETS OUTSWAPPED/INSWAPPED
*
*        COMMAND FORMAT.
*
*        DI(SPLAY)  SW(APPER)
*
SWAP     LI,1     SWAPMSG         *
         BAL,0    TITEL           * TITLE LINE OUT
         LI,4     0               * INITIALIZE THE POINTER
SWAPLOP0 EQU      %               *
         LI,R5    0               * RESET COLUMN COUNTER
SWAPLOP1 EQU      %               *
         CI,R4    NUMSWAP         * AT END OF TABLES
         BGE      SWAPLOP15       * YES - STOP HERE
         LH,R1    MSGBAS,R4         * GET NEXT MSG ADDRESS OFFSET
         AI,R1    SMSGBAS           * CREATE CORE ADDRESS
         BAL,R0   MSG               * MOVE IT
         LI,R1    EQLMSG            * AND
         BAL,R0   MSG               * THEN THE EQUAL SIGN
         LI,R3    0                 * ASSUME AN SREF
         LH,R14   FINDTAB1,R4       * LOAD NEXT TABLE
         AND,R14  #R16              *
         BEZ      SWAPLOP11       * JUMP IF NO ADDRESS (SREF'D - REMBER)
         MTW,7    LOOKING         * SET FLAG FOR ONE PAGE READ ONLY
         BAL,R0   GETADDR         * GET IT
         LW,R3    *R15            * ALL WORD ENTRIES
SWAPLOP11 EQU     %               *
         LW,R1    R5              * CURRENT COLUMN COUNTER
         AI,R1    11              * BUMP FOR VALUE
         BAL,R0   SPACES          *
         BAL,R0   TRANSSZ         * PUT OUT VALUE FOR CELL
         AI,R5    20              * NEXT TEXT SPACE
         LW,R1    R5              *
         BAL,R0   SPACES          * PUT IT OUT
         AI,R4    1               * NEXT INDEX INTO TABLES
         CI,R5    80              * AT MAX PRINT LINE
         BL       SWAPLOP1        * NOT YET
         BAL,R0   BUFOUT          * PUT IT OUT
         B        SWAPLOP0        * START NEXXT LINE OF OUTPUT
SWAPLOP15 EQU     %               * END OF THIS DISPLAY
         BAL,R0   BUFOUT          * PRINT THE END OF IT
*
*        FALL THRU AND PROCESS OUTSWAP LISTS
*
         PAGE
*
*F*
*F*    NAME:           SWAPLIST
*F*
*F*    PURPOSE:        TO DISPLAY THE OUTSWAP USER LISTS, THE INSWAP
*F*                    PROCESSOR LISTS AND THE FREE PROCESSOR
*F*                    LISTS.
*F*
*F*    DESCRIPTION:    EACH OF THE LISTS IS GATHERED AND RUN
*F*                    AS A CHAIN - VALIDATING EACH OF THE CHAIN
*F*                    HEADS AS THEY ARE PICKED UP.
*F*
*
*        COMMAND FORMAT.
*
*        SW(AP)
*
         LI,R1    R3SWAP            INTERNAL RETURN POINT
SWAPLIST EQU      %
         PSW,R1   STACK             SSAVE RETRUN LINK
         LI,R6    #SWPLISTS         # OF ENTRIES TO RUN
SWAPLIST0 EQU     %
         EXU      SWPLISTS,R6       LOAD FIRST ADDRESS
         BAL,R0   GETADDR           GET IT
         LB,R5    *R15              GET COUNT IN LIST
         BEZ      SWAPLIST4         NO ONE IN THIS LIST - DO NEXT ONE
         BAL,R0   BLANK1            IS OKAY - JUMP
         EXU      SWPLMSG,R6        LOAD MSG ADDRESS
         BAL,R0   MSG               PUT IT OUT
         CI,R5    SMAXOUT           REASONABLE VALUE
         BG       SWPTBAD           NO - TABLE DESTROYED
SWAPLIST1 EQU     %
         LI,R1    28                INITIAL SPACING
         BAL,R0   SPACES
         LI,R4    0                 COUNT OF STRING INSERTIONS
SWAPLIST2 EQU     %
         LB,R3    *R15,R5           GET LIST ITEM
         BAL,R0   TRANSSZ           ONTO PRINT LINE
         LI,R1    AND
         BAL,R0   MSG               PUT IN THE ARROW
         AI,R4    1                 BUMP INSERTION COUNT
         CI,R4    8                 AT MAX
         BG       SWAPLIST3         YEP
         BDR,R5   SWAPLIST2         NO
SWAPLIST3 EQU     %
         BAL,R0   BUFOUT            PRINT EVERYTHING
         AI,R5    -1                DECREMENT LIST COUNT
         BGZ      SWAPLIST1         NO - CONTINUE
SWAPLIST4 EQU     %
         BDR,R6   SWAPLIST0         CONTINUE WITH NEXT LIST
         PLW,R1   STACK
         B        0,R1              RETURN TO CALLER / OR FALL THRU
*
*
*
SWPLISTS EQU      %-1
         LI,R14   SB:OSN            OUT SWAP USER LIST
         LI,R14   SB:NP             IN SWAP PROCESSOR LIST
         LI,R14   SB:FPL            FREE PROCESSOR LIST
#SWPLISTS EQU     %-SWPLISTS-1
*
*
SWPLMSG  EQU      %-1
         LI,R1    OSULMSG
         LI,R1    INPLMSG
         LI,R1    FPLMSG
*
*
         PAGE
*
*        ROUTINE TO PUT OUT THE SWAPPER 'DEVICE' TABLES
*
R3SWAP   EQU      %               * ENTRY TO PUT OUT DEVICE TABLES
         BAL,0    BLANK1          * PRINT A BLANK LINE
         LI,1     SWAP3MSG        * LOAD TITLE LINE
         BAL,R0   MBB             * PRINT IT
         LI,2     LSWAP           * LENGTH OF TABLES
         LI,4     LSWAP+1         * DITTO PLUS ONE
R3SWAP1  EQU      %               *
         LI,5     0               * INTERNAL INDEX
R3SWAP2  EQU      %               *
         LB,1     TABTAB,5        * LOAD SPACING VALUE
         BAL,0    SPACES          * SPACE OVER REQUIRED AMOUNT
         EXU      LISWAP,5        * LOAD R14 W/ADDRESS
         BAL,0    GETADDR         * FETCH ADDRESS
         EXU      LWSWAP,5        * LOAD R3 WITH VALUE
         MTB,0    SW:SCRUB,R5       * IS HALF-WORD
         BEZ      %+2               * NO
         AND,R3   #R16              * YES
         BAL,0    TRANSSZ         * PUT OUT VALUE W/O LEAD ZEROS
         AI,5     1               * BUMP POINTER
         CI,5     NUSWAP          * AT TOP
         BL       R3SWAP2         * NO - GO ON
         BAL,0    BUFOUT
         AI,2     -1
         BDR,4    R3SWAP1
         B        SCANNER
         SPACE    5
SWAP3MSG TEXTC    '   M:SWAPD  MB:SDI  MB:SFC',;
                  '  MB:#RTRY  M:CLBGN    MH:CLEND'
*
*
SW:SCRUB EQU      %
         DATA,1   0,0,0,0,0,1       MASK FLAGS
         BOUND    4
         PAGE
*
*        SWAPPER TABLES HAVE BEEN DESTROYED
*
SWPTBAD  EQU      %
         LI,R1    DESTRMSG
         BAL,R0   MBB
         B        SWAPLIST4         TRY TO DO NEXT ONE
DESTRMSG TEXTC    ' **HAS BEEN CLOBBERED'
         PAGE
*
AND      TEXTC    ' > '
TABTAB   CSECT    1
LISWAP   CSECT    1
LWSWAP   CSECT    1
*
         USECT    PP
EQLMSG   TEXTC    '='
NUSWAP   SET      0
STAB     CNAME    1
STAH     CNAME    2
STAW     CNAME    3
         PROC
       LOCAL           A
A        SET      %
         USECT    LISWAP
         LI,14    AF(1)
         USECT    LWSWAP
         DO       NAME=1
         LB,3     *15,2
         ELSE
         DO       NAME=2
         LH,3     *15,2
         ELSE
         LW,3     *15,2
         FIN
         FIN
         USECT    TABTAB
         DATA,1   AF(2)
NUSWAP   SET      NUSWAP+1
         USECT    A
         PEND
         STAW     M:SWAPD,3
         STAB     MB:SDI,12
         STAB     MB:SFC,20
         STAB     MB:#RTRY,28
         STAW     M:CLBGN,38
         STAH     MH:CLEND,49
*
         USECT    PP
*
         PAGE
*
NUMSWAP  SET      0
*
MSGTAB   CSECT    1
MSGBAS   EQU      %
*
SMSGS    CSECT    1
SMSGBAS  EQU      %
*
FINDTAB  CSECT    1
FINDTAB1 EQU      %
         USECT    PP
*
SMSG     CNAME
         PROC
         LOCAL    U,P
U        SET      %                 SAVE CURRENT CONTROL SECTION
         USECT    SMSGS             SWITCH TO MSG CONTROL SECTION
P        SET      %                 SAVE ADDRESS OF STRING
         TEXTC    AF(1)             AND GENERATE THE MSG
         USECT    MSGTAB
         DATA,2   P-SMSGBAS         GENERATE OFFSET INTO TABLE
         USECT    FINDTAB
         DATA,2   AF(2)             GENERATE POINTER TO CORE CELL
         USECT    U                 RETURN TO USER CONTROL SECTION
NUMSWAP  SET      NUMSWAP+1         BUMP COUNTER
         PEND
*
         PAGE
*
         SMSG     'S:EVF',S:EVF
         SMSG     'S:SEVF',S:SEVF
         SMSG     'S:ISUNF',S:ISUNF
         SMSG     'S:FSEVF',S:FSEVF
         SMSG     'S:PCT',S:PCT
         SMSG     'S:PRPC',S:PRPC
         SMSG     'S:OSS',S:OSS
         SMSG     'SL:OPC',SL:OPC
         SMSG     'S:HIR',S:HIR
         SMSG     'S:SIP',S:SIP
         SMSG     'DID%IO',DID%IO
         SMSG     '#SWAP%DEV',#SWAP%DEV
         SMSG     'S:CUN',S:CUN
         SMSG     'S:CUP',S:CUP
         SMSG     'S:ISUN',S:ISUN
         SMSG     'S:CUIS',S:CUIS
         SMSG     'S:PFNI',S:PFNI
         SMSG     'S:OUIS',S:OUIS
         SMSG     'S:GUIS',S:GUIS
         SMSG     'S:BFIS',S:BFIS
         SMSG     'S:BUIS',S:BUIS
         SMSG     'S:RTCORE',S:RTCORE
         SMSG     'S:ACORE',S:ACORE
         SMSG     'S:PCORE',S:PCORE
         SMSG     'SL:CORE',SL:CORE
         SMSG     'S:LCORE',S:LCORE
         SMSG     'S:STL#',S:STL#
         SMSG     'S:STLC',S:STLC
         SMSG     'SL:STLM',SL:STLM
         SMSG     'SL:RSVP',SL:RSVP
         SMSG     'SL:QUAN',SL:QUAN
         SMSG     'SL:QMIN',SL:QMIN
         SMSG     'SL:SQUAN',SL:QUAN
         SMSG     'SL:OIMF',SL:OIMF
         SMSG     'SL:OXMF',SL:OXMF
         SMSG     'SL:BIMF',SL:BIMF
         SMSG     'SL:BXMF',SL:BXMF
         USECT    PP
OSULMSG  TEXTC    'OUT-SWAP USER LIST:'
FPLMSG   TEXTC    'FREE PROCESSOR LIST:'
INPLMSG  TEXTC    'IN-SWAP PROCESSOR LIST:'
         PAGE
*
*        DRIVE DISPLAY OF ALLYCAT'S COMBUF CHAIN
*
GHOST:COM EQU     %
         LI,R1    ATMSG2
         BAL,R0   MSG%OUT
         LI,R1    ATMSG3
         LI,R5    2                 TWO PASSES
         LI,R4    24                TOTAL MAX LOOP
         LI,R14   CBFHD             FIRST CELL/CHAIN
ALLYTABL4 BAL,R0  GETADDR
         LB,R3    *R15              GET HEAD
         BAL,R0   MSG
         LI,R1    16                SPACE
         BAL,R0   SPACES
ALLYTABL5 BAL,R0  TRANSSZ           PUT OUT THE VALUE
         LI,R1    ARROW
         BAL,R0   MSG
         CI,R3    0                 IS CURRENT NULL
         BEZ      ALLYTABL6         YEP . THATS THE TAIL
         LI,R14   COMBUF
         BAL,R0   GETADDR
         LW,R0    *R15,R3
         LB,R3    R0                GET FLINK
         BDR,R4   ALLYTABL5         CONTINUE
ALLYTABL6 LI,R1   TAILMSG
         BAL,R0   MBB               PUT IT OUT
         LI,R1    ATMSG4            NEXT MSG
         LI,R14   CBAHD             NEXT CHAIN
         BDR,R5   ALLYTABL4         GO
         B        SCANNER           ALL DONE....
ATMSG2   TEXTC    'GHOST COMMUNICATIONS:'
ATMSG3   TEXTC    'FREE CHAIN:'
ATMSG4   TEXTC    'IN USE CHAIN:'
         PAGE
*
*F*
*F*    NAME:           COCODE
*F*
*F*    PURPOSE:        TO DISPLAY EITHER A SELECT LIST OF COC
*F*                    LINE TABLES OR ALL COC LINE TABLES.
*F*
*F*    DESCRIPTION:    USING THE LIST ROUTINE 'GETLIST' - COCODE
*F*                    RUNS THE DISPLAY BY EXTRACTING VALUES FROM
*F*                    EACH OF THE COC TABLES DISPLAYING SAME ON THE
*F*                    PRINT LINE.
*F*
*
*        COMMAND FORMAT.
*
*        DI(SPLAY) CO(C)  (1)(,2)(,3)(,4)(,5)
*
*        NOTE THAT LIST IS OPTIONAL - LACK OF A LIST IMPLIES THAT
*        ALL COC TABLES SHOULD BE DISPLAYED
*
COCODE   LI,1     COCMSG          *
         BAL,0    TITEL           * TITLE LINE OUT
         LI,1     COC             * IS THIS A TIMESHARING SYSTEM
         BEZ      NOTRACE         * THIS IS NOT A COC SYSTEM
         LI,R1    COCTAB            * HEADER LINE
         BAL,R0   MBB               * OUT WITH A BLANK LINE
         LI,1     2               * GET ANY SPECIFIED LINE NUMBER
COCODE0  EQU      %               *
         BAL,0    GETHEX          *
         LI,R8    LNOL            * ASSUME ALL LINES
         LW,R6    R2              * IS THAT TRUE
         BEZ      %+2             * YES - USER GAVE NO OPTION
         LI,R8    1               * NO - USER GAVE OPTION - SET ONE PAS
COCLOOP  LI,14    LB:UN           * GET THE USER NUMBER ASSOCIATED
         BAL,0    GETADDR         *
         LB,7     *15,6           * THE USER NUMBER
         BNEZ     COCLOOP0        * DEFINITELY A USER THERE...
         LI,R14   COCOR           * MAYBE NOT - GET NEXT TRY
         BAL,R0   GETADDR         * NEXT TABLE
         MTH,0    *R15,R6         * ANYTHING THERE
         BNEZ     COCLOOP0        * YEP - JUMP
         LI,R14   BUFCNT          * LAST CHANCE
         BAL,R0   GETADDR         *
         MTB,0    *R15,R6         * ANYTHING IN BUFFER COUNTER
         BEZ      COCINCR1        * ***NO USER ON THIS LINE***
COCLOOP0 EQU      %               * FOUND A USER
         LI,R5    0               * INITIALIZE INDEX REGISTER
         LW,3     6               * PUT OUT THE LINE NUMBER
         BAL,0    TRANSSZ         *
COCLOOP1 EQU      %               *
         LB,1     COCSP,5         *
         BAL,0    SPACES          * PUT OUT THE CORRECT SPACES
         LH,R14   GETCOC,R5         * GET ADDRESS OF TABLE
         AND,R14  #R16              * NO SIGN EXTENSION
         BAL,0    GETADDR         * GET THE TABLE
         LB,R0    COCACT,R5         * FETCH OPCODE
         BAL,R1   RUNTAB            * FETCH CONTENTS
         DATA     X'3C000F'         *
NOTYPE   EQU      %               *
NOTANY   BAL,0    TRANSSZ         * PUT OUT HEX VALUE
COCINCR  AI,5     1               * NEXT TABLE
         CI,5     COCTABSIZ       * FINISHED
         BL       COCLOOP1        * NO, GET NEXT
         BAL,0    BUFOUT          * PUT OUT WHAT WE GOT
COCINCR1 AI,6     1               * NEXT LINE
         BDR,8    COCLOOP         * GET ALL THEM ACTIVE LINES
         LI,R6    COCODE0         * SET RETURN POINT
         B        GETLIST         * CHECK FOR LIST OF ITEMS
         PAGE
*
*        MESSAGES/TEXT STRINGS FOR COC TABLE DISPLAYS
*
COCTAB   EQU      %
         TEXTC    'LN ',;
                  'U# ',;
                  'TRM ',;
                  'EOM  ',;
                  'BUFS ',;
                  'CP ',;
                  'RSZ ',;
                  'MO ',;
                  'M2 ',;
                  'M3 ',;
                  'M4 ',;
                  'M5 ',;
                  'M6 ',;
                  'TL   ',;
                  'II   ',;
                  'IR   ',;
                  'ARSZ ',;
                  'PI ',;
                  'OI   ',;
                  'OR   ',;
                  'OC   '
*
*
COCSP    DATA,1   3,6,10,15,20,23,27,30,33,36,39,42,45,50,55,60,65,;
                  68,73,78,83
         BOUND    4
GETCOC   EQU      %
         DATA,2   LB:UN,;           0
                  COCTERM,;         1
                  EOMTIME,;         2
                  BUFCNT,;          3
                  CPOS,;            4
                  RSZ,;             5
                  MODE,;            6
                  MODE2,;           7
                  MODE3,;           8
                  MODE4,;           9
                  MODE5,;           10
                  MODE6,;           11
                  TL,;              12
                  COCII,;           13
                  COCIR,;           14
                  ARSZ,;            15
                  CPI,;             16
                  COCOI,;           17
                  COCOR,;           18
                  COCOC             19
COCTABSIZ EQU     HA(%)-HA(GETCOC)
         BOUND    4
*
*
*
COCACT   EQU      %
         BYTE     0                 LB:UN
         BYTE     1                 COCTERM
         HALF     2                 EOMTIME
         BYTE     3                 BUFCNT
         BYTE     4                 CPOS
         BYTE     5                 RSZ
         BYTE     6                 MODE
         BYTE     7                 MODE2
         BYTE     8                 MODE3
         BYTE     9                 MODE4
         BYTE     10                MODE5
         BYTE     11                MODE6
         HALF     12                TL
         HALF     13                COCII
         HALF     14                COCIR
         BYTE     15                ARSZ
         BYTE     16                CPI
         HALF     17                COCOI
         HALF     18                COCOR
         HALF     19                COCOC
         BOUND    4
*
*
4F     EQU     #R16
ARROW    EQU      AND
TAILMSG  TEXTC    'TAIL'
         PAGE
*
*F*
*F*    NAME:           USERS
*F*
*F*    PURPOSE:        TO PRODUCE EITHER A SELECT LISTING OF USERS
*F*                    TABLES OR ALL USER TABLES.
*F*
*F*    DESCRIPTION:    SCANNER PARSES THE COMMAND LINE AND COMES
*F*                    HERE WHEN IT FINDS THE DISPLAY USERS COMMAND.
*F*                    USERS DISPLAYS THE REQUESTED USER TABLES
*F*                    USING THE LIST RETURNING ROUTINE 'GETLIST'.
*F*
*F*                    IN THE GHOST MODE 'ALL' - ALL THE USERS (EXCEPT-
*F*                    FOR 'SNULL' PEOPLE) ARE DISPLAYED.
*F*
*
*        COMMAND FORMAT.
*
*        DI(SPLAY)  US(ER)  (1)(,2)(,3)(,4)(,5)
*
*        NOTE THAT LIST IS OPTIONAL - LACK OF A LIST IMPLIES
*        THAT ALL USER TABLE ENTRIES SHOULD BE DISPLAYED.
*
USERS    EQU      %               *
         LI,R1    USRTMSG         * TITLE LINE MSG ADDRESS
         BAL,R0   TITEL           * NOW.
         LI,R1    USRMSG          * AND THEN THE HEADER LINE
         BAL,R0   MSG%OUT         * HERE.
         LI,R1    1               * RESET STATE SORT CELL
         STW,R1   CURR%STATE      * TO INITIAL VALUE
         LI,R1    2               * LOAD FIRST FIELD # REGISTER
USERS1   EQU      %               *
         BAL,R0   GETHEX          * AND GO LOOK FOR REQUEST #
         STW,R2   USER            * SAVE REQUEST
         AI,R2    0               * WAS THERE A NUMBER GIVEN
         BEZ      USERS2          * NO - DO ALL USERS
         CLM,R2   USERLIMS        * IS IT A VALID NUMBER
         BCS,9    RES:JIT5        * NO - EXIT W/ERROR MSG
         LI,R10   1               * SET LOOP REGISTER UP
         LW,R4    R2              * MOVE USER # TO INTERNAL USAGE REG.
         B        USERS3          * JOIN UP.
USERS2   EQU      %               *
         LI,R4    1               * LOAD INITIAL USER'S NUMBER
         LI,R10   SMUIS           * SET LOOP REGISTER FOR ALL USERS
USERS3   EQU      %               *
         LI,R2    0               * LOAD INDEX INTO INTERNAL TABLES
USERS4   EQU      %               *
         LH,R14   UTABS,R2          * LOAD ADDRESS OF TABLE
         AND,R14  #R16              *
         BAL,R0   GETADDR         * FETCH REQUIRED ADDRESS
         LB,R0    ACTION,R2         * PICK UP OPCODE
         BAL,R1   RUNTAB            * AND FETCH TABLE ENTRY
         DATA     X'38000F'         REMAINDER OF INST
USERS5   EQU      %               *
         CI,R2    0               * ARE WE DOING THE STATE TABLE
         BG       USERS7          * NOPE - JUMP
         MTW,0    USER            * DOING JUST ONE USER
         BNEZ     USERS6          * YES - NO STATE SORT
         CW,R3    CURR%STATE      * IS STATE WE WANT NOW...
         BNE      USERS9          * NO - SKIP TILL LATER
USERS6   EQU      %               *
         XW,R3    R4              * STATE # TO R4 / USER # TO R3
         BAL,R0   TRANSSZ         * PUT OUT USER #
         LB,R1    USER:SPC,R2     * GET SPACING COUNT
         BAL,R0   SPACES          * AND PUT IT OUT
         LW,R6    R4              * MOVE STATE # TO R6
         BAL,R0   SETR6           * CREATE STATE TEXT MSG
         XW,R4    R3              * USER # BACK TO R4
         B        USERS8          * AND MERGE
USERS7   EQU      %               *
         BAL,R0   TRANSSZ         * PUT OUT VALUE ON PRINT LINE
USERS8   EQU      %
         AI,R2    1               * BUMP TO NEXT ENTRY
         LB,R1    USER:SPC,R2     * GET NEXT SPACING
         BEZ      %+2              * HIT THE END OF SPACING
         BAL,R0   SPACES          * PUT IT OUT
         CI,2     UTABS1Z         * DONE W/TABLES YET
         BL       USERS4          * NOT DONE WITH ROW YET
         BAL,R0   BUFOUT          * PRINT ENTIRE LINE
USERS9   EQU      %               *
         AI,R4    1               * STEP TO NEXT USER #
         BDR,R10  USERS3          * FINISH LIST
         MTW,0    USER            * DOING OPTIONS BY COMMAND
         BNEZ     USERS10         * YES - JUMP
         LW,R1    CURR%STATE      * GET STATE WE JUST FINISHED WITH
         AI,R1    1               * BUMP
         STW,R1   CURR%STATE      * AND REPLACE IT
         CI,R1    #STATES         * AT END OF ALL STATES
         BL       USERS2          * NOT YET
USERS10  EQU      %               *
         LW,R1    FIELD#          * GET CURRENT FIELD NUM
         AI,R1    1               * ADVANCE IT
         LW,R2    FIELDS,R1       * GET NEXT ONE
         BEZ      U2:TABLES       * END OF LIST
         LW,R2    0,R2            * GET NEXT VALUE
         BEZ      U2:TABLES       * END OF LIST
         B        USERS1          * GET NEXT LIST ITEM
         PAGE
*
*        DISPLAY THE REMAINDER OF THE USER TABLES
*
U2:TABLES EQU     %               *
         LI,R1    U2:TITE         * TITLE LINE
         BAL,R0   TITEL           * OUT
         LI,R1    U2:HEAD         * HEADING
         BAL,R0   MSG%OUT         * OUT
         LI,R1    2               * FIRST OPTION FIELD
U2:OPT   EQU      %               *
         BAL,R0   GETHEX          * GET OPTION FIELD
         BGZ      US:ONE          * USE IT
         LI,R10   SMUIS           * NO, SET UP TO DO ALL
         LI,R2    1               * STARTING AT NUMBER ONE
         B        U2:START        * GO
US:ONE   LI,R10   1               * SET TO DO ONLY ONE
U2:START EQU      %               *
U2:ROWS  LI,R14   UB:US           * CHECK
         BAL,R0   GETADDR         * FOR A USER THERE
         LB,R3    *R15,R2         * IS THERE
         MTW,0    USER            * DOING A SINGLE USER
         BNEZ     STATEOK         * YES - SKIP STATE CHECKS
         CI,R3    0               * IS THERE A STATE THERE
         BEZ      U2:NOST         * NOPE - GO TO NEXT USER
         CI,R3    #STATES         * IS THE SNULL STATE
         BE       U2:NOST         * YES, DONT DISPLAY
STATEOK  EQU      %               *
         LI,R4    0               * YEP, SET INDEX REG
         LW,R3    R2              * MOVE USER # FOR DISPLAY
         BAL,R0   TRANSSZ         * USER'S #
U2:LOOP  LB,R1    U2:SPACES,R4    * GET SPACING
         BAL,R0   SPACES          *
         LI,R3    0               * ASSUME TABLE WONT BE THERE
         LH,R14   U2TAB,R4          * LOAD ADDRESS OF TABLE
         BEZ      U2:SCR          * TABLE WAS SREF'D - BRANCH
         BAL,R0   GETADDR         * GET IT
         LB,R0    U2ACT,R4          GET OPCODE
         BAL,R1   RUNTAB            * GET ENTRY
         DATA     X'34000F'         * REMAINDER OF INST
U2:SCR   BAL,R0   TRANSSZ         * SHOVE OUT THE VALUE
         AI,R4    1               * NEXT ROW
         CI,R4    #U2ACTS         * DONE WITH ROW
         BL       U2:LOOP         *
         BAL,R0   BUFOUT          * PRINT THE WHOLE THING
U2:NOST  AI,R2    1               * NEXT USER #
         BDR,R10  U2:ROWS         * DO NEXT ONE IF WE SUPPOSED TO
         LI,R6    U2:OPT          * RETURN POINT
         B        GETLIST         * GET LIST OR QUIT
         PAGE
*
*        COMPLETE THE INSTRUCTION
*
RUNTAB   EQU      %
         LW,R13   0,R1              GET REMAINDER OF INST
         STB,R0   R13               STORE OPCODE
         EXU      R13               FETCH ENTRY
         STW,R1   TEMP1             SAVE RETURN ADDRESS
         AND,R13  =X'00F00000'      PULL OUT REGISTER #
         OR,R13   =X'4B000000'      INSERT THE 'AND' OPCODE
         LI,R1    X'60'             MASK TO PULL
         AND,R1   R0                OUT TYPE OF INST OPCODE IN R0
         SLS,R1   -5                CONVERT TO INDEX VALUE
         OR,R13   INSERTS,R1        INSERT PROPER ADDRS PER OPCODE
         EXU      R13               MASK VALUE CORRECTLY
         LW,R1    TEMP1
         B        1,R1              RETURN TO CALLER
*
INSERTS  EQU      %
         DATA     #R1               0 DOUBLE WORD
         DATA     #R1               1 WORD
         DATA     #R16              2 HALF-WORD
         DATA     #RFF              3 BYTES
*
#RFF     DATA     X'FF'
#R1      DATA     -1
*
         USECT    DATA
TEMP1    DATA     0
         USECT    PP
         PAGE
*
*        TABLE DATA FOR ADDITIONAL USER TABLES
*
U2TAB    EQU      %
         DATA,2   U:MISC,;          0
                  UH:DL,;           1
                  UB:C#,;           2
                  UB:PRIO,;         3
                  UB:PRIOB,;        4
                  UB:NECB,;         5
                  UH:WL,;           6
                  UB:MPFLG,;        7
                  UB:CALR,;         8
                  U:CALC            9
#U2ACTS  EQU      HA(%)-HA(U2TAB)
         BOUND    4
*
*
*
U2ACT    EQU      %
         WORD     0
         HALF     1
         BYTE     2                 UB:C#
         BYTE     3                 UB:PRIO
         BYTE     4                 UB:PRIOB
         BYTE     5                 UB:NECB
         HALF     6                 UH:WL
         BYTE     7                 UB:MPFLG
         BYTE     8                 UB:CALR
         WORD     9                 U:CALC
         BOUND    4
U2:HEAD EQU %
         TEXTC    'USER  U:MISC    UH:DL  CYL#  PRIO  ',;
                  'PRIOB  NECB  UH:WL  MPFLG  CALR  CALC'
*
*
U2:SPACES EQU     %
         DATA,1   6,16,23,29,35,42,48,55,62,68,0
         BOUND    4
         PAGE
*
*
UTABS    EQU      %
         DATA,2   UB:US,;           0
                  UB:BL,;           1
                  UB:FL,;           2
                  UH:FLG,;          3
                  UH:FLG2,;         4
                  UX:JIT,;          5
                  UB:SWAPI,;        6
                  UH:JIT,;          7
                  UH:AJIT,;         8
                  UB:PCT,;          9
                  UB:ACP,;          10
                  UB:APR,;          11
                  UB:APO,;          12
                  UB:ASP,;          13
                  UB:DB,;           14
                  UB:OV,;           15
                  UB:MF             16
UTABS1Z  EQU      HA(%)-HA(UTABS)
         BOUND    4
*
         PAGE
*
ACTION   EQU      %
         BYTE                       0
         BYTE                       1
         BYTE                       2
         HALF                       3
         HALF     4
         BYTEX    5
         BYTE     6
         HALF     7
         HALF     8
         BYTE     9
         BYTE     10
         BYTE     11
         BYTE     12
         BYTE     13
         BYTE     14
         BYTE     15
         BYTE     16
         BOUND    4
*
*
USRMSG   TEXTC    'USER STATE   BL FL FLG  FLG2  JIT  ',;
                  'SWPI  HJIT  AJIT PCT ACP APR APO ASP ',;
                  'DB OV MF'
USER:SPC DATA,1    5,13,16,19,24,30,35,41,47,52,56,60,64,68,72,75,;
                  78,0,83,0        ZERO INDICATES END OF ONLINE SPACING
         USECT    DATA
         BOUND    4
CURR%STATE DATA   0
         USECT    PP
         PAGE
*
*F*
*F*    NAME:           ADAMDUMP
*F*
*F*    PURPOSE:        TO PRODUCE A DUMP OF ADAM'S MEMORY AT
*F*                    SCREECH TIME.
*F*
*F*    DESCRIPTION:    ANLZ WILL GO INTO MASTER MODE AND READ OUT
*F*                    ADAM'S MEMORY VIA READ DIRECTS CREATING A
*F*                    BUFFER TO DUMP OUT.
*F*
*
*        COMMAND FORMAT.
*
*        DI(SPLAY)  AD(AM)
*
ADAMDUMP EQU      %
         CAL1,6   SYSFPT            ASK FOR MASTER MODE
         BCS,8    NOADAMPRIV        CANNOT DO IT
         LI,1     X'800'            UNUSED BIT IN STATUS
         RD,1     X'2FF0'           ADAM EXISTS AND STOPPED?
         CI,1     X'801'
         BANZ     DONE              NO DO NOTHING
         SLS,1    -12               LOOK AT PLUGBOARD
         CI,1     X'F'              DEFAULT PROGRAM?
         BNE      DONE              NO DO NOTHING
         LI,5     0                 INDEX INTO PAGEBUF
         LI,1     0                 TYPX OF ADAM MEMORYS
READSET  EQU      %
         LB,2     LNG,1             GET LENGTH OF THIS MEMORY
         LH,3     ADDR,1            GET THIS MEMORY'S ADDRESS
         WD,3     X'2FF2'           SET ADDRESS
READADAM EQU      %
         RD,4     X'2FF5'           READ AND INCREMENT ADDRESS
         STW,4    *PAGEBUF,5
         AI,5     1
         BDR,2    READADAM
         AI,1     1                 POINT TO NEW MENORY
         CI,1     4                 DONE?
         BNE      READSET           NO
         LI,5     5                 START SET NIA=1
         WD,5     X'2FF1'           CONTROL
DONE     EQU      %
         LPSD,0   ADAMPSD           GO BACK TO SLAVE
         CI,1     4                 DID WE READ ADAM
         BNE      SCANNER           NO, RETURN
*
*        ROUTINE TO DUMP PAGEBUF
*
AM       EQU      1
         LI,1     TABHEADER
         BAL,0    MSG
         BAL,0    BUFOUT
         LI,5     0                 COUNTER
TABDUMP  EQU      %
         LI,4     0                 TABLE POJMTER
         LW,3     5
         BAL,0    TRANSSZ
TABLOOP  EQU      %
         LB,1     ADAMSPS,4
         BAL,0    SPACES
         CB,5     COUNTERSIZE,4     OVER TABLE SIZE?
         BGE      TNEXT             YES
         LB,2     TABSTART,4
         AW,2     PAGEBUF           START OF TABLE
         EXU      ADAMLOAD,4        WORD TO 8,9
         LW,3     8
         BAL,0    TRANS             TRANSLATE 8
         CI,4     AM                WORD RESOLUTION
         BE       TNEXT             YES
         LW,3     9                 NI, DOWBLEWORD
         BAL,0    TRANS
TNEXT    EQU      %
         AI,4     1
         CI,4     4
         BL       TABLOOP
         BAL,0    BUFOUT
         AI,5     1
         CI,5     64                MAX COUNTERSIZE
         BL       TABDUMP
         B        SCANNER           RETURN, FINISHED
*
*
ADAMLOAD EQU      %
         LD,8     *2,5
         LW,8     *2,5
         LD,8     *2,5
         LD,8     *2,5
*
*
NOADAMPRIV  LI,R1 NAPM
         B        PUSHMSG
NAPM     TEXTC    'CANNOT GET INTO MASTER MODE TO READ ADAM MEMORY'
SYSFPT   GEN,8,24 8,0
         BOUND    8
ADAMPSD  GEN,12,20   12,DONE+1
         DATA     0
LNG      DATA,1   64,64,64,128
ADDR     DATA,2   0,X'1000',X'2000',X'3000'
TABSTART DATA,1   0,64,128,192
COUNTERSIZE  DATA,1  32,64,32,64
ADAMSPS  DATA,1   8,26,36,52
TABHEADER TEXTC   'NUM    AP               AM        BP              ',;
                  '  BM'
         PAGE
         USECT    PP
*
*F*
*F*    NAME:           PROCS
*F*
*F*    PURPOSE:        TO PRODUCE EITHER A LIST OF SELECTED
*F*                    PROCESSORS OR ALL PROCESSORS.
*F*
*F*    DESCRIPTION:    USING THE LIST GIVEN PROCS WILL PRODUCE
*F*                    A FORMATTED LISTING OF ALL THE PROCESSOR
*F*                    TABLES.
*F*
*
*        COMMAND FORMAT.
*
*        DI(SPLAY)  PR(OCESSOR)  (1)(,2)(,3)(,4)(,5)(,6)
*
*        NOTE THAT LIST IS OPTIONAL - LACK OF A LIST IMPLIES TO
*        DISPLAY ALL PROCESSOR TABLES
*
PROCS    EQU      %               * ENTRY...
         LI,R1    PROTMSG         * LOAD TITLE MSG ADDRESS
         BAL,R0   TITEL           * AND PUT OUT NEW PAGE/TITLE LINE
         LI,R1    PROCMSG         *
         BAL,R0   MSG%OUT         * PUT OUT HEADER LINE
         LI,R1    2               * INITIAL OPTION FIELD #
PROCS0   EQU      %               *
         BAL,R0   GETHEX          * GET OPTION FIELD
         LW,R7    R2              * ANY OPTION FIELD GIVEN
         BEZ      PROCS1          * NO
         LI,10    0               * SET FOR ONE PASS
         B        PROCS2          * DO IT
PROCS1   EQU      %
         LI,R10   PPROCS+1          * SET MAXIMUM LOOP THRU TABLES
PROCS2   EQU      %               *
         LI,R2    0               * INDEX INTO INTERNAL TABLES
         LW,R3    R7              * PUSH
         BAL,R0   TRANSSZ         * PROCESSOR#
         AI,R2    1               * NEXT COLUMN#
         LB,R1    SPROCT,R2       * SEND
         BAL,R0   SPACES          *
         LI,R14   P:NAME          *
         BAL,R0   GETADDR         * FETCH PROC NAME TABLE
         LI,R3    0               * ASSUME THERE WILL BE NO NAME
         LD,R8    *15,R7          * GET NAME
         BEZ      PROCS3          * TRUE - NO NAME - JUMP
         AND,R8   =X'07FFFFFF'    * NAME CANT BE >7 CHARS
         STD,R8   PROCNAME        * STORE IT FOR PRINTING
         LI,R1    PROCNAME        * LOAD MSG POINTER TO IT
         MTB,R0   PROCNAME        * WAS PROC REPLACED BY D.R.S.P.
         BNEZ     PROCS4          * NO - PRINT NAME
         LW,R3    PROCNAME        * YES - SHOW VALUE
PROCS3   EQU      %               *
         BAL,R0   TRANSSZ         * .VS. NAME
         B        %+2             * MERGE...
PROCS4   BAL,R0   MSG             * OR PRINT NAME
*
*        NOTE THAT LOOP BETWEEN PROCS5 - PROCS9 PUTS OUT
*        THE REMAINDER OF THE TABLES FOR THE CURRENT PROCESSOR
*
         LI,R4    0               * SET INTERNAL INDEX REGISTER
PROCS5   EQU      %               * LOOP RETURN POINT FOR EACH LINE
         AI,R2    1               * BUMP SPACING INDEX REGISTER
         LB,R1    SPROCT,R2       * GET NEXT SPACING VALUE
         BAL,R0   SPACES          * AND SPACE OVER IN PRINT LINE
         MTB,0    ACTP1,R4          CHECK FOR
         BNEZ     ACTP2             YUP--> CHECK FOR END OF TABLE
PROCS6   EQU      %               * RETURN HERE IF IT IS
         LI,R3    0               * ASSUME TABLE WONT BE THERE
         LH,R14   LOADP,R4          * GET ADDRESS OF TABLE
         BEZ      PROCS7          * JUMP - UNSATISFIED SREF
         BAL,R0   GETADDR         * AND FETCH ADDRESS INTO BUF
         LB,R0    ACTP,R4           * GET OPCODE
         BAL,R1   RUNTAB            * FETCH ENTRY
         DATA     X'3E000F'         * REMAINDER OF INST
PROCS7   EQU      %               *
         LB,R1    ACTP3,R4          GET ACTION INDEX
         EXU      TRANSL,R1         LOAD R0 WITH ADDRESS
         BAL,R0   *R0               AND GO TO TRANSLATOR
PROCS8   EQU      %               * COME HERE IF NO TABLE
         AI,R4    1               * NEXT INDEX
         CI,R4    PTABSIZ         * DONE
         BL       PROCS5          * NOT DONE W/CURRENT ROW YET
         BAL,R0   BUFOUT          *
PROCS9   EQU      %               *
         AI,R7    1               * STEP TO NEXT PROCESSOR #
         BDR,R10  PROCS2          * DO NEXT TILL COUNT RUNSOUT
         LI,R6    PROCS0          * SET RETURN POINT
         B        GETLIST         * AND CHECK FOR LIST OF ITEMS
         PAGE
*
*
ACTP     EQU      %
         BYTEX    0
         BYTEX    1
         BYTE     2
         BYTE     3
         BYTE     4
         HALF     5
         HALF     6
         BYTE     7
         BYTE     8
         BYTE     9
         BYTE     10
         BYTE     11
         BYTE     12
         WORD     13
         WORD     14
         BYTE     15
         BOUND    4
         PAGE
*
*
LOADP    EQU      %
         DATA,2   PX:HPP,;          0
                  PX:TPP,;          1
                  PB:PSZ,;          2
                  PB:DSZ,;          3
                  PB:DCBSZ,;        4
                  PH:PDA,;          5
                  PH:DDA,;          6
                  PB:UC,;           7
                  PB:LNK,;          8
                  PB:PVA,;          9
                  PB:HVA,;          10
                  PB:C#,;           11
                  PB:DC#,;          12
                  P:SA,;            13
                  P:TCB,;           14
                  PB:LCT            15
PTABSIZ  EQU      HA(%)-HA(LOADP)
         BOUND    4
*
*        ACTION TABLE TO AVOID PRINTING TABLES THAT ARENT THERE
*
ACTP1    EQU      %
         DATA,1   0,;               0
                  0,;               1
                  0,;               2
                  1,;               3
                  1,;               4
                  0,;               5
                  1,;               6
                  0,;               7
                  0,;               8
                  0,;               9,;
                  10,;              10
                  0,;               11
                  0,;               12
                  13,;              13
                  14,;              14
                  0                 15
         BOUND    4
*
*
*
ACTP3    EQU      %
         DATA,1   0,;               0
                  0,;               1
                  0,;               2
                  0,;               3
                  0,;               4
                  0,;               5
                  0,;               6
                  0,;               7
                  0,;               8
                  0,;               9
                  0,;               10
                  0,;               11
                  0,;               12
                  1,;               13
                  1,;               14
                  0                 15
         BOUND    4
*
*
TRANSL   EQU      %
         LI,R0    TRANSSZ           0 MODE
         LI,R0    TRANS             1 MODE
         LI,R0    REM:DBL           2 MODE
         LI,R0    INACCT            3 MODE
         LI,R0    RBBIN4            4 MODE
*
*
*
*
ACTP2    EQU      %
         CI,R7    PNAMEND-1         IS THE TABLE ENTRY REALLY THERE
         BLE      PROCS6          TABLE IS THERE STILL
         LI,R1    NOTABMSG          TABLE ENTRY NOT THERE
         BAL,R0   MSG               INDICATE THIS BY DASHES
         B        PROCS8          REJOIN MAIN PATH...
NOTABMSG TEXTC    '--'
PROCMSG  TEXTC    ' P#  P:NAME  HPP   ',;
                  'TPP    PSZ  DSZ  DCBSZ',;
                  '  PDA   DDA   UC   LNK',;
                  '  PVA  HVA  PC#   DC# START     TCB       LCT'
*                 '**---**---**---***---*-----*****---*******---'
SPROCT   EQU      %
         DATA,1   1,5,14,20,26,31,36,43,49,55,60,65,70,75,81,85
         DATA,1   95,105,115
         BOUND    4
         PAGE
*
*        REMOTE PROCESSING TABLES
*
*
*
REMOTE   EQU      %
         DATA,2   RBLIMS,;          0
                  RBB:SFC,;         1
                  RBB:SPC,;         2
                  RBB:CPZ,;         3
                  RBB:LPZ,;         4
                  RBB:BCB,;         5
                  RBB:HOU,;         6
                  RBB:HIN,;         7
                  RBB:HFE,;         8
                  RBB:ID,;          9
                  RBH:ACK,;         10
                  RB:BUF,;          11
                  RBD:WSN,;         12
                  RB:FLAG           13
#REMOTES EQU      HA(%)-HA(REMOTE)-1
         BOUND    4
*
REM:LOAD EQU      %
         ZIP      0
         BYTE     1
         BYTE     2
         BYTE     3
         BYTE     4
         BYTE     5
         BYTE     6
         BYTE     7
         BYTE     8
         BYTE     9
         HALF     10
         WORD     11
         ZIP      12
         WORD     13
         BOUND    4
*
*
REM:ACTION EQU    %
         DATA,1   0,;               0
                  0,;               1
                  0,;               2
                  0,;               3
                  0,;               4
                  0,;               5
                  0,;               6
                  0,;               7
                  0,;               8
                  0,;               9
                  0,;               10
                  1,;               11
                  2,;               12
                  1                 13
         BOUND    4
*
REM:ACTION2 EQU   %
         DATA,1   0,0,0,0,0,0,0,0,0,0,;
                  0,1,0,0
         BOUND    4
*
*
*
GET:RBTBUF EQU    %
         CI,R3    0                 ANY BUFFER  ASSIGNED
         BEZ      RBT45             NOPE
         CI,R3    511               OR IS IT A RETRY COUNTER
         BLE      RBT45             ONE OR THE OTHER
         LCI      0
         PSM,R0   STACK             SAVE EM
         LI,R4    X'7FFFF'
         AND,R4   R3                EXTRACT BUF WA
         SLS,R4   -9                INTO A PAGGE  NUMBER
         LCFI     10                STORE
         STCF     PG:MODE           OWNER'S CODE
         BAL,R0   PAGETABLE         RECORD IRBT WORK PAGE
         LCI      0
         PLM,R0   STACK
         B        RBT45             AND MERGE WITH ROUTINE
*
REM:SPAC EQU      %
         DATA,1   1,5,15,33,43,48,51,55,58,62,66,70,74,78,82
         BOUND    4
*
*
RBT:HEAD EQU      %
 TEXTC ' #   FLAGS     WSN               BUF       ACK  ID',;
                  ' HFE IN OUT BCB LPZ CPZ SPC SFC '
*
*
         USECT    DATA              GENERATE DATA SECTION HERE
         BOUND    8
COPYLIMS DATA     0,0
         USECT    PP                AND BACK TO PROCEDURE SECTION
*
         PAGE
*
*F*
*F*    NAME:           RBTDISP
*F*
*F*    PURPOSE:        TO DISPLAY THE RBT TABLES IF THIS IS AN RBT SYS.
*F*
*F*    DESCRIPTION:    RBTDISP WILL PICK UP THE RBLIMS CLM PAIR
*F*                    AND SCAN THRU THE DCT/IOQ TABLES TILL IT FINDS
*F*                    AN RBT ENTRY.
*F*                    ONCE AN RBT IS FOUND - ALL THE IRBT TABLES
*F*                    WILL BE DISPLAYED.
*F*
*
*        COMMAND FORMAT.
*
*        DI(SPLAY)  RB(TS)
*
RBTDISP  EQU      %
         LI,R1    RBTITLE           PUT OUT TITLE LINE
         BAL,R0   TITEL
         LI,R14   SPOOL             FIRST LETS GO GET THE SYMBIONT
         BAL,R0   GETADDR           WORK PAGE WORD ADDRESS
         LW,R4    *R15              FETCH IT
         BEZ      RBT0              NONE
         SLS,R4   -9                INTO A PAGE NUMBER
         LCFI     10
         STCF     PG:MODE           STORE SYMBION OWNER'S CODE
         BAL,R0   PAGETABLE         AND INSERT IT INTO MATRIX
RBT0     EQU      %
         LI,R1    RBT:HEAD          NOW FOR THE HEADING LINE
         BAL,R0   MBB               OUTPUT
         LI,R14   RBLIMS            FIRST GET REMOTE TABLE
         BEZ      NOTRACE           DOESNT EXIST IN THIS SYSTEM
         BAL,R0   GETADDR           PICK IT UP
         LCFI     2
         LM,R0    *R15              GET IT
         STM,R0   COPYLIMS          AND PUT IT IN OUR TABLE
         CW,R0    R1                IS FIRST WORD > SECOND WORD
         BG       NOTRACE           THIS IS NOT A RBT SYSTEM
         LW,R6    R0                MOVE FIRST DCT INDEX
RBT1     EQU      %
         LI,R5    0                 INDEX INTO MY TABLES
         CLM,R6   COPYLIMS          DOES THIS DCT INDEX FIT
         BCR,9    RBT:ENTRY         YEP
RBT2     EQU      %
         AI,R6    1                 NOPE
         CI,R6    DCTSIZ            AT TOP
         BLE      RBT1              GO TILL TOP
*
*        FALL THRU AND DISPLAY RBT BUFFERS
*
         PAGE
*
*        DISPLAY ALL RBT BUFFERS
*
         LI,R1    RBTBUFTM          TITLE LINE
         BAL,R0   TITEL             OUTPUT
         LW,R6    COPYLIMS          FIRST RBT DEVX
RBT:BUF  EQU      %
         LI,R14   RB:FLAG           GET FLAGS
         BAL,R0   GETADDR           FOR THIS RBT ENTRY
         LI,R7    512               ASSUME FULL PAGE DUMP
         LW,R0    *R15,R6           GET THE FLAGS
         SLS,R0   -16
         CI,R0    32                IS 1/2 PAGE BIT SET
         BAZ      %+2               NO
         LI,R7    256               YES
         LI,R14   RB:BUF            NOW WE NEED BUF ADDRESS
         BAL,R0   GETADDR
         LW,R14   *R15,R6           GET BUFFER ADDRESS
         AND,R14  =X'7FFFF'         SCREEN IT
         BEZ      RBT:BUF1          NONE
         CI,R14   511               CHECK FOR RETRY COUNTER
         BLE      RBT:BUF1          YES-> SKIP
         BAL,R0   GETADDR           GRAB THIS BUFFER
         LW,R8    R15
         BAL,R0   DUMPSOME          DUMP IT
         BAL,R0   BLANK1
RBT:BUF1 EQU      %
         AI,R6    1
         CW,R6    COPYLIMS+1
         BLE      RBT:BUF           NOT DONE YET
         B        SCANNER
         PAGE
*
*        FOUND AN RBT ENTRY
*
RBT:ENTRY EQU     %
         LW,R7    R6                MOVE DCT INDEX INTO OUR REG.
         LB,R1    REM:SPAC,R5       GET FIRST SPACING
         BAL,R0   SPACES
         LW,R3    R7                GET RBT NUMBER (INDEX)
         BAL,R0   TRANSSZ           ONTO PRINT LINE
         LI,R4    #REMOTES          SET UP LOOP
RBT3     EQU      %
         AI,R5    1                 BOOST
         LB,R1    REM:SPAC,R5       GET SPACING
         BAL,R0   SPACES
         LH,R14   REMOTE,R4         LOAD TABLE ADDRESS
         AND,R14  #R16
         BAL,R0   GETADDR           GO GET IT
         LB,R0    REM:LOAD,R4       GET OPCODE
         BEZ      RBT4              NOT SUPPOSED TO GO
         BAL,R1   RUNTAB            ELSE FETCH TABLE ENTRY
         DATA     X'3E000F'
RBT4     EQU      %
         MTB,0    REM:ACTION2,R4    SUPPOSED TO LOOK FOR RBT BUFFER
         BNEZ     GET:RBTBUF        YUP--> SEE IF THERE
RBT45    EQU      %                 REJOIN FROM BUF LOOK
         LB,R1    REM:ACTION,R4     * GET NDX
         LW,R1    TRANSL,R1         * GET ADDRESS TO GO TO
         BAL,R0   *R1               AND GO THERE
RBT5     EQU      %                 REJOIN FROM DBL-WORD MOVE
         BDR,R4   RBT3              FINISH LOOP
         BAL,R0   BUFOUT            PRINT EVERYTHING WE JUST DID
         B        RBT2              AND GO TO NEXT ENTRY
*
*        MOVE DBL-WORD WORK STATION NAME IN TEXT
*
REM:DBL  EQU      %
         LD,R0    *R15,R7           GET WSN NAME
         BEZ      REM:DBL1          DONT PRINT ZEROS
         LB,R3    R0                GET FIRST BYTE OF NAME
         BEZ      REM:DBL1          MOVE BLANKS
         CI,R3    X'F0'             IS PRINTABLE TEXT
         BANZ     REM:DBL2          YEP - USE IT
REM:DBL1 EQU      %
         LD,R0    BLANKS            USE BLANKS IF NOT PRINTABLE
REM:DBL2 EQU      %
         STD,R0   DEV%MSG           STORE IT
         LI,R1    DEV%MSG           SET LOCATION
         LI,R2    8                 SET COUNT
         BAL,R0   MSG1              PUT NAME INTO PRINT LINE
         B        RBT5              REJOIN MAIN PATH
         BOUND    8
BLANKS   TEXT     '     '
*
        PAGE                                                                 A00
*
*F*
*F*    NAME:           IODISPLAY
*F*
*F*    PURPOSE:        TO DISPLAY A LIST OF DEVICE ORDERED BY
*F*                    CHANNEL NUMBER.
*F*
*F*    DESCRIPTION:    IODISPLAY WILL SCAN THRU THE DEVICE TABLES
*F*                    DISPLAYING DEVICES THAT ARE ON THE SAME
*F*                    I/O CHANNEL. THIS ROUTINE IS NOT TO BE CONFUSED
*F*                    WITH THE DCT/IOQ DISPLAYS IN ANALZO2 - IT IS
*F*                    DISTINCTLY DIFFERENT.
*F*
*
*        COMMAND FORMAT.
*
*        DI(SPLAY)  IO(CHANNEL)     (1)(,2)(,3)(,4)(,5)(,6)(,7)
*
*        NOTE THAT LIST IS OPTIONAL - LACK OF A LIST IMPLIES TO
*        DISPLAY ALL I/O CHANNELS.
*
IODISPLAY EQU     %                                                          A00
         LI,R1    -128              LENGTH OF TABLE
         LI,R0    0                 NEW CONTENTS TO GO INTO TABLE
         LW,R2    USERLIST          ADDRESS OF SCRATCH PAD TABLE
         AI,R2    128
         STW,R0   *R2,R1            CLEAR THE TABLE TO ALL ZEROS
         BIR,R1   %-1               FOR IOQ CHAIN OBSERVATION
         LI,1     IODISMSG          SET UP TITLE                             A00
         BAL,0    TITEL             AND SHOVE IT OUT                         A00
         LI,14    DCT2                                                       A00
         BAL,0    GETADDR         PICK UP ALL CHANNELS                       A00
         PAGE
*
*        DISPLAY DEVICES ON EACH CHANNEL - AND THE IOQ ENTRIES
*        ASSOCIATED WITH THAT CHANNEL
*
         LI,R1    2                 OPTIONAL FIELD NUMBER
NXTCIT   EQU      %
         BAL,R0   GETHEX
         STW,R2   USER              SAVE NUM OR ZERO
         AI,R2    0                 WAS OPTION GIVEN
         BGZ      %+2               YUP
         LI,R2    1                 START AT ONE IF NO OPTION GIVEN
         CLM,R2   CITLIMS           CHK GIVEN OPTION AGAINST POSSIBLE
         BCS,9    SCANNER           ILLEGAL OPTION GIVEN
         STW,R2   CURCITX           INITIALIZE DATA CELL
CITSPIN  EQU      %
         BAL,R0   BLANK1
         LI,R1    DCTHDR            PUT OUT THE DCT HEADER LINE
         BAL,R0   MB
         LI,R4    1                 INITIAL DCT INDEX
FINDEV   EQU      %
         STW,R4   CURDCTX           SAVE CURRENT DCT INDEX
         LI,R14   DCT2              GO GET THE DEV'S CHAN TABLE
         BAL,R0   GETADDR
         LW,R2    CURCITX           GET CURRENT CIT INDEX
         CB,R2    *R15,R4           IS CITX FOR DEV ONE WE WANT
         BNE      FINDEV1           NOPE - GO ON
         LW,R7    R4                PASS DCT INDEX IN R7 TO ROUTINES
         BAL,R0   DCTABLES          DISPLAY THE DCT TABLES
         BAL,R0   BUFOUT            PRINT THEM
FINDEV1  EQU      %
         LW,R4    CURDCTX           RESTORE CURRENT DCT INDEX
         AI,R4    1                 TO NEXT ONE
         CI,R4    DCTSIZ            AT TOP
         BLE      FINDEV            NOT YET
*
*        AT TOP - FALL THRU AND DISPLAY THE IOQ ENTRIES FOR
*        THIS CHANNEL
*
FINDQ    EQU      %
         LI,R14   CIT1              NOW LETS FETCH THE CHANNEL TABLE
         BAL,R0   GETADDR           **AGAIN***
         LW,R2    CURCITX           PICK UP CURRENT CHANNEL INDEX #
         LB,R7    *R15,R2           GET CHANNEL HEAD OF QUEUE #
         BEZ      CITINCR           NONE - GO TO NEXT CHANNEL
         LI,1     IOQHDR            PUT OUT THE IOQ HEADER LINE
         BAL,R0   MB                AND
         B        FINDQ2            MERGE
FINDQ1   EQU      %
         LI,14    IOQ2              NOW LETS GET
         BAL,0    GETADDR           THE CHANNEL FLINK
         LB,7     *15,7             GET IT
         BEZ      CITINCR           NONE - GO TO NEXT CHANNEL
FINDQ2   EQU      %
         BAL,0    IOTABLES          PUT OUT THE NEXT ENTRY
         BAL,0    BUFOUT            PRINT EM ALL
         B        FINDQ1            AND GO AROUND TO NEXT ONE
         USECT    DATA
CURDCTX  DATA     1                 CURRENT DCT INDEX IN USE
CURCITX  DATA     1                 CURRENT CIT INDEX IN USE
         USECT    PP
         PAGE
*
*F*
*F*    NAME:           QFREELIST
*F*
*F*    PURPOSE:        TO DISPLAY THE CURRENT FREE IOQ CHAIN AS
*F*                    IDENTIFIED BY THE POINTER 'QFREE'.
*F*
*F*    DESCRIPTION:    QFREELIST WILL PICK UP 'QFREE' AND RUN THE
*F*                    DISPLAY THRU THE LINKED LIST, DISPLAYING ALL
*F*                    ALL OF THE IOQ TABLES FOR EACH FREE ENTRY.
*F*
*
*        COMMAND FORMAT.
*
*        DI(SPLAY)  FQ(LIST)
*
QFREELIST EQU     %               * ENTRY...
         LI,R1    -128
         LI,R0    0
         LW,R2    USERLIST
         AI,R2    128
         STW,R0   *R2,R1
         BIR,R1   %-1
         LI,14    QFREE           GEHEAD OF FREE QUEUE LIST
         BAL,0    GETADDR         * GET IT
         LB,7     *15             * FETCH HEAD POINTER
         BEZ      SCANNER         * NO FREE QUEUE CHAIN
         BAL,R5   QUECHK          * PLANT HEAD OF CHAIN INTO LIST
         LI,1     FREEQS          * LOAD TITLE LINNE
         BAL,0    TITEL           * AND PUT IT OUT
         LI,1     IOQHDR          * LOAD HDR MSG ADDRS
         BAL,R0   MSG%OUT         * AND PUT IT OUT
         LI,1     X'100'          * LOAD MAX LOOP
         B        QLOOP1          * AND MERGE
QLOOP    EQU      %               *
         LI,14    IOQ2            * LOAD FWD LINK ADDRESS
         BAL,0    GETADDR         * AND GET IT
         LB,7     *15,7           * GET FWD LINK
         BEZ      SCANNER         * NONE - ALL DONE HERE
         BAL,R5   QUECHK          * PUT IT INTO LIST
         BDR,1    QLOOP1          * FINISH LIST TILL TAIL HITS
         B        SCANNER         * AND THEN WE'RE DONE...
QLOOP1   EQU      %               *
         BAL,0    IOTABLES        * PUT OUT IOQ TABLES FOR ENTRY
         BAL,0    BUFOUT          * PRINT EVERYTHING
         B        QLOOP           * AND LOOP TILL END OF LIST
*                                 *
*
         PAGE
*
*        INSURE IOQ INDEX IN R7 IS VALID AND NOT CIRCULAR
*
QUECHK   EQU      %
         CLM,R7   IOQLIMS           IS VALID IOQ INDEX
         BCS,9    QUECHK2           NOPE--> FLAG IT
         MTB,0    *USERLIST,R7      HAVE USED THIS IOQ ENTRY BEFO..
         BNEZ     QUECHK1           YUP--> ERROR
         MTB,1    *USERLIST,R7      FLAG IT AS CURRENTLY IN USE THEN
         B        0,R5              AND EXIT
*
*        CHAIN IS INVALID OR CIRCULAR
*
QUECHK1  EQU      %
         BAL,R0   BLANK1
         MTW,0    MONFLAG           LOOKING AT RUNNING MONITOR
         BNEZ     0,R5              YUP--CANT TELL IF BAD OR NOT
QUECHK2  EQU      %
         LI,R1    CHAINCHK
         BAL,R0   MBB
         B        SCANNER           CRASH OUT OF DISPLAY
CHAINCHK TEXTC    '** FREE QUEUE CHAIN IS OUT OF SEQUENCE '
         PAGE
*
*        INCREMENT TO NEXT SOFTWARE CHANNEL - LIMIT TO CITSIZ MAX
*
CITINCR  EQU      %
         MTW,0    USER              DID WE DO JUST ONE CHANNEL
         BNEZ     CITINCR1          YES - CHECK FOR A LIST OF ITEMS
         LW,R2    CURCITX           GET CURRENT CIT INDEX
         AI,R2    1                 BUMP TO NEXT VALUE
         STW,R2   CURCITX           AND REMEMBER IT
         CI,R2    CITSIZ            AT WORST CASE MAX
         BLE      CITSPIN           NOT THERE YET
         MTW,0    BALL              DOING ALL (GHOST RUN--ETC)
         BEZ      CITINCR1
         B        QFREELIST         YES - SHOW FREE QUEUE CHAIN
CITINCR1 EQU      %
         LI,R6    NXTCIT
         B        GETLIST           CHECK FOR LIST OF ITEMS
         PAGE
DCTHDR   EQU      %
 TEXTC 'DEVICE ADDR CX  OIDTS    BPWXKCSB QX AIO      TDV',;
                  ' STAT DBL-WORD   C1 C2 C3'
IOQHDR   EQU      %
         TEXTC    'Q1 ',;           IOQ1
                  'Q2 ',;
                  'Q3 ',;
                  'Q4 ',;
                  'Q5 ',;
                  'Q6       ',;
                  'Q7 ',;
                  'Q8       ',;
                  'Q9   ',;
                  '10 ',;
                  '11 ',;
                  'Q12      ',;
                  'Q13      Q13      ',;
                  '14 ',;
                  '15 ',;
                  '16'
        PAGE
*
*
*        OUTPUT THE DCT TABLES
*
DCTABLES EQU      %
         PSW,R0   STACK             SAVE RETURN LINK
         LI,R2    0               INITIAL INTERNAL INDEX
DCTLOOP  EQU      %
         LH,R14   DCTS,R2           GET TABLE ADDRESS
         AND,R14  #R16
         BAL,0    GETADDR
         LB,R0    GETDCT,R2         GET OPCODE
         BAL,R1   RUNTAB            * FETCH CONTEN
         DATA     X'4E000F'
DCTLOOP1 EQU      %
         LW,R3    R4                MOVE VALUE TO DISPLAY REGISTER
         EXU      DCTACT,R2         DISPATCH ROUTINE
DCTLOOP2 EQU      %
         CI,R4    -1                WAS DEVICE REMOVED
         BNE      DCTLOOP20         NOPE
         LW,R5    ='FFFF'           YES--GET SOME TEXT F'S
         LI,R4    'F'               LOAD ONE HERE ALSO
DCTLOOP20 EQU     %
         AND,R4   =X'FF'            MASK OUT FIRST BYTE OF DCT16
         OR,R4    =X'40036000'      MERGE IN MSG CNT AND A DASH
         LW,R3    CURDCTX           GET CURRENT DCT INDEX VALUE
         BAL,R0   TRANSSZ           PUT IT INTO PRINT LINE
         SCD,R4   8                 MOVE DEVICE NAME INTO PLACE
         STD,R4   DEV%MSG
         LI,R1    DEV%MSG
         BAL,0    MSG             PUT OUT THE MESSAGE
         B        DCTSP
         PAGE
*
*        ROUTINES TO HANDLE DATA FROM DCT TABLES
*
DCTLOOP3 EQU      %
         AND,R3   #R16              HANDLES ALL HALF WORDS
         BAL,R0   TRANSSZ           MINUS LEADING ZEROES
         B        DCTSP             REJOIN
*
*        PUT OUT WHOLE WORDS
*
DCTLOOP4 EQU      %
         BAL,R0   TRANS             WITH LEADING ZEROES
         B        DCTSP             REJOIN
*
*        FIRST WORD OF A DBL WORD
*
DCTLOOP5 EQU      %
         BAL,R0   TRANS
*
*        SECOND WORD OF A DBL WORD
*
DCTLOOP6 EQU      %
         LW,R3    R5                MOVE IT OVER
         BAL,R0   SPACE2            FIRST SPACE OVER TWO BYTES
         BAL,R0   TRANS             THEN PUT OUT VALUE
         B        DCTSP             AND REJOIN...
         PAGE
*
*        PUT IN PROPER SPACING BETWEEN VALUES IN DCT DISPLAY
*
DCTSP    EQU      %
         LB,R1    DCTSPACES,R2      PICK UP NEXT SPACING
         BAL,R0   SPACES            AND PUT IT OUT
         AI,R2    1               NEXT INTERNAL INDEX
         CI,R2    #OFDCTS         AT TOP
         BL       DCTLOOP         NOT YET
         LI,R14   CIT1              FIRST PICK UP
         BAL,R0   GETADDR           GO GET TABLE
         LW,R7    CURCITX           GET CURRENT CIT INDEX
         LB,R3    *R15,R7           GET VALUE
         LI,R2    -3                INDEX INTO CIT INTERNAL TABLE
         LI,R4    0
CITLOOP  EXU      GETCIT,R2         LOAD R14 WITH ADDRESS
         BAL,R0   GETADDR           GET IT
         LB,R3    *R15,R7           GET THE VALUE
         BAL,R0   TRANSSZ           PUT OUT THE VALUE
         LB,R1    CITSPACES,R4      GET THE SPACING
         BAL,R0   SPACES
         AI,R4    1
         BIR,R2   CITLOOP           CONTINUE ALONG
         PLW,R0   STACK             GET RETURN LINK
         B        *0              RETURN
*
*
*
         PAGE
*
*        DRIVE DISPLAY OF I/O ENTRIES FOR THIS CHANNEL
*
IOTABLES EQU      %
         PSW,R0   STACK             SVE RETURN LINK
         LI,R2    00              INITIAL INTERNAL INDEX
         LI,R6    0                 SPACING INDEX
IOLOOP   EQU      %
         LH,R14   IOQS,R2           GET TABLE ADDRESS
         AND,R14  #R16
         BAL,0    GETADDR
         LB,R0    IOLOAD,R2         GET OPCODE
         BAL,R1   RUNTAB
         DATA     X'4E000F'
IOLOOP0  LW,R3    R4                MOVE VALUE
         BAL,0    TRANSSZ         TRANSLATE IT
         CI,R2    12                DOING IOQ13 THIS PASS
         BNE      IOLOOP1           NO
         LI,R1    65                WORD TWO GOES HERE....
         BAL,R0   SPACES            INSERT SPACES FOR OTHER HALF
         LW,R3    R5                OTHER HALF OF DOUBLE WORD
         BAL,R0   TRANSSZ
IOLOOP1 LB,R1     IOSPACES,R6       GET NEXT SPACING
         AI,R6    1                 BUMP FOR NEXT LOOP
         BAL,R0   SPACES
         AI,R2    1               NEXT POSITION
         CI,R2    #OFIOQS         AT TOP YET
         BL       IOLOOP          NOT YET
         PLW,R0   STACK
         B        *0              RETURN
         PAGE
*
*
*        NUMBER TO BE BROKEN IS IN R3
*
DCTBITS  EQU      %
BITPUT   EQU      %
         LI,1     8
         AWM,1    PTR
         AWM,1    COLPT
         LW,4     PTR
         AI,4     -1
BITLOOP  EQU      %
         LI,R5    'X'               ASSUME BIT IS SET
         CI,R3    1                 TRUE..
         BANZ     %+2               YES - JUMP
         LI,R5    '.'               NO BIT GETS A DOT
         STB,5    OBUF,4            PUT IT INTO PRINT LINE
         AI,4     -1
         SLS,3    -1              GET NEXT BIT
         BDR,1    BITLOOP
         B        DCTSP             REJOIN MAIN PATH...
         PAGE
*
*
*        DATA AREA FOR ABOVE ROUTINES
*
         USECT    DATA
DEV%MSG  EQU      PROCNAME
*
        USECT     PP
GETCIT   EQU      %+3
         LI,R14   CIT1
         LI,R14   CIT2
         LI,R14   CIT3
*
*
CITSPACES DATA,1  69,72,75,78
         PAGE
*
DCTS     EQU      %
         DATA,2   DCT16,;           0
                  DCT1,;            1
                  DCT2,;            2
                  DCT3,;            3
                  DCT5,;            4
                  DCT6,;            5
                  DCT12,;           6
                  DCT13             7
#OFDCTS  EQU      HA(%)-HA(DCTS)
         BOUND    4
*
*
DCTACT   EQU      %
*
         B        DCTLOOP2          DCT16
         B        DCTLOOP3          DCT1
         B        DCTLOOP3          DCT2
         B        DCTBITS           DCT3
         B        DCTBITS           DCT5
         B        DCTLOOP3          DCT6
         B        DCTLOOP4          DCT12
         B        DCTLOOP5          DCT13 FIRST WORD
         B        DCTLOOP6          DCT13 SECOND WORD
         NOP      %
*
GETDCT   EQU      %
         DWORD    0                 DCT16
         HALF     1                 DCT1
         BYTE     2                 DCT2
         BYTE     3                 DCT3
         BYTE     4                 DCT5
         BYTE     5                 DCT6
         WORD     6                 DCT12
         DWORD    7                 DCT13
         BOUND    4
DCTSPACES EQU     %
         DATA,1   7,12,16,25,34,37,46,66,68,80
         BOUND    4
         PAGE
*
*
*
IOQS     EQU      %
         DATA,2   IOQ1,;            0
                  IOQ2,;            1
                  IOQ3,;            2
                  IOQ4,;            3
                  IOQ5,;            4
                  IOQ6,;            5
                  IOQ7,;            6
                  IOQ8,;            7
                  IOQ9,;            8
                  IOQ10,;           9
                  IOQ11,;           10
                  IOQ12,;           11
                  IOQ13,;           12
                  IOQ14,;           13
                  IOQ15,;           14
                  IOQ16             15
#OFIOQS  EQU      HA(%)-HA(IOQS)
         BOUND    4
         PAGE
IOLOAD   EQU      %
         BYTE     0
         BYTE     1                 IOQ2
         BYTE     2                 IOQ3
         BYTE     3                 IOQ4
         BYTE     4                 IOQ5
         WORD     5                 IOQ6
         BYTE     6                 IOQ7
         WORD     7                 IOQ8
         HALF     8                 IOQ9
         BYTE     9                 IOQ10
         BYTE     10                IOQ11
         WORD     11                IOQ12
         DWORD    12                IOQ13
         BYTE     13                IOQ14
         BYTE     14                IOQ15
         WORD     15                IOQ16
         BOUND    4
*
IOSPACES EQU      %
         DATA,1   3,;               IOQ1 AT ZERO - IOQ2 AT 3
                  6,;               IOQ3
                  9,;               IOQ4
                  13,;              IOQ5
                  15,;              IOQ6
                  24,;              IOQ7
                  27,;              IOQ8
                  36,;              IOQ9
                  41,;              IOQ10
                  44,;              IOQ11
                  47,;              IOQ12
                  56,;              IOQ13
                  74,;              IOQ14
                  77,;              IOQ15
                  80,;              IOQ16
                  90,;              END
                  99                END
         BOUND    4
*
         PAGE
*
*F*
*F*    NAME:           TPWP
*F*
*F*    PURPOSE:        TO DISPLAY THE PHYSICAL WORK PAGE TABLES
*F*                    FOR CP-V TRANSACTION PROCESSING.
*F*
*F*    DESCRIPTION:    TPWP WILL START AT THE BOTTOM OF THE TPWP
*F*                    TABLES AND DISPLAY EACH USED ENTRY.
*F*
*
*        COMMAND FORMAT.
*
*        DI(SPLAY)  TP(TABLES)
*
TPWP     EQU      %
         LI,R1    TPHDR             * PUT OUT THE
         BAL,R0   TITEL             * TP HEADER
         LI,R14   PWPTABLE          * IS THIS SYSTEM TP TYPE
         BEZ      NOTRACE           * NOPE - ALL STOP
         LI,R1    TPHDR1            * YES - PRINT TABLE HEADINGS
         BAL,R0   MBB               * ON TOP OF DATA
         LI,R7    0                 * INITIAL INDEX INTO TABLES
         STORE,R7 *USERLIST         CLEAR HEAD OF TABLE TO ZERO (CNT)
TPWP1    EQU      %                 *
         LI,R14   PWPTABLE          * BASE ADDRESS OF TABLES
         LW,R13   R14               * COPY TO R13
         AW,R13   R7                * CALCULATE HOW MANY MORE
         CI,R13   PWPEND            * HIT THE TOP YET
         BG       TPWP4             * ALL DONE
         BAL,R0   GETADDR           * NO - GET NEXT ONE INTO CORE
         LW,R5    *R15,R7           * EXTRACT ENTRY FROM TABLE
         LOAD,R3  R5                * EXTRACT PAGE # FROM ENTRY
         BEZ      TPWP3             * NO PAGE - NO DISPLAY
         LW,R4    R3                * COPY TO R4 FOR
         BAL,R0   PREMEM            STORE PAGE NUMBER
         LCFI     8                 * PLACING INTO PAGE TABLE ARRAY
         STCF    PG:MODE            * POST TP FLAG INTO PAGE # CELL
         BAL,R0   PAGETABLE         * INSERT ENTRY INTO TABLE
TPWP2    EQU      %                 * ENTER HERE IF NO PAGE ASSIGNED
         AND,R3   #R16              * 16 POSSIBLE BITS
         BAL,R0   TRANSSZ           * PUT INTO PRINT LINE
         LW,R3    R5                * RE-ACQUIRE ENTRY
         AND,R3   #R16              * SAVE TP FLAGS IN RIGHT HALF
         LI,R1    14                * SPACES TO NEXXT COLUMN
         BAL,R0   SPACES            * GO INSERT SPACING
         BAL,R0   TRANSSZ           * INSERT VALUE
         BAL,R0   BUFOUT            * PRINT ENTIRE LINE
TPWP3    EQU      %
         AI,R7    1                 * NEXT INDEX
         B        TPWP1             * LOOP TILL END OF TABLES
TPHDR1   TEXTC    'WORK PAGE#    TP FLAGS'
         PAGE
*
*        DUMP OUT THE T-P PAGES
*
TPWP4    EQU      %
         LOAD,R5  *USERLIST         GET COUNT IN LIST...
         BEZ      SCANNER           NOPE
         LI,R1    TPHDR2            SECOND HEADER/TITLE LINE
         BAL,R0   TITEL
TPWP5    EQU      %
         LOAD,R1  *USERLIST,R5      GET ENTRY FROM LIST
         BEZ      SCANNER
         BAL,R0   DISP:PP
         BAL,R0   GET1ADDR          FETCH IN THE PAGE
         LW,R8    R15               MOVE POINTER
         LI,R7    512               SIZE OF DUMP IN WORDS
         BAL,R0   DUMPSOME          DUMP THE PAGE OUT TO THE LO DEVICE
         BDR,R5   TPWP5             FINISH UP...
         B        SCANNER           AND EXIT
         PAGE
*
*F*
*F*    NAME:           PAGEDISP
*F*
*F*    PURPOSE:        TO PROVICE A MECHANISM FOR DUMPING SELECTED
*F*                    PAGES/PARTS OF PAGES.
*F*
*F*    DESCRIPTION:    PAGEDISP WILL PICK UP THE COMMAND FIELDS
*F*                    AND FETCH THE REQUESTED PAGE - AND THEN WILL
*F*                    DUMP OUT THE REQUESTED PAGE USING THE
*F*                    START-STOP PARAMETERS AS GIVEN (IF ANY).
*F*
*
*        COMMAND FORMAT.
*
*        DI(SPLAY)  PP AAA (,BBB)   (,CCC)    (,DDD) (,EEE) (,FFF)
*
*        WHERE;
*        AAA      FIRST SELECTED PAGE # TO DUMP
*        BBB      RELATIVE OFFSET INTO FIRST PAGE
*        CCC      RELATIVE END OF DUMP IN FIRST PAGE
*
*        DDD      SECOND PAGE TO DUMP OUT
*        EEE      RELATIVE OFFSET INTO PAGE FOR DUMP TO START AT
*        FFF      RELATIVE END OFFSET INTO PAGE FOR DUMP TO END AT
*
*        NOTE:    LACK OF BBB-CCC FIELDS INDICATES TO DUMP ALL
*                 OF THE PAGES - LISTS ONLY WORK IF YOU SPECIFY
*                 START-STOP PAIRS FOR EACH PAGE.
*
PAGEDISP EQU      %                 ALREADY UNMAPPED ENTRY
PAGEDISP1 LI,R1   2                 FIELD POSITION FOR PAGE #
PAGEDISP2 EQU     %
         BAL,0    GETHEX            IN HEX
         LW,R14   R2                MOVE PAGE #
         SLS,R14  9                 MAKE IT WA
         BAL,R0   NEXTLOC           GET DISPLACEMENTS (IF ANY)
         AW,R14   R8                ADD STARTING DISP
         BAL,R0   GETADDR           READ THE WA (STARTING WORD)
         LW,R8    R15               MOVE POINTER INTO BUF
         CI,7     1                 WANTS AT LEAST 1
         BNE      %+2               YES
         LI,7     X'200'            NO,DUMP THE WHOLE THING
         BAL,R0   DUMPSOME          DUMP IT
         LI,R6    PAGEDISP2         RETURNN POINT
         B        GETLIST           CHECK FOR LIST OF ITEMS
         PAGE
*
*F*
*F*    NAME:           VIR:PAGE
*F*
*F*    PURPOSE:        TO PROVIDE A MECHANISM FOR DUMPING OUT
*F*                    SELECTED VIRTUAL PAGES/PARTS OF PAGES.
*F*
*F*    DESCRIPTION:    SEE DESCRIPTION OF PAGEDISP ON PROCEEDING PAGE.
*F*                    NOTE THAT YOU MUST BE IN THE MAPPED MODE TO
*F*                    USE THIS ROUTINE.
*F*
*
*        NOTE:    YOU MUST HAVE MAPPED SOMEONE BEFORE YOU GET HERE
*                 OR ANLZ IS GOING TO COMPLAIN ABOUT THAT.
*
VIR:PAGE EQU      %
         MTW,0    MAPFLAG           ARE WE MAPPED NOW
         BNEZ     PAGEDISP1         YEP
         LI,R1    NOMAP:MSG         NO
         LI,R0    SCANNER
         B        MSG%OUT           PRINT ERROR/RETURN TO SCANNER
NOMAP:MSG TEXTC 'YOU HAVE NOT MAPPED ANY USER YET'
        PAGE
*
*F*
*F*    NAME:           REPLACEMENT
*F*
*F*    PURPOSE:        TO PROVIDE A MECHANISM FOR CHANGING LOCATIONS
*F*                    IN MEMORY.
*F*
*F*    DECRIPTION:     REPLACEMENT WILL PICK UP THE ADDRESS SPECIFED
*F*                    BY THE USER AND COLLECT THE VALUE THE USER
*F*                    SPECIFIED TO PLACE THERE. IT WILL THEN MAP
*F*                    ONTO THE LOCATION AND PLACE THE VALUE THERE
*F*                    IF THE USER HAS THE PROPER PRIVILEGE LEVEL,
*F*
*F*               OF CERTAIN MONITOR LOCATIONS.
*
*        COMMAND FORMAT.
*
*        LOC=VALUE                  WHERE LOC=ADDRESS AND VALUE=NEW
*                                   CONTENTS FOR THAT ADDRESS
*
REPLACEMENT EQU   %
        MTW,0     MONFLAG
        BEZ       NOREP
         LB,1     JB:PRIV
         CI,R1    X'B0'             IS PRIVILEGE HIGH ENUFF
         BL       NOGOT             NOPE
        LI,1      0
        LI,9      0
        BAL,0     LOCLOC          GET BOTH LOCATION AND VALUE
         STW,R8   LASTLOC           REMEMBER LAST LOCATION
         LW,R14   R8                GET BASE WA OF LOCATION
         MTW,1    LOOKING           ONLY NEED ONE PAGE FOR THIS COMMAND
         BAL,R0   GETADDR           GET THE PAGE INTO MY MAP
         STW,R9   *R15              STORE VALUE AWAY
         BAL,R2   TATTLE            TELL OPERATOR ABOUT CORE CHANGE
ZAPREP   EQU      %
         LI,0     0
         STW,0    REPFLAG
        B         SCANNER
*
NOREP   EQU       %
        LI,1      NOREPMSG
         BAL,R0   MBB               MSG / BUFOUT / BLANK1
         B        ZAPREP
*
NOREPMSG TEXTC    'YOU MUST BE LOOKING AT THE MONITOR TO CHANGE IT'
         PAGE
*
*F*
*F*
*F*    NAME:           COMPARE
*F*
*F*    PURPOSE:        TO PROVIDE A MECHANISM FOR COMPARING THE
*F*                    DUMP FILE VERSUS THE RUNNING MONITOR.
*F*
*F*    DESCRIPTION:    COMPARE WILL PICK UP THE START-STOP VALUES
*F*                    AS GIVEN BY THE USER AND COMPARE THE RUNNING
*F*                    MONITOR TO THE DUMP FILE WORD-BY-WORD.
*F*
*F*                    ANY DIFFERENCES WILL BE DISPLAYED ON THE PRINT
*F*                    LINE.
*F*
*
*        COMMAND FORMAT.
*
*        CO(MPARE)    START,STOP
*
*        WHERE START/STOP SPECIFIY RANGES OF LOCATIONS TO COMPARE.
*
COMPARE  EQU      %
         LH,R0    M:EI              GET FIRST 16 BITS OF DCB WORD 0
         CI,R0    X'20'             IS DCB OPEN BIT SET
         BAZ      PAGERR0           NO - SEND ERROR MSG
         LI,R1    COMP:HD           HEADING
         BAL,R0   MBB               MSG / BUFOUT / BLANK1
         BAL,R0   RESETM            CRASH ALL THE POINTERS NOW...
         LI,1     1
         BAL,0    LOCLOC            GET FIELDS
         LW,4     8
COMPLOOP EQU      %
         CLM,R4   CURADRSS          GOT THIS ADDRESS STILL
         BCR,9    COMPLOOP1         YUP--> KEEP GOING
         BAL,R0   COMP:SET          CHANGE CVM WINDOW TO NEW ADDRESS
         LI,R5    X'7FE00'          WA MASK
         STS,R4   SADCAL1           STORE ADDRESS INTO SAD CAL
         MTW,1    LOOKING           ONLY NEED ONE PAGE FOR THIS STUFF
         LW,R14   R4
         BAL,R0   GETADDR           GET DUMP FILE ADDRESS
         CAL1,8   SADCAL1           MAP ONTO MONITOR
         BCS,8    NOSADPAGE         DIDNT WORK
         LI,R5    X'1FF'            PAGE MAX MASK
         AND,R5   R4                OBTAIN INDEX INTO PAGE
         AW,R9    R5                MAKE R9 DIRECT POINTER IN CVM PAGE
COMPLOOP1 EQU     %
         LW,R13   *R9               GET WORD FROM RUNNING MONITOR
         CW,R13   *R15              COMPARE TO DUMP FILE
         BNE      PRINTCOM          NOT EQUAL - PRINT EM OUT
COMPLOOP3 EQU     %
         AI,R9    1                 NEXT CVM WINDOW ADDRS
         AI,R15   1                 NEXT DMP WINDOW ADDRS
         AI,R4    1                 NEXT PHYSICAL CORE ADDRESS
         BDR,R7   COMPLOOP          GO TILL COUNT DONE
         B        SCANNER           AND THEN QUIT
         PAGE
*
*        REGISTERS ARE NOW:
*
*        R4 =     ABSOLUTE CORE ADDRESS AT NOW
*        R7 =     COUNT REMAINING TO LOOK AT
*        R9 =     CVM WINDOW ADDRESS
*        R15=     DUMP FILE BUFFER WINDOW ADDRESS
*
PRINTCOM EQU %
         LW,R3    R4                ADDRESS WE'RE AT
         STW,R3   LASTLOC           REMEMBER LOCATION
         LI,R1    1                 SPACING FOR ADDRS
         BAL,R0   SPACES
         BAL,R0   TRANSSZ           ADDRS OUTPUT
         LI,R1    10                NEXT SPACING
         BAL,R0   SPACES
         LW,R3    *R9               GET WORD FROM RUNNING MONITOR
         BAL,R0   TRANS             OUT
         LI,R1    20                NEXT
         BAL,R0   SPACES            SPACING
         LW,R3    *R15              CONTENTS OF DUMP FILE
         BAL,R0   TRANS
         BAL,R0   BUFOUT            PRINT THE WHOLE LINE
         B        COMPLOOP3         CONTINUE ALONG WITH EXAMINATION
COMP:HD  TEXTC    ' ADDRESS  MONITOR   DUMP FILE'
         PAGE
*
*        GET TWO PAGES FOR COMPARISON BUFFERS
*
COMP:SET EQU      %
         PSW,R0   STACK
         LW,R9    VIRPAGE1          ALREADY HAVE BUFFER
         BGZ      COMP:SET1         YEP - JUMP
         CAL1,8   GETPAGE           GET ONE PAGE FOR COMPARISONS
         BCS,8    NO:COMP           CANT DO IT
         STW,R9   VIRPAGE1          REMEMBER BASE ADDRESS
COMP:SET1 EQU     %
         CAL1,8   FREEIT            AND FREE IT FOR CVM CAL
         PLW,R0   STACK
         B        *R0
*
*
NO:COMP  EQU      %
         LI,R1    COMPBUFMSG
         B        PUSHMSG
COMPBUFMSG TEXTC  'COULD NOT ACQUIRE BUFFERS FOR COMPARISON'
         USECT    PP
         END

