*M*      ANALZO4  FOURTH OVERLAY OF THE ANLZ LOAD MODULE
*
*        TREE STRUCTURE LOCATION IS NOT CRITICAL TO THIS MODULE
*
 TITLE '*** A N A L Y Z E   O V E R L A Y  #  4  C 0 1  C P - V  ***'
         PAGE
*
*
*P*      THIS MODULE EXISTS SOLELY TO CUT DOWN ON RESIDENT CORE
*P*      REQUIREMENTS OF THE ANLZ LOAD MODULE.
*P*
*P*
*P*      THE FOLLOWING ROUTINES MAY BE FOUND IN THIS MODULE;
*P*
*P*      ROUTINE                  DESCRIPTION
*P*      -----------              ----------------------------------
*P*      PROCLIST                 DISP OF TEMP PROCESSOR INSWAP TABLES
*P*      UID                      DISP OF USER ID'S IN SYSTEM
*P*      TPAGE                    TRAPPED PAGE CONTENTS
*P*      USERSLIST                USER OUTSWAP TABLES (IF IN USE)
*P*      TRPAGE                   ALTERNATE ENTRY TO TPAGE
*P*      FIX%TIME                 OBTAIN TIME OF CRASH
*P*      DO%SYMBOLS               PUT OUT SYMBOL MAP ON COMMAND
*P*      SYMBOLMAP                ENTRY TO BUILD SYMBOL TABLE
*P*      INIT:MD                  INITIALIZE SYMBOL POINTER TABLE
*P*      SYM:DISP                 PUT OUT SYMBOL MAP
*P*      SEGMAP                   PUT OUT CSECTS MAP
*P*      SETVERS                  CALCULATE VERSION LEVEL OF SYSTEM
*P*      RUN                      RUN COMMAND PROCESSOR
*P*      UPAGES                   RUN USER PAGE CHAINS
*P*      RTPAGES                  RUN REAL-TIME PAGE CHAINS
*P*      XDELPGS                  RUN XDELTA/UMOV PAGE CHAINS
*P*      PGSOUT                   ACTUAL CHAIN RUNNER
*P*      MPAGES                   RUN FREE PAGE CHAIN
*P*      SPAGES                   RUN SWAP PAGE CHAIN
*P*      PPAGES                   RUN PROC PAGE CHAIN
*P*      STATES                   RUN STATE CHAINS
*P*      PHYMAP                   CREATE PHYSICAL PAGE MATRIX DISPLAY
*P*      MASK                     SMASK COMMAND PROCESSOR
*P*      SEARCH                   SEARCH COMMAND PROCESSOR
*P*      REGS                     DISPLAY SCREECH REGISTERS
*P*      WHY                      WHY COMMAND PROCESSOR
*P*      GETHIGH                  PICKS UP SYSTEM CELLS BEFORE RUNNING
*P*
         PAGE
*
*        THE FOLLOWING PROC IS A DUPE OF THE CP-V PROC 'BIF'
*        ANLZ NEEDS IT'S OWN BECAUSE WE CANT LOOK DIRECTLY
*        AT THE 'BIF' TARGET WORD.
*
BIFM     CNAME
         PROC
         LOCAL    P,BR
LF       LC       MACHINE           PICK UP CC BITS
P        SET      SCOR(CF(2),S7,S9,X560,S7S9,S9S7,;
                  S7X560,X560S7,S9X560,X560S9,UNK)
         ERROR,3,(P<1)|(P>10)  'CONFIGURATION CONDITION NOT',;
                                    ' RECOGNIZED'
BR       SET      8,4,2,12,12,10,10,6,6,15
         GEN,1,7,4,3,17  AFA(1),X'69'-(P=10),BR(P),AF(2),WA(AF(1))
         PEND
         PAGE
PROCEDE  CSECT    1                 PURE PROCEDURE
DATA     CSECT    0                 PURE DATA CONTROL SECTION
OUTSWAP# DATA     0                 NUMBER OF PEOPLE BEING OUTSWAPED
OUTSWAPC DATA     0                 AND THEIR RUNNING TOTAL PAGE CNT
PROCIN#  DATA     0                 NUMBER OF PROCESSORS BEING INSWAPPED
PROC:CNT DATA     0                 AND THEIR RUNNING PAGE COUNT
*
*
PIN#     EQU      %
         DATA     0,0               PROCESSOR NUMBERS
*
*
PINHD    DATA     0,0,0,0           HEAD OF PAGE CHAIN
*
*
PINTL    DATA     0,0,0,0           TAIL OF PAGE CHAIN
*
*
PINC     DATA     0,0,0,0           COUNT OF PAGE CHAIN
*
*
         USECT    PROCEDE           GENERATE PROCEDURE SECTION
*
*
UFLAGS   SET      1
MONPROC  SET      1
UTSPROC  SET      1
         SYSTEM   UTS
         OPEN     BUFSIZ
         OPEN     UNMAP
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6
R7       EQU      7
R8       EQU      8
R9       EQU      9
R10      EQU      10
R11      EQU      11
R12      EQU      12
R13      EQU      13
R14      EQU      14
R15      EQU      15
*
*
         PAGE
*
*        REFERENCES THAT ARE SATISFIED FROM ANALZ ITSELF
*
         REF      #R16            * DATA CELL OF X'0000FFFF'
         REF      #STATES         * # OF STATES ANLZ RECOGNIZES
         REF      ACCOUNT         * PLACE WHERE ACCOUNT WAS STORED
         REF      ADDEFEND        * TOP OF SYMBOL TABLE BUFFER
         REF      BADCOM          * ROUTINE TO SAY EH TO BUM COMMAND
         REF      BIGBUF          * POINTER TO SYMBOL TABLE BUFFER
         REF      BLANK1          * ROUTINE TO PRINT BLANK LINE
         REF      BUFLIM          * CLM PAIR FOR DUMP INPUT BUFFERS
         REF      BUFOUT          * ROUTINE TO PRINT THE BUFFER
         REF      BUFSIZ          * LINE PRINTER CAL SIZE SLOT
         REF      CLOSEDCB        * CLOSE DCB IN R7 ROUTINE
         REF      CPOINTER        * POINTS TO CSECTS IN SYMBOL BUFFER
         REF      CUN             * CONTAINS S:CUN VALUE
         REF      DECIMAL         * ROUTINE TO PUT OUT DECIMAL DATA
         REF      DELPGS          * TITLE LINE FOR XHANDLER PAGE CHAIN
         REF      DISP:PP           *
         REF      DUMP:DIR        * RELATIVE ADDRESSING DUMPS FLAG
         REF      DUMPSOME        * ROUTINE TO DUMP SPECIFIED AREA
         REF      F:OSYMS         * ROUTINE TO WRITE OUT REDUCED MONSTK
         REF      F:SCR           * DCB USED TO READ ERROR MSG FILE
         REF      F:SYMS          * DCB USED TO READ 'SYMBOLS' FILE
         REF      FIELD2          * COMMAND FIELD 2 BUCKET
         REF      FIELD3            * COMMAND FIELD THREE BUCKET
         REF      FILENAME        * SYMBOLS FILE NAME IF OPTION GIVEN
         REF      FILETEXT        * PLACE WHERE FILE NAME WAS STORED
         REF      FINDER          * LOCATOR TABLE FOR SYMBOL TABLE
         REF      FIRSTPG         * COPY OF LOW (VALIDATED)
         REF      FPGS            * FREE PAGE FPT
         REF      FREEIT          * M:FVP FPT
         REF      GETADDR         * ROUTINE TO FETCH ADDRESS IN R14
         REF      GETHEX          * ROUTINE TO RETURN REQUESTED FIELD
         REF      GETIT           * M:GVP FPT
         REF      GETLIST         * ROUTINE TO RETURN NEXT LIST ITEM
         REF      GET1ADDR        * GETS ONE PAGE FOR NUM IN R1
         REF      GPGS            * GET PAGE FPT
         REF      HDMSG           * HEADING MSG
         REF      ISUN            * COPY OF S:ISUN
         REF      JITBUF          * POINTS TO JIT BUFFER
         REF      JITPAGE         * CONTAINS THE JIT PAGE #
         REF      LASTLOC         * LAST LOCATION DUMPED OUT
         REF      LASTSVTF        * LAST LOOKED SYMBOL LOC IN TABLE
         REF      LASTITEL
         REF      LISTCHARS         * LIST OF PRINTABLE CHARS
         REF      LEGCORAD        * CLM PAIR OF VALID CORE ADDRESSES
         REF      LOCJIT          * LOCATES JITS IN THE DUMP FILE
         REF      LOCLOC          * GET LOC-LOC FROM REQUESTED FIELDS
         REF      LOOKING         * SET SAYS JUST POKIN AROUND FLAG
         REF      LPFLAG          * SET SAYS WRITING ON THE LINE PRINTER
         REF      M:SYM           * DCB TO READ MONSTK THRU
         REF      MACHINE         * DUPE OF C%CPU FROM SYSTEM
         REF      MAP:USER        * ROUTINE TO MAP ONTO USER IN R2
         REF      MAPLIMS           CLM PAIR (JXBUFVP,255)
         REF      MAPFLAG           >>0 SAYS WE ARE MAPPED
         REF      MB              * MSG/BUFOUT ROUTINE
         REF      MBB             * MSG/BUFOUT/BLANK1 ROUTINE
         REF      MONFLAG         * SET SAYS LOOKING AT REAL CORE
         REF      MPGMSG          * MONITOR PAGE CHAIN TITLE LINE
         REF      MSG             * ROUTINE TO MOVE TEXTC MSG TO BUF
         REF      MSG%OUT         * SAME AS MBB ROUTINE
         REF      MSG1            * ROUTINE TO MVE TEXT MSG TO BUF
         REF      MTB             * MSG/TRANS/BUFOUT ROUTINE
         REF      MTBB            * MSG/TRANS/BUFOUT/BLANK ROUTINE
         REF      NOTRACE         * SAYS 'DOENST EXIST' ROUTINE
         REF      NULLPAGE        * CLM PAIR OF NMPC/FMPC CONSTANTS
         REF      OBUF            * LINE PRINTER BUFFER
         REF      ODDROW          * PAGE MATRIX ODD ROW WIDTH
         REF      PAGE:ERROR      * INDICATES ERROR FOR CURRENT PAGE #
         REF      PAGEBUF         * POINTS TO DUMP INPUT BUFFER
         REF      PAGETABLE       * POINTS TO PAGE TABLE MATRIX
         REF      PAGLIMS         * CLM PAIR OF VALID PAGE #
         REF      PASS            * PLACE WHERE SYMBOLS PASSWORD STORED
         REF      PATCHLOC        * LOCATION OF MPATCH CLM PAIR
         REF      PG:ARRAY        * POINT TO PHYSICAL PAGE MATRIX BUF
         REF      PG:MODE         * INDICATES PAGE OWNER FOR MATRIX
         REF      PGMAPMS         * PHYSICAL PAGE MATRIX TITLE LINE
         REF      PPGMSG          * PROCESSOR PAGE CHAIN TITLE LINE
         REF      PROCNAME        * DBL-WORD FOR PROCESSOR NAMES
         REF      PTEMPC          * PROC TEMP PAGE CHAIN TITLE LINE
         REF      PTR             * POINTS TO CURRENT LOC IN PRINT BUF
         REF      PUSHMSG         * PRINTS MSG AND GOES TO SCANNER
         REF      RCVLIMITS       * CLM PAIR FOR RCVRY SIZE DATA
         REF      RE:PNT          * CLEARS ADDRESS POINTERS ROUTINE
         REF      REG%FLAG        * SET SAYS REG CODE RAN ALREADY
         REF      REGMSG          * SCREECH CODE TITLE LINE
         REF      RERR1           * ROUTINE TO REPORT I/O ERROR
         REF      RES:JIT         * ROUTINE TO FETCH USER JIT
         REF      ROWCNT          * WIDTH OF DUMP OUTPUT (4,8) ETC
         REF      RTPMSG          * REAL TIME PAGE CHAIN TITLE LINE
         REF      RTHDR2            * REAL -TIME PAGE DUMP TITLE
         REF      SCANNER         * COMMAND PARSER
         REF      SCR:CNT         * NUM OF SCREECHES SPECIAL CASED
         REF      SCREECH%CODE    * SCREECH CODE AS IT WAS REPORTED
         REF      SCR24:29        * CLM PAIR FOR SCREECHES 24 THRU 29
         REF      SEGMTIT         * SEG MAP TITLE LINE
         REF      SETR6           * LOADS R6 WITH STATE MESSAGE
         REF      SORTALBE        * ADDRESS OF SORT BUFFER
         REF      SPACES          * ROUTINE TO INSRT SPACES IN BUFR
         REF      SPGMSG          * SWAPPER PAGE CHAIN TITLE LINE
         REF      STACK           * ANLZ'S TEMP STACK
         REF      STCMSG          * STATE CHAIN TITLE LINE
         REF      STKSIZE         * SIZE OF MONSTK AS READ INITIALLY
         REF      SWAP:TIT        * TITLE LINE FOR PROC INSWAP DISP.
         REF      SYMBOL:FLAG     * SET SAYS SYMBOLS WERE GOTTEN
         REF      SYMBOLMS        * SYMBOL TITLE LINE
         REF      SYMCNT          * COUNT OF SYMBOLS IN SYMBOL BUF
         REF      SYMCNT1         * DUPE OF SYMCNT - DOESNT CHANGE
         REF      TITEL           * ROUTINE TO DO NEW PAGE/TITLE TEXT
         REF      TPMSG           * TRAPPED PAGE TITLE LINE
         REF      TRANS           * ROUTINE TO TRANS W/LEAD ZEROES
         REF      TRANSSZ         * ROUTINE TO TRANS W/O LEAD ZEROES
         REF      TRAP:SCR        * REGISTERS TITLE LINE
         REF      UCTITLE         * SET SAYS NO MORE PAGE HEADINGS
         REF      UHFLGLOC        * POINTER TO UH:FLG WINDOW BUFFER
         REF      UHFLGR1         * SECOND WORD OF UH:FLG WINDOW CLM
         REF      ULSTSIZE          * SIZE OF USERLIST TABLE
         REF      UNMAP           * ANLZ'S INTERNAL UNMAP ROUTINE
         REF      UNOWNMS         * 'OWNED PAGE' MESSAGE
         REF      UPGMSG          * USER PAGE CHAIN TITLE LINE
         REF      USER            * CELL TO CONTAIN USER #
         REF      USERIDMS        * USER IDENTIFICATION TITLE LINE
         REF      USERLIST        * BYTE TABLE SMUIS LONG
         REF      USERLTIT        * USER SWAP LIST TITLE LINE
         REF      USRMAP            * POINTS TO THE MAP BUFFER
         REF      WRITBUF         * LINE PRINTER WRITE CAL FPT
         REF      WRITESYMS       * SET SAYS TO CREATE 'SYMBOLS' FILE
         REF      X1FF            * DATA X'000001FF'
         REF      ZEROS           * 16 WORDS OF ZEROS
         PAGE
*
*        REFERENCES THAT ARE SATISFIED FROM MONSTK AT LOAD TIME
*
         SREF     :B9            * BIG SIGMA 9 SYSTEM FLAG
         SREF     C%CPU           * BITS IDENTIFYING TYPE OF CPU
         SREF     COCFLAG         * FLAG FOR TESTING COC TYPE SYSTEM
         SREF     CORE            * SIZE OF CORE AS SYSGENED
         SREF     CRASHTYP          * TYPE OF RECOVERY CELL
         SREF     F:BREG            * LAST MON BRANCH CELL
         SREF     DATE            * DATE SLOT
         SREF     HIGH            * HIGHEST PAGE # IN SYSTEM
         SREF     J:ALB           * LST BRANCH SLOT IN THE JIT
         SREF     J:JIT           * ADDRESS OF THE JIT(VIRTUAL)
         SREF     JB:PRIV         * PRIV LEVEL SLOT IN JIT
         SREF     JBPPC           * BYTE INDEX TO PAGE CNT IN JIT
         SREF     JITLOC          * LOC WHRER JIT SITS AT BOOT TIME
         SREF     JOVVP           * FIRST USER VIRTUAL PAGE #
         SREF     JOVVPA          * FIRST USER VIRTUAL ADDRESS
         SREF     JXPPH           * DISP TO HEAD OF CHAIN SLOT IN JIT
         SREF     JXPPT           * DISP TO TAIL OF CHAIN SLOT IN JIT
         SREF     LOW             * LOWERST ALLOCATABLE PAGE IN SYSTEM
         SREF     M:FPPH          * MONITOR FREE PAGE CHAIN HEAD
         SREF     MAXG            * MAX LENGTH OF GHOST TABLES
         SREF     MP:UPPH         * XDELTA'S/HANDLER PAGE CHAIN HEAD
         SREF     MX:PPUT         * PHYSICAL PAGE TABLE
         SREF     P:NAME          * PROC NAME TABLE
         SREF     PB:PSZ          * PROC PROCEDURE SIZE TABLE
         SREF     PFSRSW          * SENSE SWITCHES SAVED BY RCVRY
         SREF     PP:UPPH         * REAL TIME PAGE CHAIN HEAD VALUE
         SREF     PPROCS          * MAX LENGTH OF PROC TABLES
         SREF     PPSTART         * APPROX TOP OF DATA IN MONITOR
         SREF     PX:HPP          * HEAD OF PROCESSORS PAGE CHAIN TABLE
         SREF     PX:TPP          * TAIL PAGE # FOR PROC PAGE CHAINS
         SREF     RCVCODE         * SCREECH CODE CELL
         SREF     RCVPSD          * SCREECH XPSD RECEIVER
         SREF     RCVSIZE         * RCVRY SIZE INFO
         SREF     S:BADFLG        * RT FLAG/SUA FLAG ...ETC...FLAGS
         SREF     S:BCL           * BEGIN CLIST ADDRS
         SREF     CORED           * SIZE OF PHYSICAL MEMORY
         SREF     S:BDA           * BEGIN DISC ADDRS
         SREF     S:BECL          * BEGIN CLIST TABLE FOR USER OUTSWAPS
         SREF     S:CUN           * PLACE WHERE CURRENT USER NUM KEPT
         SREF     S:ECL           * END CLIST
         SREF     S:FPPH          * SWAPPERS HEAD PAGE CHAIN VALUE CELL
         SREF     S:GJOBTBL       * NAMES OF GHOST JOBS
         SREF     S:ISUN          * INSWAP USER NUMBER
         SREF     S:SIP           * SWAP IN PROGRESS FLAG
         SREF     SAVEREGS        * REG BLOCK ZERO SAVE SLOT
         SREF     SAVEREGS1       * REG BLOCK TWOO SAVE SLOT
         SREF     SB:GJOBUN       * GHOST JOB USER NUMS TABLE
         SREF     SB:HQ           * HEAD OF QUEUE TABLE
         SREF     SB:OSUL         * OUTSWAP USER LIST
         SREF     SB:PNL          * PROC INSWAP LIST
         SREF     SH:EDA          * END DISC ADDRESS SWAPPER TABLE
         SREF     SH:SDA          * START DISC ADDRS
         SREF     SITEID          * CONTAINS SITE ID DATA FROM PASS2
         SREF     SMAXOUT         * MAX OUTSWAP USER COUNT
         SREF     SMUIS           * # OF TOTAL USERS IN SYSTEM
         SREF     SNSTS           * LENGTH OF A STATE TABLE
         SREF     SX:HPP          * INSWAP TEMP PAGE CHAIN FOR PROCS
         SREF     SYSVERS         * COPY OF X'2B'
         SREF     TEMPT           * # OF SECONDS SLOT
         SREF     TRAPPSD         * SLOT WHRE TRAP PSD IS KEPT
         SREF     TRAPSAVE        * PLACE WHERE RCVRY SAVED XPSD'S
         SREF     UB:FL           * FWD LINK TO NEXT USER IN SAME STATE
         SREF     UB:PCT          * USER PAGE COUNT TABLE
         SREF     UB:SWAPI        * SWAP TABLE INDEX USER TABLE
         SREF     UB:US           * USERS STATE TABLE
         SREF     UH:AJIT         * AJIT PAGE # TABLE
         SREF     UH:FLG          * USER FLAGS TABLE
         SREF     UX:JIT          * USER JIT PAGE NUM TABLE
         SREF     1MIN            * # OF MINUTES LSOT
         SREF     545ASAVE          * 54-5A INT SAVE LOCATIONS
         PAGE
*
*        EXTERNAL DEFINITIONS
*
         DEF      DO%SYMBOLS      * ENTRY TO PUT OUT SYMBOL MAP NOW..
         DEF      FIX%TIME        * GETS TIME FROM DUMP FILE
         DEF      GETHIGH         * COLLECTS INITIAL INFO ROUTINE
         DEF      INIT:MD         * ROUTINE TO BUILD POINTERS TO SYMBOLS
         DEF      MASK            * PROCESSES MASK COMMAND
         DEF      MPAGES          * RUNS MONITOR PAGE CHAIN DISPLAY
         DEF      PGSOUT          * DRIVES THE PAGE CHAIN DISPLAYS
         DEF      PHYMAP          * PUTS OUT PHYSICAL PAGE MATRIX
         DEF      PPAGES          * RUNS PROC PAGE CHAIN DISPLAY
         DEF      PROCLIST        * RUNS TEMP INSWAP PROCESSOR TABLES
         DEF      REGS            * RUNS REGISTER DISPLAY ROUTINE
         DEF      RTPAGES         * RUNS REAL TIME PAGE CHAINS
         DEF      RUN             * PROCESSES RUN COMMAND
         DEF      SEARCH          * PROCESSES SEARCH COMMAND
         DEF      SEGMAP          * ROUTINE TO RUN CSECT MAP
         DEF      SETVERS         * GETS SYSTEM VERSION
         DEF      SPAGES          * RUNS SWAPPER PAGE CHAIN DISPLAY
         DEF      STATES          * RUNS STATE CHAINS
         DEF      SYM:DISP        * ROUTINE TO SHOW SYMBOLS NOW.
         DEF      SYMBOLMAP       * ENTRY JUST TO BUILD SYMBOL TABLE
         DEF      TPAGE           * TRAPPED PAGE DISPLAY
         DEF      TRPAGE          * ALT ENTRY TO TRAPPED PAGE ROUTINE
         DEF      UID             * RUNS USER ID DISPLAY
         DEF      UPAGES          * RUNS USER PAGE CHAINS
         DEF      USERSLIST       * RUNS OUTSWAP USER DISPLAY
         DEF      WHY             * RUNS SCREECH CODE DISPLAY ROUTINE
         DEF      XDELPGS         * RUNS DELTA/HANDLER PAGE CHAINS
         PAGE
*
*        TABLES TO DRIVE PROCESSOR INSWAP TABLE DISPLAY
*
SWAPTABL EQU      %
         NOP      %                 0
         LI,R14   SH:EDA            1 - END DISC ADDRESS
         LI,R14   S:BDA             2 - BEGINNING DISC ADDRESS
         LI,R14   SH:SDA            3 - PROCESSOR DISC ADDRESS
         LI,R14   S:ECL             4 - END OF COMLIST
         LI,R14   S:BCL             5 - START OF COMLIST
         LI,R14   PB:PSZ            6 - PROCESSOR PROCEDURE SIZE
         LI,R14   SX:HPP            7 - TEMP HEAD OF PP CHAIN
         LI,R14   SB:PNL            8 - INSWAP BYTE LIST
#SWAPTABL EQU     %-SWAPTABL-1      **DEFINE NUMBER OF ENTRIES**
*
*
SWAPTABL1 EQU     %
         NOP      %                 0
         B        HALF:SWAP         1 - 16 BITS
         LW,R3    *R15,R7           2 - 32 BITS
         B        HALF:SWAP         3 - 16 BITS
         LW,R3    *R15,R7           4 - 32 BIT TABLE
         LW,R3    *R15,R7           5 - 32 BITS
         B        PCOUNT            6 - 8 BITS FROM PB:PSZ
         B        HALF:SWAP1        7 - 8 OR 16 BITS
         B        PROC:NAME         8 - 8 BITS PLUS NAME FROM P:NAME
*
SWAP:HDR EQU      %
 TEXTC ' PNL         SX:HPP  PSZ  BCL       ECL       SDA',;
                  '   BDA       EDA       '
*
SWAP:SPAC EQU     %
         DATA,1   72,62,52,46,36,26,21,13,1
         BOUND    4
*
         PAGE
*F*
*F*    NAME:           PROCLIST
*F*
*F*    PURPOSE:        TO DISPLAY THE LIST OF PROCESSOR BEING
*F*                    INSWAPPED (IF ANY).
*F*
*F*    DESCRIPTION:    PROCLIST OBTAINS THE LIST COUNT FROM THE
*F*                    HEAD SLOT 'SB:PNL' . IF IT INDICATES THAT
*F*                    PROCESSORS WERE BEING INSWAPPED - PROCLIST
*F*                    WILL PRODUCE A FORMATTED LISTING OF THE
*F*                    TABLES.
*F
*
PROCLIST EQU      %
         LCFI     2
         LM,R0    ZEROS
         STM,R0   PROCIN#           RESET OBSERVATION CELLS
         STM,R0   PIN#              ZAP NUMBER TABLE
         STM,R0   PINHD             ZAP HEAD #
         STM,R0   PINTL             ZAP TAIL #
         STM,R0   PINC              ZAP COUNTS
         STW,R0   PR:INCNT          RESET INSWAP PROCESSOR PG CNT
         LI,R14   SB:PNL            TABLE CONTAINING NUMBERS
         BAL,R0   GETADDR           GO GET IT
         LB,R14   *R15              GET COUNT OF PROCESSORS COMING IN
         BEZ      SCANNER           NONE
         LI,R1    SWAP:TIT          FIRST THE TITLE
         BAL,R0   TITEL             GOES OUT
         LI,R1    SWAP:HDR          THEN
         BAL,R0   MBB               THE HEADER
         CI,R14   7                 IN RANGE
         BG       PLIST:GONE        NO
         STW,R14  PROCIN#           AND SAVE IT
         STW,R14  INSWAP            SET INSWAP TRUE/NOT TRUE
         LI,R7    0                 INDEX INTO SB:PNL
         LI,R5    8                 MAX LENGTH OF SB:PNL
PROCLIST0 EQU     %
         LI,R4    #SWAPTABL         # OF ENTRIES WE WILL SHOW
PROCLIST1 EQU     %
         LB,R1    SWAP:SPAC,R4      GET SPACING COUNT
         BAL,R0   SPACES            PUT OUT
         EXU      SWAPTABL,R4       EXECUTE THE R14 LOAD UP
         BAL,R0   GETADDR           GO GET THE ADDRESS
         EXU      SWAPTABL1,R4      EXECUTE THE FETCH
PROCLIST2 EQU     %
         BAL,R0   TRANSSZ           PUT OT THE VALUE
PROCLIST3 EQU     %
         BDR,R4   PROCLIST1         COMPLETE CURRENT ROW
         BAL,R0   BUFOUT            PRINT ENTIRE LINE
         AI,R7    1                 NEXT INDEX INTO SB:PNL
         BDR,R5   PROCLIST0         COMPLETE ENTIRE DISPLAY
         LW,R3    PROC:CNT          GET PAGE COUNT
         BEZ      SCANNER           NO COUNT
         STW,R3   PR:INCNT          SAVED
         BAL,R0   BLANK1
         LI,R1    PRINMSG
         BAL,R0   MTBB              MSG / TRANSSZ / BUFOUT / BLANK1
         B        PROCHAIN          SHOW PROCESSOR PAGE CHAINS
         BOUND    8
PNUM     DATA     1,PPROCS          VALID PROC # PAIR
         PAGE
*
*        PROCESSOR INSWAP TABLE DESTROYED
*
PLIST:GONE EQU    %
         LI,R1    PGONEMSG
         B        PUSHMSG
PGONEMSG TEXTC    '*** PROCESSOR INSWAP TABLE DESTROYED'
         PAGE
*
*        RUN THE PROCESSOR TEMPORARY PAGE CHAINS
*
PROCHAIN EQU      %
         LB,R7    PIN#              GET HEAD OF LIST
         BEZ      SCANNER           NONE OR WE SCREWED UP
         LI,R1    PTEMPC            PUT OUT TITLE LINE
         BAL,R0   TITEL
PROCHAIN0 LB,R7   PIN#              GET NEXT INDEX
         LB,R2    PIN#,R7           GET NEXT PROCESSOR NUMBER
         BEZ      PROCHAIN1         NONE
         LOAD,R4  PINHD,R7          GET HEAD
         BEZ      PROCHAIN1         NO HEAD = NO DISPLAY
         STW,R4   PR:HD             STORE IT FOR MAIN ANALZ
         LOAD,R5  PINTL,R7          GET TAIL
         BEZ      PROCHAIN1         NO TAIL = NO DISPLAY
         STW,R5   PR:TL             STORE IT FOR MAIN ANALZ
         LOAD,R6  PINC,R7           GET COUNT
         STW,R6   PR:CNT            STORE IT FOR MAIN ANALZ
         LI,R7    1                 PASS ONE PASS FLAG
         BAL,R1   PTPAGES           GO DISPLAY THIS LIST
PROCHAIN1 MTB,-1  PIN#              DECREMENT LIST
         BGZ      PROCHAIN0         MORE TO GO YET
         B        SCANNER           ALL DONE
         PAGE
*
*        PROCESSOR NAME NEEDS TO GO OUT ALONGSIDE NUMBER
*
PROC:NAME EQU     %
         LI,R6    0                 INITIALIZE NUMBER  CELL
         LB,R3    *R15,R7           PICK UP # FROM SB:PNL
         BEZ      PROCLIST2         NONE - GO ON
         BAL,R0   TRANSSZ           OKAY - PUT OUT NUMBER
         CI,R7    0                 ON INITIAL ROW
         BEZ      PROCLIST3         YES - GO ON
         LW,R6    R3                LOAD R6 WITH PROCESSOR #
         LB,R1    PIN#              GET HEAD OF OUR TEMP LIST
         AI,R1    1                 BUMP
         STB,R6   PIN#,R1           SAVE PROCESSOR NUMBER
         CW,R1    PROCIN#           WILL TEMP COUNT BE > REAL CNT
         BG       %+2               YES - LEAVE SET HERE
         STB,R1   PIN#              REMEMBER COUNTS
         LI,R14   P:NAME
         BAL,R0   GETADDR           GO GET PROCESSOR NAME TABLE
         LI,R1    5                 SPACE OVER TO CORRECT COLUMN
         BAL,R0   SPACES
         LD,R0    *R15,R6           GET NAME
         AND,R0   =X'07FFFFFF'      LIMIT NAME TO 7 CHARACTERS
         STD,R0   PROCNAME          AND PLACE IT AWAY
         LI,R1    PROCNAME
         BAL,R0   MSG               MVE NAME TO PRINT LINE
         B        PROCLIST3         AND CONTINUE ALONG WITH DISPLAY
*
*
HALF:SWAP EQU     %
         LH,R3    *R15,R7           PICK UP HALF WORD ENTRIES
         AND,R3   #R16              LIMIT TO 16 BITS WORTH
         B        PROCLIST2         REJOIN MAIN PATH...
         PAGE
*
*        IF BIG SYSTEM MASK FOLLOWING ITEM
*
*
*        OBTAIN TEMP HEAD AND TEMP TAIL OF PROCESSORS PAGE CHAIN
*
HALF:SWAP1 EQU    %
         LOAD,R3  *R15,R7           PICK UP SX:HPP VALUE
         AND,R3   #R16              MASK IT
         LB,R1    PIN#              GET HEAD OF OUR TEMP LIST
         BEZ      PROCLIST2         NONE
         CI,R6    0                 ANY PROCESSOR TO DO
         BEZ      PROCLIST2         NOPE
         CW,R7    PROCIN#           WILL TEMP CNT BE > REAL
         BG       PROCLIST2         YES - JUMP
         STORE,R3 PINHD,R1          STORE HEAD OF TEMP PRO. CHAIN
         LI,R14   PX:TPP            PROCESSOR TAIL PAGE NUMBER
         BAL,R0   GETADDR           GO GET IT
         LOAD,R8  *R15,R6           GET TAIL
         STORE,R8 PINTL,R1          SAVED FOR LATER
         B        PROCLIST2         REJOING MAIN PATH
         PAGE
*
*        GOT A PROCESSOR NUMBER HERE
*
PCOUNT   EQU      %
         LB,R3    *R15,R6           GET ENTRY FROM PB:PSZ
         CLM,R6   PNUM              VALID PROCESSOR #
         BCS,9    PROCLIST2         NO
         CI,R7    0                 ON FIRST ENTRY
         BEZ      PROCLIST2         YES
         CW,R7    PROCIN#           DOES THIS PROCESSOR BELONG IN LIST
         BG       PROCLIST2         NO
         LB,R1    PIN#              GET HEAD OF OUR TEMP LIST
         STB,R3   PINC,R1           STORE PAGE COUNT
         AWM,R3   PROC:CNT          UPDATE INSWAP CORE COUNT
         B        PROCLIST2         AND REJOIN
         PAGE
*
*        TABLES TO DRIVE THE DISPLAY
*
USERHDR  EQU      %
 TEXTC ' USER SWAPI JIT  AJIT PCT  BCL      ECL      SDA',;
                 '  BDA      EDA  BECL       '
*
OUT:SPC  EQU      %
         DATA,1   74,64,59,50,45,36,27,22,17,12,6,1
         BOUND    4
*
*
OUT:LD   EQU      %
         NOP
         LI,R14   S:BECL            1
         LI,R14   SH:EDA            2
         LI,R14   S:BDA             3
         LI,R14   SH:SDA            4
         LI,R14   S:ECL             5
         LI,R14   S:BCL             6
         LI,R14   UB:PCT            7
         LI,R14   UH:AJIT           8
         LI,R14   UX:JIT            9
         LI,R14   UB:SWAPI          10
         LI,R14   SB:OSUL           11
#OUT     EQU      %-OUT:LD-1        **DEFINE LENGTH OF TABLE**
*
*
OUT:ACT  EQU      %
         NOP
         B        OUT:DBL           1 IS DOUBLE WORD
         B        OUT:HALF          2 IS HALF WORD
         LW,R3    *R15,R7           3 IS OBVIOUSLY A WORD
         B        OUT:HALF          4 IS HALF WORD
         LW,R3    *R15,R7           5
         LW,R3    *R15,R7           6
         B        USER:CNT          7 USER TABLE BYTE
         B        USER:HALF         8 USER TABLE HALF WORD
         B        USER:HALF1        9 USER TABLE LOAD ITEM
         LB,R3    *R15,R6           10 USER TABLE BYTE
         B        USER:INIT         11 USER TABLE - INIT REGISTERS
*
*
         PAGE
*F*
*F*    NAME:           USERSLIST
*F*
*F*    PURPOSE:        TO DISPLAY THE LIST OF USERS BEING
*F*                    OUTSWAPPED.
*F*
*F*    DESCRIPTION:    USERSLIST WILL OBTAIN THE COUNT FROM THE
*F*                    CELL 'SB:OSUL' - IF NON ZERO IT WILL DISPLAY
*F*                    THE TABLES ASSOCIATED WITH THE SWAP.
*F*
*
USERSLIST EQU     %
         LCFI     2
         LM,R0    ZEROS
         STW,R0   OUT:CNT           RESET COUNT OF OUTSWAP PAGES
         STM,R0   OUTSWAP#          ZAP THE TABLES
         LI,R14   SB:OSUL           FIRST GET
         BAL,R0   GETADDR           THE LIST
         LB,R14   *R15              GET THE COUNT OF OUTSWAP PEOPLE
         BEZ      SCANNER           DONE
         LI,R1    USERLTIT          PUT OUT THE
         BAL,R0   TITEL             TITLE LINE
         LI,R1    USERHDR           AND THEN THE
         BAL,R0   MBB               HEADER LINE
         CI,R14   SMAXOUT           AT MAX
         BG       ULIST:GONE        BLOWN
         STW,R14  OUTSWAP#          SAVED
         STW,R14  OUTSWAP           SET OUTSWAP TRUE/NOT TRUE
         LI,R7    1                 START WITH ENTRY ONE
         LI,R4    SMAXOUT           MAX LOOP THRU TABLES
USERLIST1 EQU     %
         LI,R6    0                 INDEX INTO USER TABLES
         LI,R5    #OUT              INDEX INTO INTERNAL TABLES
USERLIST2 EQU     %
         LB,R1    OUT:SPC,R5        GET COLUMN SPACING
         BAL,R0   SPACES            AND PUT IT OUT
         EXU      OUT:LD,R5         LOAD ADDRESS
         BAL,R0   GETADDR           GET IT
         EXU      OUT:ACT,R5        EXECUTE FETCHER....
USERLIST3 EQU     %
         BAL,R0   TRANSSZ           PUT IT OUT
USERLIST4 EQU     %
         BDR,R5   USERLIST2         FINISH ROW
         BAL,R0   BUFOUT            AND PRINT IT
         AI,R7    1                 NEXT INDEX INTO SB:OSUL
         CW,R7    OUTSWAP#          HAVE WE SHOWN ALL OF THE PEOPLE
         BG       %+2               YEP
         BDR,R4   USERLIST1         FINISH OUT SWAP TABLE
         LW,R3    OUTSWAPC          GET COUNT OF OUTSWAP PAGES
         BEZ      SCANNER           NONE
         STW,R3   OUT:CNT           SAVE COUNT FOR LATER USE
         BAL,R0   BLANK1            BLANK LINE FIRST
         LI,R1    OUTSWPMSG         LOAD MESAGE ADDRESS
         BAL,R0   MTBB              PUT OUT MSG / TRANS / BLANK1
         B        SCANNER           AND RETURN TO SCANNER
OUTSWPMSG EQU     %
 TEXTC '**CORE PAGE COUNT IN USE FOR OUTSWAPS: '
PRINMSG EQU       %
 TEXTC '**CORE PAGE COUNT IN USE FOR PROCESSOR INSWAPS: '
         PAGE
*
*        USER OUTSWAP TABLES DESTROYED
*
ULIST:GONE EQU    %
         LI,R1    UGONEMSG
         B        PUSHMSG
UGONEMSG TEXTC    '*** USER OUTSWAP TABLES DESTROYED'
         PAGE
*
*        RUN USER'S PAGE CHAIN BACKWARDS
*
*
BACKWARDS EQU     %
         LI,R1    2                 USER # IS IN FIELD # 2
         BAL,R0   GETHEX            CONTAING USER #
         STW,R2   USER              SAVED
         LI,R14   UB:US             FIRST GET STATE TABLES
         BAL,R0   GETADDR
         LB,R7    *R15,R2           GET STATE OF USER
         CI,R7    #STATES           IS ACTIVE USER
         BE       NO:USER           NO
         LI,R14   UX:JIT            OKAY
         BAL,R0   GETADDR           GET
         LOAD,R7  *R15,R2           THE JIT PAGE #
         BEZ      NO:USER           NONE
         STW,R7   U:FPPT            SAVE THE TAIL #
         LI,R14   UB:PCT            NOW
         BAL,R0   GETADDR
         LB,R6    *R15,R2           PAGE CNT
         BEZ      NO:USER           NONE
         STW,R6   U:FPPC            SAVED
         AI,R6    -1                ADJUST COUNT FOR TAIL PAGE #
SEARCHA  EQU      %
         LI,R5    CORE
         SLS,R5   -9                # OF ENTRIES IN MX:PPUT
         LI,R14   MX:PPUT
         BAL,R0   GETADDR           GO GET
SEARCH0  EQU      %
         COMPARE,R7  *R15,R5        FIND THE #
         BE       SEARCH1           GOTCHA
         BDR,R5   %-2
         B        FAILED            SOMETHING WRONG HERE
SEARCH1  EQU      %
         STW,R5   U:FPPH            LEAVE IT FOR LATER
         STW,R7   R4                REMEMBER R7 FOR ONE PASS
         XW,R7    R5                PICK UP NEXT BLINK
         BDR,R6   SEARCHA           CONTINAUE SEARCHAW/COUNT
         STW,R7   U:FPPH            WE NOW HAVE THE HEAD PAGE #
         LI,R1    USERMSG
         LW,R3    USER
         BAL,R0   MSG               PRINT THE MSG
         BAL,R0   TRANSSZ           PUT OUT THE USER'S #
         LCFI     4
         LM,R4    U:FPPH            PICK UP HEAD - TAIL - COUNT
         BAL,R0   PGSOUT            AND RUN THE CHAIN WE BUILT
         B        SCANNER
USERMSG  TEXTC    'USER# '
         USECT    DATA
SYM:PASS EQU      %
U:FPPH   DATA     0
U:FPPT   DATA     0
U:FPPC   DATA     0
         USECT    PROCEDE
         PAGE
*
*        NO USER TO BE FOUND
*
NO:USER  EQU      %
         LI,R1    USERAMSG
         B        PUSHMSG
USERAMSG TEXTC '**NO USER AROUND BY THAT NUMBER'
         PAGE
*
*        WE DIDNT FIND CURRENT VALUE IN R7 - TRY SEARCHING
*        FOR A POSSIBLE DOUBLE ENTRY BY SWITCHING R7
*        AS NEXT INDEX AND SEARCHING LOWER FOR A HIT
*
FAILED   EQU      %
         LW,R5    U:FPPH            LAST PLACE WE FOUND VALUE
         BEZ      FAILED1           TOO FAR
         AI,R6    1                 ADJST 6 - WE ALREADY DINGED IT DOWN
         CW,R6    U:FPPC            GOING TO SCREW UP
         BG       FAILED1           YEP - STOP NOW
         LW,R7    R4                LAST ONE WE WERE LOOKING FOR
         BDR,R5   SEARCH0           TRY SEARCHING LOWER FOR IT
FAILED1  EQU      %
         LI,R1    FA:MSG
         LW,R3    R4                VALUE WE WERE LOOKING FOR
         BAL,R0   MTB               PUT OUT MSG / TRANSSZ / BUFOUT
         B        SCANNER           **TEMP** RETURN TO SCANNER
FA:MSG   TEXTC    '** CANT FIND ENTRY IN MX:PPUT: '
         PAGE
*
*        FIRST PASS - MOVE USER NUMBER INTO INTERNAL REGISTER
*
USER:INIT EQU     %
         LB,R3    *R15,R7           GET USER NUMBER
         LW,R6    R3                MOVE USER # TO WORK REG
         B        USERLIST3         AND REJOIN
*
*        PICK UP USER PAGE COUNT AND INCREMENT OUTSWAP COUNTER
*
USER:CNT EQU      %
         LB,R3    *R15,R6           GET IT
         CW,R7    OUTSWAP#          IS THIS POSITION REALLY IN LIST
         BG       USERLIST3         NO - GO ON
         AWM,R3   OUTSWAPC          YES - BUMP OUTSWAP PAGE CNT
         B        USERLIST3         GO ON TO DISPLAY NUMBER
         PAGE
*
*        MANIPULATE HALF WORD ENTRIES
*
OUT:HALF EQU      %
         LH,R3    *R15,R7           GET HALF WORD FROM SWAPPER TABLE
OUT:HALF1 EQU     %
         AND,R3   #R16              MASK IT DWON
         B        USERLIST3         REJOIN MAIN PATH...
*
*        GET HALF WORD FROM USER TABLE
*
USER:HALF EQU     %
         LH,R3    *R15,R6
         B        OUT:HALF1
*
*        GET ENTRY FROM USER TABLE THAT IS LOAD ITEM
*
USER:HALF1 EQU    %
         LOAD,R3  *R15,R6           GET IT
         B        OUT:HALF1         REJOIN
*
*        GET ENTRY FROM SWAPPER TABLE THAT IS DOUBLE WORD
*
OUT:DBL  EQU      %
         LD,R10   *R15,R7           GET DBL WORD
         LW,R3    R10               GET FIRST WORD
         BAL,R0   TRANSSZ           OUTPUT
         LI,R1    74                NEXT COLUMN
         BAL,R0   SPACES            START THERE FOR NEXT PART OF DBLWRD
         LW,R3    R11               SECOND WORD
         BAL,R0   TRANSSZ
         B        USERLIST4         REJOIN MAIN PATH....
*
*
         PAGE
*F*
*F*    NAME:           UID
*F*
*F*    PURPOSE:        TO SCAN THRU ALL THE JITS THAT CANBE FOUND
*F*                    IN THE MONDMP FILE AND DISPLAY THE NAME,
*F*                    JOB ORIGIN AND PRIVELEGE LEVEL OF EACH IT
*F*                    FINDS.
*F*
*F*    DESCRIPTION:    UID SETS THE 'LOOKING' FLAG TO SUPPRESS ERROR
*F*                    MESSAGES AND CALLS LOCJIT TO FIND EACH JIT
*F*                    POSSIBLE IN THE SYSTEM. EVERY TIME LOCJIT
*F*                    SETS THE 'FOUND' CONDITION CODES UID WILL
*F*                    EXTRACT THE NAME/LEVEL/MODE DATA AND PRODUCE
*F*                    A PRINT LINE OF THAT INFO.
*F*
UID      LI,1     USERIDMS          PUSH
         BAL,0    TITEL             HEADER TITLE
         LI,1     USERIDMS1         DO
         BAL,R0   MSG%OUT           PRINT LINE
         LI,1     2                 CHECK
UID0     EQU      %
         BAL,0    GETHEX            FOR AN OPTION
         LI,10    0                 PREPARE FOR IT
         AI,2     0                 WAS THERE
         BNEZ     UID2              YES,USE IT AS INDEX
         AI,2     1                 NO,POINT TO FIRST ONE
         LI,10    SMUIS             SET MAXIMUM LOOP
UID2     STW,R2   USER              INITIALIZE POINTER
         LI,1     %                 SET FLAG
         STW,1    LOOKING           TO PERUSE FILE
         BAL,R0   RES:JIT           FIND THE JIT
         BCS,4    UID4              NONE - SKIP TO NEXT
UID3     LI,1     1                 DO SPACING
         BAL,0    SPACES
         LW,3     2                 INSERT
         BAL,0    TRANSSZ           USER#
         LI,1     9                 SPACE
         BAL,0    SPACES            OVER
         LI,R3    JB:PRIV-J:JIT     WORD DISP TO JB:PRIV
         SLS,R3   2                 INTO BYTE DISPLACEMENT
         LB,R3    *JITBUF,R3        GET USER'S PRIVILEGE LEVEL
         BAL,R0   TRANSSZ           PUT IT INTO PRINT LINE
         LI,R1    17                NEXT SPACING
         BAL,R0   SPACES
         LB,1     *JITBUF           GET USER
         SLS,1    -5                USER ORIGIN
         AND,1    =7                MASK DOWN
         CI,1     1                 ODD BIT SET
         BAZ      %+2               NO
         AI,1    -1                 YES,BUMP IT
         AI,1     UORIGIN           TYPE IN TEXT
         BAL,0    MSG
         LI,1     27                SPACE
         BAL,0    SPACES            PROPERLY
         LI,1     1
         LCI      2                 GET USERS
         LM,7     *JITBUF,1         ACCOUNT#
         PSW,2    STACK             SAVE #
         LI,2     8                 8 BYTE ACCOUNT#
         LI,1     7                 POINT TO MSG ADDRS
         BAL,0    MSG1              INSERT TO PRINT LINE
         LI,1     38                SPACE
         BAL,0    SPACES            PROPERLY
         LI,1     3                 INDEX TO USER
         LCI      3                 NAME IN JIT
         LM,7     *JITBUF,1         GET IT
         LW,R2    *STACK            GET USER ID                              B00
         LC       *JITBUF           GET JOB ORIGIN
         BCR,4    NOGHOST           NOT A GJOST JOB
         LI,R14   SB:GJOBUN                                                  B00
         BAL,R0   GETADDR                                                    B00
         LI,R7   MAXG                                                        B00
GJOB%SRCH  EQU    %                                                          B00
         CB,R2    *R15,R7           LOOK FOR INDEX INTO                      B00
         BE       GJOB%NAM             GJOBTABLE                             B00
         BDR,R7   GJOB%SRCH                                                  B00
         B        NOGHOST           COULDN'T FIND ONE                        B00
GJOB%NAM EQU      %                                                          B00
         LI,R14   S:GJOBTBL                                                  B00
         BAL,R0   GETADDR                                                    B00
         LD,R8    *R15,R7           GET EBCDIC OF GJOB NAME                  B00
         AND,R8   =X'07FFFFFF'      LIMIT OF 7 CHARACTERS PER NAME
         STD,R8   PROCNAME                                                   B00
         LI,R1    PROCNAME                                                   B00
         BAL,R0   MSG                                                        B00
         B        UBUFOUT                                                    B00
NOGHOST  EQU      %                                                          B00
         LI,2     3*4               BYTE LENGTH
         LI,1     7                 POINT TO MSG ADDRS
         BAL,0    MSG1              INSERT IT
UBUFOUT  EQU      %                                                          B00
         BAL,0    BUFOUT            PRINT THE WHOLE THING
         PLW,2    STACK             RESTORE R2
UID4     AI,2     1                 BUMP TO NEXT
         BDR,10   UID2              GO TO NEXT USER
         LI,R6    UID0              RETURN POINT
         B        GETLIST
UORIGIN  TEXTC    'BATCH'
         TEXTC    'GHOST'
         TEXTC    'ONLINE'
USERIDMS1 EQU     %
         TEXTC   ' USER    PRIV    ORIGIN    ACCOUNT    USER NAME'
         PAGE
*F*
*F*    NAME:           TPAGE
*F*
*F*    PURPOSE:        TO DISPLAY THE PAGE IN WHICH THE TRAP
*F*                    OCCURED (IE; TRAP 40-42 OR 61).
*F*
*F*    DESCRIPTION:    TPAGE INSURES THAT THE 'REGS' ROUTINE HAS
*F*                    RUN AND SAVED THE SCREECH CODE. IF THE SCREECH
*F*                    CODE INDICATES THAT A TRAP HAS OCCURED
*F*                    THAT WE WANT TO LOOK AT - TPAGE WILL CHECK TO
*F*                    SEE IF IT SHOULD MAP ONTO SOME USER..ETC..TO
*F*                    OBTAIN THE PROPER PAGE IN WHICH THE TRAP
*F*                    OCCURED.
*F*                    IT WILL (ONCE THE PROPER PAGE IS IN THE HAND)
*F*                    THEN DUMP OUT THAT PAGE.
*F*
TPAGE    EQU      %
         MTW,0    REG%FLAG          BEEN THRU REG CODE                       A00
         BGZ      TRPAGE            YES                                      A00
         BAL,R1   REGS              NO, GO DO IT                             A00
TRPAGE   EQU      %                                                          A00
         BAL,R0   UNMAP             BACK TO REAL TRANSLATION
         MTW,0    TRAP:SCR          WAS THE SCREECH DUE TO A TRAP
         BEZ      SCANNER           NO - EXIT FROM HERE
         LI,R1    TPMSG             TITLE LINE FOR THIS DISPLAY
         BAL,R0   TITEL             PUT IT OUT
         LI,R14   TRAPPSD           ADDR OF PSD AT TIME OF LAST TRAP         A00
         BAL,R0   GETADDR                                                    A00
         LCFI     2
         LM,R10   *R15              GET  BOTH WORDS OF THE PSD
         STM,R10  PIN#              SAVE BOTH WORDS OF PSD
         LW,R14   *R15              PICK IT UP...
         LH,13    14                GET MS/MM BIT FIELDS
         AND,14   =X'1FFFF'         MASK DOWN ADDRS
         CI,13    X'0040'           IS A MAPPED TRAP
         BAZ      TRPAGE1           NO,REAL ADDRS IN 14
         CI,R14   JOVVPA            IS REALLY USER'S VIRTIAL MMEMORY
         BL       TRPAGE1           NO - MAPPED ONE-TO-ONE
         LI,R1    VIRT:MSG          LETS SAY SOMETHING ABOUT IT
         BAL,R0   MBB               FOR VIEWERS BENEFIT
         PSW,14   STACK
         LI,R1    CUN:ERR           ERROR MSG IN CASE S:CUN CLBERED
         LW,R2    CUN               GET CURRENT USER #
         BLEZ     ERRMSG            ***ERROR***
         STW,R2   USER              SET FLAG FOR RES:JIT
         BAL,0    MAP:USER          HIS MAP
         LW,R7    *STACK            RETRIEVE TRAP ADDRESS
         SLS,R7   -9                INTO A PAGE #
         CLM,R7   MAPLIMS           IS PAGE # IN MAPPED MEMORY
         BCS,9    MAPOKAY           NOPE--> JUMP
         LI,R1    CUN:MAP           NOW LETS
         BAL,R0   MBB               SAY WE'RE GOING TO USE S:CUN'S MAP
         LOAD,R6  *USRMAP,R7        GET PAGE # FROM THE USER'S MAP
         BGZ      MAPTEST1          IS OKAY
         LI,R1    BADVALUE          NOT OKAY
         B        ERRMSG
MAPTEST1 EQU      %
         CLM,R6   NULLPAGE          IS ASSIGNED PAGE
         BCS,9    MAPTEST2          YEP
         LI,R1    ASNERR            NO
         B        ERRMSG
MAPTEST2 EQU      %
         CLM,R6   PAGLIMS           IS WITHIN CORE LIMITS
         BCR,9    MAPOKAY           YEP
         LI,R1    LIM:ERR           NO
ERRMSG   EQU      %
         BAL,R0   MB                PUT OUT THE MESSAGE
         LI,R0    0                 TURN OFF
         STW,R0   MAPFLAG           THE MAP FLAG
         LI,R1    ERRCMSG           TELL VIEWER
         BAL,R0   MBB               THAT WE WENT UNMAPPED
MAPOKAY  EQU      %
         PLW,R14  STACK             AND RETRIEVE THE MAPPED IA
         B        TRPAGE11          GO TO MAPPED MERGE POINT
TRPAGE1  EQU      %
         LI,R1    :B9               IS THIS A BIG NINE SYSTEM
         BEZ      TRPAGE11          NOT  A BIG  NINE SYSTEM
*
*        BIG NINE SYSTEM - CHECK FOR EXTENDED ADDRESSING MODE
*
         LW,R14   PIN#              GET PSD WORD ZERO
         AND,R14  =X'1FFFF'         CLEAR  ALL BUT ADDRS  FIELD
         CI,R14   X'10000'          CHECK FOR EXTENDED ADDRESS BIT
         BAZ      TRPAGE11          NOT SET - BYPASS E.A. CALCULATION
*
*        BIG NINE AND EXTENDED  ADDRESSING CALLED FOR
*
         AND,R14  #R16              SAVE PSW  ZERO
         LW,R15   PIN#+1            GET  PSW WORD ONE
         AND,R15  =X'3F0000'        PULL OUT EXTENDED  ADDRESSING FIELD
         AW,R14   R15               ADD  EM UP TO GET REAL ADDRESS
         LI,R1    EXTNDMSG
         BAL,R0   MB                PUT OUT MSG ABOUT SIG 9 MODE
TRPAGE11 EQU      %
         CLM,R14  PATCHLOC          TRAP IN PATCH AREA
         BCS,9    TRPAGE15          NO
         LI,R1    TRAPATCH          YES
         BAL,R0   MSG%OUT           WARNING MSG
TRPAGE15 BAL,R0   GETADDR           GET THE TRAP ADDRESS
         LW,R8    R15               MOVE POINTER TO BUFFER
         LI,7     X'200'            SET UP DISPLAY
         BAL,0    DUMPSOME          DUMP THE PAGE
TRPAGE2  LI,0     SCANNER           RETURN FOR
         B        UNMAP             UNMAP ROUTINE
TRAPATCH TEXTC '** TRAP LOCATION IS IN PATCH AREA'
EXTNDMSG TEXTC    '** ADDRESS TRANSLATION IS VIA SIGMA 9 EXTENDED',;
                  ' ADDRESSING MODE'
VIRT:MSG TEXTC '** TRAP ADDRESS IN USER VIRTUAL MEMORY'
CUN:MAP  TEXTC '** ADDRESS TRANSLATION IS VIA S:CUN MAP'
ASNERR   TEXTC    '** S:CUN MAP CONTAINS FMPC/NMPC FOR VIRTUAL PAGE'
BADVALUE TEXTC '** S:CUN MAP CONTAINS INVALID ENTRY FOR VIRTUAL PAGE'
LIM:ERR  TEXTC    '** S:CUN MAP CONTAINS OUT OF RANGE PHYSICAL PAGE',;
                  ' # FOR VIRTUAL PAGE'
CUN:ERR  TEXTC    '** S:CUN CLOBBERED'
ERRCMSG  TEXTC    '** TRANSLATION WILL BE PHYSICAL'
         PAGE                                                                A00
*F*
*F*    NAME:           FIX%TIME
*F*
*F*    PURPOSE:        TO OBTAIN THE TIME OF THE DUMP
*F*
*F*    DESCRIPTION:    FIX%TIME FETCHES THE TIME OF THE DUMP FROM THE
*F*                    MONITOR LOCATIONS 'DATE' / 'TIME' AND PLACES
*F*                    THEM INTO ANLZ'S PRINT TITLE LINE.
*F*
FIX%TIME EQU      %                                                          A00
         PSW,R1   STACK                                                      A00
         LI,R14   TEMPT             PTR TO TIME OF DUMP                      A00
         MTW,1    LOOKING           ONLY NEED ONE PAGE
         BAL,R0   GETADDR                                                    A00
         LW,R2    *R15                                                       A00
         AI,R15   1                                                          A00
         LW,R3    *R15                                                       A00
         SLD,R2   16                SHIFT OUT COUNT AND NEW LINE CHAR'S
         STW,R2   HDMSG+2           STORE 'HH:M'
         SLD,R2   8                 NOW (R2)='...M'                          A00
         STB,R2   HDMSG+3           STORE LAST BYTE OF MINUTE
         LI,R2    1
         LI,R5    '.'
         STB,R5   HDMSG+3,R2        STORE A DOT
         LI,R14   1MIN
         MTW,1    LOOKING           ONLY NEED ONE PAGE
         BAL,R0   GETADDR           GET # 1.2 SECONDS LEFT IN MINUTE
         LI,R5    60                COUNT IS IN 1.2 INCREMENTS
         SW,R5    *R15              GET SECONDS INTO MINUTE
         AND,R5   =X'3F'            MODULO 50
         LI,R1    BA(HDMSG)+15      LOC WHERE SECONDS GO...
         CI,R5    10                CORRECT
         BGE      %+2               YES
         AI,R1    -1                NO
         BAL,R0   DECIMAL           INSERT
         LI,R2    ' '
         LI,R14   DATE              PTR TO DAY OF YEAR                       A00
         BAL,R0   GETADDR                                                    A00
         LB,R3    *R15                                                       A00
         AND,R3   L(X'0F')                                                   A00
         MI,R3    10                                                         A00
         LI,R4    1                                                          A00
         LB,R5    *R15,R4                                                    A00
         AND,R5   L(X'0F')                                                   A00
         AW,R3    R5                (R3)=MONTH AS HEX INTEGER                A00
         LW,R3    MO%TBL,R3         (R3)= ' MMM' - MONTH IN EBCDIC           A00
         SLD,R2   24                                                         A00
         STW,R2   HDMSG+4           STORE 'MO DADA'
         AW,R3    L(X'400000')      (R3)='M ..'                              A00
         LH,R2    *R15,R4                                                    A00
         AND,R2   #R16                                                       A00
         AW,R3    R2                                                         A00
         STW,R3   HDMSG+5           THE REST OF DAY MONTH
         LW,R2    L(','''**16)                                               A00
         AI,R15   1                                                          A00
         LH,R3    *R15,R4                                                    A00
         AND,R3   #R16                                                       A00
         AW,R2    R3                                                         A00
         STW,R2   HDMSG+6
         PLW,R1   STACK                                                      A00
         B        0,R1              RETURN TO CALLER
MO%TBL   EQU      %-1                                                        A00
         DATA,4   ' JAN',' FEB',' MAR',' APR',' MAY',' JUN',;                A00
                  ' JUL',' AUG',' SEP',' OCT',' NOV',' DEC'                  A00
         PAGE
*F*
*F*    NAME:           DO%SYMBOLS
*F*
*F*    PURPOSE:        THIS IS THE COMMAND ENTRY POINT FOR 'SYMBOLS'
*F*
*F*    DESCRIPTION:    DO%SYMBOLS DISPATCHES THE ROUTINES TO OUTPUT
*F*                    THE SYMBOL MAP ONTO THE PRINT MEDIUM.
*F*
DO%SYMBOLS  EQU   %                                                          A00
         PSW,R1   STACK             SAVE RETURN                              A00
         BAL,R1   SYMBOLMAP                                                  A00
         BAL,R1   SYM:DISP                                                   A00
         PLW,R1   STACK                                                      A00
         B        0,R1              RETURN TO CALLER
         PAGE
*F*
*F*    NAME:           SYMBOLMAP
*F*
*F*    PURPOSE:        THIS IS THE ENTRY TO CREATE THE SYMBO TABLE
*F*                    BUT NOT TO OUTPUT SAME.
*F*
*F*    DESCRIPTION:    SYMBOLMAP WILL EITHER USE 'SYMBOLS' IF ITS
*F*                    EXISTS OR MONSTK.:SYS FOR INPUT . IT WILL
*F*                    THEN BUILD A VALUE SORTED TABLE OF SYMBOLS
*F*                    IN THE BUFFER POINTED TO BY 'BIGBUF'.
*F*
SYMBOLMAP  EQU    %                                                          A00
         MTW,0    FIELD2            WAS THER E A FIELD # 2
         BNEZ     SYMBOLMAP1        YES - JUMP
         MTW,0    SYMBOL:FLAG       ALREADY DONE IT
         BEZ      SYMBOLMAP1        HAVEN'T CREATED IT YET
         CI,R1    SCANNER           HAVE DONE IT - WAS BY COMMAND
         BE       SYM:DISP          YES - GO DISPLAY IT
         B        0,R1           **NOT BY COMMAND - RETURN TO DO%SYMBOLS
SYMBOLMAP1 PSW,R1 STACK             SAVE RETURN LINK
         LW,R9    BIGBUF            DO WE ALREADY HAVE A BUFFER
         BNEZ     GOT%BUF           YES                                      A00
         CAL1,8   GPGS              NO,GET ONE                               A00
         BCS,8    NO%SYM%BUF        CAN'T                                    A00
         AWM,R8   FPGS              UPDATE FREE PAGE COUNTER
         STW,R9   BIGBUF                                                     A00
         SLS,R8   9                 # OF PAGES INTO WORD COUNT
         AI,R8    -1                ADJUST TO STAY WITHIN PAGE LIMITS
         SLS,R8   2                 # OF BYTES
         STW,R8   RDSIZE            SETUP READ CAL FPT
GOT%BUF  EQU      %                                                          A00
         STW,R9   SAVE%BUF          REMEMBER THE ORIGINAL ADDRESS
         BAL,0    FILENAME          GET FILE NAME FOR SYMBOLS
         MTW,0    FILETEXT          ANY FILE NAME
         BEZ      CHK:FILE          DEFAULT - GO TRY FOR SYMBOLS FILE
         LCI      3                 GET
         LM,0     FILETEXT          AND
         STM,0    SYM:FIL           PUT INTO PLACE
SMAP1    EQU      %
         LD,R0    FIELD3            DID USER ACTUALLY TYPE SOMETHING..
         BNEZ     SMAP115           YEP--GO PICK IT UP
         LCI      2
         LM,R0    J:JIT+1           ELSE USE RUNNING ACCOUNT
         STM,R0   SYM:ACN           IN OPEN FPT
         B        SMAP2             MERGE-->
SMAP115  EQU      %
         LCI      2                 GET
         LM,0     ACCOUNT           AND
         STM,0    SYM:ACN           PUT INTO PLACE
SMAP2    MTW,0    PASS              ANY PASSWORD
         BEZ      SMAP3             NOPE
         LCI      2                 GET
         LM,0     PASS              AND
         STM,0    SYM:PAS           PUT INTO PLACE
         B        SMAP4             GO ON
         PAGE
*
*        THIS IS ENTRY TO READ THE 'SYMBOLS' FILE
*
*
CHK:FILE LI,R1    0                 INITIALIZE
         STW,R1   WRITCNT           BYTE COUNT OF SYMBOLS
         CAL1,1   OPEN:SYMS         TRY TO OPEN SPECIAL FILE
READ:SFIL CAL1,1  READ:SYMS         READ THE RECORD IN
         LW,R6    F:SYMS+13         GET BYTE COUNT
         STW,R6   WRITCNT           SAVE COUNT TO WRITE OUT
         AI,R6    3
         SLS,R6   -2                INTO WORD COUNT
         STW,R6   STKSIZE           LEAVE WORD COUNT SET UP
         AW,R6    BIGBUF            R6 = TOTAL SPACE IN TABLE
         CAL1,1   CLOSE:SYMS        CLOSE THE FILE UP
         B        SYMS:END          JUMP
         PAGE
*
*        THIS IS ENTRY TO READ M:MON'S REF/DEF RECORD
*
*        NOTE:    WE READ THE TREE RECORD OF M:MON
*                 (OR ANY OTHER FILE NAME THE USER GIVES
*                 US) TO OBTAIN THE REF/DEF KEY.
*
SMAP3    LI,1     1                 IF NO PASSWORD
         MTB,1    SYM:ACN-1,1       SET NONE FLAG
SMAP4    EQU      %
         LCFI     2
         LM,R0    KEY%START         GET INITIAL
         STM,R0   STKTREE           KEY AND RE-INIT
         LW,R0    SAVE%BUF          RE-INIT
         STW,R0   BIGBUF            THE BUFFER POINTER..
         CAL1,1   OPNSTK            OPEN THE NAMED FILE
         CAL1,1   RDSTK             READ THE TREE RECORD
*
*        WE NOW HAVE THE TREE RECORD SITTING IN 'BIGBUF'
*
         LI,R0    0                 AND CLEAR
         STW,R0   STKSIZE           TOTAL LENGTH OF BUFFER
         LCFI     5
         LM,R0    *BIGBUF           PICK UP THE ROOT NAME
         STM,R1   STKTREE           AND STORE THE ROOT NAME AWAY
         STW,R0   TREE%LENGTH       STORE LENGTH OF TREE RECORD AWAY
         LCW,R7   R0                XFER TREE RECORD LENGTH
         SLS,R7   2                 INTO # OF BYTES
         AWM,R7   RDSIZE            DECREMENT MAX POSSIBLE READ SIZE
         AW,R0    BIGBUF            CALCULATE SPOT FOR SYMBOLS
         STW,R0   SYM%BUF           AND SAVE FOR READING RECORDS
         LW,R1    BIGBUF            NOW RESTORE R1 TO POINT
         STW,R0   BIGBUF            REMEMBER BASE OF SYMBOL TABLE
         AI,R1    1                 THE OVERLAY REF/DEF RECORDS
NEXT%KEY EQU      %
         STW,R1   KEY%LOC           SAVE CURRENT LOC OF KEY
         LI,R0    24                SIZE OF NEXT RECORD
         BAL,R7   CHK%SIZ           SEE IF NEXT NAME FITS IN BUFFER
         LCFI     5
         LM,R8    *KEY%LOC          GET OVERLAY NAME
         STM,R8   STKTREE           AND PUT IT DOWN FOR READING FILE
         LCI      3
         LM,R5    DUMY%REC          PICK UP DUMMY INSERT
         LCI      6                 AND...
         STM,R5   *SYM%BUF          STORE OVERLAY NAME INTO SYMBOL TABLE
         MTW,6    SYM%BUF           ADVANCE POINTER INTO BUFFER
         LB,R1    STKTREE           GET LENGTH OF NAME (ITS TEXTC)
         LI,R0    0                 WE WANT THE ZERO RECORD
         AI,R1    1
         STB,R0   STKTREE,R1        CREATE THE NEW KEY
         STB,R1   STKTREE           AND CREATETHE NEW COUNT
STKRD    EQU      %
         CAL1,1   RDSTK             READ THAT RECORD
         LW,R0    M:SYM+13          SIZE OF RECORD READ IN BYTES
         BAL,R7   CHK%SIZ           CHECK BUFFER SIZE NOW
         AWM,R0   SYM%BUF           ADVANCE POINTER INTO BUFFER
NEXT%BUF EQU      %
         LI,R0    -11               LENGTH OF CURRENT ENTRY IN TREE REC..
         AWM,R0   TREE%LENGTH       DECREMENT # OF ENTRIES OBTAINED
         BLEZ     END%KEYS          AT END
         LI,R1    11                NOT AT END
         AW,R1    KEY%LOC           ADVANCE LOC OF NEXT KEY
         CW,R1    BIGBUF            DONT OVER-RUN SYMBOL TABLE
         BL       NEXT%KEY          NOT THERE YET
END%KEYS EQU      %
         CAL1,1   CLOSSYM           CLOSE THE FILE UP...
         LI,0     0                 POSITION IS STACK
         STW,0    SYMCNT            RESET SYMBOL COUNT
         LW,6     BIGBUF            INITIALIZATION FOR SORT
         PAGE
*
*        LOOP FROM 'STKLOOP' TO 'SINCR1' BUILDS SYMBOL TABLE
*
STKLOOP  EQU      %
         LI,R9    -1                SET POSSIBLE ABS FLAG
         LW,1     0                 NEXT INDEX TO R1
         LW,2     *BIGBUF,1         FIRST WORD IN ENTRY
         LB,3     2                 SIZR IN WORDS
         CW,R2    SYMASK            CHECK FOR CSECT DEF
         BAZ      NOCSECT           NOPE
         CW,R2    TYP1CSECT         IS IT ONE OF THESE
         BANZ     SINCR1            YEP - THROW IT AWAY
         CW,R2    TYP4CSECT         SELECT FIRST TYPE
         BANZ     CSECTENT          OKAY TO USE
         CW,R2    TYP2CSECT         SELECT OTHER TYPE
         BAZ      SINCR1            SKIP IT
CSECTENT EQU      %
         MTW,1    CSECTFLAG         BUMP THE FLAG
NOCSECT  EQU      %
         CI,R3    4                 IS THIS A USABLE DEF ENTRY
         BL       SINCR1            NOPE - GO TO NEXT ONE
         AI,1     1
         LW,R12   *BIGBUF,R1        GET SYMBOLS'S VALUE
         AI,R1    1
         LW,R7    *BIGBUF,R1        GET RESOLUTION FIELD
         BLEZ     ABSENTRY          ITS AN ABS SYMBOL
         LI,R9    0                 NOT ABS--CLEAR FLAG
         LI,R5    3                 MAX SEARCH LOOP
         MTB,0    R7,5              FIND THE RESOLUTION BYTE
         BNEZ     %+2               GOTCHA
         BDR,R5   %-2               KEEP CHECKING FOR IT
*
*<<<<<<<<< ASSUMES WORD RESOLUTION IF NO BYTE SET >>>>>>>>
*
         EXU      SYMSHIFT,R5       SHIFT R12 INTO WORD RESOLUTION
ABSENTRY EQU      %
         AI,R1    1                 POINT TO SYMBOL NAME SLOT
         LCI      3
         LM,13    *BIGBUF,1         PICK UP THE SYMBOL
         LB,7     13                GET TEXTC COUNT
         LB,R10   R13,R7            GET LAST BYTE OF SYMBOL
         CI,7     7                 WILL FIT NORMAL
         BLE      %+2               YEP
         LI,R7    X'87'   NO,TRUNC TO 7 BUT SET HI BIT TO SAY SO             A00
         CI,R10   ':'               IS XDELTA SAVE SYMBOL
         BE       CSECTYP           YEP
         AI,R9    0                 IS THIS A LIBRARY DEFINITION
         BEZ      NOTLIBE           NOPE
         OR,R7    =X'40'            YES - POST THE FLAG
         B        ENTERFLAG
NOTLIBE  EQU      %
         MTW,0    CSECTFLAG         IS THIS A MODULE BASE DEFINITION
         BEZ      %+2               NOT A CONTROL SECTION
CSECTYP  EQU      %
         OR,R7    =X'20'            YES - ENTER FLAG
ENTERFLAG EQU     %
         STB,R7   R13               PUT AWAY FLAGS AND BYTE COUNT
         LW,R7    R6                MOVE CURRENT POINTER
         CW,R6    BIGBUF            AT FIRST ENTRY
         BE       NOMOVE            YUP..JUMP
         LI,R4    -3                NOPE..INIT INDEXER
MOVELOOP EQU      %
         CW,R12   *R7,R4            IS CURRENT VALUE>>PREVIOUS
         BGE      NOMOVE            YUP..RIGHT ORDER
         LCI      3                 NO
         LM,R8    *R7,R4            GET PREVIOUS SYMBOL ENTRY
         STM,R8   0,R7              AND RELOCATE IT
         AI,R7    -3
         CW,R7    BIGBUF            DONT OVER-RUN START OF TABLE
         BG       MOVELOOP
NOMOVE   EQU      %
         LCI      3
         STM,R12  0,R7              STORE CURRENT SYMBOL ENTRY
         AI,R6    3
         LI,R9    0                 NOW ERASE THE CSECT FLAG
         STW,R9   CSECTFLAG         CAUSE WE'VE HANDLED IT NOW
         MTW,1    SYMCNT            COUNT OF SYMBOLS
SINCR1   EQU      %
         AW,0     3
         CW,0     STKSIZE           FINISHED
         BL       STKLOOP           NO, CONTINUE
         AI,R6    -3                AT END - POINT TO LAST ENTRY
         STW,R6   ADDEFEND          STORE STOP ADDRESS FOR SYMBOL SEARCHES
         PAGE
*
*        THE SYMBOLS ARE NOW SORTED INTO NUMERIC ORDER - SEE
*        IF WE HAVE SPACE ENUFF TO SORT THEM LATER INTO
*        ALPHA-NUMERIC ORDER.
*
*        IF SO:   NO ACTION
*        IF NOT:  GET SOME EXTRA SPACE TO DO IT
*
SYMS:END EQU      %
         LW,R4    BIGBUF            BASE ADDRS OF TABLE
         AW,R4    STKSIZE           R4 = TOP ADDRS IN TABLE
         STW,R6   SORTALBE          SAVE SHELL SORT TABLE ADDRS
         SW,R6    BIGBUF            CALCULATE # OF WORDS IN SYM TABLE
         STW,R6   STKSIZE           REMEMBER IT
         LW,R5    R6                MOVE FOR ARITHMETIC
         DW,R5    =3                CALCULATE # OF STYMBOL ENTRIES
         STW,R5   SYMCNT            AND REMEMBER IT
         STW,R5   SYMCNT1           REMEMBER ORIGINAL TOTAL
         SW,R4    SORTALBE          CALCULATTE ROOM REMAINING
         BGZ      %+2               OKAY VALUE
         LW,R4    R5                NOT OKAY - ADJUST
         CW,R4    SYMCNT            ENUFF TO SHELL SORT ENTRIES
         BG       SCOUNT4           YEP - DONT NEED ANY MORE PAGES
         AI,R4    512               ROUND UP TO NEXT FULL PAGE
         SLS,R4   -9                # OF PAGES NEEDED
         LI,R1    1
         STH,R4   GPGS,R1           STORE PAGE COUNT AWAY
         CAL1,8   GPGS              ASK FOR PAGES
         STCF     R7                SAVE CCS
         AWM,R8   FPGS              UPDATE FREE PAGE COUNTER
         LC       R7                CHECK ANSWER
         BCS,8    SYM:DISP5         CANT SORT
SCOUNT4  LW,R2    STKSIZE           GET # OF WORDS
         SLS,R2   2                 TO BYTES
         STW,R2   WRITCNT           SAVE IT
         MTW,7    SYMBOL:FLAG       SAVE FLAG
         LI,R0    0
         XW,R0    WRITESYMS         SUPPOSED TO WRITE
         BEZ      SCOUNT5
         CAL1,1   OPOUT:SYMS
         CAL1,1   WRIT:SYMS
         CAL1,1   CLOSE:SYMS1
SCOUNT5  PLW,R1   STACK             GET EXIT ADDRESS
         B        INIT:MD           INIT TABLES
*                                                                            A00
*
SYMSHIFT EQU      %
         SLS,R12  -2                BA
         SLS,R12  -1                HA
         B        ABSENTRY          WA
         SLS,R12  1                 DA
         B        ABSENTRY          (WA)..DUMMY FOR OVERLAY NAME
         PAGE
*
*        GOT AN ERROR WRITING OUT THE SYMBOL TABLE SAVE FILE
*
WRSYMS   BAL,R2   RERR1
         LI,R1    WRITERR
         B        PUSHMSG
WRITERR  TEXTC    'WRITING OUT THE SYMBOL TABLE'
         PAGE
*
*        CALCULATE IF RECORD SIZE IN R0 (WROD COUNT) WILL EMPTY
*        THE SYMBO BUFFER
*
CHK%SIZ  EQU      %
         LCI      3
         PSM,R7   STACK
         LCW,R8   R0                NEG BYTE COUNT
         AWM,R8   RDSIZE            DECREMENT READ SIZE LEFT
         BLEZ     CHK%SIZ1          BUF EMPTY
         LW,R8    RDSIZE
         SW,R8    R0                SUBTRACT # ABOUT TO USE UP
         BLEZ     CHK%SIZ1          ALL DONE
         STW,R8   RDSIZE            REPLACE IT
         CI,R8    511*4             GOT A PAGE LEFT YET
         BG       CHK%SIZ2          YUP---> EXIT
         B        %+2
CHK%SIZ1 LI,R8    0
         STW,R8   RDSIZE            REPLACE READ SIZE AVAILABLE
         CAL1,8   GETONE            GET ANOTHER PAGE
         AWM,R8   FPGS              UPDATE FREE PAGE COUNTER
         SLS,R8   11                # PAGES INTO # OF WORDS
         AWM,R8   RDSIZE            UPDATE READ SIZE AVAILABLE
CHK%SIZ2 EQU      %
         SLS,R0   -2                SHIFT ORIG BYTE COUNT TO WORD CNT
         AWM,R0   STKSIZE           AND BUMP SIZE OF TOTAL TABLE
         LCI      3
         PLM,R7   STACK
         B        0,R7              RETURN TO CALLER
         PAGE
*F*
*F*    NAME:           INIT:MD
*F*
*F*    PURPOSE:        TO CONSTRUCT THE SYMBOL TABLE LOCATOR TABLE.
*F*
*F*    DESCRIPTION:    INIT:MD WILL SCAN EACH OF THE SYMBOLS BUILDING
*F*                    BOTH THE CSECT POINTER TABLE AND THE SYMBOL
*F*                    LOCATOR TABLE.
*F*
INIT:MD  EQU      %
         PSW,R1   STACK             SAVE LINK
         LW,R1    BIGBUF            START OF TABLE
         STW,R1   LASTSVTF          REMEMBERED..
         LW,R2    STKSIZE           SIZE OF TABLE
         AW,R2    R1                TOP OF TABLE
         STW,R2   ADDEFEND          INIT STOP ADDRESS
         LW,R4    *FINDER           DID  WE  ALREADY INIT TABLE
         BGZ      INIT:MD4          YES - EXIT
         LI,R4    9*16              MAX LOOP
         LI,R5    160               MAX DEPTH OF CSECT TABLE
         LI,R6    -1                INDEX INTO CSECT TABLE
         LI,R3    0                 INDEX INTO LOCATE/FINDER TABLES
         LI,R8    0
         LI,R9    256               LOAD UP FIRST PAIR
         STD,R8   PROCNAME          AND STORE FOR CLM CHECKS
INIT:MD1 EQU      %
         LW,R2    0,R1              GET SYMBOL VALUE
         BLZ      INIT:MD3          THROW THESE AWAY
         CLM,R2   PROCNAME          IS SYMBOL ADDRESS IN CURRENT RANGE
         BCS,9    INIT:MD2          NOPE--> KEEP GOING UP
         SLS,R2   -8                ISOLATE THOUSANS/HUNDREDS FIELDS
         MTW,0    *FINDER,R2        DI WE HAVE THIS POINTER
         BGZ      %+2               OK--> HOP
         STW,R1   *FINDER,R2        NOP--SAVE IT
INIT:MD11 EQU     %
         AI,R3    1                 NEXT ENTRY IN LOCATOR TABLE
         LW,R7    R3                MOVE INDEX
         MI,R7    256
         STW,R7   PROCNAME
         AI,R7    256
         STW,R7   PROCNAME+1
         AI,R4    -1                DECREMENT COUNT LEFT TO GO
         BLZ      INIT:MD4          WE'RE DONE
         B        INIT:MD21         MERGE
INIT:MD2 EQU      %
         BG       INIT:MD11         B IF SYMBOL VALUE .GT. CLM PAIR
INIT:MD21 EQU     %                 OTHERWISE FALL THRU AND SCAN
         LI,R7    1                 INDEX TO REACH
         AW,R7    R1                TEXT STRING
         LC       *R7               TEST FOR CSECT ENTRY
         BCS,2    CSECT             GO - WE FOUND A CSECT ENTRY
INIT:MD3 EQU      %
         AI,R1    3                 POINT TO NEXT ENTRY IN SYMBOL TABLE
         CW,R1    ADDEFEND          GONE TOO FAR
         BL       INIT:MD1          NOT YET
INIT:MD4 EQU      %
         PLW,R1   STACK
         B        0,R1
         PAGE
*
*        SAVE ADDRESS OF CSECTS IN SYMBOL TABLE
*
CSECT    EQU      %
         AI,R5    -1                GOT ROOM FOR THIS ONE
         BLZ      INIT:MD3          NO - RETURN
         AI,R6    1                 CREATE INDEX INTO TABLE
         STW,R1   *CPOINTER,R6      SAVE IT
         B        INIT:MD3          AND MERGE
         PAGE
*
*        GOT AN ERROR READING THE SYMBOL FILE
*
*
NOSYMBOLS EQU     %
         LB,R2    10                GET I/O ERROR CODE
         CI,R2    X'07'             LOSE DATA
         BE       GETSYMPAGE        YEP
         CI,R2    X'03'             DOESNT EXIST
         BE       SYMBOLFIL         IF IT DOESNT EXITST
         CI,R2    X'14'             TROUBLE W/IT..
         BE       SMAP3             YEP - FORGET IT
         BAL,R2   RERR1
         LI,R1    RDSYMSMSG
         B        NOMORPAGE1        MERGE W/ERROR EXITS
RDSYMSMSG TEXTC 'READING/OPENING THE SYMBOL TABLE FILE'
         PAGE
*
*        GET ANOTHER PAGE TO READ THE SYMBOL FILE
*
GETSYMPAGE CAL1,8  GETONE
         BCS,8    NOMORPAGE
         CAL1,1   POS:BOF           BACK UP TO BEGINNING OF FILE
         LI,1     512*4
         AWM,1    RDSIZE
         MTW,1    FPGS              BUMP FREE PAGE COUNT
         B        READ:SFIL         READ IT AGAIN
         PAGE
*
*        IF FILE WASNT THERE - SAVE IT IF IN GHOST MODE
*
*
SYMBOLFIL LC      J:JIT             RUNNING AS A GHOST
          BCR,4   SMAP3             NO - FORGET IT
          MTW,1   WRITESYMS         YES - SET FLAG
          B       SMAP3             AND GO READ MONSTK...
         PAGE
*F*
*F*    NAME:           SYM:DISP
*F*
*F*    PURPOSE:        TO OUTPUT THE SYMBOL TABLE AS A MAP.
*F*
*F*    DESCRIPTION:    SYM:DISP WILL SCAN THRU THE VALUE MAP AND PUT
*F*                    OUT THAT MAP FIRST. IT WILL THEN SHELL SORT
*F*                    THE SYMBOLS INTO AN ALPHA-NUMERIC
*F*                    FORM AND THEN OUTPUT THAT MAP.
*F*
SYM:DISP EQU      %
         PSW,R1   STACK                                                      A00
         BAL,R1   SEGMAP            PUT OUT THE SEGMENT MAP
         LW,R9    SORTALBE          ADDRESS OF SORT BUFFER
         BLEZ     NSF1              SOMEBODY BLEW IT
         LI,R1    SYMBOLMS                                                   A00
         BAL,R0   TITEL             TITLE LINE                               A00
         LI,R1    30
         BAL,R0   SPACES
         LI,R1    ALPHAMSG          AND PUT OUT HEADER
         BAL,R0   MBB
         LI,R1    SYM%EXP           SYMBOL FLAG CODES FOR USER               A00
         BAL,R0   MSG%OUT
         LI,1     2                 TWO PASS DISPLAY
         STW,1    SYM:PASS          SET FOR LOOP
         LI,R1    0
         LW,R2    SYMCNT1           GET COUNT OF SYMBOLS
         STW,R2   SYMCNT            AND RESTORE COUNTER
         LW,3     BIGBUF            LOCATION OF SYMBOL TABLE
         BLEZ     NSF1              NONE OR ERROR
         AI,3     1                 POINT TO FIRST SYMBOL
SYM:DISP1 STW,3   *9,1              SET INTO TABLE
         AI,R3    3
         AI,1     1                 UP INDEX
         BDR,2    SYM:DISP1         FINISH BUILDING TABLE
         LW,8     9                 FIRST KEY ADDRS
         STW,9    SORTALBE          SAVE TABLE ADDRS
         LW,9     SYMCNT            PUT COUNT INTO 9 ALSO
         BAL,15   SORTER            GO SORT TABLE
         LW,4     SORTALBE          SET UP DISPLAY LOOP
SYM:DISP2 LI,7    0                 INITIAL INDEX
SYM:DISP3 LW,5    *4                GET NEXT KEY POINTER
         AI,5     -1                POINT TO VALUE
         LW,3     0,5               GET VALUE
         BAL,0    TRANSSZ           AND PUT IT OUT
         LB,1     SYMSPACES,7       GET RIGHT SPACING
         BAL,0    SPACES
         AI,7     1                 BUMP COLUMN COUNT
         AI,5     1                 POINT BACK TO SYMBOL
         LI,1     ABSMSG            ASSUME ITS ABS DEF
         LC       *R5               TEST FLAG FOR ABS DEFINITION
         BCS,4    %+2               ITS ABS ALRIGHT...
         LI,1     SPCMSG            IT IS NOT ABS DEF
         BAL,0    MSG               IS ABS
         LW,1     5                 SET UP REGISTER
         BAL,0    MSG               INSERT STRING
         LB,1     SYMSPACES,7       GO TO NEXT COLUMN
         BAL,0    SPACES
         MTW,-1   SYMCNT            DECREMENT COUNT
         BLEZ     SYM:DISP4         DONE
         AI,4     1                 NOPE,NEXT POINTER
         AI,7     1                 NEXT POSITION IN ROW
         LI,8     13                13 ROWS IF BATCH
         MTW,0    LPFLAG            GOING TO LINE PRINTER
         BNEZ     %+2               YES,FULL PAGE OUTPUT
         LI,8     8                 YES,
         CW,7     8                 AT LIMIT YET
         BL       SYM:DISP3         NO
         BAL,0    BUFOUT            YES,OUTPUT BUFFER
         B        SYM:DISP2         AND CONTINUE ON NEXT ROW
SYM:DISP4 BAL,0   BUFOUT            LAST LINE OUT
         MTW,-1   SYM:PASS          TO NEXT PHASE
         BLEZ     SYM:DISP42      ALL DONE - GET LINK AND EXIT
         LW,R5    SYMCNT1           GET ORIGINAL COUNT
         STW,R5   SYMCNT            AND RESTORE COUNTER
         LI,1     0                 SET INDEX
         LW,3     BIGBUF
         LW,4     SORTALBE          SET POINTERS
         AI,3     1                 POINT TO 1ST TEXTC STRING
SYM:DISP41 STW,3  *4,1              BUILD TABLE
         AI,R3    3
         AI,1     1                 UP INDEX
         BDR,5    SYM:DISP41        FINISH UP
         LI,R1    SYMBOLMS
         BAL,R0   TITEL             NEXT TITLE
         LI,R1    30
         BAL,R0   SPACES
         LI,R1    VALUEMSG
         BAL,R0   MBB
         B        SYM:DISP2         DO NEXT DISPLAY
SYM:DISP42 EQU    %
         PLW,R1   STACK             RETRIEVE THE RETURN LINK
         B        0,R1              AND RETURN
         PAGE
*
*        CATASTROPHIC ERROR
*
NOMORPAGE EQU     %
NO%SYM%BUF EQU    %
         LI,R1    NOSYMBUFMSG       ERROR MSG
NOMORPAGE1 EQU    %
         BAL,R0   MBB               OUT
NOMORPAGE2 EQU    %
         LI,R7    0                 AND
         STW,R7   BIGBUF            ERASE ALL TRACKS
         CAL1,8   FPGS              FREE ALL WE GOT
         LI,R6    1
         STH,R7   FPGS,R6           CLEAR FREE PAGE CAL COUNT
         B        NSF1              CLOSE FILE/GO TO SCANNER
         PAGE
*
*        READ THE FILE - BUT CAN'T GET THE SORT BUFFER
*
SYM:DISP5 EQU     %
         LI,R1    NOSORT
         BAL,R0   MBB
         LI,R7    0
         STW,R7   SORTALBE          ERASE POINTER
         B        SCOUNT4           GO GET NEXT COMMAND
         PAGE
*F*
*F*    NAME:           SEGMAP
*F*
*F*    PURPOSE:        TO OUTPUT A MAP OF THE CONTROL SECTIONS AS
*F*                    FOUND IN THE MONITOR'S REF/DEF STACK.
*F*
*F*    DESCRIPTION:    THE EARLIER ROUTINES THAT RAN HAVE LEFT
*F*                    POINTERS SET POINTING TO EACH OF THE
*F*                    CONTROL SECTION SYMBOLS IN THE TABLE.
*F*                    SEGMAP WILL UTILIZE THESE POINTERS AND PRODUCE
*F*                    A MAP OF CSECTS.
*F*
SEGMAP   EQU      %
         PSW,R1   STACK
         LI,R1    SEGMTIT
         BAL,R0   TITEL             PUT OUT TITLE LINE
         LI,R5    0                 INDEX INTO CSECT POINTER TABLE
SEGMAP0  EQU      %
         LI,R2    -1                INITIAL LINE SPACING INDEX
SEGMAP1  EQU      %
         LW,R4    *CPOINTER,R5      GET ADDRESS OF CSECT ENTRY
         BEZ      SEGMAP5           ALL DONE - SO EXIT
         AI,R2    1                 NEXT SPACING INDEX
         LW,R3    0,R4              GET VALUE FROM ENTRY
         BAL,R0   TRANSSZ           PUT IT OUT
         LB,R1    SYMSPACES,R2      GET PROPER SPACING
         BAL,R0   SPACES
         LW,R1    R4                MOVE SO
         AI,R1    1                 POINT TO TEXT STRING
         BAL,R0   MSG               MESSAGE KNOW WHERE IT IS
         AI,R2    1
         LB,R1    SYMSPACES,R2
         BAL,R0   SPACES
SEGMAP2  EQU      %
         AI,R5    1                 NEXT ENTRY IN CSECT POINTER TABLE
         CI,R5    160               AT TOP OF LIST YET
         BGE      SEGMAP5           YES - ALL DONE
         LI,R8    12                WIDTH IF WRITING THE LP
         MTW,0    LPFLAG            WRITING HE LP
         BNEZ     %+2               YEP
         LI,R8    6                 NO
         CW,R2    R8                TIME TO PRINT A LINE
         BL       SEGMAP1           NO
SEGMAP4  BAL,R0   BUFOUT
         BAL,R0   BLANK1            DOUBLE SPACE THE DISPLAY
         B        SEGMAP0           START NEXT LINE
SEGMAP5  EQU      %
         BAL,R0   BUFOUT            PRINT LAST OF LINE...
         PLW,R1   STACK             GET THE LINK
         B        0,R1              RETURN TO CALLER
VALUEMSG TEXTC    '          ** REF/DEF MAP SORTED BY VALUE **'
ALPHAMSG TEXTC    '          ** REF/DEF MAP SORTED BY NAME **'
         PAGE
*
*        ALPHA-NUMERIC SORT SUBROUTINE
*
SORTER   EQU      %
         PSW,15   STACK             SAVE RETURN LINK
         AI,8     -1
         LW,10    9                 COUNT IN 9
         BEZ      SSXIT             NOTHING TO DO
SSR3     SLS,10   -1                HALF IT
         AI,10    0                 ANYTHING TO DO AFTER HALFING
         BEZ      SSXIT             NOPE,EXIT
         LW,11    9                 COUNT TO 11
         SW,11    10                TAKE AWAY 1/2 COUNT
         LI,3     1                 SET INITIAL
SSR4     LW,1     3                 IN 3 AND 1
SSR2     LW,2     1                 SET INITIAL 2
         AW,2     10                POINT TO HALF WAY POINT
         LW,4     8                 *
         AW,4     1                 SET
         LW,5     8                  UP
         AW,5     2                   POINTERS
         LW,6     0,4               GET LOW VALUE
         LW,7     0,5               GET UPPER VALUE
         SLD,6    2                 BOTH INTO BA FORM
         LB,13    0,6
         CB,13    0,7
         BL       %+2
         LB,13    0,7
         AND,R13  =7
         STB,13   7
         AI,R6    1
         AI,R7    1
         CBS,6    0
         BLE      SSR1
         LW,6     0,4
         XW,6     0,5
         STW,6    0,4
         SW,1     10
         BGZ      SSR2
SSR1     AI,3     1
         CW,3     11
         BG       SSR3
         B        SSR4
SSXIT    EQU      %
         PLW,R15  STACK             RETRIEVE RETURN LINK
         B        *15
*
*
*
SYMSPACES DATA,1 6,16,22,32,38,48,54,64,70,80,86,96,102
         DATA,1   110,116,126,132,0
         BOUND    4
         PAGE
*
*
*        DATA/FPT'S ETC FOR SYMBOL MANIPULATIONS
*
*
NOSYMBUFMSG EQU   %
  TEXTC '** COULD NOT GET ENUFF PAGES TO READ THE FILE'
SYM%EXP  TEXTC    '(''-'' = ABS DEF; ''<'' = TRUNCATED SYMBOL)'              A00
*
SPCMSG   TEXTC    ' '
TYP4CSECT DATA    X'C0000'          SELECT DSECT / CSECT BITS
TYP2CSECT DATA    X'20000'          SELECT CSECT ALT BIT
TYP1CSECT DATA   X'10000'           NOT NEEDED ENTRY
SYMASK    DATA    X'E0000'
         USECT    DATA
CSECTFLAG DATA    0
         USECT    PROCEDE
*
KEY%START TEXTC   'TREE'            INITIAL KEY IN TREE RECORD.
*
DUMY%REC EQU      %
         DATA     X'061C0000'   **0= COUNT,FLAGS
         DATA     X'8000'       **1= ADDRESS VALUE
         DATA     X'0100'       **2= RESOLUTION OF ADDRESS
*
NOSORT   EQU      %
  TEXTC  '** COULD NOT GET ENUFF PAGES TO SORT THE SYMBOLS'
Y002     DATA     X'00200000'
*
         USECT    DATA
*
*
KEY%LOC  DATA     0                 LOC OF CURRENT IN  USE KEY
*
TREE%LENGTH DATA  0                 LENGTH OF TREE RECORD
*
*
SAVE%BUF DATA     0                 BASE ADDRESS OF COMPLETE TABLE
*
*
*
*
OPNSTK   GEN,8,24 X'14',M:SYM
         GEN,16,16 X'C748',9
         DATA     READERR
         DATA     READERR
         DATA     2,2,1,2,8
         DATA     X'01000303'
SYM:FIL  TEXTC    'M:MON'
         TEXT     '   '
         DATA     X'02000202'
SYM:ACN  TEXT     ':SYS  '
         DATA     X'03010202'
SYM:PAS  TEXT     'PASSWORD'
*
RDSTK    GEN,8,24 X'10',M:SYM
         DATA     X'F8000010'
         DATA     READERR
         DATA     READERR
SYM%BUF  EQU      %
         PZE      *BIGBUF           INITIALLY IS THE BUFFER
RDSIZE   DATA     16*512*4          INITIAL SIZE OF BUFFER
         DATA     STKTREE           POINTS TO KEY BUFFER
STKTREE  TEXTC    'TREE'            INITIAL KEY WE USE
         DATA     0,0,0,0,0         PAD OUT KEY BUFFER
*
         USECT    PROCEDE
*
*
OPEN:SYMS GEN,8,24  X'14',F:SYMS
         GEN,32   X'C5400001'
         DATA     NOSYMBOLS,NOSYMBOLS
         DATA     1,1,2
         DATA     X'01000202'
         TEXTC    'SYMBOLS'
         DATA     X'02000202'
         TEXT     ':SYS  '
         DATA     X'03010002'
READ:SYMS GEN,8,24  X'10',F:SYMS
         DATA     X'F0000010'
         DATA     NOSYMBOLS,NOSYMBOLS
         PZE      *BIGBUF           BUFFER ADDRESS
         PZE      *RDSIZE           SIZE TO READ
CLOSE:SYMS GEN,8,24  X'15',F:SYMS
         PZE      *0
         DATA     2
         USECT    DATA
WRIT:SYMS GEN,8,24  X'11',F:OSYMS
         DATA     X'F0000010'
         DATA     WRSYMS,WRSYMS
         PZE      *BIGBUF
WRITCNT  DATA     0                 WILL BE SETUP W/BYTE COUNT
         USECT    PROCEDE
OPOUT:SYMS  GEN,8,24  X'14',F:OSYMS
         DATA     X'F7400001'
         DATA     WRSYMS,WRSYMS
         PZE      *BIGBUF
         PZE      *RDSIZE
         DATA     1,1,2,2
         DATA     X'01000202'
         TEXTC    'SYMBOLS'
         DATA     X'02010002'
CLOSE:SYMS1 GEN,8,24  X'15',F:OSYMS
         PZE      *0
         DATA     2
POS:BOF  GEN,8,24  X'1C',F:SYMS     POSITION TO BOF CAL
         GEN,28,4   1,0             NECESSARY BIT
         PAGE
         USECT    PROCEDE
*
*        ABNORMAL FROM M:SYM DCB
*
READERR  EQU      %
         LB,2     10                GET AMJOR I/O CODE
         CI,2     X'07'             LOST DATA
         BE       READERR1          YES,GET ANOTHER PAGE
         CI,2     X'03'             NO SUCH FILE
         BE       NO:SYM:FIL        YES
         CI,2     X'14'             NO ACCESS
         BE       NO:SYM:FIL        YES
         CI,R2    X'2E'             FILE ALREADY OPEN
         BE       *R8               YEP, RETURN TO CAL PLUS ONE
         BAL,2    RERR1             RECORD ERROR
         LI,1     NSFMSG            SET UP
         BAL,R0   MSG
         LI,R1    SYM:FIL           LOC OF FILE NAME
         BAL,R0   MB                PUT OUT
         B        NOMORPAGE2        MERGE W/ERROR EXITS
READERR1 CAL1,8   GETONE            GET NEXT PAGE
         BCS,8    NOMORPAGE         GET IT
         MTW,1    FPGS              INCREMENT THE PAGES TO FREE
         LI,1     512*4             PAGE CNT INTO BYTES
         AWM,1    RDSIZE
         B        STKRD             TRY AGAIN
GETONE   GEN,8,24 8,1
FREEONE  GEN,8,24 9,1
         PAGE
*
*        PROBLEM ACCESSING FILE USER SAID TO USE
*        FOR SYMBOL MAP
*
NO:SYM:FIL EQU    %
         LI,1     NSFMSG
         BAL,0    MSG
         LI,1     SYM:FIL
         BAL,0    MSG
         BAL,0    BUFOUT
NSF1     LW,0     M:SYM             SEE IF OPEN
         CW,0     Y002              NOW...
         BAZ      %+2               NO
         CAL1,1   CLOSSYM           IF SO CLOSE IT NOW
         LW,R0    SYMCNT1           RESTORE
         STW,R0   SYMCNT            THE TABLE COUNTER FOR SYMBOL DISP.
         B        SCANNER           RETURN TO MAIN LOOP
NSFMSG   TEXTC    'ERR/ABN TRYING TO ACCESS FILE '
ABSMSG   TEXTC    '-'
         PAGE
*F*
*F*    NAME:           SETVERS
*F*
*F*    PURPOSE:        TO DETERMINE THE VERSION LEVEL OF THE
*F*                    MONITOR WE ARE LOOKING AT (CORE OR DUMP) AND
*F*                    PLACE SAID VERSION INTO THE PRINT LINE TITLE
*F*                    MESSAGE.
*F*
SETVERS  EQU      %
         PSW,R1   STACK             SAVE LINK
         LI,R14   SYSVERS           LOC OF WORD / COPY OF X'2B'
         MTW,1    LOOKING           ONLY NEED ONE PAGE
         BAL,0    GETADDR           GET IT
         LH,2     *15               GET VERSION BITS
         AND,2    =X'01FF'          MASK DOWN
         SLD,2    -4
         SLS,3    -28
         LI,1     3
         CB,2     VTAB1,1
         BLE      SETVERS1          GOT A MATCH
         BDR,1    %-2
         B        SCANNER           CANT BE DETERMINED
SETVERS1 LB,4     VTAB2,1           GET EBCDIC BASE
         LB,5     VTAB3,1           GET SUBTRACTOR
         SW,2     5                 TAKE AWAY SET AMOUNT
         AW,4     2                 ADD EM UP
         AI,3     X'F0F0'           MAKE IT 00 SOMETHING
         STH,4    3                 SET EM TOGETHER
         LB,R2    HDMSG             GET TEXTC COUNT OF HEADER STRING
         STB,R2   R3                INSERT INTO VERSION WORD
         STW,R3   HDMSG             AND STORE TEXTC WITH VERSION MSG
         PLW,R1   STACK
         B        0,R1              RETURN TO CALLER
VTAB1    DATA,1   0,X'1A',X'12',9
VTAB2    DATA,1   0,X'E1',X'D0',X'C0'
VTAB3    DATA,1   0,X'12',9,0
*
*
CLOSSYM GEN,8,24  21,M:SYM
         DATA     0,0
         USECT    DATA
PGCOUNT  DATA     0                 RUNNING COUNTER OF PAGES
         USECT   PROCEDE
         PAGE
*F*
*F*    NAME:           RUN
*F*
*F*    PURPOSE:        TO PROCESS THE BASIC COMMAND RUN - AND TO
*F*                    DETERMINE WHAT TO DO (IE; SUBFIELD CONTENTS)
*F*
*F*    DESCRIPTION:    RUN WILL PICK UP THE COTENTS OF COMMAND
*F*                    FIELD TWO AND VECTOR TO THE APPROPRIATE
*F*                    ROUTINE IF THE NAME IS RECOGNIZED.
*F*
RUN      EQU      %
         LI,R1    SCANNER           SET DEFAULT RETURN POINT
         LI,R2    #RUNCOMS          NUMBER OF DIFFERENT RUN OPTIONS
         LH,R3    FIELD2            GET SUB-OP FIRST TWO BYTES
         CH,R3    RUNCOM,R2         FIND MATCHING BYTE
         BE       RUNVEC,2
         BDR,2    %-2
RUNVEC   B        BADCOM
         B        UPAGES
         B        MPAGES
         B        PPAGES
         B        STATES
         B        RTPAGES
         B        XDELPGS
         B        SPAGES            RUN THE SWAPPER PAGE CHAIN
         B        BACKWARDS
RUNCOM   EQU      %
         DATA,2   '  '              NULL FIRST ENTRY
         DATA,2   'US'              USER PAGE CHAINS
         DATA,2   'MO'              MONITOR PAGE CHAINS
         DATA,2   'PR'              PROCESSOR PAGE CHAINS
         DATA,2   'ST'              USER STATE CHAINS
         DATA,2   'RT'              REAL TIME PAGE CHAINS
         DATA,2   'XD'              XDELTA PAGE CHAINS
         DATA,2   'SW'              RUN SWAPPER PAGE CHAINS
         DATA,2   'BA'              RUN USERS CHAIN BACKWARDS
#RUNCOMS EQU      HA(%)-HA(RUNCOM)-1
         BOUND    4                 ORG BACK TO WORD BNDRY
         PAGE
*F*
*F*    NAME:           UPAGES
*F*    PURPOSE:        TO RUN THE USER'S PAGE CHAINS.
*F*
*F*    DESCRIPTION:    UPAGES WILL RUN THE PAGE CHAINS OF EACH
*F*                    USER THAT WAS INCORE AT CRASH TIME. INCLUDING
*F*                    THE INSWAP USER...
UPAGES   LI,1     UPGMSG          GET HEADER MSG
         BAL,0    TITEL             TITLE LINE OUT
         LI,1     2               GET THE JIT SPECIFIED
UPAGES1  EQU      %
         BAL,0    GETHEX          BY GETTING THE TYPED FIELD
         LI,10    0               INITIALIZE USER
         LW,2     2               USER # SPECIFIED
         BNEZ     ULOOP           YES, GET HIS PAGES ONLY
         AI,2     1               START WITH FIRST USER
         LI,10    SMUIS           AND GET THEM ALL
ULOOP    LI,14    UH:FLG          CHECK TO SEE IF HES IN
         BAL,0    GETADDR         CORE
         CW,R2    ISUN              IS THIS USER THE INSWAP GUY
         BE       ULOOP1            YES - HE ALWAYS GETS DONE
         LH,1     *15,2           GET HIS FLAGS
         CI,1     JIC             JIT IN CORE?
         BAZ      UCONT           NO CONTINUE WITH NEXT
ULOOP1   EQU      %
         STW,2    PG:MODE           SAVE USER#
         STW,2    USER              SET HIM TOO
         LCI      4                 INDICATE USER
         STCF     PG:MODE           USER MODE
         BAL,0    BLANK1            ONE BLANK LINE
         BAL,R0   RES:JIT           FIND THE JIT
         BCS,4    UCONT             NONE FOUND
         LI,1     JXPPH             BYTE DISP TO HEAD
         SLS,R1   -:BIG             CHANGE DISP IF BIG MAP MODE
         LOAD,4   *JITBUF,1
         LI,1     JXPPT             TO TAIL
         SLS,R1   -:BIG             CHANGE DISP IF BIG MAP MODE
         LOAD,5   *JITBUF,1
         LI,1     JBPPC
         LB,6     *JITBUF,1         AND COUNT
         BEZ      UCONT           IF NO PAGES, GET NEXT USER
         LI,1     UPMG            IF PAGES, THEN PRINT
         BAL,0    MSG             A HEADER WITH USERS NUMBER
         LW,3     2
         BAL,0    TRANSSZ
         CW,R2    ISUN              IS THIS THE INSWAP USER #
         BNE      ULOOP2            NOPE
         LI,R1    ISUN%MSG          FLAG EM ON LISTING
         BAL,R0   MSG               FOR SWAPPER PEOPLE TO LOOK AT
ULOOP2   EQU      %
         LI,R1    CUN%MSG           ASSUME ITS THE CURRENT USER
         CW,R2    CUN               IS TRUE
         BNE      %+2               NO
         BAL,R0   MSG               YES - PUT OUT THE MSG
         BAL,R0   PGSOUT            RUN THE PAGE CHAIN THRU THE MILL
UCONT    AI,2     1               BUMP THE USER NUMBER
         BDR,R10  ULOOP             DO NEXT ONE
         LI,R6    UPAGES1           RETURN POINT
         B        GETLIST           CHECK FOR LIST OF ITEMS
ISUN%MSG TEXTC    '<ISUN>'
CUN%MSG  TEXTC    '<CUN>'
         PAGE
*F*
*F*    NAME:           RTPAGES
*F*
*F*    PURPOSE:        TO SET UP THE REAL TIME PAGE CHAIN DISPLAY.
*F*
*F*    DESCRIPTION:    RTPAGES PICKS UP THE REAL TIME PAGE HEAD
*F*                    (IF ANY) AND CALLS 'PGSOUT' TO RUN THE
*F*                    CHAIN.
*F*
RTPAGES  EQU      %
         LI,R1    RTPMSG
         BAL,R0   TITEL             TITLE LINE...
         LI,R14   PP:UPPH           HEAD OF REAL TIME PAGE CHAIN
         BEZ      NOTRACE           NOT REAL-TIME SYSTEM
         BAL,R0   GETADDR           PICK UP TABLES
         LCFI     5                 REAL-TIME OWNERS CODE
         STCF     PG:MODE           SAVED
         LI,R7    0
         STORE,R7 *USERLIST         ZIP THE COUNTER
         LCFI     3
         LM,R4    *R15              GET HEAD/TAIL/COUNT REAL-TIME PAGES
         BAL,R0   PGSOUT            AND PUT OUT DISPLAY
         LOAD,R5  *USERLIST         GET COUNTER
         BEZ      SCANNER           NOPE
         LI,R1    RTHDR2
         BAL,R0   TITEL             PUT OUT TITLE LINE
RTPAGES1 EQU      %
         LOAD,R1  *USERLIST,R5      GET ENTRY FROM LIST
         BEZ      SCANNER           DONE
         BAL,R0   DISP:PP
         BAL,R0   GET1ADDR
         LW,R8    R15               MOVE POINTER
         LI,R7    512
         BAL,R0   DUMPSOME          DUMP OUT THE PPGE TO LO DEVICE
         BDR,R5   RTPAGES1          AND FINISH UP
         B        SCANNER
         PAGE
*F*
*F*    NAME:           XDELPGS
*F*
*F*    PURPOSE:        TO SET UP THE XDELTA/HANDLER PAGE CHAIN DISPLAY.
*F*
*F*    DESCRIPTION:    XDELPGS PICKS UP THE XDELTA/HANDLERS HEAD
*F*                    COUNT AND CALLS 'PGSOUT' TO RUN THE
*F*                    CHAIN.
*F*
XDELPGS  EQU      %
         LI,R1    DELPGS
         BAL,R0   TITEL             OUTPUT
         LI,R14   MP:UPPH           HEAD OF PAGE CHAIN
         BAL,R0   GETADDR
         LCFI     3
         LM,R4    *R15              PICK UP HEAD/TAIL/COUNT
         LCFI     6                 DELTA'S OWNER CODE
         STCF     PG:MODE           SAVED....
         BAL,R0   PGSOUT            PUT OUT THE CHAIN
         B        SCANNER
         PAGE
*
*        BAD PAGE CHAIN DISCOVERED
*
CHAIN%ER EQU      %
         BAL,R0   TRANSSZ           PUT OUT THE VALUE
         PLW,R0   STACK             RESTORE RETURN LINK
         B        MBB               AND PUT OUT ERROR MSG
*
BAD%HD   TEXTC    ' ** INVALID CHAIN HEAD PAGE # '
BAD%TL   TEXTC    ' ** INVALID CHAIN TAIL PAGE # '
         PAGE
*
*        ASSUMES H,T,C IN 4,5,6
*
PGSOUT   EQU      %
         CI,R4    0                 NO CNT - IS THERE A HEAD #
         BEZ      *R0               NO - EXIT
PGSOUT0  EQU      %              **POSSIBLE ERR - NO CNT AND HEAD NON ZERO
         PSW,R0   STACK             SAVE RETURN LINK
         LI,R1    14                INITIAL SPACING
         BAL,R0   SPACES            INSERTED
         LI,R1    BAD%HD            ASSUME BAD HEAD PAGE #
         LW,R3    R4                MOVE HEAD # TO PRINT REG.
         CLM,R4   PAGLIMS           IS OK
         BCS,9    CHAIN%ER          YES ITS IN ERROR
         LI,R1    BAD%TL            ASSUME BAD TAIL THEN
         LW,R3    R5                MOVE TAIL # TO PRINT REG.
         CLM,R5   PAGLIMS           IS OK
         BCS,9    CHAIN%ER          BAD TAIL PAGE # PASSED
*
*        COUNT IS EXAMINED ELSEWHERE
*
         LI,14    MX:PPUT
         BAL,0    GETADDR
         BAL,12   HLOOP
         LOAD,4   *15,4
         LI,1     14                SPACE
         BAL,0    SPACES            TO COL#4
         LI,1     TAILMSG
         LW,R3    R5                MMOVE THE VALUE FOR
         BAL,R0   MTB               PUTTING IT OUT
         LI,R1    13                INDENT TO
         BAL,R0   SPACES
         LI,R1    CNTMSG
         LW,R3    R6                MOVE THE COUNT
         BAL,R0   MTB               PUT IT OUT
         PLW,0    STACK
         B        *0
ARROW    TEXTC    ' > '
         PAGE
*
*        4 CONTAINS DISPLACEMENT, 15 CONTAINS WA OF TABLE
*
HLOOP    EQU      %
         LI,R1    HEADMSG
         BAL,R0   MSG               PUT OUT MSG 'HEAD >' ...
         LI,0     1                 SET COUNTER,1 FOR HEAD PAGE
         STW,0    PGCOUNT           PAGE COUNTER
         BAL,0    PAGETABLE         INSERT HEAD PAGE#
         LI,11    72                MAX ROW OF DISPLAY
         B        PLOOP2            START OFF ROW
PLOOP1   LI,1     20                INDENT
         BAL,0    SPACES            TO HERE
PLOOP2   LW,3     4
         BAL,R0   TRANSSZ           PUT OUT THE VALUE..
         LB,R14   PAGE:ERROR        GET ERROR FLAGS
         BEZ      NOQERROR          NO ERROR FOUND
         LI,R1    PEMSGR            FLAG ERROR W/ASTERISK
         BAL,R0   MSG
         CI,R14   X'F0'             IS PAGE INVALID...(..OUTOF RANGE..)
         BE       BADPENTRY         YUP...TERMINATE THIS PAGE CHAIN
NOQERROR EQU      %
CHNEXU   EXU      *12
         BEZ      PTAILX
         BAL,0    PAGETABLE         BUILD TABLE
         MTW,1    PGCOUNT           BUMP COUNTER
         LI,1     ARROW
         BAL,0    MSG
         CW,11    PTR             IS THE MSG TOO BIG
         BG       PLOOP2
         BAL,0    BUFOUT          YES, PUT IT OUT
         LI,R3    SMUIS             MAX LOOP THRU A STATE CHAIN
         CI,R13   'ST'              COMING FROM STATES
         BE       %+2               YEP
         LI,3     1024              THE MOST THERE CAN EVER BE
         CW,3     PGCOUNT
         BL       TOOMANY           CHAIN IS CIRCULAR
         B        PLOOP1            NEXT ROW STARTING
PTAILX   LI,1     TAILMSG
         BAL,R0   MB
         CI,R13   'ST'              IS FROM A STATE CHAIN
         BE       HLRETURN          YES - STATE CHAIN EXITS NOW
         LI,R15   0                 RESET ERROR FLAG
         CW,5     3               TAIL = TAIL?
         BE       CHKCOUNT          YES,CHECK COUNT
         LI,R15   -1                SET ERROR FLAG
         LI,R1    ERRMSG1           NO - SAY TAIL ERRO
         BAL,R0   MB
CHKCOUNT EQU      %
         CW,R6    PGCOUNT           DOES PASSED CNT = REAL CNT
         BE       HLRET             NO ERROR
         LI,R15   -1                SET ERROR FLAG
         LI,R1    ERRMSG2           NO - SAY COUNT ERROR
         BAL,R0   MB                PUT IT OUT
HLRET    EQU      %
         AI,R12   1                 BUMP RETURN
         LW,R0    SWAP:CHN          GET SWAPPER PAGE CNT
         AND,R0   #R16              MASK TO LIMIT
         LW,R1    SWPBSY            GET  COPY OF S:SIP
         AND,R1   #R16              MASK TOLIMIT
         AW,R0    R1                ADD EM TOGETHER
         BEZ      *R12              NOT A SWAPPER ERROR
         CI,R13   'SW'              BUT IS IT THE SWAPPER CHAIN
         BNE      *R12              NO - EXIT OUT
         CI,R15   0                 WAS THERE AN ERROR AT ALL
         BGEZ     *R12              NO - RETURN
         LI,R1    INSWAP%SWAP%MSG   PUT OUT ERROR MSG
         BAL,R0   MBB
HLRETURN EQU      %
         B        *R12              RETURN TO CALLER
TOOMANY  EQU      %                 CIRCULAR CHAIN HANDLER
         LI,1     CIRCMSG
         BAL,R0   MB
         B        PTAILX            AND EXIT
*
BADPENTRY EQU     %
         BAL,R0   BUFOUT            PRINT WHAT WE HAVE BUILT NOW
         LI,R1    14
         BAL,R0   SPACES            SPACE OVER
         LI,R1    PGE%ERR
         BAL,R0   MB                PUT OUT THIS ERROR MSG
         B        *R12              RETURN TO CALLER
PGE%ERR  TEXTC    '** CHAIN DISPLAY TERMINATED BY INVALID ENTRY '
         PAGE
*
*
HEADMSG  TEXTC    ' HEAD '
TAILMSG  TEXTC    ' TAIL '
CNTMSG   TEXTC    ' COUNT '
ERRMSG1  TEXTC    '   ***TAIL ERROR'
ERRMSG2  TEXTC    '   ***COUNT ERROR'
CIRCMSG  TEXTC    '   ***CIRCULAR PAGE CHAIN'
INSWAP%SWAP%MSG TEXTC '***SWAP CHAIN INCONSISTENCIES DUE TO',;               A00
                      ' AN UNFINISHED INSWAP***'                             A00
         USECT    DATA                                                       A00
SWPBSY   DATA     0                 INDICATES IF SWAPPER RUNNING
SWAP:CHN DATA     0                 INDICATES IF SWAPPER HAS PAGE CHAIN
USWPDONE DATA     0                 INDICATES S:ISUN WAS IN CORE
SWPNOTT  DATA     0                 INDICATES S:ISUN WAS NOT IN CORE
INSWAP:HD DATA    0                 HEAD OF INSWAP USER PAGE CHAIN
INSWAP:TL DATA    0                 TAIL OF INSWAP USER PAGE CHAIN
INSWAP:CNT DATA   0                 COUNT OF PAGES IN INSWAP CHAIN
FPPH     DATA     0                 SWAPPER HEAD PAGE #
FPPT     DATA     0                 SWAPPER TAIL PAGE #
FPPC     DATA     0                 SWAPPER PAGE CHAIN COUNT
INSWAP   DATA     0                 INDICATES INSWAPS WERE BEING DONE
OUTSWAP  DATA     0                 INDICATES OUTSWAPS WERE RUNNING
#SVARIABLES EQU   %-SWPBSY-1        NUMBER OF VARIABLES TO ZERO OUT
OUT:CNT  DATA     0                 PAGE COUNT OF USER'S BEING SWAPPED
*                                   OUT OF CORE
PR:INCNT DATA     0                 PAGE COUNT OF PROCESSOR'S BEING
*                                   INSWAPPED
*
         USECT   PROCEDE                                                     A00
DOING%SWAP%CHAIN EQU SWPBSY
INSWAP%SWAPPER%MIX  EQU  SWAP:CHN
INSWAP%HEAD EQU   INSWAP:HD
*
*
SWPTBLMSG TEXTC   '** S:ISUN WAS CLOBBERED'
         PAGE
*F*
*F*    NAME:           MPAGES
*F*
*F*    PURPOSE:        TO SET UP THE FREE PAGE CHAIN DISPLAY.
*F*
*F*    DESCRIPTION:    MPAGES PICKS UP THE FREE PAGE HEAD AND CALLS
*F*                    'PGSOUT' TO RUN THE CHAIN.
*F*
MPAGES   LI,1     MPGMSG
         BAL,0    TITEL
         LCI      2                 STORE
         STCF     PG:MODE           MODE
         LI,14    M:FPPH
         BAL,0    GETADDR
         LCI      3
         LM,4     *15
         BAL,0    PGSOUT
*
*        FALL THRU AND PUT OUT SWAPPER PAGE CHANIN
*
         PAGE
*F*
*F*    NAME:           SPAGES
*F*
*F*    PURPOSE:        TO SET UP THE SWAPPER PAGE CHAIN DISPLAY.
*F*
*F*    DESCRIPTION:    SPAGES PICKS UP THE SWAPPER PAGE CHAIN POINTERS
*F*                    AND VALIDATES SAME. PRIOR TO CALLING
*F*                    'PGSOUT' SPAGES CHECKS TO SEE IF THERE
*F*                    WAS A SWAP IN PROGRESS - IF SO SPAGES SETS
*F*                    A FLAG TO HAVE 'PGSOUT' SAY THAT PAGE CHAIN
*F*                    ERRORS WERE CAUSED BY AN UNFINISHED SWAP.
*F*
SPAGES   EQU      %
         LI,R1    SPGMSG            TITLE LINE
         BAL,R0   TITEL             FOR DISPLAY
         LCFI     12                # OF WORDS IN TABLES
         LM,R0    ZEROS             GET SOME ZEROES
         STM,R0   SWPBSY            AND RESET ALL THE VARIABLES
         LI,R14   S:SIP             SWAPPER IN PROGRESS CELL
         MTW,1    LOOKING           ONLY NEED ONE PAGE
         BAL,R0   GETADDR           GO GET IT
         LW,R14   *R15              PICK IT UP
         STW,R14  SWPBSY            AND SAVE IT
         STW,R14  SWAP:CHN          AND FLAG IT
         LW,R2    ISUN              PICK UP INSWAP USER #
         BGZ      SPAGES1           VALUE OKAY
         CI,R2    0                 IS GARBAGE
         BEZ      SPAGES3           NO - JUST RESET
         LI,R1    SWPTBLMSG         BETTER PUT OUT A MSG
         BAL,R0   MB
         LI,R2    0                 AND RESET
         STW,R2   ISUN              RESET FLAG
         B        SPAGES4           JUMP DOWN THERE
SPAGES1  EQU      %
         STW,R2   ISUN              SAVE INSWAP USER NUMBER
         AWM,R2   INSWAP            SET INSWAP TRUE / NOT TRUE
         LI,R14   UH:FLG            NOW LETS SEE
         BAL,R0   GETADDR           IF THE INSWAP WAS COMPLETED
         LH,R3    *R15,R2           OR NOT
         CI,R3    JIC               WAS IT
         BAZ      SPAGES2           NOPE
         MTW,1    USWPDONE          BOOST SWAP COMPLETE FLAG
         B        SPAGES3           JUMP
SPAGES2  EQU      %
         MTW,1    SWPNOTT           BOOST SWAP NOT COMPLETE FLAG
SPAGES3  EQU      %
         STW,R2   USER              SAVE USER NUMBER
         CI,R2    0                 IS THER ONE
         BLEZ     SPAGES4           NO - JUMP
         MTW,1    LOOKING
         BAL,R0   LOCJIT            SEE IF WE CAN FIND HIS JIT
         BCS,4    SPAGES4           JIT NOT FOUND ANYWHERE
         LI,R1    JXPPH             BYTE DISP TO HEAD
         SLS,R1   -:BIG             TO HALF OR STAY AT BYTTE
         LOAD,R1  *JITBUF,R1        PICK UP USER'S HEAD PAGE #
         STW,R1   INSWAP:HD         SAVE IT
         LI,R1    JXPPT             BYTE DISP TO USERS TAIL
         SLS,R1   -:BIG             TO HALF OR STAY AT BYTE
         LOAD,R1  *JITBUF,R1        GET TAIL
         STW,R1   INSWAP:TL         SAVED
         LI,R1    JBPPC             BYTE INDEX TO COUNT
         LB,R1    *JITBUF,R1        PICK IT UP
         STW,R1   INSWAP:CNT        SAVED
SPAGES4  EQU      %
         LI,R14   S:FPPH            SWAPPER PAGE CHAIN HD - TL - CNT
         BAL,R0   GETADDR           GO GET ADDRESS
         LCFI     1                 SET FLAG
         STCF     PG:MODE           FOR PAGE TABLE MATRIX HANDLER
         LCFI     3                 PICK UP
         LM,R4    *R15              SWAPPER HD - TL - COUNT
         STM,R4   FPPH              AND SAVE THEM FOR ANALYSIS
         CLM,R4   PAGLIMS           DOES HEAD PAGE # FIT IN CORE
         BCS,9    SPAGES5           NOPE
         CLM,R5   PAGLIMS           DOES TAIL PAGE # FIT IN CORE
         BCS,9    SPAGES5           NO
         CI,R6    128*2             DOES COUNT LOOK REASONABLE
         BG       SPAGES5           NOPE
         STW,R6   SWAP:CHN          OKAY - SET HIS CHAIN BUSY
         LI,R13   'SW'              PASS FLAGS FOR SWAPPER PAGE CHAIN
         BAL,R0   PGSOUT            GO AHEAD AND RUN CHAIN
         LI,R0    0
         STW,R0   SWAP:CHN          AND THEN RESET IT
         B        SCANNER
         PAGE
*
*        INCONSISTENT SWAPPER PAGE CHAIN
*
SPAGES5  EQU      %
         LI,R1    SWP:CHN:ERR       ERROR MSG
         B        PUSHMSG           GET OUT OF DISPLAY
SWP:CHN:ERR TEXTC '** SWAPPER PAGE CHAIN DESTROYED'
         PAGE
*F*
*F*    NAME:           PPAGES
*F*
*F*    PURPOSE:        TO SET UP THE PROCESSOR PAGE CHAIN DISPLAY - AND
*F*                    TO RECEIVE THE TEMP PAGE CHAIN CALL FROM
*F*                    PROCLIST.
*F*
*F*    DESCRIPTION:    PPAGES SCANS THRU THE TABLE 'PX:HPP' LOOKING
*F*                    FOR PROCESSORS THAT WERE IN CORE. EACH ONE
*F*                    CAUSES PPAGES TO CALL 'PGSOUT' TO RUN THAT
*F*                    PROCESSOR'S PAGE CHAIN.
*F*
PPAGES   EQU      %
         PSW,R1   STACK             SAVE THE RETURN
         LI,1     PPGMSG            SEND THE
         BAL,0    TITEL             TITLE LINE
         LI,1     2                 GO LOOK FOR
PPAGES0  EQU      %
         BAL,0    GETHEX            AN OPTION
         AI,2     0                 WAS THERE
         BNEZ     PPLOOP0           YES,USE IT
         AI,2     1                 NO,START AT #1
         LI,7     PPROCS            SET MAX LOOP
         B        PPLOOP1           START IT OFF
PPLOOP0  LI,7     1                 SET FOR ONE PASS THRU
PPLOOP1  LI,3     3
PPLOOP2  EXU      PLO,3
         BAL,0    GETADDR
         EXU      PLOEXU,3
         STW,R4   PCHAINS,R3        STORE VALUES
         BDR,3    PPLOOP2
         PLW,R1   STACK
PTPAGES  EQU      %                 ENTRY FROM ANALZO4 TO PUT OUT
*                                   TEMP PAGE CHAINS
         PSW,R1   STACK
         LW,R1    PR:HD             HEAD PAGE #
         BEZ      PPCONT            NONE---> DO NEXT
         LI,14    P:NAME          PUT OUT NAME FIRST
         BAL,0    GETADDR         BUT ONLY IF THE PROCESSOR
         LD,10    *15,2             GET PROC NAME
         AND,R10  =X'07FFFFFF'      MASK BYTE COUNT / CONTENTS
         STW,2    PG:MODE           SAVE PROCESSOR#
         LCI      3                 INDICATE
         STCF     PG:MODE           PROCESSOR MODE
         LI,1     10
         BAL,0    MSG
         LI,1     #MS               INSERT # SIGN
         BAL,0    MSG               INSERT # SIGN
         LW,3     2                 INSERT PROCESSOR#
         BAL,0    TRANSSZ           IN PRINT LINE
         LCFI     3                 NOW PICK UP
         LM,R4    PR:HD             HEAD - TAIL - COUNT OF CHAIN
         BAL,0    PGSOUT
         BAL,0    BLANK1            ONE BLANK LINE
PPCONT   AI,2     1                 NEXT INDEX
         BDR,7    PPLOOP1           GET NEXT PROCESSOR
         PLW,R1   STACK             GET THE RETURN LINK
         CI,R1    SCANNER           WAS CALLED BY DISPLAY
         BE       PPCONT1           YES - CAN RUN ANY LIST
         B        0,R1              NO - MUST EXIT TO CALLER
PPCONT1  EQU      %
         PSW,R1   STACK             SAVE THE LINK FOR LATER
         LI,R6    PPAGES0           RETURN POINT
         B        GETLIST           CHECK FOR LIST OF ITEMS
*
*
#MS      TEXTC    '#'
PLO      EQU      %-1
         LI,14    PX:HPP
         LI,14    PX:TPP
         LI,14    PB:PSZ
*
PLOEXU   EQU      %-1
         LOAD,4   *15,2
         LOAD,4   *15,2
         LB,4     *15,2
         USECT    DATA
PCHAINS  DATA     0
PR:HD    DATA     0                 PROCESSOR HEAD PAGE NUMBER
PR:TL    DATA     0                 PROCESSOR TAIL PAGE NUMBER
PR:CNT   DATA     0                 PROCESSOR PAGE CHAIN COUNT
         USECT   PROCEDE
         PAGE
*F*
*F*    NAME:           STATES
*F*
*F*    PURPOSE:        TO SET UP THE STATE CHAIN DISPLAYS.
*F*
*F*    DESCRIPTION:    STATES RUNS THRU THE TABLE 'SB:HQ' LOOKING
*F*                    FOR A CHAIN IN PROGRESS. EACH TIME IT FINDS
*F*                    A CHAIN IN USE IT CALLS 'PGSOUT' TO RUN
*F*                    THAT STATE CHAIN.
*F*
STATES   LI,1     STCMSG
         BAL,0    TITEL             TITLE LINE OUT
         LI,R1    -128              LENGTH OF LIST
         LI,R0    0
         LW,R2    USERLIST          ADDRESS OF TABLE
         AI,R2    128               TOP OF TABLE
         STW,R0   *R2,R1            CLEAR TABLE COMPLETELY
         BIR,R1   %-1               BEFORE RUNNING THIS DISPLAY
         LI,R13   'ST'              PASS FLAGS FOR STATE CHAIN
         LI,1     2
STATES0  EQU      %
         BAL,0    GETHEX
         LI,10    0
         LW,2     2
         BNEZ     %+3
         LI,2     1
         LI,10    SNSTS
STLOOP   LI,14    SB:HQ
         BAL,0    GETADDR
         LB,4     *15,2
         BEZ      STLOOP2         LOOP IF NO ONE IN QUEUE
         LI,1     STATEMSG
         BAL,0    MSG
         LW,6     2                 SET
         BAL,0    SETR6             R6 UP
         LI,14    UB:FL
         BAL,0    GETADDR
         BAL,12   HLOOP
         LB,4     *15,4
         BAL,0    BLANK1            ONE BLANK LINE
STLOOP2  AI,2     1
         BDR,10   STLOOP
         LI,R6    STATES0           RETURN POINT
         B        GETLIST           CHECK FOR LIST OF ITEMS
UPMG     TEXTC    'USER#'
         PAGE
STATEMSG TEXTC    'STATE  '
PEMSGR   TEXTC    '*'
         PAGE
*F*
*F*    NAME:           PHYMAP
*F*
*F*    PURPOSE:        TO DISPLAY THE PHYSICAL PAGE MAP.
*F*
*F*    DESCRIPTION:    EACH OF THE ROUTINES IN ANLZ HAS PREVIOUSLY
*F*                    CALLED THE ROUTINE THAT HAS BUILT THE PHYSICAL
*F*                    PAGE TABLE. THIS ROUTIEN WILL NOW OUTPUT
*F*                    A FORMATTED DISPLAY OF THE MAP.
*F*
PHYMAP   EQU      %
         MTW,0    PG:ARRAY          WAS IT BUILT
         BEZ      SCANNER           NO,EXIT
         LI,1     PGMAPMS           OUTPUT
         BAL,0    TITEL             TITLE LINE OUT
         LI,5     16                SET LOOP
         LI,2     -1                INIT ROW
         STW,2    ROW#              PROPERLY
         LI,3     0                 NOW SET INDEX
PHYMAP0  LB,1     PGSPAC,3
         BAL,0    SPACES
         BAL,0    TRANSSZ           INSERT#
         AI,3     1
         BDR,5    PHYMAP0
         BAL,0    BUFOUT            OUTPUT HEADER LINE
         LW,1     PG:ARRAY          GET POINTER
         AI,1     -16               ADJUST IT DOWN
         STW,1    PG:POINT          PROPERLY
PHYMAP1  BAL,0    BLANK1            ONE BLANK LINE
         LI,2     16
         AWM,2    PG:POINT          SET POINTER
         LI,4     0                 SET UP FOR NEXT ROW
         LW,1     ROW#              GET ROW#
         AI,1     1                 BUMP
         STW,1    ROW#              REPLACE
         CW,1     ROWCNT            AT MAX YET
         BL       PHYMAP11          KEEP GOING
         LI,2     0
         XW,2     ODDROW            ANY ODD COUNT TO DO
         BEZ      PHYMAP5           NO,ALL DONE
PHYMAP11 LW,3     ROW#              GET ROW NUMBER CURRENTLY
         BAL,0    TRANSSZ           IN COL#1
PHYMAP2  LB,1     PGSPAC,4          GET SPACING
         AI,1     -1                BACK UP FOR EASY READING
         BAL,0    SPACES            TO NEXT COL#
         LI,3     0
         XW,3     *PG:POINT,4       GET CELL
         BEZ      PHYMAP30          NO  OWNER..CHECK FOR JIT
         LB,6     3                 GET POINTER
         SLS,6    -4                POSITION POINTER
         CI,R6    10                IS IN RANGE W/KNOWN ENTRIES
         BLE      PHYMAP3           YEP
         LI,R6    0                 SET UP THE PROPER PATH....
         LI,1     DBLPG             NO,TWO OWNERS
         B        PHYMAP32          PUT OUT OWNER'S MSG
*
*
PHYMAP3  EQU      %
         LW,R1    PHOWN,R6          GET MSG OF OWNER CODE
         B        PHYMAP32          AND PUT IT OUT
*
*        OWNER NOT INDICATED - IF LESS THAN FIRST ALLOCATABLE
*        PAGE - SAY IT BELONGS TO CP-V
*
PHYMAP30 EQU      %
         LI,R6    0                 SET UNALLOCATED PAGE SIGN REGISTER
         LW,R0    ROW#              CALCULATE
         SLS,0    4                 POSITIONS THE TENS FIELD
         AW,0     4                 THE PHYSICAL PAGE#
         CW,0     JITPAGE           IS THIS THE JIT PAGE
         BNE      PHYMAP31          NO
         LI,1     JITPGMS           YES,LETS PUT
         B        PHYMAP32          MSG IN THAT ROW
PHYMAP31 EQU      %
         LI,R1    UTSMSG            ASSUME IN ROOT OF MONITOR
         CW,R0    FIRSTPG           TRUE...
         BL       PHYMAP32          YUP
         LW,7     PG:ARRAY          ADDRESS OF TABLE
         LW,5     PAGECNT           CURRENT INDEX
         STW,0    *7,5              STORE PAGE# AWAY
         MTW,1    PAGECNT           BUMP INDEX
         LI,R1    PH0               NO OWNER'S MESSAGE TO PRINT
PHYMAP32 BAL,0    MSG               SHOVE OUT MSG
         LI,1     #MS
         EXU      MAPVECT,R6        DISPATCH PROPER ROUTINE
PHYMAP33 EQU      %
         BAL,R0   MSG               PUT OUT NUMBER SIGN
         AND,3    =X'FF'            GET#
         BAL,0    TRANSSZ           PUT IN COLUMN
PHYMAP4  AI,4     1                 BUMP TO NEXT
         BDR,2    PHYMAP2           DO NEXT ONE
         BAL,0    BUFOUT            PUT OUT ROW
         B        PHYMAP1           DO NEXT ROW
         PAGE
*
*        NOW DISPLAY ALL THE UN-OWNED PAGES WE
*        FOUND IN THE PHYSICAL MEMORY MAP
*
PHYMAP5  EQU      %
         LW,2     PAGECNT           GET INDEX
         CI,2     1                 ANY GET MOVED
         BE       PHYMAP8           NO,EXIT
         LI,1     UNOWNMS
         BAL,0    TITEL             MAKE A TITLE LINE
         BAL,0    UNMAP
PHYMAP6  LW,3     *PG:ARRAY,2       GET A PAGE#
         BEZ      PHYMAP7           NOBODY THERE
         BAL,0    BLANK1            ONE BALNK LINE
         LI,1     UNOWNMS1
         BAL,R0   MTBB              PUT IT OUT
         LW,R1    R3                PHYSICAL PAGE #
         BAL,R0   GET1ADDR          GO GET ONE PAGE IN
         LW,R8    R15               MOVE POINTER
         LI,7     X'200'            SIZE OF IT
         BAL,0    DUMPSOME          DUMP IT OUT
PHYMAP7  BDR,2    PHYMAP6           KEEP GOING
PHYMAP8  LI,7     1                 INDEX
         STW,7    PAGECNT           COVER ALL TRACKS
         B        SCANNER           AND RETURNO NEXT
UNOWNMS1 TEXTC    'PAGE # '
         USECT    DATA
PAGECNT  DATA     1                 INDEX TO TABL
ROW#     DATA     0
PG:POINT DATA     PG:ARRAY-16
         USECT    PROCEDE
PHOWN    DATA     PH0,PH1,PH2,PH3,PH4
         DATA     PH5
         DATA     PH6
         DATA     PH7
         DATA     PH8
         DATA     PH9
         DATA     PH10
PH9      TEXTC    'CP'              SLAVE CPU MSG
PH10     TEXTC    'SYMB'
PH8      TEXTC    'TPWP'            TRANSACTION PROCESSING WORK PAGE
PH7      TEXTC    'RAPP'
PH0      TEXTC    '****'
PH1      TEXTC    'SWAP'
PH2      TEXTC    'FREE'
PH3      TEXTC    'P'
PH4      TEXTC    'U'
PH5      TEXTC    '*RT*'
PH6      TEXTC    'XHAN'
DBLPG    TEXTC    'MULT'
JITPGMS  TEXTC    'JIT'
UTSMSG   TEXTC    'CP-V'                                                     A00
*
*
MAPVECT  EQU      %
         B        PHYMAP4           0 = UNALLOCATED PAGES
         B        PHYMAP4           1 = SWAPPER PAGES
         B        PHYMAP4           2 = FREE PAGES
         B        PHYMAP33          3 = PROCESSOR PAGES
         B        PHYMAP33          4 = USER PAGES
         B        PHYMAP4           5 = REAL TIME PAGES
         B        PHYMAP4           6 = XDELTA / UMOV PAGES
         B        PHYMAP4           7 = READ AHEAD PAGES
         B        PHYMAP4           8 = TRANSACTION PROCESSING PAGES
         B        PHYMAP33          9 = MULTI-PROCESSING PAGES
         B        PHYMAP4           10= SYMBIONT PAGES
PGSPAC   DATA,1   5,12,19,26,33,40,47,54,61,68,75,82,89
         DATA,1   96,103,110,117,124
         BOUND    4
         PAGE
*F*
*F*    NAME:           MASK
*F*
*F*    PURPOSE:        TO PRESERVE THE MASK VALUE SUPPLIED BY THE
*F*                    USER.
*F*
*F*    DESCRIPTION:    THE USER HAS COMMANDED 'SMASK' THIS ROUTINE
*F*                    WILL SAVE THE REQUESTED MASK IN THE LOCATION
*F*                    'MASQ'.
*F*
MASK     LI,1     1
         BAL,0    GETHEX
         STW,2    MASQ
         B        SCANNER
         PAGE
         USECT    DATA
MASQ     DATA     -1
*
*        SEARCH   XXXXXXXX,LOC-LOC  (WITH MASK SPECIFIED)
*
SERVAL   DATA     -1
*
         PAGE
*F*
*F*    NAME:           SEARCH
*F*
*F*    PURPOSE:        TO SCAN FOR THE SELECTED WORD THRU THE
*F*                    RANGE OF ADDRESSES GIVEN.
*F*
*F*    DESCRIPTION:    THE COMMAND SCANNER HAS COME HERE AFTER
*F*                    DETECTING THE COMMAND 'SEARCH'.
*F*                    SEARCH WILL EXTRACT THE SEARCH FOR WORD,AND THE
*F*                    RANGE OF LOCATIONS FROM THE COMMAND.
*F*                    SEARCH WILL THEN EXAMINE EITHER REAL CORE OR
*F*                    THE DUMP FILE LOOKING FOR THE VALUE GIVEN.
*F*
         USECT    PROCEDE
SEARCH   LI,1     1
         BAL,0    GETHEX
         STW,2    SERVAL
         LI,1     2
         BAL,0    LOCLOC
SRLOOP0  EQU      %
         MTW,1    LOOKING           SET ONE PAGE READ FLAG
         LW,14    8
         BAL,0    GETADDR
SRLOOP1  EQU      %
         LW,R2    *R15              GET VALUE
         LW,R3    MASQ              GET MASK
         CS,R2    SERVAL            COMPARE TO VALUE GIVEN
         BE       SRFOUND           ***GOTCHA***
SRLOOP2  EQU      %
         AI,R8    1                 NEXT ADDRS NEEDED
         BDR,R7   SRLOOP0           GET NEXT PAGE INTO CORE
         B        SCANNER           FINISHED UP - EXIT TO SCANNER
         PAGE
*
*        FOUND WORD USER IS LOOKING FOR
*
SRFOUND  EQU      %
         STW,R8   LASTLOC           KEEP REMEMBERING LAST LOC
         LCFI     2
         PSM,R7   STACK
         LI,R7    1                 GONNA DUMP ONE WORD
         LW,R8    R15               MOVE POINTER
         BAL,R0   DUMPSOME          DUMP IT OUT
         LCFI     2
         PLM,R7   STACK
         B        SRLOOP2           GO ON TO NEXT WORD
         PAGE
*F*
*F*
*F*    NAME:           WHY
*F*
*F*    PURPOSE:        TO DISPLAY UPON COMMAND THE SCREECH CODE AND
*F*                    THE TEXT MESSAGE ASSOCIATED WITH THE SCREECH.
*F*
*F*    DESCRIPTION:    WHY ENTERS THE ROUTINE 'REGS' WHO FINDS
*F*                    OUT WHAT THE SCREECH CODE IS - 'REGS' THEN
*F*                    READS THE ERROR MESSAGE FILE TO PULL OUT
*F*                    THE SCREECH MESSAGE AND PRINTS IT.
*F*                    'REGS' WILL THEN RETURN TO THE SCANNER.
*F*
WHY      EQU      %
         LI,R13   'WH'            POST FLAG
         B        REGS00          AND MERGE
         PAGE
*F*
*F*    NAME:           REGS
*F*
*F*    PURPOSE:        TO FIND OUT WHAT THE SCREECH WAS - PRINT INFO
*F*                    ABOUT SCREECH CODE (INCLUDING THE ERROR MSG
*F*                    FILE TEXT MSG) ; PRINT THE TWO REGISTER
*F*                    BLOCKS ; THE RECOVERY PSD ; THE SENSE SWITCHES
*F*                    AT THE TIME OF THE SCREECH AND TO SAVE INFO
*F*                    REGARDING THE SCREECH FOR LATER USE IN ANLZ.
*F*
*F*    DESCRIPTION:    'REGS' EXTRACTS THE SCREECH CODE FROM THE
*F*                    SAVED LOCATION IN THE DUMP FILE - PRINTS IT
*F*                    AND THEN OPENS THE ERROR MESSAGE FILE TO READ
*F*                    THE MESSAGE THAT GOES WITH THE SCREECH CODE.
*F*
*F*                    IT THEN PRINTS THE RCVRY PSD AND SENSE SWITCHES
*F*                    THAT RECOVERY SAVED.
*F*
*F*                    IT THEN OBTAINS THE REGISTER BLOCKS THAT
*F*                    THAT RECOVERY SAVED AND PRINTS THEM .
*F*
REGS     EQU      %
         LI,R13   'NO'            POST NORMAL FLAG
REGS00   EQU      %
         PSW,1    STACK             SAVE LINK
         CI,R13   'WH'              DISPLAYING SCREECH CODE ONLY
         BE       REGS0A            YEP - JUMP
         LI,1     REGMSG            SET HDR ADDRS
         BAL,0    TITEL             TITLE LINE OUT
REGS0A   EQU      %
         MTW,1    REG%FLAG          TELL WORLD WE'VE BEEN HERE               A00
         LH,R3    SCREECH%CODE      GET MAJOR PART OF SCREECH CODE
         LB,R1    SCR:CNT           LENGTH OF TABLE
         CB,R3    SCR:CNT,R1        SEE IF SCREECH CAUSED BY TRAP
         BE       REGS01            GOT EM
         BDR,R1   %-2
         B        REGS02            SCREECH NOT FROM A TRAP
REGS01   MTW,1    TRAP:SCR          BOOST THE FLAG HIGH
REGS02   LI,R1    RCMSG             NOW PUSH OUT TITLE LINE
         BAL,0    MSG
         BAL,0    TRANSSZ
         LW,R3    SCREECH%CODE      GET THE WHOLE CODE..
         AND,R3   =X'FF'            MASK OFF SUBCODE...
         LI,1     RC1MSG
         BAL,R0   MTBB              PUT IT OUT
         STW,R3   SUBCODE           SAVE SUBCODE
         LI,R2    3                 INDEX TO
         STB,R3   ERRMSGKEY,R2      STORE SUBCODE IN KEY
         LH,R3    SCREECH%CODE      GET MAJOR PART OF CODE
         LI,R2    2                 INDEX TO STORE
         STB,R3   ERRMSGKEY,R2      STORE THAT
         LI,R2    1                 INDEX TO STORE
         LI,R3    X'08'             GROUP CODE
         STB,R3   ERRMSGKEY,R2      STORED
         LI,R3    X'03'             KEY LENGTH
         STB,R3   ERRMSGKEY
         CAL1,1   OPEN:SCR
         CAL1,1   SET:SCR           SET ERR/ABN
TRYAREAD CAL1,1   READ:SCR          TRY READING CURRENT KEY
         LW,R1    F:SCR+13          GOT IT - GET ARS
         AI,R1    -1
         STW,R1   PTR               SAVE SIZE OF PRINT BUFFER
         BAL,R0   BUFOUT            PRINT AND BLANK BUFFER
         LI,R7    F:SCR             SET DCB ADDRS
         BAL,R0   CLOSEDCB          CLOSE DCB OUT
         BAL,R0   BLANK1
         LI,R14   CRASHTYP          GET CRASH TYPE
         BEZ      REGSOUT           NOT A D00 SYSTEM
         BAL,R0   GETADDR           GO GET IT
         LI,R6    0                 ASSUME TYPE ZERO MODE
         LI,R7    7                 MASK TO EXTRACT TYPE
         LS,R7    *R15              GET TYPE
         BEZ      CRASHTYPE         GOTCHA
         LI,R6    3                 HAVE TO CHECK TABLE
         CB,R7    CTYPES,R6         FOR A MATCHUP
         BE       CRASHTYPE         GOTCHA
         BDR,R6   %-2               KEEP LOOKING
         B        REGSOUT           WELL THE HECK W/IT
CRASHTYPE EQU     %
         LW,R1    CTYPESM,R6        GET MSG LOCATION
         BAL,R0   MB                PUT IT OUT
         B        REGSOUT
NOSCRF   LI,R1    NOSCRFM           OPEN ERROR MSG
         B        ERRMSG110         JUMP
NOSCRK   LW,R3    ERRMSGKEY         GET KEY
         CI,R3    X'FF'             WAS THERE AN SUBCODE
         BAZ      NOSCRK1           NOPE
         AND,R3   =X'FFFFFF00'      STRIP SUBCODE
         STW,R3   ERRMSGKEY
         B        TRYAREAD          TRY READING AGAIN
NOSCRK1  LI,R1    NOSCRKM           KEYED READ ERROR MSG
ERRMSG110 BAL,R0  MSG%OUT           PRINT THAT LINE
         PAGE
*
*        PUT OUT FIRST TWO REGISTER BLOCKS , RECOVER PSD ,
*        AND SENSE SWITCHES
*
REGSOUT  EQU      %
         CI,R13   'NO'            RUNNING NORMALLY
         BE       REGSOUT0        YES - JUMP
         PLW,R1   STACK           NO - RETRIEVE THE LINK
         B        0,R1            AND RETURN TO CALLER
REGSOUT0 EQU      %               OR GO AHEAD AND COMPLETE THE DISPLAY
         BAL,R0   BLANK1            FIRST A BLANK LINE
         LI,R1    19                SPACE OVER
         BAL,R0   SPACES            TO PLANT FIRST LINE
         LI,R1    BADFLMSG1         OF HEADING
         BAL,R0   MB
         LI,R1    BADFLMSG          PUT
         BAL,R0   MB                OUT HEADER STRING
         LI,R5    #RFETCHS          # OF ENTRIES TO PUT OUT
         LI,R6    0                 INDEX INTO SPACES TABLE
REGSOUTA EQU      %
         EXU      REGFETCH,R5       LOAD R14 WITH ADDRESS
         MTW,1    LOOKING           ONLY NEED ONE PAGE
         BAL,R0   GETADDR           GO GET IT
         LB,R1    RSPACES,R6        LOAD SPACING VALUE
         BAL,R0   SPACES            PUT THEM OUT
         LW,R3    *R15              GET VALUE
         BAL,R0   TRANS             PUT IT OUT
         AI,R6    1                 NEXT SPACING INDEX
         BDR,R5   REGSOUTA          FINISH LOOP
         LI,R14   PFSRSW            NOW GET SENSE SWITCHES
         MTW,1    LOOKING
         BAL,R0   GETADDR           GO..
         LW,R7    *R15              GET CONTENTS
         LI,R5    4                 4 BIT LOOP ON A BDR
         LI,R4    0                 SPACING INDEX REGISTER
REGSOUTB LI,R6    0                 RESET ACCUMULATOR
         LB,R1    SSWSPCS,R4        GET SPACING
         BAL,R0   SPACES
         SLD,R6   1                 SHIFT ONE IN FROM R7
         LW,R3    R6
         BAL,R0   TRANSSZ           MOVE CONTENTS OF R3 TO PRINT LINE
         AI,R4    1
         BDR,R5   REGSOUTB          FINISH UP
         BAL,R0   BUFOUT
         BAL,R0   BLANK1
         B        REGSOUT1          GO TO NEXT ROUTINE
*
*
REGFETCH EQU      %
         NOP
         LI,R14   RCVPSD+1
         LI,R14   RCVPSD
         LI,R14   S:BADFLG
#RFETCHS EQU      %-REGFETCH-1
*
*
RSPACES  DATA,1   1,14,26,37,38
         BOUND    4
SSWSPCS  DATA,1   38,44,50,56,62
         BOUND    4
*
*
CTYPES   DATA,1   0,1,2,4           TYPES OF RECOVERIES
         BOUND    4
*
CTYPESM  DATA     TYPE0,TYPE1,TYPE2,TYPE4
*
TYPE0    TEXTC    'MONITOR SNAPSHOT DUMP'
TYPE1    TEXTC    'SINGLE USER ABORT'
TYPE2    TEXTC    'SLOW RECOVERY MODE'
TYPE4    TEXTC    'FAST RECOVERY MODE'
*
BADFLMSG1 TEXTC 'RECOVERY'
BADFLMSG EQU      %
  TEXTC  ' S:BADFLG     PSW 0       PSW 1       SSW1  SSW2  SSW3',;
                   '  SSW4  '
*
         PAGE
*
*        HERES WHERE THE REGISTER BLOCKS GO OUT
*
REGSOUT1 LI,R14   SAVEREGS         NLOC FOR REG BLOCK 0
         LI,R1    RBLOCK0           MESSAGE
         BAL,R0   MSG%OUT           OUTPUT TO LO
         BAL,0    GETADDR           THAT PAGE
         LI,7     16
         MTW,1    DUMP:DIR          SET DIRECT FLAG
         LW,8     15
         BAL,R0   DUMPSOME          PUT THAT OUT
         LI,R8    COCFLAG           COC TYPE SYSTEM
         BEZ      REGSOUT2          NOPE
         LI,R14   SAVEREGS1         YEP
         BAL,R0   GETADDR           GET REGISTER BLOCK 1
         LI,R1    RBLOCK1           MESSAGE
         BAL,R0   MSG%OUT           OUTPUT
         LW,R8    R15               LOAD POINTER TO LOCATON
         MTW,1    DUMP:DIR          RELATIVE ADDRESSING
         BAL,R0   DUMPSOME          PUT OUT THE BLOCK
REGSOUT2 EQU      %
         LI,R14   J:ALB             LAST BRANCH ADDRESS
         BEZ      REGSOUT3          NOT A C00 SYSTEM
         BIFM,S7S9 REGSOUT3         NOT A XEROX 560 CPU HERE
         BAL,R0   UNMAP
         LW,R3    SCREECH%CODE      GET TYPE OF SCREECH
         CLM,R3   SCR24:29          IS SPECIAL HARDWARE SCREECH
         BCS,9    %+2               NOPE
         LI,R14   F:BREG            YES--LAST BRANCH IS KEPT HERE..
         BAL,R0   GETADDR           GET IT
         LW,R3    *R15              GET VALUE
         BAL,R0   BLANK1
         LI,R1    ALBMSG            PUT OUT MSG
         BAL,R0   MTBB              MSG/TRANSSZ/BUFOUT/BLANK1
REGSOUT3 EQU      %
         PLW,R0   STACK
         B        *R0
ALBMSG   TEXTC    '**LAST BRANCH ADDRESS: '
         PAGE
*F*
*F*    NAME:           GETHIGH
*F*
*F*    PURPOSE:        TO SERVE AS A FOCAL POINT FOR COLLECTING
*F*                    VARIOUS CELLS THAT DO NOT HAVE TO BE COLLECTED
*F*                    AGAIN.
*F*
*F*    DESCRIPTION:    THE ROUTINE HAS HARD CODED A NUMBER OF CELLS
*F*                    THAT ARE ONE TIME FETCHES..S:CUN,S:ISUN..ETC...
*F*
*F*                    THESE CELLS ARE THEN SAVED FOR LATER USE.
*F*
*
GETHIGH  EQU      %
         LCI      3
         PSM,0    STACK             SAVE WORKING REGS
         LI,R14   RCVCODE
         BAL,R0   GETADDR           PICK UP SCREEC CODE
         LW,R3    *R15              AND
         STW,R3   SCREECH%CODE      REMEMBER IT FOR LATER
         LH,R4    R3                GET MAJOR PART..
         AND,R3   =X'FF'            MASK SUB-CODE
         SLD,R4   -4                POSITION FIRST DIGIT
         LB,R7    LISTCHARS,R4      GET EBCDIC FORM
         LI,R6    61
         STB,R7   HDMSG,R6
         LI,R4    0
         SLD,R4   4                 SHIFT BACK OTHER DIGIT
         LB,R4    LISTCHARS,R4
         AI,R6    1
         STB,R4   HDMSG,R6
*
         LW,R4    R3                GET SUB-CODE
         SLD,R4   -4
         LB,R4    LISTCHARS,R4
         LI,R6    64
         STB,R4   HDMSG,R6
         LI,R4    0
         SLD,R4   4
         LB,R4    LISTCHARS,R4
         AI,R6    1
         STB,R4   HDMSG,R6
         LI,R14   C%CPU           DEF WHAT DEFINES TYPE OF CPU
         BEZ      NOMACHINE         NOT A C00 CP-V SYSTEM
         MTW,1    LOOKING
         BAL,R0   GETADDR           GET IT
         LW,R3    *R15              GOTCHA
         STW,R3   MACHINE           SAVED AWAY
NOMACHINE EQU     %
         BAL,R1   FIX%TIME          GET TIME FROM DUMP FILE
         BAL,R1   SETVERS           SET VERSION INTO HEADING
         LI,R14   S:CUN             LETS GET CURRENT USER
         MTW,1    LOOKING
         BAL,R0   GETADDR
         LW,R2    *R15
         STW,R2   CUN               SAVED
         LI,R14   S:ISUN            NOW INSWAP USER #
         MTW,1    LOOKING
         BAL,R0   GETADDR
         LW,R2    *R15
         STW,R2   ISUN              SAVED FOR LATER USE
         LI,14    SITEID            FROM ROOT
         BAL,0    GETADDR
         LCI      2
         LM,0     *15
         STM,R0   HDMSG+9           STORE SITE ID TEXT STRING
         LI,R14   RCVSIZE
         BAL,R0   GETADDR
         LW,R14   =X'00FFFFFF'      M24 TYPE BIT MASK
         LI,R7    -1
         AND,R14  *R15,R7           GET RECOVERY'S BA IN CORE
         SLS,R14  -2
         STW,R14  RCVLIMITS
         LW,R7    =X'00FFFFFF'      M24 TYPE BIT MASK
         AND,R7   *R15              GET RECOVERY'S SIZE IN BYTES
         SLS,R7   -2                INTO WORDS
         AW,R7    R14               ADD BASE WA
         STW,R7   RCVLIMITS+1       CREATING CLM PAIR
         LI,R14   CORED             NOW LETS GO PICK UP
         BAL,R0   GETADDR           PHYSICAL LIMITS OF THE CPU
         AI,R14   -1                ADJUST BY MINUS ONE
         BLEZ     BAD:CORED         BAD
         CW,R14  =X'3FFFFF'         IS GREATER THAN POSSIBLE
         BLE      CORED:OK          IS REASONABLE VALUE I THINK
BAD:CORED EQU     %
         LI,R14   CORE-1            IF BAD USE SYSGEN CREATED VALUE
CORED:OK EQU      %
         STW,R14  LEGCORAD+1        SAVE VALUE
         LW,R3    R14               MOVE CORE WORD COUNT TO R3
         LI,R14   HIGH
         MTW,1    LOOKING
         BAL,R0   GETADDR           GO PICK UP 'HIGH' CONTENTS
         SLS,3    -9                #PAGES IN CORE
         LW,1     *15
         BGZ      %+2               GOOD VALUE
         LW,1     3                 SET IT TO MAX
         CW,1     3                 IS IT OK
         BLE      %+2               YES
         LW,1     3                 NO,USE CORE PAGE COUNT
         STW,R1   PAGLIMS+1
         LW,3     1                 MOVE FOR ARITH
         LI,2     0
         DW,2     =16               CALCULATE ROWS
         LI,2     16                THINK ABOUT THAT...
         STW,3    ROWCNT
         STW,2    ODDROW            SAVE ODD COUNT
         LI,R1    J:JIT             IN ANY EVENT NEVER HIGHER
         SLS,1    -9                NUMBER
         STW,1    JITPAGE           SAVED
         LI,R14   LOW               GET
         MTW,1    LOOKING
         BAL,R0   GETADDR           LOWEST PAGE
         LI,R13   PPSTART         CLOSEST SYMBOL TO PROCEDURE START
         AI,R13   512               FIRST
         SLS,R13  -9                PAGE OF MONITOR PROCEDURE
         LW,R14   *R15              GET 1ST PAGE #
         BLEZ     FIRST:NOK         ERROR
         CW,R14   R13               IS VALID FOR LOW SIDE
         BG       %+2               YEP
FIRST:NOK EQU     %
         LW,R14   R13               NOPE
         LW,R13   LEGCORAD+1        GET MAX WORD ADDRESS IN CPU
         SLS,R13  -9                CALCULATE HIGH SIDE
         CW,R14   R13
         BL       %+2               MUST BE LOWER VALUE
         LI,R14   JOVVP             USE THIS VALUE IF LOW IS BAD
         STW,R14  FIRSTPG           REMEMBER FIRST ALLOCATABLE PAGE#
         LI,R0    0                 RESET
         STW,R0   UCTITLE           M:UC TITLE LINE SUPRESSION
         STW,R0   LASTITEL          SUPPRESS LAST TITLE LINE RECORD.
         LW,R0    PAGLIMS+1         GET HIGHEST PAGE IN SYSTEM
         CI,R0    X'80'             IS 64K SYSTEM
         BLE      NOSETUP           YES - AVOID EXTRA PAGES IN 64K
         LI,R1    SMUIS+2           # OF USERS PLUS ROUND FACTOR
         SLS,R1   -2                # OF WORDS IN A BYTE TABLE
         AI,R1    UB:US             TOP WORD IN UB:US TABLE
         LI,R0    UH:FLG            BASE TABLE WE WANT
         AND,R0   =X'1FE00'         FORCE TO PAGE BOUNDARY
         STD,R0   PROCNAME          SVE THESE FOR A SEC
         LD,R10   ZEROS
         STD,R10  UHFLGR1-1         ZIP THE CLM TABLE
         AI,R1    512               FORCE UPPER LIMIT TO
         SLS,R1   -9                A PAGE BOUNDARY
         SLS,R1   9                 FOR CLM CHECKS
         AI,R1    -1                POINT BAK INTO LAST PAGE
         SW,R1    R0                CALCULATE # OF PAGES REQUIRED
         AI,R1    512               ROUND UP TO TOTAL PAGES REQUIRED
         SLS,R1   -9
         LI,R2    1
         STH,R1   GETPAGES,R2       STORE PAGE COUNT AWAY
         LW,R9    UHFLGLOC          ALREADY HAVE BUFFER
         BGZ      SETUP0            YES - JUMP
         CAL1,8   GETPAGES          GET THE NECESSARY PAGES
         BCS,8    NOSETUP           CANT GET EM
         STW,R9   UHFLGLOC          REMEMBER ADDRESS OF TABLE
SETUP0   EQU      %
         MTW,0    MONFLAG           ARE IN MONITOR DISPLAY MODE
         BNEZ     MAPTABLE          GO AND MAP ONTO THE TABLES
SETUP    EQU      %
         CAL1,8   FREEIT            GOT TO BE FREE BEFORE GETTING IT
         CAL1,8   GETIT             AND THEN RESTORE IT
         AI,R9    512               BUMP TO NEXT PAGE
         BDR,R1   SETUP             FINISH RE-ACQUIRING THE PAGES
         LI,R2    1
         LH,R1    GETPAGES,R2       RESTORE R1
         SLS,R1   9                 # OF WORDS TO MOVE
         LI,R3    0
         LW,R14   PROCNAME          OBJECT WORD ADDRESS
         STW,R14  TEMP1             INIT WA POINTER
SETUP1   EQU      %
         LW,R14   TEMP1             GET NEXT OBJECT WA
         BAL,R0   GETADDR           GET IT
         STW,R14  *UHFLGLOC,R3      STORE IT
         MTW,1    TEMP1             ADVANCE POINTER
         AI,R3    1                 NEXT INDEX
         BDR,R1   SETUP1            LOOP TILL DONE
         B        SETUP2
NOSETUP  LI,R1    0
         STW,R1   UHFLGLOC          ZAP THE POINTER
SETUP2   EQU      %
         LD,R0    PROCNAME          GET CLM PAIR
         STD,R0   UHFLGR1-1         AND STORE FOR CHECKS IN ROOT
         LCI      3
         PLM,0    STACK             RESTORE REGS
         B        0,R1              RETURN TO CALLER
         USECT    DATA
TEMP1    DATA     0
*
GETPAGES GEN,8,24 8,2               FOR GETTING PAGES
*
         USECT    PROCEDE
         PAGE
*
*        WHEN IN MONITOR DISPLAY MODE WE JUST MAP ONTO THE
*        TABLES 'UH:FLG' AND 'UX:JIT' FOR LATER USE
*
MAPTABLE EQU      %
         STW,R9   SADCAL+1          STORE VIRTUAL WORD ADDRESS AWAY
         LI,R2    1
         LH,R1    GETPAGES,R2       GET # OF PAGES INVOLVED HERE
         CAL1,8   GETIT             GET VIRTUAL PAGE
         CAL1,8   FREEIT            AND FREE VIRTUAL PAGE
         AI,R9    512
         BDR,R1   %-3               FINISH FREEING EM
         LH,R1    GETPAGES,R2       RESTORE R1 AGAIN
         LW,R6    R0                FIRST ADDRESS TO MAP ONTO
         LI,R7    X'7FE00'          PAGE BNDRY MASK
         STS,R6   SADCAL            STORE WORD WE WANT
MAPTABLE1 EQU     %
         CAL1,8   SADCAL            MAP ONTO A PAGE
         BCS,8    NOSETUP           WE GOOFED SOMEWHERE
         LI,R9    512
         AWM,R9   SADCAL            BUMP BOTH INTO NEXT PAGES
         AWM,R9   SADCAL+1          ADVANCE POINTERS
         BDR,R1   MAPTABLE1         AND FINISH UP
         B        SETUP2            AND EXIT
         USECT    DATA
SADCAL   GEN,8,24 7,0
         DATA     0
         USECT    PROCEDE
         PAGE
*
*        DATA/CODE FOR REGISTER DUMPS
*
RCMSG    TEXTC    '   SCREECH CODE:  '
RC1MSG   TEXTC    '   SUB-CODE:  '
         USECT    DATA
ERRMSGKEY         DATA   X'03087E40'
SUBCODE  DATA     0
         USECT    PROCEDE
NOSCRFM  TEXTC    'CANNOT OPEN ERROR MESSAGE FILE'
RBLOCK0  TEXTC    '   ** REGISTER BLOCK 0 **'
RBLOCK1  TEXTC    '   ** REGISTER BLOCK 1 **'
NOSCRKM  TEXTC    '**** UNLISTED SCREECH ***'
OPEN:SCR  GEN,8,24  X'14',F:SCR
          DATA    X'C7400009'
         DATA     NOSCRF,NOSCRF
         DATA     2,2
         DATA     1,2
         DATA     X'01000202'
         TEXTC    'ERRMSG'
         DATA     X'02010202'
:SYSACN  TEXT     ':SYS   '         DEFAULT ACCOUNT NUMBER
*
SET:SCR GEN,8,24  X'06',F:SCR
         GEN,4,28  12,0
         DATA     NOSCRK,NOSCRK
*
READ:SCR GEN,8,24  X'10',F:SCR
         GEN,8,24   X'F8',16
         DATA     NOSCRK,NOSCRK
         DATA     OBUF,131
         DATA     ERRMSGKEY
         END

