*M*      ANALZ        ROOT MODULE OF THE ANLZ LOAD MODULE.
*P*
*P*    THIS MODULE CONTAINS ROUTINES THAT ALL OVERLAYS ARE
*P*    UTILIZING - DUMP ROUTINES - COMMAND SCANNER - ADDRESS
*P*    FETCHERS..ETC...
         PAGE
*
*P*      THE FOLLOWING ROUTINES CAN BE FOUND IN THIS MODULE;
*P*
*P*      ROUTINE                  PURPOSE/USAGE
*P*      -----------              -------------------------------------
*P*      INITIAL                  LOAD MODULE START ADDRESS
*P*      NOFIL                    ROUTINE TO COMPLAIN ABOUT FILE NOT THERE
*P*      RESETM                   CRASHES ALL ADDRESS POINTERS
*P*      RERR                     PUTS OUT I/O ERROR MESSAGE
*P*      SCANNER                  MAIN COMMAND SCANNING ROUTINE
*P*      GETLIST                  RETURNS NEXT LIST ITEM IF PRESENT
*P*      CLOSEIT                  CLOSES DUMP FILE IF OPEN
*P*      BADCOM                   PUTS OUT EH MESSAGE - GOES TO SCANNER
*P*      FILENAME                 COLLECTS 'FID' FROM COMMAND LINE
*P*      NOTRACE                  SAYS 'DOESNT EXIST' ROUTINE
*P*      PUSHMSG                  PRINTS MSG - GOES TO SCANNER ROUTINE
*P*      SETR6                    CONVERTS STATE # TO MSG/PUTS IT OUT
*P*      PAGETABLE                BUILDS PHYSICAL MEMORY MATRIX
*P*      BLNKBUF                  CRASHSES PRINT BUF POINTERS
*P*      BLANK1                   WRITES A BLANK LINE
*P*      RES:JIT                  GETS JITS IN MONITOR DISP MODE
*P*      RES:JIT5                 'NO SUCH USER' MSG WRITER
*P*      NEXTLOC                  USES 'FIELD#' TO GET NEXT FIELD
*P*      LOCLOC                   GETS LOC-LOC FIELDS USING R1 FIELD #
*P*      GETHEX                   GET FIELD USING R1 FIELD #
*P*      TRANSSZ                  HEX->EBCDIC W/O LEAD ZEROS
*P*      TRANS                    HEX->EBCDIC WITH LEAD ZEROS
*P*      BUFOUT                   PRINTS THE PRINT BUFFER
*P*      SPACE2                   PUTS TWO SPACES INTO PRINT LINE
*P*      TITEL                    BUILDS CONTENTS TABLE - WRITES TITLES
*P*      MTBB                     MSG/TRANS/BUFOUT/BLANK ROUTINE
*P*      MBB                      MSG/BUFOUT/BLANK ROUTINE
*P*      TBB                      TRANS/BUFOUT/BLANK ROUTINE
*P*      MSG%OUT                  BLANK/MSG/BUFOUT/BLANK ROUTINE
*P*      BMBB                     BLANK/MSG/BUFOUT/BLANK ROUTINE
*P*      TB                       TRANSSZ/BUFOUT ROUTINE
*P*      MB                       MSG/BUFOUT ROUTIE
*P*      MTB                      MSG/TRANSSZ/BUFOUT ROUTINE
*P*      DISP:PP                  INFO ABOUT PAGE # (WA..ETC) ROUTINE
*P*      RE:PNT                   CRASHES ADDRESS CLM PAIR
*P*      CLOSEDCB                 CLOSES DCB POINTED TO BY R7
*P*      TCONT                    BUILDS TABLE OF CONTENTS PAGE
*P*      GET1ADDR                 FETCH ONE PAGE ROUTINE
*P*      GETADDR                  FETCH ADDRESS ROUTINE
*P*      MAP:USER                 MAP USER ROUTINE
*P*      RES:BUF                  RESTORE CVM WINDOW PAGES ROUTINE
*P*      UNMAP                    GO UNMAPPED ROUTINE
*P*      LOCJIT                   GET JIT FROM DUMP FILE ROUTINE
*P*      DUMPSOME                 DUMP SPECIFIED AREA ROUTINE
*P*      MSG1                     MOVE TEXT MSG ROUTINE
*P*      MSG                      MOVE TEXTC MSG ROUTINE
*P*      SPACES                   SPACE TO REQUESTED COLUMN ROUTINE
*P*
 TITLE '*** A N A L Y Z E   R O O T   M O D U L E   D 0 0 ***'
       PAGE
*
*      DECLARE SYSTEM FILE USAGES
*
*
UTSPROC  SET      1
MONPROC  SET      0
UFLAGS   SET      1
S69PROC  SET      1
*
         SYSTEM   UTS
*
         OPEN     UNMAP             SYMBOL IS USED INTERNALLY
         OPEN     MAP               SYMBOL IS USED INTERNALLY
         OPEN     TSTACK            DITTO
         OPEN     PP                DITTO
         OPEN     BUFSIZ            DITTO
         OPEN     RSZ               DITTO
       PAGE
*
*      THE FOLLOWING REFERENCES ARE SATISFIED FROM INTERNAL ANLZ
*      SOURCES AT LOAD TIME
*
         REF      %CITS             * CIT TABLES DISPLAY
         REF      %DCTS             * DCT TABLES DISPLAY
         REF      %IOQS             * IOQ TABLES DISPLAY
         REF      ADAMDUMP          * ADAM MEMORY DUMP ROUTINE
         REF      ALLJIT            * DISPLAY IN CORE JITS
         REF      ALLOUTJIT         * DISPLAY OUT OF CORE JITS
         REF      ALLYTABL          * ALLYCAT TABLE ROUTINE
         REF      AVR%TABLES        * AVR TABLES DISPLAY
         REF      BLKPRT            * BLOCK PRINT BANNER ROUTINE
         REF      COCODE            * COC TABLES ROUTINE
         REF      COMPARE           * DUMP.VS.CORE COMPARE ROUTINE
         REF      CURRENT%USER      * DISPLAYS CURRENT USER IN DUMP
         REF      DISPSTK           * DISPLAY TSTACK ROUTINE
         REF      DO%SYMBOLS        * INITIALIZE SYMBOL MAP
         REF      ERROR%LOG         * ERROR LOG BUFFER ANALYSIS DISP.
         REF      F:PAT             * PATCH FILE INPUT DCB
         REF      FED:TAB
         REF      GETHIGH           * COLLECT INITIAL DATA ROUTIEN
         REF      GHTABLES          * GHOST JOB TABLES
         REF      GIVE:HELP         * LIST COMMANDS ROUTINE
         REF      INIT:MD           * INIT SYMBOL TABLE POINTERS
         REF      IODISPLAY         * I/O CHANNEL DISPLAY ROUTINE
         REF      JITS              * DISPLAY JITS PROCESSOR
         REF      JJITVP            * JITS VIRTUAL PAGE #
         REF      M:BI              * TAPE DUMP INPUT DCB
         REF      M:C               * READ PROCESSOR BANG CARD
         REF      M:EI              * DUMP INPUT DCB
         REF      M:EO              * TAPE DUMP OUTPUT DCB
         REF      M:LL              * BLANK LINE WRITING DCB
         REF      M:LO              * PRINT LINE WRITE DCB
         REF      M:OC              * TYPING DCB
         REF      M:SI              * COMMANDS READ THRU DCB
         REF      MASK              * SMASK COMMAND PROCESSOR
         REF      MD:CORE           * MONITOR ROOT DUMP ROUTINE
         REF      MD:SUBQ           * RESOURCE SUB-Q DISPLAY
         REF      MDDCB             * DCB ANALYSIS ROUTINE
         REF      MDTRAPS           * TRAPS/INTS DISPLAY
         REF      MPAGES            * MONITOR PAGE CHAINS
         REF      MPTABLES          * MULTI-PROCESSING TABLES
         REF      PAGEDISP          * DUMP PHYSICAL PAGE ROUTINE
         REF      PARTITIONS        * DISPLAY PARTITON TABLES
         REF      PHYMAP            * DISPLAY PHYSICAL PAGE MATRIX
         REF      PPAGES            * PROCESSOR PAGE CHAINS
         REF      PROCLIST          * PROC. INSWAP LIST
         REF      PROCS             * PROCESSOR TABLES ROUTINE
         REF      QFREELIST         * RUN FREE Q CHAIN ROUTINE
         REF      RA:TABL           * READ-AHEAD TABLES TOUTINE
         REF      RAT%TABLES        * RESOURCE TABLES ROUTINE
         REF      RBBREA            * ERROR RETURN FROM RBBAT RCVRY RD
         REF      RBTDISP           * RBT DISPLAY ROTIEN
         REF      RECOVERY%CONTEXT  * DUMP RECOVERY'S CORE IF TAPEDMP
         REF      REGS              * DISPLAY SCREECH REGISTERS
         REF      REPLACEMENT       * REPLACE LOC ROUTINE
         REF      RTPAGES           * REAL TIME PAGE CHAINS
         REF      RUN               * RUN PROCESSOR
         REF      SEARCH            * SEARCH PROCESSOR
         REF      SEGMAP            * PUT OUT CSECT MAP
         REF      SNOOP             * IN ANALZO6 OVERLAY
         REF      SPY
         REF      SLCPU             SLAVE CPU PAGE DISPLAY
         REF      STATES            * STATE CHAINS
         REF      SWAP              * SWAPPER TABLES ROUTINE
         REF      SWAPLIST          * LIST OUTSWAP USER TABLES
         REF      SYM:DISP          * OUT OUT CSECT/SYMBOL MAPS
         REF      SYM:SERCH         * SYMBOL SLASH ROUTINE
         REF      SYMBIONTS         * DISPLAY RBBAT RCVRY RECORDS
         REF      SYMBOLMAP         * PUT OUT SYMBOL MAP
         REF      SYMTABLS          * OUTPUT SYMBIONT TABLES ROUTINE
         REF      TPAGE             * TRAPPED PAGE ROUTINE
         REF      TPWP              * T.P. WORK PAGE DISPLAY
         REF      TRPAGE            * ALT ENTRY TO TPAGE
         REF      UID               * USER IDS ROUTINE
         REF      UPAGES            * USER PAGE CHAIN DISPLAY
         REF      USERS             * USER TABLE DISP ROUTINE
         REF      USERSLIST         * ROUTINE RUNS OUTSWAP LIST
         REF      VALTEXT           * VALUE RIGHT BRACKET ROUTINE
         REF      VIR:PAGE          * DUMP VIRTUALL PAGE ROUTINE
         REF      WHY               * LIST SCREECH CODE TEXT ROUTINE
         REF      XDELPGS           * DELTA/HANDLER PAGE CHAINS
       PAGE
*
*      THE FOLLOWING REFERENCES ARE SATISFIED FROM MONSTK AT
*      LOAD TIME
*
         REF      :BIG              * BIG SYSTEMS FLAG (A ONE)
         REF      CORE              * SIZE OF CORE AS SYSGENED
         REF      CORED             * SIZE OF PHYSICAL CORE
         REF      J:ACCN
         REF      J:UNAME
         REF      IOSPIN            * MAKE USER WAIT FOR I/O TO FINI.
         REF      J:JIT             * ADDRESS OF USER JOB INFO TABLE
         REF      J:AJIT          * ADDRS OF USER ADDITIONAL JIT
         REF      J:TCB             * PUSH DOWN STACK PROVIDED BY LDR..
         REF      JB:PRIV           * PRIV LEVEL SLOT IN J:JIT
         REF      JBUPVP          * FIRST USER PAGE VALUE
         REF      JBUPVPA           * FIRST USER POSSIBLE ADDRS
         REF      JOVVP           * OVERLAY'S FIRST PAGE #
         REF      JOVVPA          * OVERLAY'S FIRST WORD ADDRS
         REF      JX:CMAP           * ADDRS OF CMAP
         REF      JXBUFVP         * FIRST WINDOW PAGE VALUE
         REF      JXCMAP            * DISP TO CMAP IN JIT
         REF      MING              * KNOWN GHOSTS LEVEL FLAG
         REF      MONORG            * FIRST LOC ABOVE TRAPS CELL
         REF      MPATCH            * LOC OF PATCH AREA
         REF      MX:PPUT           * TOP OF MPATCH ADDRESS
         REF      RCVRCNT           * ID OF CURRENT DUMP FILE
         REF      SMUIS             * NUM OF USERS IN SYSTEM MAX
         REF      T:REG             * REPORT EVENT AND GIVEUP
         REF      TSTACK            * ADDRS OF THE TEMP STACK
         REF      UB:ACP            * USER S COMMAND PROCESSOR
         REF      UB:US             * USER STATE TABLE
         REF      UH:FLG            * USERS FLAGS TABLE
         REF      UH:FLG2           * SECOND SET OF USERS FLAGS
         REF      UX:JIT            * JIT PAGE TABLE
       PAGE
*
*      THE FOLLOWING EXTERNAL DEFINITIONS EXIST FOR THE OVERLAY
*      STRUCTURE OF ANLZ TO UTILIZE
*
         DEF      #OFREGS           * # OF REGS WE KNOW ABOUT
         DEF      #R16              * 16 BIT MASK
         DEF      #STATES           * LENGTH OF STATE TEXT TABLE
         DEF      ACCOUNT           * PLACE WHERE ACCN NAME STORED
         DEF      ACT:INST          * CONSTRUCTED TEXT OF INST
         DEF      ADDEFEND          * TOP OF SYMBOL TABLE
         DEF      ATMSG             * ALLOCATION TABLE TITLE LINE
         DEF      AVR%MSG           * AVR TABLES TITLE LINE
         DEF      BATOQ:TIT         *
         DEF      BATIQ:TIT         *
         DEF      BADCOM            * BAD COMMAND COMPLAINER
         DEF      BALL              * DOING ALL FLAG
         DEF      BATFLAG           * DATA X'04000000'
         DEF      BIGBUF            * POINTS TO SYMBOL TABLE BUFFER
         DEF      BLANK1            * ONE BLANK LINE ROUTINE
         DEF      BLNKBUF           * RESETS BUFFER POINTERS ROUTINE
         DEF      BMBB              * BLANK/MSG/BUFOUT/BLANK ROUTINE
         DEF      BRKHIT            * >>0 SAYS TO IGNORE BREAK KEY
         DEF      BUFOUT            * PRINTS ENTIRE BUFFER ROUTINE
         DEF      BUFLIM            * BUFFER CLM LIMITS PAIR
         DEF      BUFSIZ            * LP FPT SIZE BUCKET
         DEF      CITSMSG           * CIT TABLES TITLE LINE
         DEF      CLOSEDCB          * CLOSE DCB IN R7 ROUTINE
         DEF      CLOSEIT           * CLOSE DCB ROUTINE
         DEF      CLOSESTADD        * SYMBOL FETCH CLOSEST ADDRESS
         DEF      CLOSESTSYM        * DITTO BUT SYMBOL ADDRS
         DEF      CMMSG             * RBBAT TITLE
         DEF      COCMSG            * COC TABLES TITLE LINE
         DEF      COLPT             * CURRENT COLUMN POINTER-1 CELL
         DEF      CPOINTER          * CSECT TABLE POINTER
         DEF      CPOOLMSG          * CPOOL DISP TITLE LINE
         DEF      CUJITMSG          * CURRENT USER DISP TITLE LINE
         DEF      CUN               * COPY OF S:CUN
         DEF      CURADRSS          * CLM PAIR OF CURRENT ADDRS IN BUF
         DEF      CURR:LOC          * CURRENT VALUE FROM THE STACK
         DEF      DATA              * ANLZ'S PURE DATA CONTROL SECTI
         DEF      DATA:AREA         * CLM PAIR FOR USER DATA AREA
         DEF      DATAFLAG          * SET SAYS TO DUMP RAW DATA
         DEF      DCTMSG1           * ADDITIONAL DCT TABLES TITLE LINE
         DEF      DCTSMSG           * DCT TABLES TITLE LINE
         DEF      DDMSG             *
         DEF      DECIMAL           * HEX->DECIMAL ROUTINE
         DEF      DELPGS            * DELTAS PAGES TITLE LINE
         DEF      DISP:PP           * ROUTINE TO DISP PAGE INFO
         DEF      DUMP:DIR          * RELATIVE DUMP ADDRESSING MODE
         DEF      DUMPSOME          * MEMORY DUMP ROUTINE
         DEF      EHLP:TITLE        * HELP LIST TITLE LINE
         DEF      ELOG%HDG1         * ERROR LOG DISP TITLE LINE
         DEF      FEB:TIT
         DEF      FDB:TIT
         DEF      FIELD#            * CONTAINS CUR FIELD NUMBER
         DEF      FIELD1            * LOC OF FIELD1
         DEF      FIELD2            * COMMAND FIELD TWO BUCKET
         DEF      FIELD3            * COMMAND FIELD THREE
         DEF      FIELDS            * VECTOR TABLE OF FIELD ADDRESSES
         DEF      FILENAME          * GET FILE NAME ROUTINE
         DEF      FILETEXT          * PLACE WHERE FILE NAME STORED
         DEF      FINDER            * SYMBOL LOCATOR TABLE
         DEF      FIRSTPG           * FIRST ALLOCATABLE PAGE CELL
         DEF      FLDCNTS           * TABLE OF FIELD LENGTHS
         DEF      FPGS              * M:FP FPT SHELL
         DEF      FREEIT            * FREE VP FPT
         DEF      FREEQS            * FREE QUEUE CHAIN TITLE LINE
         DEF      GETADDR           * ROUTINE TO FETCH ADDRS IN R14
         DEF      GETHEX            * GET REQUESTED FIELD ROUTINE
         DEF      GETIT             * RESTORE VP FPT
         DEF      GETLIST           * RETURN NEXT LIST ROUTINE
         DEF      GETONE            * GET ONE PAGE M:GP FPT
         DEF      GET1ADDR          * READ ONE PAGE NUMBER IN R1
         DEF      GHST:STRT         * CLM PAIR FOR USERS MEMORY
         DEF      GHTITLE           * TITLE FOR GHOST JOB DISPLAY
         DEF      GJOB%FLAG         * SET SAYS RUNNING AS A GHOST
         DEF      GPGS              * M:GP FPT
         DEF      HDMSG             * ANLZ'S TITLE LINE FOR LO
         DEF      IMONLOC           * 17 BITS FROM INST:SAVE
         DEF      INITIAL           * ANLZ'S START ADDRESS
         DEF      INST:SAVE         * CONTENTS OF ADDRS IN TSTACK
         DEF      IODISMSG          * I/O DISPLAY TITLE LINE
         DEF      IOQSMSG           * IOQ TABLES TITLE LINE
         DEF      ISJITMSG          * INSWAP USER TITLE LINE
         DEF      ISUN              * COPY OF S:ISUN
         DEF      IVMSG
         DEF      J:PAGE            * CURNT JIT PHYSICAL PAGE #
         DEF      JITBUF            * POINTS TO JIT INPUT BUF
         DEF      JITBURST          * DUMPING A JIT FLAG
         DEF      JITMSG            * MONITOR JIT TITLE LINE
         DEF      JITPAGE           * CONTAINS JIT PAGE #
         DEF      JITSTAT           * STATUS OF JIT READ I/O
         DEF      LAST:LINE         * LAST RELATIVE LOC OF A REG
         DEF      LASTLOC           * LAST LOC DUMPED OUT
         DEF      LASTSVTF          * LAST ACCESSED SYMBOL VALUE
         DEF      LASTITEL
         DEF      LISTCHARS         * LIST OF PRINTABLE CHARS
         DEF      LEGCORAD          * LEGAL CORE ADDRS CLM PAIR
         DEF      LOCJIT            * LOCATE OUT OF CORE JIT
         DEF      LOCLOC            * GATHER LOC-LOC FIELDS
         DEF      LOOKING           * SET SAYS SUPPRESS ERROR MSGS
         DEF      LPFLAG            * SET SAYS WRITING THE LP
         DEF      MACHINE           * FOR USE IN BIF PROC
         DEF      MAP:USER          * MAP ONTO REQUESTED USER
         DEF      MAPFLAG           * SET SAYS WE'RE RUNNING MAPPED
         DEF      MB                * MSG/BUFOUT ROUTINE
         DEF      MBB               * MSG/BUFOUT/BLANK ROUTINE
         DEF      MJITMSG           * MONITOR JIT HEADING
         DEF      MONFLAG           * SET SAYS LOOKING AT REAL CORE FLAG
         DEF      MPGMSG            * MONITOR PAGE CHAIN TITLE LINE
         DEF      MPTITLE           * MULTI-PROCESSING TITLE LINE
         DEF      MRMSG             * MONITOR ROOT TITLE LINE
         DEF      MSG               * PLACES TEXTC MSG STRINGS
         DEF      MSG%OUT           * SAME AS BMBB
         DEF      MSG1              * PLACES TEXT MSG STRINGS
         DEF      MTB               * MSG/TRANS/BUFOUT ROUTINE
         DEF      MTBB              * MSG/TRANS/BUFOUT/BLANK ROUTINE
         DEF      NEXTLOC           * GET 'NEXT' FIELD PLEASE
         DEF      NO:CORE           * SET SAYS USER HAS NO CORE
         DEF      NOFILMSG          * 'FILE NOT OPEN' MESSAGE
         DEF      NOGOT             * PRIV LOW ROUTINE
         DEF      NOSADPAGE         * CANT CVM COMPLAINER ROUTINE
         DEF      NOTCOM            * COMMAND IS NOT RIGHT
         DEF      NOTRACE           * 'IT DOENST EXIST' ROUTINE
         DEF      NULLPAGE          * NMPC/FMPC CLM PAIR
         DEF      OBUF              * PRINT BUFFER FOR ANALZ
         DEF      ODDROW            * SIZE OF ODD ROW IN PAGE MATRIX
         DEF      OLDPAGE           * LAST PHYSICAL PAGE # GOTTEN
         DEF      OLDPAGEM          * LAST READ PAGE (VIRTUAL )
         DEF      OSJITMSG          * OUTSWAP USERS TITLE LINE
         DEF      OUTUSERS          * OUT OF CORE USERS TITLE LINE
         DEF      PAGE:ERROR        * SET SAYS ERROR ON THIS PAGE
         DEF      PAGEBUF           * POINTS TO DUMP INPUT BUFFERS
         DEF      PAGERR0           * I/O ERROR COMPLAINER
         DEF      PAGETABLE         * BUILDS PHYSICAL MEMORY MATRIX
         DEF      PAGLIMS           * CLM PAIR OF VALID PAGE #
         DEF      PARTABMSG         * PARTITIONS TITLE LINE
         DEF      PARTRES           * PARTITION RESOURCE LIMIT TITLE MSG
         DEF      PASS              * PLACE WHERE PASS NAME STORED
         DEF      PATCH             * ANLZ'S PATCH AREA
         DEF      PATCHLOC          * MPATCH CLM PAIR
         DEF      PG:ARRAY          * POINTS TO PAGE MATRIX BUFFER
         DEF      PG:MODE           * PAGE OWNER'S CODE
         DEF      PGMAPMS           * PHYSICAL PAGE DISP TITLE LINE
         DEF      PP                * ANLZ'S PURE PROCEDURE START
         DEF      PPGMSG            * PROCSSOR PAGE CHAIN TITLE LINE
         DEF      PREMEM            * PAGE REMEMBER ROUTINE
         DEF      PROCNAME          * TEMP STOREAGE FOR NAMES(7 BYTES)
         DEF      PROTMSG           * PROCESSOR TABLE TITLE LINE
         DEF      PTEMPC            * TEMP PAGE CHAIN TITLE LINE
         DEF      PTR               * CURRENT COLUMN POINTER CELL
         DEF      PUSH:FLAG         * SET IF A PUSHALL FOUND
         DEF      PUSHMSG           * SEND MSG/BUFOUT GO TO SCANNER
         DEF      R:STITLE          * RESOUCE SUB-Q TITLE LINE
         DEF      RA:TITE           * READ-AHEAD TITLE LINE
         DEF      RANGE             * RANGE OF ADDRS FOR CURNT SYMBOL
         DEF      RATMSG            * RESOURCE ALLOCATION TITLE LINE
         DEF      RBTITLE           * RBT DISPLAY TITLE LINE
         DEF      RBTBUFTM          * RBT BUFFER TITLE MSG
         DEF      RCVLIMITS         * CLM PAIR OF RCVRY CLOBBERED CORE
         DEF      RCVRY%CXT%MSG     * TITLE LINE FOR SAME
         DEF      RE:PNT            * CLEARS ADDRESS CLM PAIR
         DEF      REG%FLAG          * HIT A REG FLAG
         DEF      REG:REG           *
         DEF      REGFLAG           * INDICATES A REG WAS FOUND
         DEF      REGIA             * REG VALID ADDRESSES
         DEF      REGMSG            * REGISTER DISPLAY TITLE LINE
         DEF      REPFLAG           * SET SAYS EQUAL FOUND IN COMMAND
         DEF      RERR1             * PUTS OUT I/O ERROR MSG
         DEF      RES:BUF           * RESTORE CVM WINDOWS ROUTINE
         DEF      RES:JIT           * RESTORE JIT ROUTINE
         DEF      RES:JIT5          * 'NO SUCH USER' ROUTINE
         DEF      RESETM            * SUPER CLEAR OF ADDRESS CLM PAIR
         DEF      ROWCNT            * COUNT OF ROW IN PAGE MATRIX
         DEF      RTHDR2            * RT PAGES DUMP TITLE LINE
         DEF      RTPMSG            * REAL TIME PAGE CHAIN TITLE LINE
         DEF      RUN%MODE          * IDENTIFIES TYPE OF RUN MODE
         DEF      SADCAL1           * CVM FPT FOR ANALZO4
         DEF      SCANNER           * COMMAND PARSER ROUTINE
         DEF      SCREECH%CODE      * SCREECH CODE FROM THE DUMP
         DEF      SCR24:29          * 24->29 CLM PAIR FOR SCREECHES
         DEF      SCR:CNT           * # OF SPECIAL SCREECHES
         DEF      SDMSG             * FOR RBBAT DUMPS
         DEF      SEGMTIT           * SEG MAP TITLE LINE
         DEF      SETR6             * LOADS STATE TEXT MSG ADDRESS
         DEF      SLCPUTIT          TITLE LINE FOR SLAVE CPU PAGE DISP
         DEF      SORTALBE          * ADDRESS OF SORT BUFFER
         DEF      SPACES            * SPACES TO VALUE IN R1
         DEF      SPACE2            * TWO SPACES ROUTINE
         DEF      SPECIFIC%USER%DCBS * SET SAYS DO ONE USER DCBS
         DEF      SPGMSG            * SWAPPER PAGE CHAIN TITLE LINE
         DEF      SPOOLMSG          * SPOOL DISP TITLE LINE
         DEF      STACK             * ANLZ'S PUSH DOWN STACK
         DEF      STCMSG            * STATE CHAINS TITLE LINE
         DEF      STK:CNT           * LENGTH OF THE USER'S TTSTACK
         DEF      STKSIZE         * SIZE OF MONSTK RECORD AS READ
         DEF      SWAP:TIT          * PROC INSWAP TITLE LINE
         DEF      SWAPMSG           * SWAPPER TITLE LINE
         DEF      SYM:LIMS          * SYMBOL LIMITS CLM PAIR
         DEF      SYMBOL:FLAG       * SET SAYS WE GOT SYMBOLS NOW
         DEF      SYMBOLMS          * SYMBOL MAP TITLE LINE
         DEF      SYMCNT            * # OF SYMBOLS IN TABLE
         DEF      SYMCNT1           * COPY OF SYMCNT
         DEF      SYMTAB            *
         DEF      SYMTMSG           * SYMBIONT TABLES TITLE LINE
         DEF      TAP%DMP           * DUMP WAS FROM A TAPE FLAG
         DEF      TATTLE            * TELLS OPERATOR ABOUT CORE CHANGE
         DEF      TBB               * TRANSSZ/BUFOUT/BLANK1 ROUTINE
         DEF      TCONT             * TABLE OF CONTENTS ROUTINE
         DEF      TITEL             * WRITE TITLE AND NEW PAGE ROUTINE
         DEF      TPHDR             * TRAPPED PAGE TITLE LINE
         DEF      TPHDR2            * TP PAGES DUMP TITLE LINE
         DEF      TPMSG             * TRANS/PROC. TITLE LINE
         DEF      TRACE             * SET SAYS TO WAIT FOR USERINSWAP
         DEF      TRANS           * HEX->EBCDIC WITH LEAD ZEROES
         DEF      TRANSSZ           * HEX->EBCDIC W/O LEAD ZEROES
         DEF      TRANTAB           * HEX->EBCDIC TRANS TABLE
         DEF      TRAP:SCR          * TYPE OF SCREECH SAVE CELL
         DEF      TRMSG             * TRAPPED PAGE TITLE LINE
         DEF      TSIZE             *
         DEF      TSMSGM            * MONITOR TSTACK TITLE LINE
         DEF      TSMSG1            * USER TSTACK TITLE LINE
         DEF      TST:LIMS          * CLM PAIR OF TSTACK VALID ADDRS
         DEF      UCBUF
         DEF      UCTITLE           * .NE.ZERO SAYS NO NEW PAGE FOR UC
         DEF      UHFLGLOC          * MAP WINDOW FOR UH:FLG
         DEF      UHFLGR1           *
         DEF      ULSTSIZE          * LENGTH OF USERLIST TABLE
         DEF      UNMAP             * RESETS TO REAL CORE TRANSLATION
         DEF      UNOWNMS           * 'UNOWNED PAGE' TITLE LINE
         DEF      UPGMSG            * USER PAGE CHAINS TITLE LINE
         DEF      USER              * CURRENT USER NUM WE'RE ON
         DEF      USER:MODE         * USERS JOB ORIGIN
         DEF      USERIDMS          * USER ID TITLE LINE
         DEF      USERLIMS          * VALID USER # CLM PAIR
         DEF      USERLIST          * BYTE TABLE SMUIS LONG
         DEF      USERLTIT          * OUTSWAP USER TITLE LINE
         DEF      USMSG             * USER TABLES TITLE LINE
         DEF      USRMAP            * POINTS TO MAP TABLE
         DEF      USRTMSG           * USER TABLES TITLE LINE
         DEF      U2:TITE           * ADDITIONAL USER TABLES TITLE LINE
         DEF      VIRPAGE1          * OTHER WORD OF THECVM FPT FOR O4
         DEF      WRITBUF           * SIZE SLOT IN LP WRIT FPT
         DEF      WRITESYMS         * SET SAYS TO WRITE OUT SYMBOL TABLE
         DEF      X1FF              * DATA X'000001FF'
         DEF      ZEROS             * 16 ZEROS FOR SUPPRESSING FIELDS
         PAGE
*
*        DECLARE REGISTER CONVENTIONS
*
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
*
*        DECLARE CONTROL SECTION NAMES FOR CONTROL SECTION SWITCHING
*        BETWEEN PROCEDURE AND DATA INTERNALLY.
*
         CSECT    1
PP       EQU      %                 PURE PROCEDURE CONTROL SECTION
#R16     DATA     X'FFFF'           16 BIT MASK FOR HALF WORDS
*
*        DECLARE EXTERNAL TITLE LINES FOR OVERLAY ROUTINES
*
SYMTAB   TEXTC    'RBBAT RECOVERY DATA:'
TPHDR    TEXTC    'TRANSACTION PROCESSING TABLES:'
SEGMTIT  TEXTC    'CONTROL SECTION MAP:'
PARTRES  TEXTC    'PARTITION RESOURCE LIMITS:'
PARTABMSG TEXTC   'PARTITION TABLES:'
RBTITLE  TEXTC    'REMOTE PROCESSING TABLES:'
USERLTIT TEXTC    'USER OUTSWAP TABLES:'
SWAP:TIT TEXTC    'PROCESSOR INSWAP TABLES:'
ATMSG    TEXTC    'DISC ALLOCATION TABLES:'
RA:TITE  TEXTC    'READ-AHEAD TABLES:'
RCVRY%CXT%MSG TEXTC 'RECOVERY CONTEXT AREA:'
SWAPMSG  TEXTC    'SWAPPER/SWAP SCHEDULER TABLES:'
PTEMPC   TEXTC    'PROCESSOR TEMP PAGE CHAINS:'
SYMBOLMS TEXTC    'SYMBOL MAP:'
COCMSG   TEXTC    'COC TABLES:'
U2:TITE  TEXTC    'ADDITIONAL USER TABLES:'
USRTMSG  TEXTC    'USER TABLES:'
PROTMSG  TEXTC    'PROCESSOR TABLES:'
TSMSG1   TEXTC    'CONTENTS OF TSTACK:'
TSMSGM   TEXTC    'CONTENTS OF MONITOR TSTACK:'
FREEQS   TEXTC    'FREE IOQ CHAIN:'
EHLP:TITLE TEXTC  'ANALYZE COMMANDS/OPTIONS:'
IODISMSG TEXTC    'I/O CHANNEL/DEVICE STATES:'
MRMSG    TEXTC    'MONITOR ROOT:'
DCTSMSG  TEXTC    'DEVICE CONTROL TABLES:'
CITSMSG  TEXTC    'CHANNEL INFORMATION TABLES:'
TPHDR2   TEXTC    'TRANSACTION PROCESSING WORK PAGES:'
RTHDR2   TEXTC    'REAL-TIME WORK PAGES:'
FEB:TIT  TEXTC    'FECP DEVICE TABLES:'
FDB:TIT  TEXTC    'FECP TABLES:'
CPOOLMSG TEXTC    'ACTIVE CPOOLS:'
SPOOLMSG TEXTC    'ACTIVE SPOOLS:'
IOQSMSG  TEXTC    'I/O QUEUEING TABLES:'
SYMTMSG  TEXTC    'OUTPUT SYMBIONT TABLES:'
TRMSG    TEXTC    'TRAPS/INTERRUPTS:'
USMSG    TEXTC    'USER DCB ANALYSIS:'
ELOG%HDG1 TEXTC   'ERROR LOG BUFFERS:'
RATMSG   TEXTC    'RESOURCE ALLOCATION TABLES:'
AVR%MSG  TEXTC    'VOLUME TABLES:'
R:STITLE TEXTC    'RESOURCE WAIT QUEUES:'
RBTBUFTM TEXTC    'REMOTE BATCH BUFFERS: '
DCTMSG1  TEXTC    'ADDITIONAL DCT TABLES:'
MPTITLE  TEXTC    'MULTI-PROCESSING TABLES:'
GHTITLE  TEXTC    'GHOST JOB TABLES:'
SLCPUTIT TEXTC    'SLAVE CPU PRIVATE PAGES:'
BATOQ:TIT TEXTC   'BATCH OUTPUT QUEUE:'
BATIQ:TIT TEXTC   'BATCH INPUT QUEUE:'
CMMSG    TEXTC    'RBBAT COMMUNICATION BUFFERS:'
IVMSG    TEXTC    'RBBAT ENVIRONMENT:'
DDMSG    TEXTC    'RBBAT DYNAMIC DATA:'
SDMSG    TEXTC    'RBBAT STATIC DATA:'
*
         PAGE
*
*        DECLARE DATA SECTION OF THE ROOT AND GENERATE STATIC
*        DATA FOR USE INTERNALLY.
*
         CSECT    00
DATA     EQU      %                 PURE DATA CONTROL SECTION
*
*
         BOUND    8
BIGBUF   DATA     0                 ADDRESS OF SYMBOL TABLE
ADDEFEND DATA     0                 TOP OF SYMBOL TABLE
*
DSTACK   EQU      %
STACK    DATA     0,0               PUSH DOWN STACK POINTERS
*
BUFLIM   EQU      %
JITBUF   DATA     0,0
TRAP:SCR DATA     0,0               TYPE OF SCREECH/SUB-CODE
CURADRSS DATA     -1,-1             CURRENT RANGE ADDRS IN BUFFERS
LEGCORAD DATA     0,CORE-1          VALID ADDRESSES IN SYSTEM
DATA:AREA DATA    J:JIT,JBUPVPA-1   USER MEMORY NOT IN USE BY USER
SADCAL1  GEN,8,24 7,0               AN ADDITIONAL SAD CAL FPT
VIRPAGE1 DATA     0                 FOR USE BY ANALZO4
*
MACHINE  DATA     0                 COPY OF C%CPU
*
LASTSVTF DATA     0                 LAST ACCESSED SYMBOL VAUE
*
STK:CNT  DATA     X'7A'             LENGTH OF TSTACK (INITIAL)
*
CURR:LOC DATA     0                 CURRENT INDEX INTO TSTACK
*
USER:MODE DATA    0                 TYPE OF USER WE'RE LOOKING AT
*
LASTITEL DATA     0                 LAST TITLE LINE ADDRESS
*
REGFLAG  DATA     0                 SET IF WE FIND A REG ENVIRONMENT
*
LAST:LINE DATA    0                 LAST RELATIVE LOC OF A REG
*
REG:REG  DATA     0
*
INST:SAVE DATA    00                ACTUAL INST FROM ADDRS IN TSTACK
*
IMONLOC  DATA     0                 17 BITS FROM INST:SAVE
*
PUSH:FLAG DATA    0                 SET IF WE FIND A PUSHALL IN STACK
*
*
NO:CORE  DATA     0                 STATUS OF USER / INCORE OR NOT
*
         BOUND    8
RANGE    DATA     0,0               CURRENT RANGE OF ADDRESSES FOR SYMBOL
*
GHST:STRT DATA    0,0               USERS LIMIT IN MEMORY
*
TST:LIMS DATA     TSTACK,TSTACK+130 LENGTH OF TSTACK VALID ADDRESSES
*
ACT:INST DATA     0,0               TEMP SAVE CELLS
*
REGIA    DATA     0,T:REG,IOSPIN+7  REGS WE CAN TALK ABOUT
*
#OFREGS  EQU      %-REGIA-1
*
         BOUND    8
PTR      DATA     0                 POINTER TO CURRENT COLUMN IN OBUF
COLPT    DATA     0                 PTR-1 VALUE
SRETURN  DATA     0,0,0,0,0,0       INTERMEDIATE STOREAGE
*
TPTR     DATA     0                 POINTS TO TRANSLATE COLUMN #
TYP:BUF  DATA,1   0,64,64,64        TYPE BUFFER HEADER FOR OBUF
*
         BOUND    8
OBUF     EQU      %
         DO1      33                GENERATE LENGTH OF PRINT BUFFER
         TEXT     ' '
*
*
OBUFSIZ  EQU      %-OBUF            GENERATE LENGTH SYMBOL
*
CPOINTER DATA     0                 POINTS TO CSECT TABLE
*
FINDER   DATA     0                 POINTS TO SYMBOL TABLE FINDER
*
LIST1    DATA     0
*
LIST2    DATA     0
*
         PAGE
         USECT    PP
*F*
*F*
*F*    NAME:           INITIAL
*F*
*F*    PURPOSE:        THE LOAD MODULE'S START ADDRESS.
*F*
*F*    DESCRIPTION:    DETERMINE IF RUNNING AS GHOST/BATCH/ONLINE
*F*                    AND SET UP POINTERS ACCORDINGLY.
*F*
INITIAL  EQU      %
         LCFI     2
         LM,R0    *J:TCB            PICK UP THE STACK POINTERS
         STM,R0   STACK             AND SAVE THEM TO USE HERE
         LW,R1    J:JIT             GET A NEG NUM (..MAYBE...)
         BLZ      GOT%MODE          WE APPEAR TO BE ONLINE
         LI,R1    0                 ASSUME WE'RE A GHOST...
         LC       J:JIT             GET C'S AGAIN
         BCR,4    B%MODE            NOT A GHOST
         MTW,1    GJOB%FLAG         KICK GHOST MODE FLAG
         B        GOT%MODE          AND SET OTHER FLAG
B%MODE   BIR,R1   %+1               SET R1 PLUS ONE IF BATCH
GOT%MODE NOP      %                 ALLOW A PATCH HERE
         STW,R1   RUN%MODE          SAVE FOR FUTURE REFERENCE                A00
         CAL1,8   GETONE            GET ONE PAGE FOR JIT READING
         BCS,8    NODATA:BUF        ****DISASTER***
         STW,R9   JITBUF            REMEMBER ADDRESS
         CAL1,8   GETTWO
         BCS,8    NODATA:BUF        **DISASTER**
         STW,9    PAGEBUF         WORKING BUFFER
         AI,9     511
         STW,9    BUFLIM+1
         AI,R9    1                 BUMP TO FIRST LOC IN SECOND PAGE
         STW,R9   PAGEBUF2          SAVE SECOND PAGE READ'S BUFFER
         CAL1,8   GETONE            GET A PAGE FOR SPECIAL TABLES
         BCS,8    NODATA:BUF        CANT RUN
         STW,R9   CPOINTER          SAVE CSECT TABLE ADDRESS
         AI,R9    160               RESERVE 160 WORDS FOR IT
         STW,R9   FINDER            SAVE SYMBOL LOCATOR TABLE ADDRS
         AI,R9    160               RESERVE 160 WORDS FOR IT
         STW,R9   LIST1             SAVE TITLE TABLE ADDRESS
         AI,R9    91                ADVANCE TO
         STW,R9   LIST2             LAST TABLE THAT IS NEEDED
         LI,R0    0                 NOW LETS INIT  THE TABLES  TO
         LI,R1    -512              ALL ZEROES
         LW,R2    CPOINTER          BASE OF TABLE
         AI,R2    512               CALCULATE TOP OF PAGE
         STW,R0   *R2,R1            ZIP THE WHOLE PAGE
         BIR,R1   %-1
         LI,R1    90                AND THEN SET
         STW,R1   *LIST1            TITLE TABLE COUNTERS
         STW,R1   *LIST2            TO INITIAL VALUE
         CAL1,8   GETONE            GET ANOTHER PAGE FOR MAP TABLE
         BCS,8    NODATA:BUF        ***DISASTER***
         STW,R9   USRMAP            SAVE ADDRESS OF MAP TABLE
         AI,R9    128
         STW,R9   USERLIST
         BAL,R0   UNMAP             INITIATILIZE MY MAP
         CAL1,8   TRPCONTROL        TAKE TRAP CONTROL
         CAL1,1   PROMPTX           SET UP PROMPT CHAR FOR ONLINE/GHST
         CAL1,8   BRKFPT            TAKE BREAK CONTROL
         LI,R14   CORED             NOW LETS PICK UP MACHINE SIZE IN WORDS
         BAL,R0   GETADDR
         STW,R14  LEGCORAD+1        SAVED FOR LATER
         MTW,0    RUN%MODE          ARE WE ON-LINE                           A00
         BLZ      INIT:UC           YES                                      A00
         BAL,1    OPNTOLP           OPEN LO TO LINE PRINTER
         MTW,0    RUN%MODE                                                   A00
         BEZ      LASTCRASH         WE'RE A GHOST                            A00
         B        BAT:MODE          RUNNING IN BATCH
INIT:UC  EQU      %
         BAL,R1   UCLO              SET UP M:LO
GO:ANLZ  LI,R1    ANLZMSG           SALUTATION MESSAGE
         BAL,0    MSG
         BAL,0    BUFOUT
         LI,R1    SCANNER           RETURN POINT
         B        GETHIGH           FOR ROUTINE
         PAGE
*F*
*F*      NAME:    NODATA:BUF
*F*
*F*      PURPOSE:
*F*               TO TELL THE USER OF ANLZ THAT WE COULD NOT
*F*               ACQUIRE THE MINIMUM SET OF PAGES TO RUN ANLZ
*F*               DISPLAYS.
*F*
*F*      DESCRIPTION:
*F*               AT INITIAL WE ATTEMPTED TO GET THE MINIMUM SET
*F*               OF PAGES TO RUN ANLZ AND COULD NOT . THIS ROUTINE
*F*               WILL PUT OUT AN ERROR MSG AND ABORT THE RUN.
*F*
*
NODATA:BUF LI,R1  DATAB:MSG
         BAL,R0   MSG%OUT
         CAL1,9   3               ABORT THE RUN
         PAGE
*
*        TEXTS TO PRINT INITIALLY / LO HEADER (TITLE) LINE
*
DATAB:MSG TEXTC 'CAN''T GET DUMP INPUT BUFFERS'
*
*
ANLZMSG  EQU      %
         TEXTC    'ANLZ D00 HERE'
         USECT    DATA
RUN%MODE DATA     'IBAD'            -1=ONLINE,0=GHOST,+1=BATCH               A00
HDMSG    EQU      %
         TEXTC    'XXX',;           0 = VERSION TEXT
                  '    ',;          1 =
                  '    ',;          2 = DATE
                  '    ',;          3 = DATE
                  '    ',;          4
                  '    ',;          5
                  '    ',;          6
                  '    ',;          7
                  '*** ',;          8
                  '    ',;          9
                  '    ',;          10
                  ' -- ',;          11
                  'SCRE',;          12
                  'ECH ',;          13
                  'CODE',;          14
                  ' XX-',;          15
                  'XX  ',;          16
                  ' ***',;          17
                  '    ',;          18
                  '  MO',;          19
                  'NDMP',;          20
                  '    ',;          21
                  '    ',;          22
                  'PAGE',;          23
                  '    '            24 AND FINAL WORD OF HEADER
*
GJOB%FLAG  DATA   0                 WE SET TO 1 IF A GJOB TYPE GHOST         A00
         USECT    PP
MDP%MSG TEXTC 'ANLZ: ENTER COMMAND, N/L SAYS TO DO ALL < '
         PAGE
*
*        REMEMBER PAGE # IN R4 IN TABLE 'USERLIST'
*
PREMEM   EQU      %
         PSW,R3   STACK
         LOAD,R3  *USERLIST         CURRENT LENGTH OF LIST
         AI,R3    1                 BUMP
         STORE,R4 *USERLIST,R3      REMEMBER THIS PAGE #
         STORE,R3 *USERLIST         REMEMBER NEW LENGTH OF LIST
         PLW,R3   STACK
         B        *R0               AND RETURN
         PAGE
*
*        THIS IS THE 'INPUT' PROCESSOR
*
*        THIS ROUTINE WILL EXTRACT FIELD # 2 OF THE COMMAND
*        AND DISPATCH THE PROPER ROUTINE
*
*        OPTION                   RESULT
*        -----------              ------------------------------
*        9T                       LABEL TAPE ROUTINE FOR DUMP TAPE
*        BT                       ......DITTO......
*        TA(PE)                   ..DITTO..BUT ASK FOR TAPE TYPE
*        LA(ST)                   SEE WHAT LAST MONDMP FILE IS/OPEN IT
*        CP(VDMP)                 OPEN THE CPVDMP FILE (FILE THAT
*                                 (ANLZ WRITES FROM THE TAPE DUMP).
*        0 THRU 7                 OPEN SPECIFIED MONDMP FILE NUMBER
*                                 (NOTE THAT YOU CAN SPECIFIY --
*                                 (WHAT ACCOUNT IT IS IN).
*
INPUT    EQU      %
         BAL,0    CLOSEIT           INSURE M:EI IS CLOSED
         BAL,R0   RES:BUF           RESTORE THE BUFFERS
         LH,R1    FIELD2            GET OPTION
         LI,R2    #INPUTS           MAX LOOP
         CH,R1    INPUTS,R2         FIND
         BE       INP:VEC,R2        A MATCH
         BDR,R2   %-2
INP:VEC  B        SPECFIL           ASSUME SPECIFIED MONDUMP #
         DO1      2
         B        TYP:SPEC          SPECIFIED LABEL TAPE TYPE
         B        LABEL%TAPE        GO FIND OUT THE TYPE
         B        NOT%GJOB          GET IN AT THAT POINT
         B        OPNUTSD           CP5DUMP FILE
INPUTS   DATA,2   '  '
         DATA,2   '9T'
         DATA,2   'BT'
         DATA,2   'TA'
         DATA,2   'LA'
         DATA,2   'CP'
#INPUTS  EQU      HA(%)-HA(INPUTS)-1
         BOUND    4
*
*        TAKE TYPE SPECIFIED AND SHOVE INTO OPEN FPT
*
TYP:SPEC AND,R1   #R16              DROP SIGN EXTENSION
         STW,R1   TAPE:TYP          AND PUT IT IN OPEN FPT
         B        LABEL%TAPE        GO TRY AND USE IT....
         PAGE
*
*        RUNNING IN BATCH ALL PROCESSORS HAVE THE
*        OBLIGATION TO READ ONE BANG CARD THRU THE
*        M:C DCB, HERES WHERE ANALYZE DOES IT.
*
BAT:MODE EQU      %
         CAL1,1   READCDEV          READ THAT STUPID BANG CARD
         BAL,R1   GETHIGH           INITIALIZE POINTERS
         LB,1     UCBUF             GET FIRST BYTE OF COMMAND
         CI,1     X'40'             RUNNING VIA 'RUN' LMN...
         BNE      SCANEP            NOPE,START OFF
         B        SCANNER
         PAGE
*
*        IF WE GET HERE - ANALYZE HAS TRAPPED
*
TRAPPED  EQU      %
         LW,R5    TRAP:RET          PSW0 TO RETURN TO....
         XW,R5    0,R1              TELL CP-V WHERE TO GO TO.
         CAL1,3   %+1
         DATA     0,0,0
         TEXT     'TRAPPED'
         NOP      0
         B        %+1
         CAL1,9   5                 RETURN TO THE SCANNER
TRAP:RET GEN,8,4,20   0,12,SCANNER
         PAGE
*
*        OPEN THE NAMED CRASH FILE (IE; MONDUMP(1)..(2)
*        ET CETERA...
*
*
SPECFIL  EQU      %
         LI,1     1
         BAL,0    GETHEX
         CLM,2    NUMERAL
         BCS,9    BADCOM          NOT A NUMBER
         LB,1     LIST,2
         STB,R1   GHMSG+5           PUT THE # INTO OTHER MSG
         LI,2     7
         STB,1    PATNAME,2
         STB,R1   HDMSG+21          STORE MONDMP # IN HEADER MSG
         MTW,0    FIELD3            WAS ACCN# SPECIFIED
         BEZ      SPECFIL1          DEFAULT ACCOUNT NUMBER
         LD,2     BLANKS
         STD,2    PATACN            IT OUT
         LI,R3    8                 MAX CHARACTERS
         LI,R2    0
         LB,R1    FIELD3,R2         MOVE ACCOUNT # TO FPT
         BEZ      CRASH1            ALL DONE
         STB,R1   PATACN,R2         STORE IT
         AI,R2    1
         BDR,R3   %-4
         B        CRASH1            AND OPEN FILE
SPECFIL1 EQU      %
         LCFI     2
         LM,R2    :SYSACN           GET DEFAULT ACCOUNT NUMBER
         STM,R2   PATACN            AND STORE INTO FPT FOR OPENING
         B        CRASH1
         PAGE
*
*        OPENS TO UTSDUMP
*
OPNUTSD  EQU      %
         LI,R2    OPNFPT10          LEAVE A RECORD OF IT
         STW,R2   FILTYP            FOR BLOCK PRINTING
         LI,R1    0                 INDEX TO USE AND
         B        CRASH11           MERGEUP
         PAGE
*
*        ROUTINE TO PICK UP THE NUMBER OF THE CURRENT
*        MONDMP FILE BY LOOKING AT 'RCVRCNT' IN THE ROOT.
*
GET:CNT  EQU      %
         PSW,R1   STACK             SAVE LINK
         BAL,R0   CLOSEIT           INSURE ANY M:EI FILE IS CLOSED
         BAL,R0   RESETM            RESET ALL POINTERS
         LI,R14   RCVRCNT           LOAD ADDRESS OF CELL
         STW,R14  MONFLAG           SET MONITOR DISPLAY MODE FLAG
         BAL,R0   GETADDR           MAP ONTO IT
         LB,R3    *R15              GET NUMBER
         PLW,R1   STACK             GET RETURN LINK
         B        0,R1              AND RETURN TO CALLER
         PAGE
FREEIT   GEN,1,7,24  1,5,9
GETIT    GEN,1,7,24  1,4,9
*
*
*        OPENS M:EI TO LAST RECOVERY FILE
*
LASTCRASH EQU     %
         BAL,R1   GET:CNT           GET MONDMP FILE NUMBER
         CI,R3    0                 ANYTHING ??
         BEZ      ASK%OPR           ZERO SAYS TO ASK OPERATOR
         LI,R0    0
         STB,R0   *R15              ELSE SET FLAG TO ZERO
         B        IAMAGHST          AND PROCESS THE CURRENT FILE
ASK%OPR  LI,R1    MDP%MSG           MESSAGE TO BE SENT
         BAL,R0   TYP:MSG           SEND MSG TO OPERATOR'S CONSOLE
         LI,R1    80                SIZE OF BUFFER
         CAL1,1   READCOM           READ RESPONSE
         LI,R1    #INBS             # OF CHARACTERS
         LB,R3    UCBUF             GET FIRST CHAR OF REPLY
         CB,R3    INBITE,R1         FIND MATCHING CHARACTER
         BE       ASK%OPR1          GOTCHA
         BDR,R1   %-2               KEEP LOOKING
         CLM,R3   MDNUMS            IS THE CHAR A LEGAL #
         BCS,9    ASK%OPR           NOPE--> ASK EM AGAIN
*        FALL THRU AND GO TO 'STORE%#' TO USE THE NUMBER
ASK%OPR1 EQU      %
         LH,R2    INVECT,R1         GET INDEX TO ROUTINE
         BAL,R1   INITIAL,R2        DISPATCH IT
         B        ASK%OPR           IF A RETURN--> ASK AGAIN
ASK%OPR2 EQU      %
         BAL,R1   GIVE:HELP
         BAL,R0   PRINT             PRINT EVERYTHING
         B        ASK%OPR
NOT%GJOB EQU      %                                                          A00
         BAL,R1   GET:CNT           MAP ONTO 'RCVRCNT'
         LW,R3    *R15              GET WHOLE WORD
IAMAGHST EQU      %
         AND,R3   =7                MASK FLAGS OFF THE BYTE
         LB,R3    LIST,R3           GET EBCDIC EQUIVALENT
         BAL,R0   RESETM            CLEAR ALL THE POINTERS
STORE%#  EQU      %                                                          A00
         STB,R3   HDMSG+21          PUT FILE NUMBER INTO HEADER
         STB,3    GHMSG+5
         LI,2     7
         STB,3    PATNAME,2       STORE CORRECT EBCDIC INTO FILE NAME
*
*        OPENS M:EI TO SPECIVIED FILE
*
CRASH1   EQU      %
         LI,R2    PATNAME
         STW,R2   FILTYP            REMEMBER TYPE FOR BLOCK PRINTING
         LI,R1    1                 LOAD INDEX
CRASH11  EQU      %
         BAL,R0   RESETM            CLEAR ALL ADDRESS POINTERS
         BAL,R0   RES:BUF           MAKE SURE CVM WINDOWS ARE BACK
         LW,R2    DORIGIN,R1        GET FPT ADDRESS
         CAL1,1   *R2               AND TRY TO OPEN REQUESTED FILE
         CAL1,1   SETEI
         BAL,R1   GETHIGH           ESTABLISH SYSTEM LIMITS
         MTW,0    RUN%MODE                                                   A00
         BNEZ     CRASH2            WE ARE NOT A GHOST
         LI,R1    GHMSG             GHOST FINISHED MSG
         BAL,R0   TYP:MSG           TYPE IT OUT
         CAL1,8   COMMODE           MAKE OUTPUT CONCURRENT MODE
         B        ALL               DO ALL WHEN A GHOST
*
*        IF ONLINE TELL USER WHAT MONDMP FILE # WE'RE USING
*
CRASH2   EQU      %
         LC       J:JIT
         BCR,8    SCANNER           NOT ONLINE MODE
         LI,R1    GHMSG             MSG ADDRESS
         LI,R0    SCANNER           RETURN POINT
         B        TITEL             PUT OUT MSG ABOUT FILE#
*
*        CONCURRENT OUTPUT LDEV FPT
*
COMMODE  GEN,8,24 X'1A',0
         PZE      *X'18'
         DATA     'L1'
         PAGE
*
*
INBITE   EQU      %
         DATA,1   0,;               NULL RESPONSE
                  'X',;             EXIT "      "
                  X'15',;           DO DEFAULT IF NEW LINE TYPED
                  'N',;             EXIT "      "
                  'H',;             TALK TO OC RESPONSE
                  'M',;             TALK TO OC RESPONSE
                  '?',;             LIST COMMANDS (QUESTION MARK)
                  'T',;             TAPE DUMP RESPONSE
                  'C',;             OPEN CPVDUMP FILE
                  0                 NULL RESPONSE
#INBS    EQU      BA(%)-BA(INBITE)-1
         BOUND    4
*
*
VECTR    CNAME
         PROC
LF       EQU      %
         DATA,2   AF(1)-INITIAL   **GENERATE INDEX
         PEND
*
*
INVECT   EQU      %
         VECTR    STORE%#           0 STORE THE MONDMP # AND USE IT
         VECTR    EXIT              EXIT RESPONSE
         VECTR    NOT%GJOB          NULL RESPONSE SAYS DEFAULT RUN
         VECTR    EXIT
         VECTR    INT:GHOST
         VECTR    INT:GHOST
         VECTR    ASK%OPR2          PRINT LIST OF COMMANDS
         VECTR    LABEL%TAPE
         VECTR    OPNUTSD           OPEN CPVDUMP FILE
         VECTR    NOT%GJOB          NULL RESPONSE
         BOUND    4
*
         PAGE
*F*
*F*    NAME:           RESETM
*F*
*F*    PURPOSE:        TO RESET THE MONITOR DISPLAY MODE FLAGS.
*F*
*F*    DESCRIPTION:    THE TWO MONITOR DISPLAY FLAGS ARE CLEARED
*F*                    AND THE ADDRESS POINTERS ARE RESET TO FORCE
*F*                    THE DUMP INPUT ROUTINES TO RE-READ THE
*F*                    NEXT READ SET OF ADDRESSES.
*F*
RESETM   EQU      %
         LCFI     2
         PSM,R0   STACK
         LD,R0    ZEROS
         STD,R0   MONFLAG           RESET FLAGS
         LI,R1    -1                MAKE NON-COMPARE DBL-WRD
         STD,R1   OLDPAGE           SUPPRESS PAGE READING CELL
         STD,R0   CURADRSS          AND RESET ADDRESS POINTER
         LCFI     2
         PLM,R0   STACK             RETRIEVE VOLATILES
         B        *R0               AND RETURN
         PAGE
*F*
*F*      NAME:    NOFIL
*F*
*F*      PURPOSE:
*F*               TO COMPLAIN ABOUT THE FILE THAT THE USER SAID
*F*               TO OPEN.
*F*
*F*      DESCRIPTION:
*F*               WE GET HERE VIA AN ABNORMAL RETURN FROM A FILE
*F*               OPEN. THIS ROUTINE WILL PUT AN ERROR MSG OUT
*F*               AND GO TO THE SCANNER FOR THE NEXT COMMAND.
*F*
NOFIL    EQU      %
         PSW,R1   STACK
         LC       J:JIT             RUNNING ONLINE...
         BCR,8    %+2               NOPE-JUMP
         BAL,R2   RERR1             PUT OUT I/O ERROR CODE
         LI,1     CANTMSG
         BAL,0    MSG             TELL THE USER I CAN'T OPEN THE FILE
         LC       J:JIT             TEST JOB ORIGIN AGAIN
         BCR,4    %+2               NOT GHOST JOB
         BAL,R0   TYP:MSG           TYPE IT IF GHOST JOB
         LI,R1    7                 LETS CHECK TO SEE IF M:SI
         AND,R1   M:SI              IS COMING FROM A FILE
         CI,R1    1                 TRUE
         BNE      NOFIL1            NO - CONTINUE
         BAL,R0   BUFOUT            YES - OUTPUT MSG ABOUT ERROR
         BAL,R0   BLANK1            ONE BLANK LINE
         CAL1,9   3                 AND ABORT THE RUN
NOFIL1   EQU      %                 M:SI IS NORMALLY ASSIGNED
         PLW,R1   STACK
         CI,R1    1                 IS VALID INDEX
         BG       SCANNER           NOPE
         LW,R1    DORIGIN,R1        LOAD ADDRESS OF THE FPT IF VALID
         AI,1     9               AND THE FILE NAME IN IT
         BAL,R0   MB
         BAL,R0   RESETM            RESET DUE TO NO OPEN...
         MTW,0    RUN%MODE                                                   A00
         BLZ      SCANNER           ON-LINE                                  A00
         BGZ      ERRET             BATCH                                    A00
         LI,3     X'FF'             MUST BE A GHOST
         LS,R3    KEY               BEEN HERE BEFORE
         BNEZ     EXIT              YES, QUIT                                A00
         MTW,0    GJOB%FLAG                                                  A00
         BNEZ     EXIT                                                       A00
         B        LABEL%TAPE                                                 A00
*
*
*
CANTMSG  TEXTC    'CANNOT OPEN FILE '
                  PAGE
*F*
*F*      NAME:    NOGOT
*F*
*F*      PURPOSE:
*F*               TO TELL THE USER THAT HIS PRIVILEGE LEVEL
*F*               IS TOO LOW TO DO WHAT HE ASKED TO DO.
*F*
*F*      DESCRIPTION:
*F*               EITHER WE CHECKED A STORE UNDER DELTA OR THE
*F*               REPLACEMENT COMMAND NOTED THAT THE USER DID NOT
*F*               HAVE A PRIVELEGE LEVEL ADEQUATE TO DO A REPLACE.
*F*
*F*               WE'LL COMPLAIN ABOUT IT HERE AND GO TO THE SCANNER.
*F*
NOGOT    EQU      %
         LB,3     JB:PRIV           GET HIS PRIV
         BAL,0    TRANSSZ           PUT INTO PRINT LINE
         LI,1     NOGOTMSG          NOW SHOVE
         B        PUSHMSG           MSG INTO PRINTLINE
NOGOTMSG TEXTC    ' PRIVILEGE IS NOT HIGH ENOUGH'
         PAGE
*
*        BUILDS 'UTSDUMP FROM LABEL TAPE BUILT BY RECOVER
*
LABEL%TAPE EQU    %
         BAL,0    CLOSEIT           INSURE M:EI IS CLOSED
         BAL,R0   RES:BUF           RESTORE CVM WINDOWS
         MTW,0    TAPE:TYP          ONE ALREADY SET
         BNEZ     TYP:SET           YESP, USE IT
         LI,R1    TAPE:MSG          HAVE TO FIND OUT
         LC       J:JIT             WHAT MODE
         BCS,8    ASK:ONLINE        ONLINE GOES AHEAD
         BAL,R0   TYP:MSG           BATCH/GHOST ASK AT M:OC DEVICE
         B        READ:REPLY        GO READ IT
ASK:ONLINE BAL,R0 MSG
         BAL,R0   BUFOUT
READ:REPLY EQU    %
         BAL,R1   READ:REC
         LH,R1    UCBUF
         AND,R1   #R16
         STW,R1   TAPE:TYP          HIS PROBLEM IF I CANNOT USE THIS
TYP:SET  EQU      %
         BAL,R0   RESETM            TURN OFF MONITOR DISPLAY MODE
         LI,R2    TAPEDMSG
         STW,R2   FILTYP
         CAL1,1   OPNLT             OPEN THE TAPE UP
         CAL1,1   OPEN:CPV          OPEN UP THE OUTPUT FILE
         LW,1     KEEPKEY         RESTORE THE KEY
         STW,1    KEY
READLT   EQU      %
         CAL1,1   READBI            READ A PAGE FROM TAPE                    A00
         CAL1,1   WRITE:CP          WRITE A RECORD
         MTW,1    KEY             BUMP THE KEY
         B        READLT          AND CONTINUE...EXIT THRU ABN READ
         PAGE
*
*        EXIT ON ERR/ABN RETURN
*
ERRABN   EQU      %
         LI,R0    0                 ERASE
         STW,R0   TAPE:TYP          CELL
        LW,3      Y002            DONT CLOSE IT IF ITS CLOSED
         CW,R3    M:BI                                                       A00
         BAZ      %+2                                                        A00
         CAL1,1   CLOSE:BIREL       CLOSE IT
        CW,3      M:EO
        BAZ       %+2
         CAL1,1   CLOSE:EOSAVE      CLOSE THAT ONE TOO
         LB,3     10
         CI,R3    6                 EOD
         BE       TAPE:END          YEP
         CI,R3    5                 EOF
         BE       TAPE:END
         LI,R2    SCANNER           WE DONT HANDLE ANY OTHERS
         B        RERR1             PRINT ERR/ABN MSG
TAPE:END LW,R3    KEEPKEY           ALL DONE WITH TAPE
         XW,3     KEY
         SW,3     KEY
         AI,3     -1
         MTW,1    TAP%DMP           SET TAPE DUMP MODE FLAG
        LI,1      LSTPGMSG        TELL HIM THE LAST PAGE NUMBER
         BAL,R0   MTB               MSG / TRANSSZ / BUFOUT
         LI,R1    0
         B        CRASH11           MERGE W/COMMON PATH
*
*
DORIGIN  EQU      %
         DATA     OPNFPT            TO OPEN THE 'CP5DUMP' FILE
         DATA     OPNPFIL           TO OPEN THE 'MONDMPX' FILES
*
*
LSTPGMSG TEXTC    'THE LAST PHYSICAL PAGE IN THE FILE IS '
         PAGE
*
*        DATA FOR OVERLAYS
*
         USECT    DATA
WRITESYMS DATA    0
*
SYMCNT   DATA     0
LASTEVAL DATA     0
SYMCNT1  DATA     0                 COPY OF SYMCNT FOR LATER
PG:MODE  DATA     0
SORTALBE DATA     0
         USECT    PP
GETTWO   GEN,8,24  8,2
Y002     DATA     X'00200000'
         USECT    DATA
GPGS     GEN,8,24 8,16
FPGS     GEN,8,24 9,0               COUNT IS DYNAMIC
         USECT    PP
READBI   GEN,8,24 X'10',M:BI                                                 A00
         GEN,4,28 X'F',X'10'
         DATA     ERRABN
         DATA     ERRABN
         GEN,1,31  1,PAGEBUF
         DATA     4*512
*
OPEN:PATF GEN,8,24  X'14',F:PAT
         DATA     X'C7400009'
         DATA     NOTRACE,NOTRACE
         DATA     1,1,1
         DATA     2
         DATA     X'01000202'
         TEXTC    'PATCH'
         DATA     X'02010202'
:SYSACN  TEXT     ':SYS '
*
*
SET:PATF GEN,8,24   X'06',F:PAT
         GEN,4,28   12,0
         DATA     PATCHES2,PATCHES2
*
*
READ:PATF  GEN,8,24  X'10',F:PAT
           DATA      X'F0000010'
           DATA      PATCHES2,PATCHES2
           DATA      OBUF,132
*
         PAGE
*F*
*F*      NAME:    RERR / RERR1
*F*
*F*      PURPOSE:
*F*               TO COMPLAIN ABOUT AN ERROR/ABNORMAL FROM A CAL.
*F*
*F*      DESCRIPTION:
*F*               VARIOUS ROUTINES BAL HERE TO PUT THE MESSAGE
*F*               CONCERNING THE ERROR/ABNORMAL. THE I/O ERROR
*F*               CODE IS PUT OUT W/A MESSAGE.
*F*
         USECT    PP
RERR     EQU      %
         LI,1     PGMSG
         LI,R3    X'3FF'            MASK TO PICK UP
         LS,R3    KEY               COUNT FROM KEY'S WE BUILT IN FILE
         AI,R3    -1                ADJUST BY ONE
         BAL,R0   MTB               MSG / TRANSSZ / BUFOUT
         LI,R2    ERRABN            SET RETURN LINK FOR RERR1
*
*        FALL THRU AND PUT OUT MSG
*
RERR1    EQU      %
         LI,R1    RERRMSG           MSG ADDRESS
         LW,R3    R10               I/O ERROR CODE / DCB ADDRESS
         BAL,R0   MTB               MSG / TRANSSZ / BUFOUT
         B        0,R2              RETURN TO CALLER
*
RERRMSG  TEXTC    'ERR/ABN CODE = '
*
*
PGMSG    TEXTC    'UNABLE TO READ PAGE '
         PAGE
         USECT    DATA
*
KEY      DATA     X'03000000'
         USECT    PP
KEEPKEY  DATA     X'03000000'
*
TRPCONTROL  GEN,8,24  X'14',TRAPPED
         DATA     X'00380003'       ABORT ON NAO-UI-STK; IGNORE DEC/FX
         USECT    DATA
*
*
*
STKSIZE  DATA     0
*
*
FILTYP   DATA     COREMSG           INDICATES TYPE OF FILE OPENED
         USECT    PP
GETONE   GEN,8,24 8,1
FREEONE  GEN,8,24 9,1
         PAGE
*
*
*        BREAK HANDLER
*
BREAK    EQU      %
         MTW,0    BRKHIT            ARE  WE ALREADY IN A BREAK EVENT
         BNEZ     CLR:BRK1          YEP-RETURN
         MTW,1    BRKHIT            NO -SET BREAK EVENT
         LI,R1    7                 MASK TO EXTRACT
         AND,R1   M:SI              ASN FIELD FROM M:SI DCB
         CI,R1    1                 COMMANDS COMING FROM A FILE
         BE       SISWTCH           YEP-SWITCH SI BACK TO THE UC
         BAL,R0   BLANK1
         LI,R1    BRK:MSG           MESSAGE TO 'PRINT'
         BAL,R0   PRINTL            PRINT OUT THE BREAK SALUTATION
         LC       J:JIT             TEST JOB ORIGIN
         BCS,8    %+2               DONT NEED TO TYPE ANYTHING ONLINE.
         BAL,R0   TYP:MSG           TYPE THE MSG TO THE OC.
         LI,R1    6                 # OF BYTES TO READ
         CAL1,1   READCOM           READING A BYTE
         BAL,R0   BLANK1            MAKES IT PRETTY ON TERMINAL PLATEN
         LB,R1    UCBUF             GET REPLY
         CI,R1    'X'               WANTS TO STOP
         BNE      CLR:BRK           DOES NOT WANT TO  STOP...
BREAK1   EQU      %
         BAL,R0   BOBUF             BLANK THE PRINT BUFFER
         BAL,R0   BLNKBUF           RESET THE PRINT BUFFERS
         LI,R0    0                 NOW THAT EVERYTHING IS PERFORMED
         STW,R0   BRKHIT            CLEAR THE BREAK EVENT FLAG
         B        SCANNER           AND GO GET THE NEXT COMMAND
BRK:MSG  TEXTC    '-- X TO ABORT.'
         PAGE
*
*        CLEAR BREAK EVENT FLAG AND RETURN TO POINT OF BREAK
*
CLR:BRK  EQU      %
         LI,R0    0
         STW,R0   BRKHIT            CLEAR FLAG
CLR:BRK1 EQU      %
         CAL1,9   5                 RETURN TO BREAK ADDRESS
         PAGE
*
*        USER HIT BREAK WHILE COMMANDS COMING FROM A FILE
*
*        RESTORE M:SI DCB ASSIGNMENT BACK TO THE UC DEVICE
*
SISWTCH  EQU      %
         LI,R7    M:SI
         BAL,R0   CLOSEDCB          CLOSE CURRENT M:SI ASSIGNMENT
         CAL1,1   SI:UC             OPEN M:SI BACK TO UC
         B        BREAK1            GO TO SCANNER BY WAY OF BREAK CODE
SI:UC    GEN,8,24 X'14',M:SI
         DATA     X'00040000'
         DATA     'UC'              WHATEVER UC HAPPENS TO MEAN...
         PAGE
*
*        TELL OPERATOR ABOUT CORE CHANGE
*
TATTLE   EQU      %
         LCI      3                 PUT DELTA'S REGISTERS
         PSM,R0   STACK             BACK INTO DELTA'S STACK
         LW,R3    LASTLOC           GET LOCATION THAT WAS MODIFIED
         BAL,R0   TRANSSZ           CONVERT TO EBCDIC
         LI,R1    MODMSG            MSG TO FLLOW
         BAL,R0   MSG
         LI,R1    J:ACCN
         LI,R2    0
TATTLE0  EQU      %
         LB,R6    J:ACCN,R2         GET BYTE OF ACCOUNT NUMBER
         CI,R6    64                BLANK CHAR
         BE       TATTLE1           AT END IF SO
         AI,R2    1                 BUMP INDEX INTO ACCOUNT
         CI,R2    8                 8 MAX ACCOUNT COUNT
         BL       TATTLE0           NOT DONE YET
TATTLE1  EQU      %
         BAL,R0   MSG1              AND PUT ACN # INTO PRINT LINE
         LI,R1    CMAMSG            AND A COMMA
         BAL,R0   MSG               GOES IN BETWEEN EM
         LI,R1    J:UNAME           LOC OF LOGON NAME
         LI,R2    12                12 BYTES OF NAME FIELD
         BAL,R0   MSG1              PUT EM OUT
         LW,R0    PTR               TOTAL LENGTH MOVED
         AI,R0    3                 COVER INITIAL COUNT OF BLANKS
         STB,R0   TYP:BUF
         LI,R1    TYP:BUF           LOC OF IT
         BAL,R0   TYP:MSG           SEND MSG TO OPERATOR'S CONSOLE
         BAL,R0   BOBUF             BLANK THE PRINT BUFFER
         BAL,R0   BLNKBUF           AND CRASH ALL PRINT BUF POINTERS
         LCI      3
         PLM,R0   STACK             RESTORE DELTA'S REGISTERS
         B        0,R2              AND RETURN
MODMSG   TEXTC    ' MODIFIED BY '
CMAMSG   TEXTC    ','
         PAGE
*
*        ROUTINE TO 'PRINT' (VIA M:LL) MSG IN R1
*
PRINTL   EQU      %
         CAL1,2   PRNTFPT           PRINT IT
         B        *R0
*
*        PRINT FPT
*
PRNTFPT  GEN,8,24 X'01',M:LL
         PZE      *0
         PZE      *R1               MSG ADDRESS IN R1
*
*
         PAGE
         USECT    PP
BRKFPT   GEN,8,24 14,BREAK
OPNFPT   GEN,8,24 X'14',M:EI
         DATA     X'C7400001'
         DATA     NOFIL,NOFIL
         DATA     2,2,1,2
         DATA     X'01010202'
OPNFPT10 TEXTC    'CP5DUMP'
SETEI    GEN,8,24 6,M:EI
         GEN,2,30 3,0
         DATA     PAGERR,PAGERR
         USECT    DATA
BRKHIT   DATA     0                 SET IF ON A BREAK
*
OPNLT    GEN,8,24 X'14',M:BI                                                 A00
         DATA     X'C7040042'
         DATA     ERRABN,ERRABN
         DATA     1,1,1
TAPE:TYP DATA     0                 THATS THE DEFAULT
         DATA     X'01000202'
         TEXTC    'TAPDUMP'
         DATA     X'07000202'
         TEXT     'RCVT '
         DATA     X'02010202'
         TEXT     ':SYS '
         BOUND    8
OPNPFIL  GEN,8,24 X'14',M:EI
         DATA     X'C7400001'
         DATA     NOFIL,NOFIL
         DATA     2,2,1,2
         DATA     X'01000202'       FILE NAME,NOT LAST ENTRY
PATNAME  TEXTC    'MONDMP '
         DATA     X'02010202'
PATACN   TEXT     ':SYS  '          DEFAULT INPUT ACCOUNT#
         USECT    PP
*
OPEN:CPV GEN,8,24  20,M:EO
         GEN,32   X'F7480001'       PARS
         DATA     ERRABN,ERRABN     ERROR HANDLERS
         PZE      *PAGEBUF          BUFFER ADDRS POINTER
         DATA     2048              RECL
         DATA     2,2,2,2           KEYED,DIRECT,OUT,SAVE
         DATA     3                 KEY MAX
         DATA     X'01010202'
CP5:NAME TEXTC    'CP5DUMP'         NAME OF OUTPUT FILE
WRITE:CP GEN,8,24  17,M:EO
         GEN,32   X'F8000030'
         DATA     ERRABN,ERRABN
         PZE      *PAGEBUF          BUFFERA DDRESS
         DATA     2048              SIZE
         DATA     KEY               KEY BUFFER
*
*
CLOSE:BIREL GEN,8,24  X'15',M:BI
         PZE      *X'20'            IMMEDIATE RELEASE OF RESOURCE
            DATA      1
*
*
CLOSE:EOSAVE GEN,8,24  X'15',M:EO
             PZE       *0
             DATA       2
         USECT    DATA
*
SADCAL   GEN,8,24 7,0
VIRPAGE  DATA     0
*
         USECT    PP
*
PROMPTX  DATA,1   X'2C',0,0,'<'
         PAGE
*
*        ENTRY POINT TO ENABLE DELTA TO USE ANALYZE SUBROUTINES
*        TO GET AND PUT INFORMATION FROM A DUMP OR THE MONITOR
*
         USECT    DATA
DELTAENT EQU      %
         DATA     DELTAGET
         DATA     DELTAPUT
         DATA     SCANNER           RETURN FROM DELTA
         DATA     ACCOUNT
         PAGE
*
*        DELTA INTERFACE SUB-ROUTINES
*
         USECT    PP                                                 RL2
DELTAGET EQU      %
         MTW,1    GETFLAG
DELTAPUT EQU      %
         STW,R3   LASTLOC           SAVE ACCESSED LOCATION
         MTW,1    UNDERDELTA
         MTW,0    GETFLAG           IS THIS A GET
         BEZ      DELTA:GO          NO - LONG FORM
         MTW,0    MAPFLAG           ARE WE MAPPED
         BNEZ     DELTA:GO          YES - HAVE TO GO LONG FORM
         CLM,R3   CURADRSS          DO WE HAVE THE ADDRESS NOW..
         BCS,9    DELTA:GO          NO - GO GET IT
         AND,R3   X1FF              PAGE MASK ADDRESS
         LW,R3    *PAGEBUF,R3       GET CONTENTS OF ADDRESS
         MTW,-1   GETFLAG           RESET GET
         MTW,-1   UNDERDELTA        RESET DELTA HERE
         LCFI     0
         B        0,R4              RETURN TO DELTA
*
*        HAVE TO PICK ADDRESS - GO GET IT
*
DELTA:GO EQU      %
         LCFI     14                PUSH EM AWAY
         PSM,4    DSTACK            SAVE REGISTERS
         LW,14    3
         BAL,0    GETADDR           GET THE SPECIFIED ADDRESS
         MTW,0    GETFLAG
         BNEZ     GETWORD           GO DO A GET OPERATION
         LB,R13   JB:PRIV           GET USER'S PRIV LEVEL
         CI,R13   X'B0'           PRIV SUFFICIENT TO STORE
         BL       NOGOT             NOPE
PUTIT    LCFI     2                 YEP
         PLM,R0   DSTACK
         STS,R0   *R15              PUT VALUE IN THROUGH CVM WINDOW
         BAL,R2   TATTLE            GO TELL OPERATOR ABOUT THIS
         LI,R2    0                 SET DELTA CC RETURN
         B        DELTARETURN
GETWORD  LW,R3    *R15              GET VALUE
         LCI      2
         PLM,0    DSTACK            ADJUST THE STACK
         MTW,-1   GETFLAG
         LI,2     0                 FOR CONDITION CODES
DELTARETURN EQU   %
         LCI      12
         PLM,4    DSTACK            RESTORE THE REGISTERS
         MTW,-1   UNDERDELTA
         SCS,2    -1                 SET HIGH BIT FOR CC'S
         LC       R2                LOAD CONDITION CODES
         B        0,4
DELRET   EQU      %                 BAIL-OUT RETURN
         LCI      2
         PLM,0     DSTACK           ADJUST THE STACK
         LI,2      1
         B         DELTARETURN
         PAGE
*
*        DELTA INTERFACE DATA
*
         USECT    DATA
         BOUND    8
ACCOUNT  TEXT     ':SYS  '
PASS     DATA     0,0
FILETEXT TEXTC    'M:MON'
         TEXT     '    '
GETFLAG  DATA     0                 >>0 = GETTING WORD FOR DELTA
*
UNDERDELTA DATA   0                 >>0 = DELTA IS INSIDE US NOW...
*
         PAGE
*
*        IF RUNNING AS A GHOST AND WE WIND UP HERE, PROMPT
*        OPERATOR'S CONSOLE
*
         USECT    PP
READ:REC EQU      %
         PSW,R1   STACK             SAVE LINK ADDRESS
         LI,R1    80                BUFFER SIZE FOR READ CAL
         CAL1,1   READCOM           READ A RECORD  FROM THE USER
         LI,R1    7                 MASK TO EXTRACT ASN
         AND,R1   M:SI              FIELD OF DCB
         CI,R1    1                 INPUT COMING FROM A FILE
         BNE      READ:REC3         NOPE - UC DEVICE OR REMOTE ASSIST
         LW,R1    M:SI+13           GET RWS FIELD OF DCB
READ:REC2 EQU     %
         AND,R1   =X'7F'            MASK TO A POSSIBLE 127 CHARS
         STW,R1   INCOUNT           SAVE IT
         PLW,R1   STACK             AND RETRIEVE LINK
         B        0,R1              AND EXIT
READ:REC3 EQU     %
         LI,R1    80                FROM DEVI MAX
         B        READ:REC2         REJOIN MAIN PATH
         USECT    DATA
INCOUNT  DATA     80                CHAR COUNT USER TYPED
OPFLAG   DATA     0               SET IF ANY ARITH OPERATORS FOUND
         USECT    PP
         PAGE
*
*
OPEN:OC  GEN,8,24 X'14',M:OC
         DATA     X'00040000'
         DATA     'OC'
*
*
*
         BOUND    4
*
READCDEV GEN,8,24 16,M:C
         GEN,4,28 15,16
         DATA     EXITCAL,EXITCAL
         DATA     UCBUF,80
*
TYPONOC  DATA     0                 M:MESSAGE FORMAT
         PZE      *0
         PZE      *R1               MSG ADDRS IN R1
*
*
*
         PAGE
*F*
*F*      NAME:    TYP:BUFR
*F*
*F*      PURPOSE:
*F*               TO TYPE A MESSAGE ONTO THE OPERATOR'S CONSOLE.
*F*
*F*      DESCRIPTION:
*F*               BAL HERE VIA R0 WITH MESSAGE ADDRESS IN R1 AND
*F*               TYP:BUFR WILL TYPE IT OUT FOR YOU.
*F*
*
*
TYP:BUFR EQU      %
         LC       RUN%MODE          ARE WE IN THE INTERACTIVE GHOST MODE
         BCR,4    *R0               NOPE
         MTW,0    LPFLAG            ARE WE WRITING THE LINE PRINTER
         BNEZ     *R0               YEP--> RETURN
         LI,R1    TYP:BUF           LOAD THE OC BUFFER ADDRESS
         MTB,3    TYP:BUF           BOOST BYTE COUNT
         AI,R0    1                 BOOST RETURN OVER LP WRITE CAL
TYP:MSG  CAL1,2   TYPONOC           SEND MSG
         B        *R0               AND RETURN
         PAGE
         USECT    PP
*F*
*F*    NAME:           SCANNER
*F*
*F*    PURPOSE:        TO PARSE THE INCOMING COMMANDS.
*F*
*F*    DESCRIPTION:    SCANNER BREAKS DOWN EACH INCOMING COMMAND
*F*                    AND PLACES THE INDIVIDUAL FIELDS INTO THE
*F*                    SLOTS AT FIELDS. THIS ALLOWS EACH SUB-ROUTINE
*F*                    TO DIRECTLY FETCH SUB-FIELDS FOR THEIR
*F*                    COMMANDS VIA THE LIST ROUTINES OR DIRECTLY
*F*                    BY THEMSELVES.
*F*
SCANNER  EQU      %
         MTW,0    UNDERDELTA        ARE WE RUNNING W/DELTA
         BNEZ     DELRET            YEP--> RETURN TO DELTA INTERFACE
         INT,R9   STACK+1           NO---> GET STACK COUNT
         LCW,R9   R9                FLIP IT OVER
         MSP,R9   STACK             AND EMPTY THE WORK STACK.
         MTW,0    BALL
         BNEZ     ALLEP             KEEP GOING ON THE 'ALL'
         CAL1,1   PROMPTX           RESET PROMPT CHARACTER
NEXTCRD  BAL,R1   READ:REC          READ NEXT CARD/UC/OC/ETC....
SCANEP   EQU      %
         LI,R2    -(DECOTOP-FIELD1)
         LD,R0    ZEROS             GET SOME ZEROS
         STW,R0   FIELD1+(DECOTOP-FIELD1),R2
         BIR,R2   %-1               ZAP ALL VARIABLES
         STW,R0   OPFLAG          CLEAR ARITH OPERATOR FOUND IN COMMAND
         STW,0    REPFLAG
         STW,R0   USER              STAYS RESET
         STW,R0   JITBURST          AND ANOTHER FLAG THAT S/B RESET
         STW,R0   LOOKING
         STD,R0   PTR               CLEAR OUTPUT BUFFER POINTERS
         STW,R0   TPTR              CLEAR TRANSLATE COLUMN POINTER
         LB,1     UCBUF
         LI,R7    #SPCS             # OF PRE-PROCESS SPECIAL CHARS
         CB,R1    SPCS,R7           EXAMINE FOR UNIQUE IINITIAL
         BE       SPCSV,R7          COMMAND
         BDR,R7   %-2               FINISH LOOK
         LI,7     0                 FIELD COUNT
         LI,1     -1                PTR INTO UCBUF
SLOOP1   LI,2     0                 PTR INTO FIELD
         AI,1     1
         LW,5     FIELDS,7          GET FIELD
         BEZ      IBADCOM           END OF POSSIBLE FIELDS
SLOOP2   LB,3     UCBUF,1           PICK UP A BYTE
SLOOP25  LI,R4    CHRSIZE           # OF SPECIAL CHARACTERS
         CB,3     CHRS,4            PICK OFF SEPARATORS
         BE       SVEC,4
         BDR,4    %-2
         CI,R2    MAXFLD            HAVE ACCUMULATED MAX FIELD
         BGE      %+2               AT MAX
         STB,3    *5,2              STORE IT AWAY
         MTW,0    SPFLAG
         BEZ      %+2
         MTW,-1   SPFLAG
         AI,2     1
SLOOP3   AI,1     1
         CW,R1    INCOUNT           COMPARE TO # BYTES WE READ
         BGE      ENDCOM            YES..ALL STOP
         CI,2     MAXFLD            AT MAX COUNT
         BGE      %+2               AT MAX
         STB,R2   FLDCNTS,R7        STORE FIELD COUNT AWAY
SLOOP4   EQU      %
         B        SLOOP2            KEEP GOING
         PAGE
*
*        SPECIAL CHARACTERS ANALYZE USES
*
*
CHRS     EQU      %                 SEPARATORS AND TERMINATORS       RL2
         DATA,1   X'40'                                              RL2
         DATA,1   X'15'                                              RL2
         DATA,1   X'D'                                               RL2
         DATA,1   ','                                                RL2
         DATA,1   '+'                                                RL2
         DATA,1   '-'                                                RL2
         DATA,1   '*'
         DATA,1   ' '                                                RL2
         DATA,1   '='                                                RL2
         DATA,1   '.'                                                RL2
         DATA,1   '#'
         DATA,1   '('
         DATA,1   '/'
         DATA,1   '%'
         DATA,1   '%'
         DATA,1   ')'
CHRSIZE  EQU      BA(%)-BA(CHRS)                                     RL2
         BOUND    4
*
*
SVEC     B        SPACE
         B        ENDCOM
         B        ENDCOM
         B        SEPR
         B        PLUSMINUS
         B        PLUSMINUS
         B        PLUSMINUS
         B        SPACE
        B         REPLACE
         B        SEPR                                               RL2
         B        SEPR
         B        CHK:SERCH         CHECK THE LEFT PAREN OUT...
         B        SYM:SERCH
         B        PLUSMINUS         SAVE THE DIVIDE SYMBOL
         B        SEPR
         B        SLOOP3            *RIGHT PAREN IS NOT A SEPERATOR..
         PAGE
*
*        HIT A LEFT PAREN IN THE INCOMING COMMAND - GO TO FIND
*        THE SYMBOL FOR THE ADDRESS IF LEFT PAREN NOT PRECEEDED BY
*        A BLANK...IE...    <8C00(     MEANS TO FIND SYMBOL FOR 8C00
*
CHK:SERCH EQU     %
         AI,R1    0                 AT FIRST CHARACTER IN FIELD
         BEZ      SLOOP3            YUP--->   RE-ENNER
         LW,R3    R1                HOLD INDEX
         AI,R3    1                 TO PICK UP NEXT CHARACTER
         LB,R3    UCBUF,R3          GET IT
         CLM,R3   FLDSTOP           CHECK AGINST STOPS
         BCR,9    VALTEXT           YUP--> GO FIND SYMBOL FOR ADDRESS
         B        SEPR              NOPE-> BREAK THE FIELD APART
*
         BOUND    8
FLDSTOP  DATA     13,64             ((( NEW LINE AND BLANK CHAR )))
*
         PAGE
*
*        ACCOUNT FOR BLANKS IN INCOMING FIELD
*
*
SPACE    MTW,0    SPFLAG
         BNEZ     SLOOP3            CONSECUTIVE BLANKS DONT MATTER
         MTW,1    SPFLAG            SET FIRST TIME BLANK HIT FLAG
SEPR     EQU      %
         AI,R7    1                 BUMP FIELD # TO NEXT POSITION
         B        SLOOP1
*
REPLACE EQU       %
        MTW,1     REPFLAG        SET THE REPLACEMENT FLAG
        B         SEPR
         PAGE
*
*        END OF INPUT - GO TO COMMAND ADDRESS
*
ENDCOM   EQU      %
         BAL,R0   BOBUF             BLANK THE PRINT BUFFER
         LH,R1    FIELD1            WAS FIRST FIELD A DELIMITER....
         BEZ      STEPIT            MEANT DOT WAS FIRST COMMAND
         LI,2     COMSIZE
         CH,1     COMMANDS,2
         BE       SCREEN
         BDR,2    %-2
*F*
*F*      NAME:    NOTCOM
*F*
*F*      PURPOSE:
*F*               NOBODY HAS FIGURED OUT WHAT THE USER HAS TYPED
*F                SO NOTCOM WILL CALL THE DUMPER ASSUMING THAT
*F*               THE USER MEANT TO DUMP SOME AREA OF CORE.
*F*
*F*      DESCRIPTION:
*F*               DISPATCH THE DUMP ROUTINE FROM HERE.
*F*
NOTCOM   EQU      %
        MTW,0     REPFLAG
        BEZ       DUMP
        B         REPLACEMENT
         PAGE
*
*        IF THE USER TYPES '.+VALUE' - WE USE THE LAST VALUE
*        GIVEN AND DISPLAY IT.
*
STEPIT   EQU      %
         LW,R15   LASTLOC           INIT R15 W/LAST ACCESSED LOCATION
         LI,R14   '+'               ALL FIELDS ARE ADD UNLESS GIVEN
         MTW,0    OPFLAG            DID USER TYPE ANY ARITHMETIC OPS
         BNEZ     STEPO1            YUP--TREATED DIFFERENTLY
         STW,R15  STEP              ENABLE PROCESS IN GETHEX
         LI,R1    2                 FIRST FIELD
         STB,R14  OPS,R1            TURN IT ON IF NOT
         BAL,R0   GETHEX            COLLECT FIRST PAIR
         LW,R8    R2                HOLD START LOC IN  R8
         LI,R1    5                 NEXT PAIR FIELD
         STB,R14  OPS,R1            ENABLE ADDITION
         STW,R15  STEP              ENABLE W/LAST ACCESSED LOC
         BAL,R0   GETHEX            PICK UP THIS PAIR
STEPIT0  EQU      %
         LW,R9    R2                MOVE LAST LOC TO R9
         SW,R2    R8                START-LAST = # OF WORDS TO DUMP
         AI,R2    1                 PLUS ONE
         LW,R7    R2                MOVE COUNT TO INTERNAL USE REGISTER
         B        DUMPEP2           AND MERGE W/DUMP ROUTINE
*
*        USER TYPED SOME ARITHMETIC OPERATOR
*
STEPO1   EQU      %
         LI,R1    1                 FIRST PAIR
         LB,R0    OPS,R1            CHECK FOR
         BNEZ     %+2               OK--> GOT AN OPCODE
         STB,R14  OPS,R1            FORCE TO ARITHMETIC THEN...
         STW,R15  STEP              ENABLE CHECKS IN  GETHEX
         BAL,R0   GETHEX            GET FIRST ADDRESS
         LW,R8    R2                START LOC TO R8
         LI,R1    3                 NEXT PAIR
         MTB,0    OPS,R1            DID USER GIVE OPERATOR
         BNEZ     %+2               YUP
         STB,R14  OPS,R1            NO--MAKE IT ADDITION
         LD,R10   F4                GET IT
         BNEZ     %+2               GOTCHA
         LD,R10   FIELD5            OR ITS THERE IF ASSUMED ADD GIVEN
         CI,R10   0                 DID WE FIND IT PROPERLY
         BNEZ     STEPO2            YUP
         LD,R10   FIELD3            ONE LAST CHANCE
         BNEZ     STEPO2            GOTCHA
         LW,R2    R8                MAKE SECOND LOC=FIRST LOC
         B        STEPIT0           AND MERGE
STEPO2   EQU      %
         STD,R10  FIELD4            PUT VALUES IN CORRECT SLOT
         STW,R15  STEP              ENABLE CHECKS IN GETHEX
         BAL,R0   GETHEX            PICK UP THE PAIR
         B        STEPIT0           AND MERGE W/COMMON ENTRY POINT
         USECT    DATA
STEP     DATA     0
         USECT    PP
         PAGE
*
*        SPECIAL COMMANDS
*
SPCS     EQU      %
         DATA,1   ' '
         DATA,1   X'15'             DUMP NEXT LOCATION
         DATA,1   X'0D'             DITTO
         DATA,1   '^'               (UP ARROW) DUMP LAST LOCATION
         DATA,1   '*'               DUMP INDIRECT CUR LOCATION
#SPCS    EQU      BA(%)-BA(SPCS)    # OF THEM ABOVE
         BOUND    4
*
*        ROUTINE ADDRESSES TO HANDLE ABOVE FUNCTIONS
*
SPCSV    EQU      %
         B        BADCOM            NO GOOD
         B        DNEXT             NEXT LOCATION
         B        SCANNER           CARRAIGE RETURN IS NULL COMMAND
         B        DLAST             LAST LOCATION
         B        INDIR             INDIRECTION ON CUR LOC
         PAGE
*
*        HIT AN ERROR ON INCOMING COMMAND
*
IBADCOM  EQU      %
         AI,R1    0                 WHAT IS COUNT WITHIN COMMAND
         BNEZ     %+2
         AI,R1    1                 ONE MORE FOR CORRECT POSITION
         BAL,R0   SPACES            ELSE SPACE OVER TO IT
IBADCOM1 LI,R1    DOLLAR            MSG TO PRINT
         BAL,R0   MSG
         BAL,R0   BUFOUT
         B        BADCOM
DOLLAR   TEXTC    '%'
        PAGE
*
*        CHECK MAP/UNMAP  DEFAULT TABLE AND CALL
*        SUBROUTINE
*
SCREEN   EQU      %
         LI,R0    SCANNER           DEFAULT RETURN POINT
         LI,R1    SCANNER           DITTO.............
         EXU      CVEC,R2           CALL SUB-ROUTINE
         PAGE
*
*        SET UP FOR ONE LEVEL OF ADDITION OR SUBTRACTION
*
PLUSMINUS STB,3   OPS,7           SAVE OPERATION
         MTW,1    OPFLAG          SET OPERATOR FOUND FLAG
         LW,5     OPFIELD,7       PUT EBCDIC IN OPFIELD
         MTW,0    *5              IS SOMETHING THERE
         BNEZ     BADCOM          YES, TOO MANY OPS
         LI,2     0
         AI,1     1
         B        SLOOP4            RE-ENTER SCANNING PROCESS...
*
         PAGE
*
*        COMMAND VECTOR LIST
*
CVEC     EQU      %-1
         B        DISPLAY
         B        SWAPLIST          IN ANALZO1
         B        SEGMAP            CONTROL SECTION MAP IN ANALZO4
         B        REPEAT            REPEAT COMMANDS THRU FILE
         B        WAIT              WAIT FOR SPECIFIED PERIOD
         B        GETCF             ESTABLISH A COMMAND FILE
         B        GHOSIM            SIMULATE GHOST RUN
         B        TRACK             WAIT FOR USER TO COME INTO CORE
         B        BLOCK
         B        SYMBOLMAP         INIT SYMBOL MAP
         B        RUN
         B        ALL
         B        SEARCH
         B        MASK
         B        LP
         B        UCLO
         B        ROWSS             ROW COMMAND
         B        CLOSEIT           CLOSE DUMP FILE
         B        SCANNER           IGNORE BATCH BANG COMMAND
         B        MAPMODE
         B        UNMAP
         B         DUM
EXIT     B        EXITCL
         B        INPUT
         B        SCANNER
         B        COMPARE
        B         MONITOR
         B        PRINT
         B        DO%SYMBOLS        SYMBOL TABLE BUILD / DISPLAY             A00
         B        COM:BF            SPECIAL ENTRY FOR 'BF' COMMAND
         B        ASSOCIATEDEL
         B        DISASSDEL
         B        GIVE:HELP
         B        SETWRITE          WITE
         B        SNOOP             ENTER SNOOP
         B        SPY
         B        CLISTS            WATCH A GIVEN CLIST VIA DCTX PASSED
         PAGE
*
*        CLOSE BOTH FILES AND SAVE THEM
*
EXITCL   EQU      %
         BAL,R0   CLOSEIT           CLOSE M:EI IF NOW IS OPEN
         LC       J:JIT
         BCR,4    NOT%GHST%XIT      NOT A GHOST JOB
         LI,R1    GXITMSG
         BAL,R0   TYP:MSG           TYPE IT OUT
         B        %+2               AND BRANCH
NOT%GHST%XIT  EQU  %                                                         A00
         CAL1,4   DISASSFPT         DISASSOCIATE DELTA IF NECESSARY
         LI,R7    M:LO            LETS CLOSE
         BAL,R0   CLOSEDCB        THE PRINTER DCBS
         LI,R7    M:LL
         BAL,R0   CLOSEDCB        IN CASE LO WENT TO A FILE
EXITCAL  CAL1,9   1
*
GXITMSG  TEXTC    'ANLZ GHOST FINISHED'                                      A00
         PAGE
*
*        WRITE OUT SYMBOL TABLE
*
SETWRITE MTW,1    WRITESYMS         SET FLAG
         B        SCANNER           RETURN
         PAGE
*
*        COMMAND 'GHOST' --- SIMULATE GHOST OUTPUT RUN
*
GHOSIM   EQU      %
         LI,R1    -1                SET SIMULATION FLAG
         STW,R1   GJOB%FLAG         FOR LATER LOOK
         B        SCANNER           GET NEXT COMMAND
         PAGE
*
*        WATCH A CLIST FOR ACTIVITY
*
         REF      DCT7
CLISTS   EQU      %
         LI,R4    -1                CLEAR CURRENT CONTENTS CELL
         LI,R1    1
         BAL,R0   GETHEX            PICK UP THE DCT INDEX
         LI,R14   DCT7
         BAL,R0   GETADDR
         LH,R5    *R15,R2           GET THE CLIST DA
         SLS,R5   1
CLISTS0  EQU      %
         LW,R14   R5                ADDRESS OF THIS CLIST
         BAL,R0   GETADDR           PICK IT UP
         LI,R7    20
CLISTS1  EQU      %
         LW,R13   *R15              GET WORD FROM MONTOR
         CW,R13   R4                COMPARE TO BIRD IN HAND
         BE       CLISTS2           SAME = NO DUMP
         STW,R13  R4                REMEMBER IT
         LI,R7    8
         LW,R8    R15               BUFFER ADDRESS
         BAL,R0   DUMPSOME
         B        CLISTS0           RE-INITIALIZE
CLISTS2  EQU      %
         BDR,R7   CLISTS1           DO IT A COUPLE OF TIMES ANYWAY
         CAL1,8   WAIT5
         B        CLISTS1           LOOP ON
         PAGE
*
*        COMMAND ACCEPTANCE LIST
*
*
COMMANDS EQU      %
         DATA,2   'XX'
         DATA,2   'DI'              DISPLAY
         DATA,2   'SW'              RUN OUT/IN SWAPPER LISTS
         DATA,2   'CS'              CONTROL SECTION MAP
         DATA,2   'RE'              REPEAT COMMANDS FROM A FILE
         DATA,2   'WA'              WAIT FOR SPECIFIED PERIOD
         DATA,2   'CF'              ESTABLISH A COMMAND FILE
         DATA,2   'GH'              SIMULATE GHOST RUN
         DATA,2   'TR'              WAIT FOR USER TO COME INTO CORE
         DATA,2   'BP'              BLOCK PRINT
         DATA,2   'IS'              INIT SYMBOL TABLES
         DATA,2   'RU'              RUN
         DATA,2   'AL'              ALL
         DATA,2   'SE'              SEARCH
         DATA,2   'SM'              SMASK
         DATA,2   'LP'              LINE PRINTER
         DATA,2   'UC'              USERS CONSOLE
         DATA,2   'RO'              ROW COUNT
         DATA,2   'CL'              CLOSE DUMP FILE
         DATA,2   '!A'              BATCH BANG CARD '!ANLZ'
         DATA,2   'MA'              MAP MODE
         DATA,2   'UN'              UNMAP
         DATA,2   'DU'              DUMP
         DATA,2   'EN'              END
         DATA,2   'IN'              INPUT
         DATA,2   'AN'              ANALYZE (IGNORE)
         DATA,2   'CO'              COMPARE
         DATA,2   'MO'              MONITOR DISPLAY
         DATA,2   'PR'              CLOSE SYMBIONT FILE
         DATA,2   'SY'              SYMBOL MAP
         DATA,2   'BF'              SPECIFY BOOT FILE NAME
         DATA,2   'DE'              ASSOCIATE DELTA
         DATA,2   'NO'              DIS-ASSOCIATE DELTA
         DATA,2   'HE'              LIST COMMANDS
         DATA,2   'WR'
         DATA,2   'SN'              CALL THE SNOOP OVERLAY
         DATA,2   'SP'              CALL SPY
         DATA,2   'WC'              WATCH A GIVEN CLIST VIA DCTX PASSED
COMSIZE  EQU      HA(%)-HA(COMMANDS)-1
         BOUND    4
         PAGE
*
*        COMMAND 'REPEAT' INDICATES COMMANDS ARE BEING READ
*        FROM A FILE - CLOSE THE FILE AND READ THEM AGAIN REPEATING
*        WHAT COMMANDS ARE IN THERE
*
REPEAT   EQU      %
         LI,R7    M:SI
         BAL,R0   CLOSEDCB          CLOSE THE FILE UP AGAIN
         B        SCANNER           AND THEN GO OPEN IT AND PERFORM AGAIN
         PAGE
*
*        COMMAND 'WAIT' - PUT VALUE IN WAIT CAL AND WAIT AWHILE
*
WAIT     EQU      %
         LI,R1    1                 VALUE IS IN FIELD 1
         BAL,R0   GETHEX            GO GET IT (AND VALIDATE SAME)
         LI,R1    1                 VALUE GOES INTO SECOND HALFWORD
         STH,R2   WAITFPT,R1        SET IN VALUE
         CAL1,8   WAITFPT           WAIT FOR SPECIFIED PERIOD
         B        SCANNER           AND RETURN FOR NEXT COMMAND
         USECT    DATA
WAITFPT  XPSD,0   0
         USECT    PP
         PAGE
*
*        COMMAND 'TRACE' - WATCH FOR USER TO COME INTO CORE
*
TRACK    EQU      %
         LW,R0    FIELD2            GET OPTION FIELD
         BEZ      TRACK1            NONE SAYS TO TURN IT ON
         CW,R0    PROFF             DO WE TURN IT OFF
         BE       TRACK1            YES - RESET IT
         STW,R0   TRACE             NO - TURN IT ON
         B        SCANNER
TRACK1   EQU      %
         LI,R1    0                 INSURE ITS OFF
         STW,R1   TRACE             BEFORE RUNNING
         B        SCANNER
         USECT    DATA
TRACE    DATA     0                 ZERO SAYS OFF
         USECT    PP
         PAGE
*
*        COMMAND 'BLOCK' - TAKE OPTION FIELD AND BLOCK PRINT IT
*
BLOCK    EQU      %
         CAL1,1   SKIP              ALWAYS SKIP A PAGE FOR BLOCK PRINTING
         LD,R12   FIELD2            OPTION IS IN THERE
         LI,R1    SCANNER           RETURN ADDRESS
         B        BLKPRT            BUILD/PRINT BLOCK PRINTED STRING
         PAGE
*
*        ANALYZE'S COMMAND DECODING TABLES
*
*        TABLE                      USAGE
*        ----------                 ---------------------------------
*        FIELDS                     POINTS TO BUCKETS TO HOLD COMMANDS
*        FIELD#                     HOLDS CURRENT WORKING FIELD #
*        OPFIELD                    POINTS TO FIELD HOLDING OPERATOR
*        FIELD1-FIELD20             HOLDS FIELD CONTENTS (COMMANDS,ETC)
*        F1-F20                     HOLD ARITHMETIC VALUE    (PLUS,MINUS,ETC)
*        FIELD1C-FIELD20C           CONTAINS COUNT OF CHARS IN FIELD
*        OPS                        CONTAINS ARITH OPERATOR (+,-,ETC)
*        ZEROS                      USED TO RESET VARIOUS TABLES
*
FIELDS   DATA     FIELD1
         DATA     FIELD2
         DATA     FIELD3
         DATA     FIELD4
         DATA     FIELD5
         DATA     FIELD6
         DATA     FIELD7
         DATA     FIELD8
         DATA     FIELD9
         DATA     FIELD10
         DATA     FIELD11
         DATA     FIELD12
         DATA     FIELD13
         DATA     FIELD14
         DATA     FIELD15
         DATA     FIELD16
         DATA     FIELD17
         DATA     FIELD18
         DATA     FIELD19
         DATA     FIELD20
         DATA     0                 INDICATES END OF ALL USABLE FIELDS
OPFIELD  EQU      %
         DATA     F1
         DATA     F2
         DATA     F3
         DATA     F4
         DATA     F5
         DATA     F6
         DATA     F7
         DATA     F8
         DATA     F9
         DATA     F10
         DATA     F11
         DATA     F12
         DATA     F13
         DATA     F14
         DATA     F15
         DATA     F16
         DATA     F17
         DATA     F18
         DATA     F19
         DATA     F20
         USECT    DATA
SPFLAG   DATA     0
FIELD#   DATA     0
         BOUND    8
FIELD1   DATA     0,0
FIELD2   DATA     0,0
FIELD3   DATA     0,0
FIELD4   DATA     0,0
FIELD5   DATA     0,0
FIELD6   DATA     0,0
FIELD7   DATA     0,0
FIELD8   DATA     0,0
FIELD9   DATA     0,0
FIELD10  DATA     0,0
FIELD11  DATA     0,0
FIELD12  DATA     0,0
FIELD13  DATA     0,0
FIELD14  DATA     0,0
FIELD15  DATA     0,0
FIELD16  DATA     0,0
FIELD17  DATA     0,0
FIELD18  DATA     0,0
FIELD19  DATA     0,0
FIELD20  DATA     0,0
F1       DATA     0,0
F2       DATA     0,0
F3       DATA     0,0
F4       DATA     0,0
F5       DATA     0,0
F6       DATA     0,0
F7       DATA     0,0
F8       DATA     0,0
F9       DATA     0,0
F10      DATA     0,0
F11      DATA     0,0
F12      DATA     0,0
F13      DATA     0,0
F14      DATA     0,0
F15      DATA     0,0
F16      DATA     0,0
F17      DATA     0,0
F18      DATA     0,0
F19      DATA     0,0
F20      DATA     0,0
*
*
MAXFLD   EQU      8                 MAX LENGTH OF ANY FIELD
FLDCNTS  EQU      %
         DO1      20
         DATA,1   0
         BOUND    4
*
OPS      EQU      %
         DO1      20
         DATA,1   0                 GENERATE ROOM FOR ALL 20 FIELDS
         BOUND    4
*
*        FOLLOWING SYMBOL MUST BE PHYSICALLY LAST BEYOND THESE
*        COMMAND DECODING TABLES
*
         BOUND    4
DECOTOP  EQU      %
*
*
         USECT    PP
         BOUND    8
BLANKS   TEXT     '     '
ZEROS    DO1      16
         DATA     0
         PAGE
*
*        COMMAND 'ROWS'
*        ROW COUNT COMMAND;
*        OPTIONS ARE 1 THRU 12,DEFAULTS ARE;
*
*        LP:      8
*        UC:      4
*
         USECT    PP
ROWSS    EQU      %
         PSW,R1   STACK             SAVE LINK
         LI,1     1                 GET FIELD 2
         BAL,0    GETHEX            IN R2
ROWS1    EQU      %                                                          A00
         LI,R1    3                 ASSUME ONLINE
         MTW,0    LPFLAG            WRITING THE LINE PRINTER
         BEZ      %+2               NO - RESTRICT TO 8 MAXIMUM
         LI,R1    0                 BATCH/GHOST DONT MATTER
CHK:ROW  EQU      %
         AI,2     0                 WAS THERE A VALUE GIVEN
         BEZ      ROWS3             NO,TAKE DEFAULTS
         CB,R2    MAXCNT,R1         COMPARE TO MAX POSSIBLE
         BLE      %+2               IS OKAY
ROWS3    LB,R2    COUNTS,R1         IS NOT OKAY
         STW,R2   BLKCNT            SAVE IT
         LW,R3    R2
         MI,R3    9                 CALCULATE
         AI,R3    15                WHERE
         LI,R2    60                TRANSLATE COLUMN
         MTW,0    LPFLAG
         BEZ      %+2
         LI,R2    90                SHOULD BE
         CW,R3    R2                WILL TRANS COLUMN BE OKAY HERE
         BLE      %+2               YEP
         LI,R3    0                 NO - NO TRANSLATING
         STW,R3   TPTRSV            REMEMBER IT FOR USE LATER
         PLW,R1   STACK             GET LINK
         B        0,R1              AND LEAVE HERE
         PAGE
*F*
*F*    NAME:           GETLIST
*F*
*F*    PURPOSE:        TO CHECK FOR A USER SUPPLIED LIST OF OPTIONS.
*F*
*F*    DESCRIPTION:    IF THE USER HAS TYPED A STRING OF OPTIONS
*F*                    GETLIST WILL RETURN TO THE ADDRESS IN R6.
*F*
*F*                    IF THERE IS NO MORE OPTIONS/OR THERE WAS NONE
*F*                    GETLIST WILL RETURN TO THE SCANNER.
*F*
         USECT    PP
*
GETLIST  EQU      %
         LW,R1    FIELD#            GET CURRENT #
         AI,R1    1                 BUMP TO NEXT ONE
         LW,R2    FIELDS,R1         GET NEXT ONE
         BEZ      SCANNER           HIT THE END
         LW,R2    0,R2              CHECK FOR A VALUE THERE
         BEZ      SCANNER           NONE - QUIT
         B        0,R6              DISPATCH LIST PROCESS AGAIN
MAXCNT   DATA,1   12,12,8,8
COUNTS   DATA,1   8,8,4,4
         PAGE
         USECT    DATA
DATAFLAG DATA     0
TAP%DMP  DATA     0                 SET = RECOVERY FROM A TAPE DUMP
TSIZE    DATA     0
UCTITLE  DATA     0                 SET = NO M:UC TITLE LINE
BLKCNT   DATA     8                 DEFAULT IF GHOST IS 8
         USECT    PP
         PAGE
*F*
*F*    NAME:           CLOSEIT
*F*
*F*    PURPOSE:        TO CLOSE THE DUMP FILE IF OPEN.
*F*
*F*    DESCRIPTION:    THIS ROUTINE WILL CHECK THE DCB OPEN BIT
*F*                    IN THE M:EI DCB AND CLOSE SAME IF SET.
*F*
CLOSEIT  PSW,0    STACK             SAVE RETURN
         BAL,R0   RESETM            RESET DUE TO CLOSING FILE
         LW,0     Y002              SEE IF
         CW,0     M:EI              ITS OPEN
         BAZ      NOCLOSE           NOPE,FORGET
         LI,R7    M:EI              POINT TO CORRECT DCB
         BAL,R0   CLOSEDCB          AND CLOSE/SAVE IT.
NOCLOSE  PLW,0    STACK             RESTORE LINK
         B        *0                AND TAKE IT
         PAGE
*F*
*F*    NAME:           BADCOM
*F*
*F*    PURPOSE:        TO COMPLAIN ABOUT AN INVALID COMMAND.
*F*
*F*    DESCRIPTION:    BADCOM WILL TYPE THE 'EH ?' MESSAGE ONTO
*F*                    M:LO DEVICE.
*F*
         USECT    PP
BADCOM   LI,1     WHAT
         LC       RUN%MODE          TEST INTERACTIVE GHOST FLAG
         BCR,4    EHTOLP            NOT RUNNING AT OPER'S CONSOLE
         LI,R0    ERRET
         B        TYP:MSG
EHTOLP   BAL,R0   MSG               ONLINE/BATCH
         BAL,0    BUFOUT
ERRET    EQU      %                                                          A00
         LB,R0    J:JIT
         BNEZ     SCANNER           CAN GET ANOTHER RESPONSE
         B        EXIT              MUST BE BATCH--> GIVE UP....
WHAT     TEXTC    'EH ?'
         PAGE
*
*        COMMAND 'PRINT'
*
PRINT    EQU      %
         PSW,R0   STACK             SAVE LINK
         LW,R0    FIELD2            CHECK FOR OPTION
         BEZ      PRINT1            NONE
         CW,R0    PRCAN             CANCEL THE SYMBIONT FILE
         BE       PRINT3            YES
         SLS,R0   -16
         CI,R0    'CA'              OR SHORT FORM CANCEL
         BE       PRINT3            YES - CANCEL THEN
PRINT1   EQU      %
         CAL1,9   6                 CLOSE PRINTER FILE
         PLW,R0   STACK
         B        *R0
PRINT3   EQU      %
         CAL1,8   CAN:PRINT         CANCEL THE SYMBIONT FILE
         B        PRINT1
PROFF    DATA,1   'O','F','F',0     INDICATES TO TURN OFF PRINTING
PRCAN    DATA,1   'C','A','N','C'
*
CAN:PRINT GEN,8,24  X'1A'
         GEN,4,20,8  12,0,X'40'
         DATA     'L1'
         DATA     'LP'
*
*
         PAGE
*
*        SUBROUTINE TO ASSOCIATE/DIS-ASSOCIATE DELTA
*
ASSOCIATEDEL EQU  %
         LW,R2    FIELD2            ANY SECOND FIELD
         AW,R2    OPFLAG            OR ARITH OPERATOR
         BNEZ     NOTCOM            YES - NOT DELTA COMMAND
         CAL1,4   ASSDELFPT         ASK TO ASSOCIATE WITH DELTA
         BCS,8    NOA1              DELTA NOT IN THIS SYSTEM
         BCS,1    NOA2              NOT ENUFF CORE TO GO TO DELTA
         B        NOA3              SHOULDNT BE HERE--> TELL USER
*
*
DISASSDEL EQU     %
         CAL1,4   DISASSFPT         DIS-ASSOCIATE DELTA
         BCS,12   NODIS             SOMETHING WRONG
DISARET  EQU      %
         CAL1,8   BRKFPT            RE-TAKE BREAK CONTROL
         B        SCANNER
*
*
ASSDELFPT EQU     %
         GEN,8,7,17   4,1,DELTAENT    GETS INTO DELTA RIGHT AWAY
         TEXTC    'DELTA'
*
*
DISASSFPT EQU     %
         GEN,8,24 5,0
         TEXTC    'DELTA'
*
*
*
NOA1     EQU      %
         LI,R1    NOA1M
         B        NOAMSG
NOA2     EQU      %
         LI,R1    NOA2M
         B        NOAMSG
NOA3     EQU      %
         LI,R1    NOA3M
         B        NOAMSG
NODIS    EQU      %
         LI,R1    NODISM
NOAMSG   EQU      %
         BAL,R0   MB
         B        DISARET           GO TO COMMON EXIT
NOA1M    TEXTC    '**DELTA NOT IN THIS SYSTEM'
NOA2M    TEXTC    '**NOT ENUFF CORE TO ENTER DELTA'
NOA3M    TEXTC    '**UNDEFINED ERROR ON ASSOCIATE CAL'
NODISM   TEXTC    '**NOT CURRENTLY ASSOCIATED WITH DELTA'
         PAGE
*F*
*F*      NAME:    FILENAME
*F*
*F*      PURPOSE:
*F*               TO PUT AWAY THE FILE NAME / ACCOUNT # / PASSWORD
*F*               THE USER HAS TYPED INTO THE VARIOUS SAVE CELLS.
*F*
*F*      DESCRIPTION:
*F*               YOU BAL HERE VIA R0 AND FILENAME BREAKS DOWN THE
*F*               COMMAND LINE PLACING THE FILE INFO INTO THE VARIOUS
*F*               PLACES YOU CAN GET IT FROM.
*F*
*F*               THE FILE NAME GOES INTO 'FILETEXT'
*F*               THE ACCOUNT # GOES INTO 'ACCOUNT'
*F*               THE PASSWORD  GOES INTO 'PASS'
*F*
COM:BF   EQU      %
         LD,R0    FIELD2           CHECK FOR AN OPTION FIELD
         BEZ      DUMP              NONE - MUST MEAN TO DUMP LOC 'BF'
         MTW,0    OPFLAG          WERE ANY OPERATORS FOUND
         BNEZ     DUMP            YEP - NOT DELTA'S COMMAND AT ALL
FILENAME EQU      %
         LCI      8
         PSM,0    STACK             SAVE WORK ARGS
         LD,2     FIELD2            PICK UP THE NAME
         LI,1     0
         LI,4     0                 INIT REGISTERS FOR COUNTING
         LI,5     7
         LI,6     8
FILOOP   EQU      %
         LB,7     2,5               BUILD TEXTC NAME IN 2,3,4
         STB,7    2,6
         BEZ      %+2
         AI,1     1
         AI,5     -1
         AI,6     -1
         BGZ      FILOOP            GET ALL THE CHARACTERS
         STB,1    2                 FORM TEXTC
         LCI      3                 STORE FILE
         STM,2    FILETEXT          NAME
         STM,R2   CFNAME            SAVE NAME HERE ASLO
         LD,R2    FIELD3            GET ACCOUNT #
         BNEZ     FILOOP1           GOT ONE
         LCFI     2
         LM,R2    :SYSACN           LOAD DEFAULT ACN #
FILOOP0  EQU      %
         STM,R2   ACCOUNT
         STM,R2   CFACN             SAVE ACN #
         B        FILOOP3
FILOOP1  EQU      %
         BAL,R4   BLNKSTUF          MERGE BLANKS
         LCFI     2
         B        FILOOP0
FILOOP3  EQU      %
         STD,2    ACCOUNT           AND STORE
         LD,2     FIELD4            GET PASSWORD
         BAL,4    BLNKSTUF          SET IN BLANKS
         STD,2    PASS              SAVE IT
         LCI      8                 RESTORE
         PLM,0    STACK             WORK ARGS
         CI,0     SCANNER           SCANNER CALLED
         BNE      %+2               NO
         MTB,1    DELTAENT+3        YES,SET DELTA FLAG
         B        *0                AND RETURN
BLNKSTUF EQU      %                                                  RL2
         BEZ      0,4                                                RL2
         LI,6     X'40'                                              RL2
         LI,5     7                                                  RL2
         MTB,0    2,5                                                RL2
         BNEZ     0,4                                                RL2
         STB,6    2,5                                                RL2
         BDR,5    %-3                                                RL2
         B        0,4                                                RL2
         PAGE
*
*        COMMAND 'CF' - ASSIGN COMMAND FILE AND USE IT
*
GETCF    EQU      %
         LD,R0    FIELD2           CHECK FOR AN OPTION FIELD
         BEZ      DUMP              NOT A COMMAND FILE COMMAND
         LW,R0    OPFLAG            CHEK ARITH OPERATOR FOUND
         BNEZ     DUMP              DEFINITELY  NT A COMMAND  FILE
         CAL1,1   CLOSESI           CLOSE CURRENT M:SI
         BAL,R0   FILENAME          CONSTRUCT NEW FPT
         CAL1,1   OPENCF            OPEN M:SI TO NEW FILE
         B        SCANNER           AND GO GET A COMMAND
         USECT    DATA
OPENCF   GEN,8,24 20,M:SI
         DATA     X'C7400009'
         DATA     NOFIL,NOFIL
         DATA     1,1,1,2
         DATA     X'01000303'
CFNAME   DATA     0,0,0
         DATA     X'02010202'
CFACN    DATA     0,0
         USECT    PP
         PAGE
BATFLAG  GEN,4,28  4,0
READCOM  GEN,8,24 X'10',M:SI
         GEN,4,28 15,16             FLAGS / WAIT BIT
         DATA     CARDERR           ABNORMAL ADDRESS
         DATA     CARDERR           ERROR ADDRESS
         DATA     UCBUF
         PZE      *R1               BUFFER SIZE IS IN R1
*
UCBUF    EQU      OBUF              PRINT BUFFER IS ALSO CARD BUFFER
         PAGE
*
*        ERROR RECOVERY FOR M:SI READ OPERATION
*
         USECT    PP
CARDERR  EQU      %
         LB,R2    R10               GET I/O ERROR CODE
         CI,R2    5                 IS EOF
         BE       EXITCL            YES - EXIT
         CI,R2    6                 IS EOD
         BE       EXITCL            YES - EXIT
         BAL,R2   RERR1             WELL - PUT OUT AN ERROR MSG
         CAL1,9   3                 AND ERROR EXIT OUT OF SYSTEM
         USECT    DATA              BACK TO DATA
         PAGE
*        ROUTINE TO SUMMARIZE THE TABLES
*
BALL     EQU      %
NOPS     DATA     0
SCREECH%CODE DATA 'IBAD'                                                     A00
REG%FLAG DATA     0        0 MEANS REGS NOT DISPED, SCREECH NOT SAVED        A00
         PAGE
*
*        SET UP FOR RUNNING GHOST MODE INTERACTIVELY
*
         USECT    PP
INT:GHOST EQU     %
         CAL1,1   CLOSESI           CLOSE INPUT STREAM
         CAL1,1   OPENSI:OC         OPEN TO OC
         CAL1,1   OPEN:OC           OPEN M:OC FOR WRITING PROMPTS
         CAL1,1   PROMPTX           SET PROMPTS
         CAL1,8   BRKFPT            TAKE BREAK CONTROL
INT1     EQU      %
         LI,R1    OUTPUT:MSG
         BAL,R0   TYP:MSG           ASK WHERE TO WRITE THE LO STUFF
         BAL,R1   READ:REC          READ THE REPLY
         LH,R1    UCBUF             GET RESPONSE
         AND,R1   #R16
         CI,R1    'LP'              IS LP THE ANSWER
         BE       LPOUTPUT
         CI,R1    'OC'              IS OC
         BE       OCOUTPUT
         CI,R1    'TY'              OR TYPEWRITER IS OK TOO
         BE       OCOUTPUT
         LI,R1    WHAT
         BAL,R0   TYP:MSG
         B        INT1
LPOUTPUT EQU      %
         BAL,R1   OPNTOLP           OPEN M:LO TO LP..SET FLAG
         B        INT2
OCOUTPUT EQU      %
         LI,R1    0
         STW,R1   LPFLAG            CLEAR THE LP FLAG
INT2     EQU      %
         LCFI     4                 SET FLAG
         STCF     RUN%MODE          FOR INTERACTIVE GHOST MODE
         B        GO:ANLZ           TAKE OFF
CLOSESI  GEN,8,24 X'15',M:SI
         DATA     0,0
OPENSI:OC GEN,8,24  X'14',M:SI
         DATA     X'00040000'
         DATA     'OC'
COREMSG  TEXT     '  CORE  '
OUTPUT:MSG TEXTC 'WRITE LO TO THE LP OR THE OC ??'
TAPEDMSG TEXT     'TAPEDMP '
         PAGE
*
*        COMMAND 'ALL'
*
*        SET UP ALL VECTOR LOOP
*
         USECT    PP
ALL      EQU      %
         MTW,0    LPFLAG            WRITING THE LINE PRINTER
         BEZ      ALL01             NO - SKIP THIS CODE
         CAL1,1   SKIP
         LCFI     2                 GET THE SITE LOCATION
         LM,R12   HDMSG+09          PICK UP SITE TEXT STRING
         BAL,R1   BLKPRT            PUT OUT THE BANNER
         CAL1,1   SKIP              ANOTHER NEW PAGE
         LW,R1    FILTYP            GET TYPE OF FILE
         BLEZ     ALL01             NONE
         LCFI     2
         LM,R12   0,R1              PICK UP FILE NAME
         LB,R10   R12               CHECK FOR A TEXTC STRING
         CI,R10   64                IS VALID EBCDIC
         BGE      %+2               YUP--NO SHIFT
         SLD,R12  8                 SHIFT OFF BYTE COUNT
         AI,R13   X'40'             BLANK OUT LAST BYTE OF NAME
         BAL,R1   BLKPRT            PRINT ON LINE PRINTER
ALL01    EQU      %
         BAL,R0   UNMAP
         BAL,R1   GETHIGH           ESTABLISH SYSTEM LIMITS
         BAL,R1   SYMBOLMAP         INIT THE MAP
         BAL,R1   INIT:MD           GET MONDMP GOING
         LI,1     -(AOPSCNT+1)      SET UP GHOST LOOP CNT
         STW,1    NOPS            # OF OPERATIONS
         LCI      10
         LM,0     ZEROS           ZERO FIELDS,
         STM,0    FIELD1          TAKE COMMAND DEFAULTS
ALLEP    EQU      %
         LI,R0    0
         STW,R0   USER              THIS THING STAYS RESET
         STW,R0   MAPFLAG           TRANSLATION IS PHYSICAL
         MTW,1    NOPS              BUMP COUNTER
         BGZ      EXITCL            ALREADY BEEN THRU THERE....
         LI,1     SCANNER           SET RETURN FOR MD CODE
         LW,2     NOPS              GET VECTOR#
         B        ALLOPS,2          AND GO
         PAGE
*
*        GHOST DISPLAY VECTOR TABLE
*
AOPS     EQU      %
         B        INIT:MD           GET MONDMP INIT                          A00
         B        REGS              TRAP REGISTERS                           A00
         B        MDTRAPS           TRAPS/INTERRUPTS                         A00
         B        TRPAGE            TRAPPED PAGE                             A00
         B        USERS             USER TABLES                              A00
         B        STATES            USER STATE CHAINS                        A00
         B        MD:SUBQ           RESOURCE WAIT QUEUES
         B        SWAP              SWAPPER TABLES                           A00
         B        MPTABLES          PUT OUT MULTI-PROCESSING TABLES
         B        SLCPU             SLAVE CPU PRIVATE PAGES
         B        GHTABLES          GHOST JOB TABLES
         B        FED:TAB           FECP TABLES
         B        PROCLIST          PROCESSORS BEING INSWAPPED
         B        USERSLIST         USER OUTSWAP LISTS
         B        PARTITIONS        DISPLAY PARTITIONS                       A00
         B        PROCS             PROCESSOR TABLES                         A00
         B        MPAGES            MONITOR/SWAPPER PAGE CHAINS              A00
         B        UPAGES            USER PAGE CHAINS                         A00
         B        PPAGES            PROCESSOR PAGE CHAINS                    A00
         B        RA:TABL           DISPLAY READ-AHEAD TABLES
         B        RTPAGES           DISPLAY REAL TIME PAGES
         B        XDELPGS           DELTA/HANDLER PAGES
         B        TPWP              TRANSACTION PROCESSING TABLES
         B        RBTDISP           REMOTE PROCESSING TABLES
         B        SYMTABLS          SHOW OUTPUT SYMBIONT TABLES
         B        PHYMAP            PHYSICAL MEMORY MAP                      A00
         B        ALLYTABL          ALLYCAT'S TABLES
         B        IODISPLAY         I/O TABLES                               A00
         B        %CITS             CITS/OPLBTS                              A00
         B        %DCTS             DCT TABLES                               A00
         B        %IOQS             IOQ TABLES                               A00
         B        COCODE            COC TABLES                               A00
         B        RAT%TABLES        RESOURCE ALLOCATION TABLES               A00
         B        AVR%TABLES        AUTOMATIC VOLUME RECOGNITION             A00
         B        ERROR%LOG                                                  A00
         B        JITS
         B        CURRENT%USER      DISPLAY CURRENT USER                     A00
         B        MONITOR%ROOT      DISPLAY MONITOR ROOT                     A00
         B        SYMBIONTS         RBBAT RECOVERY FILE                      A00
         B        UID               USER IDENTIFICATION                      A00
         B        PATCHES           DISPLAY SYSTEM PATCH FILE                A00
         B        END%GHOST%DEFAULT  QUIT HERE IF GHOST JOB                  A00
         B        RECOVERY%CONTEXT  DUMP RECOVERY CONTEXT
         B        ALLJIT
         B        TCONT
AOPSCNT  EQU      %-AOPS
         PAGE
*
*        GHOST DISPLAY FINISHED,DUMP ROOT OF MONITOR
*        IF RUNNING AS GHOST,OR RETURN TO SCANNER
*        IF RUNNING 'ALL' FOR AN ONLINE USER
*
ALLOPS   EQU      %
ALLEXIT  EQU      %
         BAL,R1   RECOVERY%CONTEXT  DISPLAY RECOVERY AREA FOR GHOST
         B        ALLJIT            GO SHOW ALL THE USER JIT'S
TPMSG    TEXTC    'PAGE IN WHICH TRAP OCCURED:'
         PAGE
*
*        DISPLAY PATCH FILE IF IT EXISTS
*
PATCHES  EQU      %
         LI,1     PATFMSG
         BAL,0    TITEL             SHOVE OUT TITEL
         CAL1,1   OPEN:PATF         OPEN THE PATCH FILE
         CAL1,1   SET:PATF          SET ERR/ABN
PATCHES1 CAL1,1   READ:PATF         READ A RECORD
         LW,R1    F:PAT+13          GET RECORD SIZE
         STW,R1   BUFSIZ            STORE IT
         CAL1,1   WRITBUF           WRITE IT ON M:LO
         B        PATCHES1          CONTINUE
PATCHES2 LI,R7    F:PAT             SET DCB ADDRS
         BAL,R0   CLOSEDCB          AND CLOSE IT
         B        SCANNER           GO TO NEXT COMMAND
PATFMSG  TEXTC    'PATCH FILE:'
*
*
*
         PAGE
*
*
*
*
SCR:CNT  EQU      %
         DATA,1   3,X'7E',X'79',X'61'
*
*        ABOVE ARE SOFTWARE TRAPS SPECIAL CASED BY ANALZ
*
USERIDMS TEXTC    'USER IDENTIFICATION:'
*
*
*
        PAGE
*
*       ROUTINE TO SET FLAG TO DISPLAY LOCATIONS IN THE
*       RUNNING MONITOR AND PERMIT CHANGING IT
*
MONITOR  EQU      %
         BAL,0    CLOSEIT           MAKE SURE DUMP ISNT OPEN
         LB,1     FIELD2            GET OPTION FIELD
         CI,R1    'D'               DISPLAY MODE TO GO ON
         BNE      NOT:MDISP         NOPE
         STW,R1   MONFLAG           SET BOTH FLAGS
         BAL,R0   UNMAP
         B        SETUPDISP         DO IT
NOT:MDISP LD,R0   ZEROS
         STD,R0   MONFLAG           THESE TWO FLAGS
         BAL,R0   RES:BUF           RESTORE THE BUFFERS
SETUPDISP MTW,0   MONFLAG           DID IT GO ON
         BEZ      SCANNER           NO - GET NEXT COMMAND
         BAL,R1   GETHIGH           PERFORM RUNNING MONITOR STUFF
         LI,R1    COREMSG
         STW,R1   FILTYP            STORE MSG FOR BANNER
         B        SCANNER
*
*
        USECT     DATA
         BOUND    8
MONFLAG  DATA     8899
REPFLAG DATA      0
         BOUND    8
RCVLIMITS DATA    X'4000',X'6200'
         USECT    PP                GENERATE PROCEDURE HERE
         PAGE
*
*        ROUTINE TO TRACE THE SPECIFIED NUMBER OF EVENTS
*        IN THE RECORDER
*
         USECT    DATA
USER:NUM EQU      %
USER     DATA     0                 SPECIFIED USER
         USECT    PP
         PAGE
*F*
*F*    NAME:           NOTRACE
*F*
*F*    PURPOSE:        TO TELL THE USER THAT THE REQUESTED DISPLAY
*F*                    ITEM IS NOT IN HIS SYSGEN.
*F*
*F*    DESCRIPTION:    NOTRACE WILL PRINT THE MESSAGE AND GO TO
*F*                    THE SCANNER.
*F*
         USECT    PP
NOTRACE LI,1      NOEVENTS
PUSHMSG  EQU      %
         BAL,R0   MSG%OUT
         B        SCANNER
NOEVENTS  TEXTC   'IT DOES NOT EXIST IN THIS SYSTEM'
MONITOR%ROOT EQU  MD:CORE
         PAGE                                                                A00
*                                                                            A00
*    TEST IF WE ARE RUNNING AS A GHOST                                       A00
*    IFSO, DO ABBREVIATED USER DISPLAY.                                      A00
*    IF NOT, CONTINUE JOB                                                    A00
*                                                                            A00
END%GHOST%DEFAULT EQU %                                                      A00
         LW,R3    GJOB%FLAG         RUNNING AS A GHOST JOB
         BGZ      ALLOPS            RUNNING AS A GHOST
         BLZ      ALLOPS            SIMULATING A GHOST
         MTW,0    RUN%MODE          RUNNING AS A BATCH JOB/ONLINE USER
         BNEZ     SCANNER           YES, GO THERE
         B        TCONT             ASSUME WE'RE A GHOST JOB
         PAGE
*F*
*F*    NAME:           SETR6
*F*
*F*    PURPOSE:        TO TAKE THE STATE NUMBER AND CONVERT IT TO A
*F*                    TEXT MESSAGE.
*F*
*F*    DESCRIPTION:    SETR6 EXPECTS R6 TO HAVE A VALID STATE NUMBER
*F*                    INIT - IT WILL THEN TAKE THAT NUMBER AND
*F*                    CONVERT IT TO THE STATE TEXT ADDRESS AND EXIT
*F*                    TO THE MESSAGE ROUTINE. THE MESSAGE ROUTINE
*F*                    WILL RETURN VIA R0 WHICH IS HOW YOU GOT HERE.
*F*
SETR6    AND,6    =X'3F'            MASK TO LIMIT
         BNEZ     %+2               LOOK OUT DUMMY
         LI,6     1                 OH OH
         SLS,6    1                 DBL-WRD INDEX
         AND,6    =-2               MASK IT AGAIN
         AI,6     STATEX            GET MSG ADDRS
         LW,1     6                 MOVE TO R1
         B        MSG               LINK STILL IN R0...
*
         PAGE
*
*        STATES
*
STATEX   EQU      %-2
1ST%STATE  EQU    %                                                          A00
         TEXTC    'SRT   '          1 - REAL TIME EXECUTE
         TEXTC    'SC0   '          2 - BACKGROUND PRIO
         TEXTC    'SC1   '          3 -
         TEXTC    'SC2   '          4
         TEXTC    'SC3   '          5
         TEXTC    'SC4   '          6
         TEXTC    'SC5   '          7
         TEXTC    'SC6   '          8
         TEXTC    'SC7   '          9
         TEXTC    'SC8   '          10
         TEXTC    'SC9   '          11
         TEXTC    'SC10  '          12
         TEXTC    'SCU   '          13 - CURRENT USER
         TEXTC    'STOB  '          14 - TERMINAL OUTPUT BLOCKED
         TEXTC    'STOBO '          15 - TERMINAL OUTPUT BLOCKED - OUT
         TEXTC    'SIOW  '          16 - I/O WAIT
         TEXTC    'SIOMF '          17 - MF TOO HIGH
         TEXTC    'SW    '          18 - ASLEEP
         TEXTC    'SQA   '          19 - QUEUED FOR ACCESS
         TEXTC    'SQR   '          20 - QUEUED FOR RESOURCE
         TEXTC    'SQRO  '          21 - QUEUED FOR RESOURCE - OUT
         TEXTC    'STI   '          22 - TERMINAL OUTPUTTING
         TEXTC    'STIO  '          23 - TERMINAL OUTPUTTING - OUT
         TEXTC    'SQFI  '          24 - QUEUED FOR INTERRUPT
         TEXTC    'NULL  '          25 - NOT USED
         TEXTC    'NULL  '          26 - NOT USED
         TEXTC    'NULL  '          27 - NOT USED
         TEXTC    'NULL  '          28 - NOT USED
         TEXTC    'NULL  '          29 - NOT USED
         TEXTC    'SNULL '          30 - NULL STATE FOR NO USER THERE
#STATES  EQU      (%-1ST%STATE)/2                                            A00
         PAGE
RTPMSG   TEXTC    'REAL-TIME PAGE CHAINS:'
DELPGS   TEXTC    'XDELTA/HANDLER PAGE CHAINS:'
*
UPGMSG   TEXTC    'USER PAGE CHAINS:'
MPGMSG   TEXTC    'MONITOR (FREE) PAGE CHAIN:'
PPGMSG   TEXTC    'PROCESSOR PAGE CHAINS:'
STCMSG   TEXTC    'USER STATE CHAINS:'
SPGMSG   TEXTC    'SWAPPER PAGE CHAIN:'
         PAGE
*
*F*
*F*    NAME:           PAGETABLE
*F*
*F*    PURPOSE:        TO BUILD THE PHYSICAL MEMORY MATRIX TABLE
*F*
*F*    DESCRIPTION:    EACH CALLER HAS THE RESPONSIBILITY OF
*F*                    PLACING AN 'OWNERS CODE' IN 'PG:MODE'.
*F*                    THIS ROUTINE WILL MARK THE PAGE HAS USED IN
*F*                    THE PHYSICAL MEMORY MATIRX WITH THE OWNERS
*F*                    CODE INSERTED INTO THE WORD.
*F*
*F*                    THE ROUTINE PHYMAP IN ANALZO4 WILL PRODUCE
*F*                    A REPORT AFTER THE TABLE HAS BEEN BUILT.
*F*
*
*        MODE SETTINGS:
*
*        10=      SYMBIONT DATA (SPOOL) PAGE
*        9 =      MULTI-PROCESSING SLAVE PRIVATE PAGE
*        8 =      TRANSACTION PROCESSING WORK PAGE
*        7 =      READ AHEAD PAGE
*        6 =      XDELTA'S CORE
*        5 =      REAL TIME USERS PAGE
*        4 =      USERS PAGE
*        3 =      PROCESSOR
*        2 =      MONITOR
*        1 =      SWAPPER
*
PAGETABLE EQU     %
         CI,13    X'E2E3'           FROM STATE CHAIN
         BE       USERQUEUE         YES - GO TO PROPER ROUTINE
         LCFI     6
         PSM,0    STACK             SAVE ALL REGS
         MTW,0    PG:ARRAY          GOT BUFER YET
         BNEZ     PG:IN             ALREADY GOT ONE
         CAL1,8   GETTWO            GET ONE THEN
         BCS,8    NO:PGS            CANT GET IT
         STW,9    PG:ARRAY          STORE ADDRESS
         LI,0     0                 SET UP
         LI,1     0
         STW,0    *9,1
         AI,1     1
         CI,1     1024
         BL       %-3               TILL 512K PAGES
PG:IN    EQU      %
         LI,R5    X'F0'             NORMAL ERROR CODE
         STB,R5   PAGE:ERROR        SAVED..
         AND,R4   #R16              SCRUB PAGE # TO 16 BITS WORTH
         CLM,R4   PAGLIMS           IS VALID PAGE NUMBER
         BCS,9    NO:PGS            NOPE...EXIT
         LI,R5    0                 RESET ERROR FLAG REGISTER
         LW,1     PG:MODE           GET TYPE OF OWNER
         LW,2     *PG:ARRAY,4       GET PREVIOUS CELL
         BEZ      STO:PG          *  NO OWNER - STORE THIS OWNER
         LC       PG:MODE         * CHECK MODE
         BCS,1    STO:PG          * IS SWAPPER--OKAY TO STORE
         LB,R2    R1                GET PREVIUS OWNERS CODE
         CI,R2    X'A0'             WAS IT A SYMBIONT PAGE
         BNE      CHK:PG            NOPE
         LB,R2    PG:MODE           AND IS IT STILL A SYMBIONT PAGE
         CI,R2    X'A0'
         BE       STO:PG            YES--NOT PROBLEM
CHK:PG   EQU      %                 MULTIPLY ALLOCATED PAGE ENTRY
         LI,R5    X'F1'             MULTIPLE PAGE OWNER'S CODE
         STB,5    1                 STORE RESULT
STO:PG   EQU      %
         STB,R5   PAGE:ERROR        SAVE FLAG
         STW,R1   *PG:ARRAY,R4      STORE PAGE DATA INTO ARRAY
         LB,R0    PG:MODE           GET OWNER'S CODE
         CI,R0    X'50'             IS REAL TIME PAGE
         BNE      %+2               NOPE
         BAL,R0   PREMEM            YUP---> GO REMEMBER IT
NO:PGS   LCFI     6
         PLM,0    STACK
         LC       PAGE:ERROR        SET CC'S FOR RETURN
         B        *0
         USECT    DATA
PG:ARRAY DATA     0                 POINTER TO BUFFER
PAGE:ERROR DATA   0                 FLAG INDICATING ERROR OR NOT
         USECT    PP
         PAGE
*
*        RUNNING STATE QUEUES - INSURE WE HAVENT DONE USER BEFORE
*
         BOUND    8
USERLIMS DATA     1,SMUIS           LIMITS OF USER NUMBERS
USERQUEUE EQU     %
         PSW,R5   STACK             SAVE R5
         LI,R5    0                 ASSUME NO ERROR
         CLM,R4   USERLIMS          IS USER # IN RANGE
         BCR,9    %+2               YES
         LI,R5    255               NO
         MTB,0    *USERLIST,R4      SEEN THIS USER BEFO ????
         BEZ      %+2               NOPE
         LI,R5    255               YES - SET ERROR FLAG
         MTB,1    *USERLIST,R4      COUNT HIM AS SEEN NOW
         STB,R5   PAGE:ERROR        SET ERROR FLAG/OR NOT
         PLW,R5   STACK             RESTORE REG
         LC       PAGE:ERROR        PASS BACK CC'S
         B        *R0               AND RETURN
         USECT    DATA
USERLIST EQU      %
         DATA     0
*
ULSTSIZE EQU      SMUIS             SAME LENGTH AS USER TABLES
*
         USECT    PP                BACK TO PROGRAM PROCEDURE
         PAGE
*
         USECT    DATA
FIRSTPG  DATA     0
JITPAGE  DATA     0
         USECT    PP
*
UNOWNMS  TEXTC    'UNALLOCATED PAGES:'
PGMAPMS  TEXTC    'PHYSICAL MEMORY ALLOCATION:'
*
*
*
         PAGE
*
*        ROUTINE  TO  ACT ON DISPLAY OPTIONS
*
DISPLAY  EQU      %
         LI,R2    #DISPLAYS         LOOP COUNT
         LI,R1    SCANNER           DEFAULT RETURN LINK
         LH,R3    FIELD2            GET OPTION
         CH,R3    DCOM,R2           FIND MATCH
         BE       GO:DISPLAY        GOT IT
         BDR,R2   %-2
         B        BADCOM
GO:DISPLAY EXU    DISP:ACT,R2       GO TO TARGET ROUTINE
         PAGE
*
*        SUBROUTINES TO PERFORM REQUESTED FUNCTION
*
DISP:ACT EQU      %
         GEN,8,24  X'68',SCANNER    0 -0 - NO OPTION
         GEN,8,24  X'68',REGS      X'681 - REGISTER DISPLAY
         GEN,8,24  X'68',TPAGE      2 -2 - PAGE WHERE TRAP OCCURED
         GEN,8,24 X'68',WHY         2.5 -  TRAP REASON CODE
         GEN,8,24  X'68',PATCHES    3 -3 - PATCH FILE CONTENTS
         GEN,8,24 X'68',ALLJIT      4 -4 - IN CORE USERS
         GEN,8,24 X'68',ALLOUTJIT   5 -5 - OUT OF CORE USERS
         GEN,8,24 X'68',MDTRAPS     6 -6 - TRAP LOCS (XPSD'S)
         GEN,8,24 X'68',USERS       7 -7 - USER TABLES
         GEN,8,24 X'68',UID         8 -8 - USER NAME/ACCOUNT
         GEN,8,24 X'68',PAGEDISP    9 -9 - PHYSICAL PAGE DUMP
         GEN,8,24 X'68',QFREELIST   10-10- FREE IOQ LIST
         GEN,8,24 X'68',PHYMAP      11-11- PHYSICAL PAGE MATRIX
         GEN,8,24 X'68',JITS        12-12- SPECIFIED JIT
         GEN,8,24 X'68',PROCS       13-13- PROCESSOR TABLES
         GEN,8,24 X'68',COCODE      14-14- COC TABLES
         GEN,8,24 X'68',SWAP        15-15- SWAPPER TABLES
         GEN,8,24 X'68',IODISPLAY   16-16- ALL I/O TABLES
         GEN,8,24 X'68',PARTITIONS  17-17- PARTITION TABLES
         GEN,8,24 X'68',SYMBIONTS   18-18- RBBAT RECOVERY FILE
         GEN,8,24 X'68',MD:CORE     20-20- MONITOR ROOT
         GEN,8,24 X'68',MDTRAPS     21-21- TRAP TABLES
         GEN,8,24 X'68',MDDCB       22-22- USER DCBS
         GEN,8,24 X'68',MONITOR%ROOT 2323- MONITOR ROOT
         GEN,8,24 X'68',%CITS       24-24- CIT TABLES
         GEN,8,24 X'68',%IOQS       25-25- IOQ ENTRIES
         GEN,8,24 X'68',%DCTS       26-26- DCT TABLES ONLY
         GEN,8,24 X'68',CURRENT%USER 2727- CURRENT USER MEMORY
         GEN,8,24 X'68',RECOVERY%CONTEXT 28- SELF EXPLANATORY
         GEN,8,24 X'68',RAT%TABLES  29- RESOURCE STUFF
         GEN,8,24 X'68',AVR%TABLES  30- VOLUMN TABLES
         GEN,8,24 X'68',SYMTABLS    31- SYMBIONT TABLES
         GEN,8,24 X'68',ALLYTABL    32- ALLYCAT'S TABLES
         GEN,8,24 X'68',ADAMDUMP    33- ADAM'S MEMORY
         GEN,8,24 X'68',DISPSTK     34- TSTACK BURST
         GEN,8,24 X'68',VIR:PAGE    35- VIRTUAL PAGE DUMP
         GEN,8,24 X'68',RA:TABL    35.5- B00 CP-V DISPLAY
         GEN,8,24 X'68',ERROR%LOG   36- ERROR LOG DUMP
         GEN,8,24 X'68',MD:SUBQ     37- RESOURCE WAIT QUEUE
         GEN,8,24 X'68',TPWP        38- TRANSACTION PROCESSING TABLES
         GEN,8,24  X'68',RBTDISP    39 - REMOTE PROCESSING TABLES
         GEN,8,24  X'68',PROCLIST   40 - PROCESSOR INSWAP LISTS
         GEN,8,24  X'68',USERSLIST  41 - OUTSWAP USER TABLES
         GEN,8,24  X'68',MPTABLES   42 - MULTI-PROCESSING TABLES
         GEN,8,24  X'68',GHTABLES   43 - GHOST JOB TABLES
         GEN,8,24  X'68',SLCPU      44 - SLAVE CPU PRIVATE PAGES
         GEN,8,24  X'68',FED:TAB    45 - FECP TABLES
         PAGE
DCOM     TEXTC    ' RE',;           REGS
                  'TA',;            TRAPPED PAGE ADDRESS
                  'WH',;            TRAP REASON ROUTINE
                  'PF',;            PATCH FILE
                  'AJ',;            ALL USER JIT/AJITS/CONTEXT
                  'OJ',;            OUT OF CORE JITS
                  'TR',;            TRAPS
                  'US',;            USERS
                  'ID',;            USER IDENTIFICATION
                  'PP',;            PHYSICAL PAGE DISPLAY
                  'FQ',;            DISPLAY FREE QUEUES
                  'PM',;            PHYSICAL PAGE MAP                        B00
                  'JI',;            JITS
                  'PR',;            PROCS
                  'CO',;            COC TABLES
                  'SW',;            SWAP
                  'IO',;            IO TABLES
                  'PA',;            PARTITIONS
                  'SY',;            SYMBIONT TABLES
                  'P2',;
                  'P3',;
                  'P4',;            DCB'S                                    A00
                  'MR',;            MONITOR ROOT                             A00
                  'CI',;            CIT'S                                    A00
                  'IQ',;            IOQS                                     A00
                  'DC',;            DCTS                                     A00
                  'CU',;            CURRENT USER                             A00
                  'RC',;            RECOVERY CONTEXT                         A00
                  'RA',;            RESOURCE ALLOC TABLES                    A00
                  'AV',;            AVR TABLES                               A00
                  'ST',;            SYMBIONT TABLES                          A00
                  'AT',;            ALLYCAT TABLES
                  'AD',;            ADAM'S MEMORY DUMP
                  'TS',;            DISPLAY TSTACK CONTENTS
                  'VP',;            DISPLAY VIRTUAL PAGE #
                  'FM',;            FILE MANAGEMENT READ-AHEAD TABLES
                  'EL',;            ERROR LOG BUFFERS
                  'RQ',;            RESOURCE WAIT QUEUES
                  'TP',;            TRANSACTION PROCESSING TABLES
                  'RB',;            REMOTE PROCSSING
                  'PN',;            PROCESSOR INSWAP TABLES
                  'OS',;            OUTSWAP USER TABLES
                  'MP',;            MULTI-PROCESSING TABLES
                  'GH',;            GHOST JOB TABLES
                  'SL',;            SLAVE CPU TABLES
                  'FE'              FECP TABLES
#DISPLAYS EQU     HA(%)-HA(DCOM)-1
         USECT    DATA
         BOUND    8
PROCNAME TEXTC    'METASYM'
CLOSESTSYM DATA   0                 ADDRESS OF SYMBOL TEXTC (CLOSEST ONEE)
CLOSESTADD DATA   0                 SYMBOL'S ADDRESS (CLOSEST ONE)
UHFLGR   DATA     UH:FLG
UHFLGR1  DATA     UX:JIT+SMUIS
         PAGE
*F*
*F*    NAME:           BLNKBUF
*F*
*F*    PURPOSE:        TO CLEAR THE PRINT BUFFER POINTERS.
*F*
*F*    DESCRIPTION:    CERTAIN ROUTINES IN ANLZ HAVE BUILT PARTIAL
*F*                    PRINT BUFFERS AND THEN DISCOVER THAT THEY
*F*                    DO NOT WANT TO DISPLAY THE CURRENT LINE.
*F*                    BLNKBUF CRASHES THE POINTERS SO THAT THE LINE
*F*                    WILL NOT BE SEEN.
*F*
         USECT    PP
BLNKBUF  EQU      %
         STW,R0   SRETURN           SAVE RETURN LINK
         LI,R0    0
         STW,R0   PTR               **CRASH
         STW,R0   TPTR                **ALL
         B        *SRETURN                **AND EXIT
         PAGE
*F*
*F*    NAME:           BLANK1
*F*
*F*    PURPOSE:        TO PRINT A BLANK LINE FOR READIBILITY.
*F*
*F*    DESCRIPTION:    CALL HERE VIA R0 AND BLANK1 WILL PRINT
*F*                    A BLANK LINE FOR YOU.
*F*
BLANK1   EQU      %
         CAL1,1   WRITBLNK          WRITE THE BLANK LINE
         B        *R0               AND EXIT
*
*
*
WRITBLNK GEN,8,24  17,M:LO
         GEN,4,28   3,0
         DATA     BLANKS
         DATA     1
*
*
WAIT5    XPSD,0   1                 1 SECOND WAIT FPT
*
*
TAPE:MSG TEXTC 'ENTER TAPE TYPE: 7T,9T,BT ETC..'
         BOUND    8
SYM:LIMS DATA     MONORG,J:AJIT-1
JIT:LIMS DATA     J:JIT,J:JIT+511
PATCHLOC DATA     MPATCH,MX:PPUT+10
         USECT    DATA
SYMBOL:FLAG DATA  0,0
         USECT    PP
*
         PAGE
*F*
*F*    NAME:           RES:JIT
*F*
*F*    PURPOSE:        TO RESTORE THE JIT FOR THE USER # IN R2.
*F*
*F*    DESCRIPTION:    RES:JIT WILL CALL LOCJIT IF WE ARE NOT
*F*                    LOOKING AT CORE.
*F*                    IF LOOKING AT CORE - RES:JIT WILL SEE IF
*F*                    THE USER IS IN CORE AND IF SO WILL MVE THE
*F*                    JIT INTO ANLZ'S JIT BUFFER (JITBUF).
*F*                    IIF NOT IN CORE RES:JIT WILL EXIT IF THE
*F*                    TRACE FLAG IS OFF.
*F*
*F*                    IF THE TRACE FLAG IS ON AND THE USER ISNT
*F*                    IN THE 'SNULL' STATE (NO ONE THERE) - RES:JIT
*F*                    WILL WAIT FOR THE USER TO COME INTO CORE AND
*F*                    THEN CAPTURE THE JIT THEN.
*F*
*
RES:JIT  EQU      %
         LW,R2    USER              *GET USER NUMBER PASSED
         MTW,0    MONFLAG           *RUNNING AGAINST MEMORY
         BEZ      LOCJIT            *NO - FILE - GO TO LOCJIT
         LCFI     0                 *
         PSM,R0   STACK             *SAVE WORK AREA
         CI,R2    0                 *IS USER NUMBER PASSED
         BGZ      RES:JIT1          *NEED A USER JIT
         LI,R1    JJITVP            *NEED MONITOR JIT
         B        RES:JIT2          *JUMP TO GET IT
RES:JIT1 EQU      %                 *
         LI,R14   UH:FLG            *NEED FLAGS
         BAL,R0   GETADDR           *GET EM
         LH,R14   *R15,R2           *
         CI,R14   JIC               *USER IN CORE
         BANZ     RES:JIT15         *JIT IS IN CORE
         MTW,0    TRACE             *SUPPOSED TO WAIT FOR IT
         BEZ      RES:JIT4          *NO - GO ON AND SAY NOT IN CORE
         LI,R14   UB:US            *FIRST LETS CHECK THE USER'S STATE
         BAL,R0   GETADDR          *
         LB,R14   *R15,R2          *GET IT
         BEZ      RES:JIT5         *NO USER THERE
         CI,R14   #STATES          *IS SNULL STATE
         BE       RES:JIT5         *YES - NO ONE THERE
         CAL1,8   WAIT5            *WAIT FOR 5 SECONDS
         B        RES:JIT1         *AND GO GET USER'S FLAGS AGAIN
RES:JIT15 EQU     %                *
         LI,R14   UX:JIT           *NOW WE NEED THE JIT PAGE #
         BAL,R0   GETADDR           *JIT PAGE ADDRESS
         LOAD,R1  *R15,R2           *FROM TABLES
RES:JIT2 EQU      %
         BEZ      SCANNER           *NONE
         LCFI     8
         STCF     JITSTAT           SET FLAGS AS THO WE GOT THE JIT
         STW,R0   OLDPAGE           CLEAR OLD PAGE CONTENTS
         STD,R0   CURADRSS          FORCE A RE-MAP IF MONITOR MODE
         STW,R1   J:PAGE            AND FINALLY SAVE PAGE #
         BAL,R0   GET1ADDR          *GET IT
         LI,R1    32                *NUMBER OF MOVES
         STW,R1   MOVCNT            *SET UP
         LW,R14   PAGEBUF
         LW,R15   JITBUF            *GET POINTERS
RES:JIT3 EQU      %                 *
         STD,R14  MOVES             *SET UP
         LCFI     0                 *
         LM,R0    *MOVES            *MOVE FROM CVM WINDOW
         STM,R0   *MOVES+1          *INTO JIT BUFFER
         LD,R14   MOVES             *GET POINTERS AGAIN
         AI,R14   16                *
         AI,R15   16                *BUMP EM
         MTW,-1   MOVCNT            *DECREMENT COUNT
         BGZ      RES:JIT3          *MORE TO GO
         LI,R14   UX:JIT            NOW LETS MAP ONTO THE TABLE
         BAL,R0   GETADDR           AGAIN
         LW,R2    USER              USER # TO GET
         LOAD,R7  *R15,R2           GET THE JIT'S PAGE NUMBERR
         LI,R14   UH:FLG            AND THEN WE NEED
         BAL,R0   GETADDR           THE FLAGS FOR HIM...
         LH,R8    *R15,R2           GET FLAGS
         CI,R8    JIC               STILL IN CORE
         BAZ      RES:JIT300        NOPE
         CW,R7    J:PAGE            IN PAGE WE GRABBED...
         BE       RES:JIT301        YUP--> GO
RES:JIT300 EQU    %
         LCFI     4                 NOPE
         STCF     JITSTAT           SET FLAGS
RES:JIT301 EQU    %
         LCFI     0                 *
         PLM,R0   STACK             *ALL DONE
         LC       JITSTAT           LOAD FLAGS
         B        *R0               *
         USECT    DATA              *
MOVCNT   DATA     0                 *
         BOUND    8
VALUES   EQU      %-1               USED BY GETHEX
MOVES    DATA     0,0               *
         USECT    PP
         PAGE
*
*        USER IS NOT IN CORE
*
RES:JIT4 EQU      %
         LI,R1    UXJITERR1         *
         BAL,R0   MSG               *
         LW,R3    USER              *GET NUMBER
         AND,R3   #R16              *MASK FLAGS
         BAL,R0   TRANSSZ           *PUT OUR NUMBER OUT
         LI,R1    RESJITM           *MSG
         BAL,R0   MBB               *SEND MSG OUT
         B        SCANNER           *AND EXIT
RESJITM  TEXTC    ' IS NOT IN CORE'
         PAGE
*F*
*F*      NAME:    RES:JIT5
*F*
*F*      PURPOSE:
*F*               TO TELL THE USER THAT THE USER JIT HE SPECIFEIED
*F*               IS REPRESENTATIVE OF A USER THAT IS NOT CURRENTLY
*F*               IN THE SYSTEM (IE; SNULL )
*F*
RES:JIT5 EQU      %
         LI,R1    RESJITM1          *MSG TO SEDN
         B        PUSHMSG           *SEND IT - GO TO SCANNER
RESJITM1 TEXTC '** NO USER IN SYSTEM WITH THAT NUMBER '
*
*
*
REGMSG   TEXTC    'REGISTERS:'
*
*
*
         USECT    DATA
LOOKING  DATA     0                 SET SAYS READ 1 PAGE FROM FILE
CUN      DATA     0                 S:CUN VALUE FROM FILE
ISUN     DATA     0                 S:ISUN FROM FILE
SPECIFIC%USER%DCBS DATA   0         SET SAYS TO DUMP JUST ONE USER
         USECT    PP
         BOUND    8
NULLPAGE DATA     X'20'
         DATA     X'22'             NMPC/FPMC COMPARISON TABLE
RCOLON   TEXTC    ' ) '
LCOLON   TEXTC    ' ( '
PPMSG    TEXTC    'PHYSICAL PAGE # '
CUJITMSG TEXTC    'CURRENT USER:'
OUTUSERS TEXTC    'OUT OF CORE USER:'
ISJITMSG TEXTC    'INSWAP USER:'
OSJITMSG TEXTC    'OUTSWAP USER:'
JITMSG   TEXTC    'INCORE USER:'
US:MSG   TEXTC    ' USER# '
         PAGE
*
*        ROUTINE TO DUMP LOC-LOC
*
*
*        NOTE:    R7 IS RETURNED BY LOCLOC WITH COUNT
*                 TO DUMP OUT.
*
*
DUM      LI,1     1               DUMP COMMAND ENTRY
         B        DUMEP
DUMP     LI,1     0               LOC-LOC IN FIELDS 0-1
DUMEP    BAL,0    LOCLOC
DUMPEP1  EQU      %
*
*        NOTE:    IF YOU WILL EXAMINE 'LOCLOC' NOTE THAT IT CANNOT
*                 RETURN YOU LESS THAN A 'RANGE' OF ONE----ALWAYS
*                 AT LEAST ONE.
*
DUMPEP2  EQU      %
         STW,R9   LASTLOC           UPDATE 'LAST' DUMPED LOC
         LW,R14   R8                LOAD FIRST LOCATION TO OBTAIN
         CI,R7    512               IS DUMP REQUEST <= PAGE
         BGE      %+2               NO
         MTW,1    LOOKING           < PAGE - SET ONE PAGE READ FLAG
         BAL,R0   GETADDR1          ENTER AT ALWAYS MAP ONTO POINT****
         LW,R8    R15               MOVE BUF POINTER TO DUMPSOME REG
         BAL,R0   DUMPSOME          DUMP IT OUT
         LI,R0    SCANNER           SET RETURN POINT
         B        TYP:BUFR          TYPE IT ON OPERATOR'S CONSOLE
         USECT    DATA
LASTLOC  DATA     0               LAST LOCATION DUMPED
         PAGE
         USECT    PP
*
*        DRIVE THE INDIRECT(*) , NEXT(LF) , AND LAST(UP ARROW)
*        COMMANDS FROMM HERE
*
INDIR    LW,14    LASTLOC         GET LAST
         MTW,1    LOOKING           ONLY NEED ONE PAGE
         BAL,0    GETADDR
         LW,R8    *R15              GET CONTENTS
INDREP   EQU      %
         AND,R8   =X'7FFFF'         LIMIT ADDRESSING TO 512K MAX.
         LW,R9    R8                PASS IT BACK IN R9 ALSO
         LI,R7    1                 SET COUNT
         B        DUMPEP1           JOIN MAIN PATH
*
*        GET NEXT LOCATION
*
DNEXT    EQU      %
         LI,R8    1                 BUMP BY ONE
         B        %+2
*
*        GET LAST LOCATION
*
DLAST    EQU      %
         LI,R8    -1                BACK BY ONE
         AW,R8    LASTLOC           ADD TO LAST LOC WE WERE AT
         B        INDREP            REJOIN MAIN PATH
         USECT    PP
X1FF     DATA     X'1FF'
         PAGE
*F*
*F*    NAME:           NEXTLOC / LOCLOC
*F*
*F*    PURPOSE:        TO RETURN THE REQUESTED FIELD TO REQUESTED
*F*                    FIELD PLUS ONE VALUES.
*F*
*F*    DESCRIPTION:    NEXTLOC UTILIZES THE FIELD NUMBER IN FIELD#.
*F*
*F*                    LOCLOC EXPECTS THE FIELD # TO BE IN R1 AT
*F*                    WHIC TIME IT WILL EXTRACT THE VALUES FROM
*F*                    THE FIELD BUFFERS WHERE THE SCANNER HAS BROKEN
*F*                    DOWN THE COMMAND.
*F*
*
NEXTLOC  EQU      %
         LW,R1    FIELD#            FETCH LAST USED FIELD
         AI,R1    1                 POINT TO LOC-LOC FIELDS
LOCLOC   PSW,0    STACK             SAVE RETURN
         BAL,0    GETHEX            GET FIRST FIELD
         AI,1     1
         STW,2    8
         BAL,0    GETHEX            GET NEXT FIELD
         STW,2    9
         MTW,0    REPFLAG           REPLACING A CELL
         BNEZ     LOCLOC1           YEP, GET OUT NOW
         CI,R9    0                 WAS ONLY LOCATION GIVEN
         BNEZ     LOCLOC0           NO, TWO LOCS
         LW,R2    R8                YES, MAKE SECOND EQUAL TO FIRST
         LW,R9    R8                ALSO RETURN R9 SAME AS FIRST LOC
LOCLOC0  SW,R2    R8                CALCULATE LENGTH OF AREA TO DUMP
         BLZ      LOCERR            ERROR
         LW,R7    R2                PASS BACK LENGTH IN R7
         AI,R7    1                 PLUS ONE FOR START CELL
LOCLOC1  PLW,R0   STACK             GET LINK
         B        *R0               AND EXIT
*
LOCERR   LI,1     LOCMSG
         B        PUSHMSG           OUTPUT MSG/GO TO SCANNER
LOCMSG   TEXTC    'LOC1 > LOC2 '
         PAGE
*F*
*F*    NAME:           GETHEX
*F*
*F*    PURPOSE:        TO TAKE THE FIELD NUMBER IN R1 AND GET THE
*F*                    VALUE IN THAT FIELD.
*F*
*F*    DESCRIPTION:    GETHEX WILL CONSTRUCT A HEX DUPE OF THE
*F*                    CONTENTS OF THE FIELD POINTED TO BY R1.
*F*
*F*                    IF GETHEX DISCOVERS THAT THE USER HAS TYPED
*F*                    SOME ARITHEMETIC OPERATOR ALONG WITH THAT
*F*                    FIELD - GETHEX WILL APPLY THE REQUESTED
*F*                    ARITHEMETIC ON THE FIELD VALUE PRIOR TO RETURNING
*F*                    THE VALUE TO THE REQUESTOR. (IN R2)
*F*
GETHEX   LW,R2    FIELDS,R1         ANYTHING THERE
         BEZ      *R0               NOPE - EXIT
         STW,R1   FIELD#            REMEMBER FIELD #
         LCFI     5                 SAVE R3 THRU R7
         PSM,3    STACK             START WITH R3
         LW,4     FIELDS,1
         BEZ      SCANNER           TOO MANY FIELDS ALREADY...
         LI,6     0               INIT R6
         LI,R7    2                 POSSIBLE TWO PASS LOOP
GETHEX1  EQU      %
         LI,R2    0                 CLEAR ACCUMULATOR
         LI,3     0                 PTR INTO FIELD
GLOOP    LB,5     *4,3
         BEZ      GEXIT             GUARANTEED <=8 BYTES BY SCANNER
         AI,5     -X'F0'
         BGEZ     %+2
         AI,5     X'39'
         CLM,5    NUMERAL
         BCS,9    BAD:HEX           BAD NUMBER
         SLS,2    4
         AW,2     5
         AI,3     1
         CI,3     8
         BGE      GEXIT             DONE AT 8
         B        GLOOP
         PAGE
*
*        HIT A CHARACTER THAT IS NOT HEXADECIMAL ORIENTED NUMMBER
*
*
BAD:HEX  EQU      %
         LI,R2    0                 CLEAR FIELD NUMBER COUNTER
BAD:HEX1 EQU      %
         CW,R2    R1                HAVE WE CAUGHT UP YET
         BGE      BAD:HEX2          YUP--> GIT OUT NOW
         LB,R0    FLDCNTS,R2        ELSE GET COUNT IN THAT FIELD
         AW,R3    R0                ADD INTO CURRENT FIELD
         AI,R2    1                 NEXT FIELD
         AI,R3    1                 ACCOUNT FOR CROSSING FIELD BOUNDARIEES
         B        BAD:HEX1          LOOP TILL WE CATCH UP TO FIELD
BAD:HEX2 EQU      %
         AI,R3    1
         LW,R1    R3
         B        IBADCOM           GO PRINT % AND EH
         BOUND    8
NUMERAL  DATA     0,X'F'
                  PAGE
*
*        CHECK IF USER TO OPERATE ON NUMBERS IN SOME FASHION
*
*        WE'LL ADD,SUBTRACT OR MULTIPLY HERE
*
GEXIT    EQU      %
         MTB,0    OPS,R1            ANY ARITHMETIC OPERATORS TO USE
         BEZ      GEXIT1          NO, RETURN
         LW,R4    OPFIELD,R1        GET ADDRESS OF ARITH BUFFER
         STW,R2   VALUES,R7         STORE CURRENT VALUE
         BDR,R7   GETHEX1           AND GET NEXT VALUE
         LW,R6    VALUES+2          LOAD R6 W/FIRST VALUE GOTTEN
         LW,R2    VALUES+1          LOAD R2 W/SECND VALUE GOTTEN
         LB,R5    OPS,R1            GET ARITHMETIC OPERATOR
         MTW,0    STEP              IS THIS A 'DOT'   COMMAND...
         BEZ      OPDIL1            NO - GO ON:
         MTW,0    OPFLAG            IS THIS BY ASSUMED ADDTION
         BEZ      GEXIT0            YUP--HOP OVER THERE
         LI,R6    0                 YES - LETS GET
         XW,R6    STEP              THE CORRECT ADDRESS TO USE
         B        OPDIL1            MERGE W/COMMOND CODE
GEXIT0   EQU      %
         LI,R2    0                 IF ASSUMED ADD--PRESERVE R6
         XW,R2    STEP              AND USE R2 FOR ADDEND
OPDIL1   EQU      %
         LB,R3    OPERATOR          GET COUNT OF OPERATORS
         CB,R5    OPERATOR,R3       FIND THE OPERATOR
         BE       OPLOC,R3          GOTCHA
         BDR,R3   %-2
OPLOC    B        SCANNER           NONE FOUND
         B        ADDIT             ADD TWO FIELDS
         B        SUBIT             SUB TWO FIELDS
         B        MWIT              MUL TWO FIELDS
         B        DIVIT             TO DIVIDE WORDS
OPERATOR TEXTC    '+-*%'
*
DIVIT    LW,R3    R6                NUMBER TO BE DIVIDED TO R3
         DW,R3    R2                DIVIDE BY DIVISOR (SEOND FIELD)
         XW,R3    R2                RETURN PRODUCT IN R2
         B        GEXIT1            MERGE WITH COMMON EXIT
ADDIT    AW,R2    R6
         B        GEXIT1            COMMON EXIT
SUBIT    XW,R2    R6                FLIP IT -(R2 IS RETURNEE)
         SW,R2    R6
         BLZ      BADCOM            WENT OUT OF RANGE
         B        GEXIT1
MWIT     LW,R3    R2
         MW,R3    R6
         LW,R2    R3                RETURN IT IN R2
GEXIT1   EQU      %
         LCFI     5                 RESTORE R3 THRU R7
         PLM,3    STACK
         CI,R2    0                 PAS BACK CC'S
         B        *0                RETURN
         PAGE
*
*        SWITCH TO LP OR UC
*
OPNTOLP  EQU      %
LP       EQU      %
         PSW,R1   STACK             SAVE LINK
         STW,R1   LPFLAG            SET LINE PRNTER FLAG
         CAL1,1   CLOSEUC           CLOSE UC DEVICE
         CAL1,1   OPNLP             AND OPEN M:LO TO LINE PRINTER
         B        HDR:SETUP         PERFORM HEADER CAL
UCLO     EQU      %
         PSW,R1   STACK             SAVE LINK
         LI,R1    7               LETS CHECK TO SEE IF THE USER
         AND,R1   M:LO            HAS ASSIGNED M:LO TO A FILE
         CI,R1    1               DID HE......
         BE       HDR:SETUP       YEP - DONT BOTHER OPENING IT
UCLO1    CAL1,1   CLOSEUC           ENTRY FOR BAL TO HERE
         CAL1,1   OPNUC             OPEN M:UC DCB
         LI,R0    0                 INSURE LP FLAG
         STW,R0   LPFLAG            IS RESET
         STW,R0   UCTITLE           RESET TITLE LINE SUPRESSION
HDR:SETUP EQU     %
         BAL,R1   ROWSS             SET UP DUMP ROW COLUMN COUNTER
          CAL1,1  HDR1:FPT
         CAL1,1   HDR:FPT
         PLW,R1   STACK
         B        0,R1              AND EXIT
         PAGE
*
*        M:LO PAGE HEADER FPT'S
*
HDR:FPT  GEN,8,24 X'26',M:LO
         GEN,4,28 12,0
         GEN,32   HDMSG
         GEN,32   4
HDR1:FPT GEN,8,24 X'24',M:LO
         GEN,4,28 8,0
         DATA     101               PLACE WHERE PAGE COUNT GOES
*
*
CLOSEUC  GEN,8,24 X'15',M:LO
         DATA     0,0
OPNLP    GEN,8,24 X'14',M:LO
         DATA     X'00040000'
         DATA     X'D3D7'
OPNUC    GEN,8,24 X'14',M:LO
         DATA     X'00040000'
         DATA     X'E4C3'
         PAGE
*F*
*F*    NAME:           TRANS / TRANSSZ
*F*
*F*    PURPOSE:        TO TAKE THE WORD IN R3 AND TRANSLATE IT INTO
*F*                    THE PRINT LINE AS EBCDIC.
*F*
*F*    DESCRIPTION:    BOTH ROUTINES ARE FUNCTIONALLY THE SAME - TRANS
*F*                    RETAINS LEADING ZEROS AND TRANSSZ DOES NOT.
*F*
*F*                    BOTH ROUTINES WILL ATTEMPT TO MAKE A SHORT CUT
*F*                    OUT OF AN ALL ZERO WORD, OTHERWISE THEY WILL
*F*                    MERGE AND PLACE THE EBCDIC INTO THE PRINT LINE.
*F*
*
*        REGISTER ASSIGNMENTS HERE
*
*        R0       RETURN LINK
*        R1       POINTER INTO PRINT BUFFER
*        R2       BYTE VALUE TO PLACE INTO PRINT BUFFER
*        R3       HEX VALUE TO TRANSLATE
*        R4       LOOP COUNTER
*
TRANSSZ  EQU      %                *
         LCFI     5                *
         STM,R0   SRETURN          *SAVE WORK AREA
         LI,R4    0                *SET FLAG FOR NO LEADING ZEROS
         LW,R2    R3                * IS WORD ENTIRELY ZERO
         BNE      T1               *NOT SHORT PATH - MERGE W/COMMON CODE
         STW,R4   TRANTYP          *ITS THE SHORT WAY - STORE FLAG
         LI,R4    1                *SET SHORT LOOP
         LW,R1    PTR              *LOAD PRINT BUFFER POINTER
         B        TLOAD            *AND JOIN SHORT PATH POINT
*
*        ENTRY TO TRANSLATE ALL OF WORD
*
TRANS    EQU      %                *
         LCFI     5                *
         STM,R0   SRETURN          *SAVE WORK AREA
         LI,R4    1                *SET FLAG FOR LEADING ZEROS
         CI,R3    0                *TEST FOR SHORT PATH
         BNE      T1               *NO - LONG FORM
         STW,R4   TRANTYP          *SET TRANSLATE FLAG
         LW,R1    PTR              *LOAD CURRENT INDEX INTO PRINT BUF
         STW,R3   LASTEVAL         *REMEMBER LAST WORD DONE
         LD,R2    ZEMOVE           *LOAD MBS REGISTERS
         AW,R3    R1               *ADD CURRENT PRINT BUF INDEX
         MBS,R2   0                *MOVE ZEROS INTO PRINT LINE
         AI,R1    8                *UPDATE PRINT BUF INDEX
         B        TLOAD1           *BYPASS CHECK OF WORD
T1       EQU      %                *MERGE POINT FOR NON-ZERO WORD
         STW,R4   TRANTYP          *REMEMBER TYPE OF TRANSLATE
         STW,R4   SUPPLZ           *SET FLAG ACCORDING TO ENTRY MODE
         STW,R3   LASTEVAL         *SAVE VALUE AS PASSED
         LI,R4    8                *SET LOOP COUNT
         LI,R0    8                *LOOP COUNT FOR FULL WORD
         LW,R1    PTR              *OBTAIN CURRENT PRINT BUFFER INDEX
TLOOP    EQU      %                *
         LI,R2    0                *RESET ACCUMULATOR CELL
         SLD,R2   4                *PICK OFF 4 BITS FROM VALUE
         AI,R2    0                *GRABBED A ZERO ??
         BNEZ     TLOAD            *NOPE
         MTW,0    SUPPLZ           *IF ZERO - SUPPOSED TO PRINT EM
         BNEZ     TLOAD            *YES - PUT EM INTO PRINT LINE
         AI,R4    -1               *ONE LESS NIBBLE
         BDR,R0   TLOOP            *FINISH COMPLETE WORD
*
*        IF WE FALL THRU - THE LAST ZERO GETS PUT OUT
*
TLOAD    EQU      %                *
         LB,R2    LIST,R2          *GET EBCDIC REPRESENTATION
         MTW,1    SUPPLZ           *BUMP FLAG NOW THAT LEAD ZEROS GONE
         STB,R2   OBUF,R1          *STORE BYTE AWAY
         AI,R1    1                *PRINT LINE BUFFER INDEX UPPED
         BDR,R4   TLOOP            *FINISH WITH ENTIRE WORD
TLOAD1   EQU      %                *
         CI,R1    OBUFSIZ*4        *WILL WE SCREW UP
         BG       DONTRANS         *YES - GET OUT NOW
         STW,R1   PTR              *  STORE NEW VALUE
         LW,R1    TRANTYP          *WHAT WAS ORIGINAL REQUEST
         BEZ      DONTRANS         *WAS 'TRANSSZ' - DONT TRANSLATE
         LW,R1    TPTR             *HAVE BEEN TRANSLATING
         BEZ      DONTRANS         *NO - EXIT
         MTW,4    TPTR             *YEP - ADVANCE TRANSLATE COLUMN
         LI,R2    3                *INDEX INTO WORD
         LI,R3    4                *LOOP COUNT AROUND WORD
         AI,R1    3                *GOING BACKWARDS INTO PRINT LINE
STUFFIT  LB,R4    LASTEVAL,R2      *GET A BYTE
         LB,R4    EBCDIC,R4        *GET PRINTABLE REPRESENTATION
         STB,R4   OBUF,R1          *AND MOVE TO PRINT LINE
         AI,R1    -1               *BUMP PRINT LINE INDEX BACK
         AI,R2    -1               *BUMP INDEX INTO WORD BACK
         BDR,R3   STUFFIT          *COMPLETE LOOP ON THIS WORD
DONTRANS EQU      %
         LCFI     5                 FIVE WENT IN / FIVE MUST COME OUT
         LM,R0    SRETURN          *RESTORE WORK AREA
         B        *0
         PAGE
*
*        TRANSLATION TABLES FOR HEX DUMPS
*
         BOUND    8
ZEMOVE   DATA     BA(EZEROES)       SOURCE BYTE ADDRS FOR TEXT ZEROES
         GEN,8,24 8,BA(OBUF)      DESTINATION BYTE ADDRESS FOR TEXT Z'S
*
*
EZEROES  TEXT     '00000000'      MOVES INTO PLACE ALL ZERO WORDS
*
LISTCHARS EQU     %
LIST     TEXT     '0123456789ABCDEF'
EBCDIC   EQU      %                 TRANSLATE TABLE
TRANTAB  EQU      %
         DO1      X'40'
         DATA,1   '.'
         DATA,1   X'40'
         DO1      9
         DATA,1   '.'
         DATA,1   '`','.','<','(','+','|',' '
         DO1      9
         DATA,1   '.'
         DATA,1   '!','%','*',')',';','~',' ','/'
         DO1      8
         DATA,1   '.'
         DATA,1   ' ',',',' ',' ','>','?'
         DO1      X'A'
         DATA,1   '.'
         DATA,1   ':','#','@',X'7D','=',X'7F'
         DO1      X'31'
         DATA,1   '.'
         DATA,1   X'B1',X'B2',X'B3',X'B4',X'B5'
         DO1      11
         DATA,1   '.'
         DATA,1   'A','B','C','D','E','F','G','H','I'
         DO1      7
         DATA,1   '.'
         DATA,1   'J','K','L','M','N','O','P','Q','R'
         DO1      8
         DATA,1   '.'
         DATA,1   'S','T','U','V','W','X','Y','Z'
         DO1      6
         DATA,1   '.'
         DATA,1   '0','1','2','3','4','5','6','7','8','9'
         DO1      6
         DATA,1   '.'
         BOUND    4
         PAGE
         USECT    DATA
SUPPLZ   DATA     1               0 => SUPPRESS LEADING ZEROS
*                                 1 => PUT THEM IN
LPFLAG   DATA     0
*
*
TPTRSV   DATA     0                 AND ITS SAVED VALUE
*
TRANTYP  DATA     0               ZERO IF TRANSSZ / ONE IF TRANS
*
*
         PAGE
         USECT    PP
*F*
*F*      NAME:    BUFOUT
*F*
*F*      PURPOSE:
*F*               TO PRINT THE PRINT BUFFER AND CLEAR THE BUFFER
*F*               FLAGS.
*F*
*F*      DESCRIPTION:
*F*               CALL HERE VIA R0 AND BUFOUT WILL PRINT THE
*F*               CONTENTS OF THE PRINT BUFFER (OBUF) . THE
*F*               COLUMN POINTERS ARE CLEARED SO THAT THE NEXT
*F*               BUFFER TO BE CONSTRUCTED WILL START AT BYTE
*F*               ZERO.
*F*
BUFOUT   EQU      %                *
         STD,R0   SRETURN          *SAVE WORK AREA
         LW,R0    TPTR              * IF TRANSLATING...
         BGZ      %+2               * THIS IS THE COUNT
         LW,R0    PTR               * ELSE THIS IS
         STW,R0   BUFSIZ            * STORE WRITE COUNT FOR CAL
         STB,R0   TYP:BUF           * STORE IT FOR TYPEING
         BAL,R0   TYP:BUFR         ** MAKE TTY TESTS
         CAL1,1   WRITBUF           * WRITE THE LO DEVICE
         LW,R0    BUFSIZ           ** RESTORE BUFFER BYTE COUNT
         LI,R1    0                 * AND THEN
         STW,R1   PTR               * SUPPRESS OLD COUNT
         STW,R1   TPTR              * AND OLD TRANS COLUMN COUNT
         LI,R1    BA(OBUF)          * NOW LETS
         STB,R0   R1                * BLANK THE PRINT BUFFER
         LW,R0    BLNKBYT           * UP TO WHERE WE USED IT
         MBS,0    0                 * FOR NEXT TIME USAGE..
         LD,R0    SRETURN          *RESTORE REGISTERS
         B        *R0              *AND RETURN TO CALLER
         PAGE
WRITBUF  GEN,8,24 X'11',M:LO        FPT FOR DUMPING STUFF FROM OBUF
         GEN,4,28 3,0
         DATA     OBUF
         PZE      *BUFSIZ
         PAGE
         USECT    PP
*F*
*F*      NAME:    SPACE2
*F*
*F*      PURPOSE:
*F*               TO PUT TWO SPACES INTO THE CURRENT PRINT LINE.
*F*
*F*      DESCRIPTION:
*F*               CALL HERE VIA R0 AND SPACE2 WILL SPACE OVER
*F*               ONE BYTE IF WRITING TO THE UC AND TWO BYTES
*F*               IF WRITING THE LP.
*F*
SPACE2   EQU      %
         STW,R0   SRETURN           SAVE RETURN LINK
         LI,R0    2                 # IF GOING TO LP
         MTW,0    LPFLAG            IS CORRECT
         BNEZ     %+2               YUP
         LI,R0    1                 NO--MUST BE UC
         AWM,R0   PTR               AND POINTER
         B        *SRETURN          AND RETURN TO CALLER
         PAGE
*
*
BOBUF    EQU      %
         LI,R7    -OBUFSIZ
         LW,R8    BLANKS
         STW,R8   OBUF+OBUFSIZ,R7
         BIR,R7   %-1
         B        *R0
TEN      DATA     10
         DEF      TEN
SKIP     GEN,8,24 4,M:LO
         PAGE
*F*
*F*      NAME:    TITEL
*F*
*F*      PURPOSE:
*F*               TO PUT OUT A NEW PAGE AND A TITLE LINE ON
*F*               EACH NEW DISPLAY.
*F*
*F*      DESCRIPTION:
*F*               CALL HERE VIA R0 AND TITEL WILL CHECK TO SEE IF
*F*               THE TARGET LO DEVICE IS THE UC TERMINAL - IF SO -
*F*               TITEL WILL ALLOW ONLY ONE NEW PAGE TO GO OUT.
*F*               IF NOT - TITEL WILL PUT OUT A NEW PAGE AND A
*F*               WRITE OF THE TITLE LINE THAT YOU HAVE PASSED
*F*               THE ADDRESS OF IN R1.
*F*
TITEL    EQU      %
         LCI      4
         PSM,0    STACK
         MTW,0    LPFLAG            GOING TO THE LINE PRINTER
         BNEZ     TITEL0            YEP
         CW,R1    LASTITEL          SAME AS LAST TITLE LINE
         BE       TITEL1            YUP - DONT SHOW IT
         STW,R1   LASTITEL          NO-SAVE CURNT
         MTW,0    UCTITLE           HAVE DONE ONE TITLE LINE FOR M:UC
         BNEZ     TITEL0+1          YES, DONT DO IT AGAIN UNTIL LATER
         MTW,1    UCTITLE           NOW WE HAVE
TITEL0   CAL1,1   SKIP              OUT GOES NEW PAGE / TITLE LINE
         BAL,R0   BMBB              PUT IT OUT
         LW,R2    *LIST1            GET COUNT IN LIST
         BLEZ     TITEL1            NO MORE
         MTW,-1   *LIST1            DECREMENT COUNTER
         STW,R1   *LIST1,R2         SAVE TITLE ADDRESS
         INT,R1   M:LO+20           GET CURRENT PAGE #
         STW,R1   *LIST2,R2         SAVED...
TITEL1   LCI      4
         PLM,0    STACK             REGISTERS
         B        *0                AND EXIT
         PAGE
*F*
*F*      NAME:    MTBB / TBB / TB / MB / MBB / BMBB / MTB / MSG%OUT
*F*
*F*      PURPOSE:
*F*               TO SERVE AS A GENERAL ENTRY TO PERFORM MSG
*F*               MOVES - HEX TRANSLATIONS - AND BUFFER WRITING.
*F
*F*      DESCRIPTION:
*F*
*F*      ROUTINE                  FUNCTION
*F*      -------     --------------------------------------------------
*F*      MTBB        MOVE MSG - TRANS R3 - PRINT BUFFER - BLANK A LINE
*F*      TBB         TRANS R3 - PRINT BUFFER - BLANK A LINE
*F*      TB          TRANS R3 - PRINT BUFFER
*F*      MB          MOVE MSG AND PRINT IT
*F*      MBB         MOVE MSG - PRINT IT - BLANK A LINE
*F*      BMBB        BLANK A LINE - MOVE MSG - PRINT IT - BLANK ALINE
*F*      MTB         MOVE MSG - TRANS R3 - PRINT ALL OF IT
*F*      MSG%OUT     IDENTICAL TO BMBB
*F*
*
MTBB     PSW,R0   STACK             SAVE RETURN LINK
         BAL,R0   MSG               PUT OUT THE MESSAGE
MTBB0    BAL,R0   TRANSSZ           PUT OUT VALUE WITH NO LEAD ZEROES
MTBB1    BAL,R0   BUFOUT            PRINT OUT THE ENTIRE BUFFER
         PLW,R0   STACK             RESTORE THE RETURN LINK
         B        BLANK1            AND BLANK OUT THE BUFFER
MBB      PSW,R0   STACK             SAVE THE LINK
         BAL,R0   MSG               PUT OUT THE MMESSAHE
         B        MTBB1             GET INTO THE OTHER ROUTINE
TBB      PSW,R0   STACK             SAVE THE LINK
         B        MTBB0             JOIN UP
TSBB     PSW,R0   STACK
         B        MTBB0             JOIN UP
MSG%OUT  EQU      %
BMBB     PSW,R0   STACK
         BAL,R0   BLANK1            BLANK THE BUFFER
         BAL,R0   MSG               PUT IN THE MESSAGE
         B        MTBB1             JOIN IN THE OTHER ROUTINE
TB       PSW,R0   STACK
         BAL,R0   TRANSSZ
         PLW,R0   STACK
         B        BUFOUT            FINISH PRINT LINE
MB       PSW,R0   STACK
         BAL,R0   MSG
         PLW,R0   STACK
         B        BUFOUT
MTB      PSW,R0   STACK
         BAL,R0   MSG
         BAL,R0   TRANSSZ
         PLW,R0   STACK
         B        BUFOUT
         PAGE
*
*F*
*F*      NAME:    DISP:PP
*F*
*F*      PURPOSE:
*F*               TO DISPLAY INFORMATION ABOUT THE PHYSICAL
*F*               PAGE # IN R1.
*F*
*F*      DESCRIPTION:
*F*               CALL HERE VIA R0 AND DISP:PP WILL PUT OUT THE
*F*               MESSAGE ABOUT THE PAGE'S WORD ADDRESS AND ITS
*F*               NUMBER.
*F*
DISP:PP  EQU      %
         LCFI     4
         PSM,0    STACK
         AND,R1   #R16
         LW,R3    R1                HOLD PGE # IN R3
         BAL,0    BLANK1
         LI,1     PPMSG
         BAL,0    MSG
         BAL,0    TRANSSZ           CONVERTED
         BAL,0    SPACE2            SPACE 2 BYTES
         SLS,3    9                 MAKE WA FROM PAGE#
         LI,1     LCOLON
         BAL,0    MSG
         BAL,0    TRANSSZ
         LI,1     RCOLON
         BAL,R0   MBB               PUT IT OUT
         LCFI     4
         PLM,0    STACK             VOLATILES
         B        *0                AND EXIT
         PAGE
*F*
*F*      NAME:    RE:PNT
*F*
*F*      PURPOSE:
*F*               TO RESET THE ADDRESS IN BUFFER POINTERS.
*F*
*F*      DESCRIPTIONS:
*F*               CERTAIN COMMANDS FROM THE USER (IE; MAP) REQUIRE
*F*               THAT WE CLEAR THE ADDRESS POINTERS AND RE-READ
*F*               WHATEVER WE HAD BEFORE. FOR EXAMPLE; IF WE HAD
*F*               PAGE#80 IN THE BUFFER UNMAPPED - THE USER MAPS
*F*               SOMEONE AND THEN WANTS TO SEE VIRTUAL PAGE#80 -
*F*               UNLESS WE CAME HERE TO CLEAR THE POINTERS WE
*F*               WOULD THINK THAT PAGE#80 IS ALREADY IN THE BUFFER.
*F*
RE:PNT   EQU      %
         LI,R2    -1
         LI,R3    -1
         STD,R2   CURADRSS          RESET ADDRESS COMPARE TABLE
         STD,R2   OLDPAGE           SUPPRESS PAGE READING CELL
         B        *R0
MJITMSG  TEXTC    'MONITOR JIT:'
         PAGE
*F*
*F*      NAME:    CLOSEDCB
*F*
*F*      PURPOSE:
*F*               UTILITY SUB-ROUTINE TO CLOSE THE DCB POINTED
*F*               TO BY R7.
*F*
*F*      DESCRIPTION:
*F*               CALL HERE VIA R0 AND CLOSEDCB WILL SLAM OUT A
*F*               CLOSE POINTING TO YOUR DCB.
*F*
CLOSEDCB EQU      %
         CAL1,1   CLOSER7
         B        *R0
CLOSER7  GEN,1,7,24   1,21,7
         PZE      *0
         DATA     2
         USECT    DATA
ODDROW   DATA     0
ROWCNT   DATA     16
UHFLGLOC DATA     0
         USECT    PP
         PAGE
*F*
*F*      NAME:    TCONT
*F*
*F*      PURPOSE:
*F*               TO OUTPUT THE TABLE OF CONTENTS.
*F*
*F*      DESCRIPTION:
*F*               THE VERY LAST THING DONE IN THE 'ALL' MODE IS
*F*               TO COME HERE AND PUT OUT THE TABLE OF CONTENTS.
*F*               THE ROUTINE 'TITEL' HAS SAVED THE PAGE # OF EACH
*F*               THE TITLE LINES AS THEY WERE PUT OUT, TCONT
*F*               WILL GO THRU THAT TABLE AND PUT OUT A LISTING
*F*               OF WHERE THE TITLE LINES WERE (LO PAGE #).
*F*
TCONT    EQU      %
         MTW,7    NOPS              MAKE POINTER -> 0 FOR SCANNER CHK
         BAL,R1   SYM:DISP        OUT SYMBOL MAP NOW THAT WERE DONE.
         LI,1     TCMSG             SEND
         BAL,0    TITEL             TITEL LINE
         LI,1     TCMSG1            SEND
         BAL,0    MSG
         LI,1     45
         BAL,0    SPACES            OTHER
         LI,1     TCMSG2
         BAL,R0   MBB               PUT IT OUT
         LW,R2    *LIST2            GET LENGTH OF THE LIST
TCONT1   LI,1     3                 SPACE
         BAL,0    SPACES            IT
         LW,R1    *LIST1,R2         GET ADDRESS OF TEXT STRING
         BEZ      TCONT2            NOTHING
         BAL,0    MSG               PUT IT ON PRINT LINE
         LB,R3    R1                WAS A USER NUMBER PASSED
         BEZ      TCONT15           NOPE
         BAL,R0   SPACE2            YES
         LI,R1    US:MSG            MSG TO SEND
         BAL,R0   MSG
         BAL,R0   TRANSSZ           PUT OUT USER NUMBER HERE
TCONT15  LI,R1    50                NEXT SPACING
         BAL,0    SPACES            SPACES
         LW,R5    *LIST2,R2         GET PAGE # IN HEX (LO PAGE #)
         LI,1     BA(OBUF)
         AI,1     47                TO ROW POSITION
         BAL,0    DECIMAL           MAKE IT DECIMAL
         BAL,0    BUFOUT            SEND THE BUFFER
TCONT2   BDR,2    TCONT1            FINISH UP
         MTW,0    GJOB%FLAG         RUNNING AS A GHOST
         BNEZ     EXIT              YES - EXIT NOW
         LI,R1    0                 NO - RESET
         STW,R1   BALL              'ALL' FLAG
         B        SCANNER
TCMSG    TEXTC    'TABLE OF CONTENTS:'
TCMSG1   TEXTC    'DISPLAY ITEM'
#MS      EQU      %
TCMSG2   TEXTC    'PAGE#'
         PAGE
*
*        HEX TO DECIMAL
*
DECIMAL  EQU      %
         LI,4     0
         DW,4     TEN               TO BASE TEN
         AI,4     X'F0'
         STB,4    0,1               MOVE TO PRINT LINE
         AI,1     -1
         AI,5     0                 DONE
         BLEZ     *0                YES
         B        DECIMAL           NOPE
         PAGE
*F*
*F*      NAME:    GET1ADDR
*F*
*F*      PURPOSE:
*F*               TO FORCE I/O ROUTINES TO READ ONLY ONE PAGE.
*F*
*F*      DESCRIPTION:
*F*               CALL HERE VIA R0 WITH PAGE # YOU WANT IN R1 AND
*F*               GET1ADDR WILL SET 'LOOKING' (SAYS TO READ 1 PAGE)
*F*               BOTH 'GETMONPG' AND 'GETPAGE' WILL READ ONLY
*F*               ONE PAGE WHEN THEY SEE THIS FLAG SET.
*F*               EXIT IS OUT OF 'GETADDR' AFTER THE PAGE HAS BEEN
*F*               BROUGHT INTO CORE (CVM'D OR READ).
*F*
GET1ADDR EQU      %
         STW,R1   OLDPAGEM          REMEMBER THE ORIGINAL REQUESTED #
         MTW,1    LOOKING           SET ONE PAGE FLAG
         LW,R14   R1                MOVE PAGE #
         SLS,R14  9                 CHANGE TO A WA
*
*        FALL THRU AND GET ADDRESS
*
         PAGE
*F*
*F*      NAME:    GETADDR
*F*
*F*      PURPOSE:
*F*               TO GET THE ADDRESS IN R14 INTO THE DUMP BUFFERS.
*F*
*F*      DESCRIPTION:
*F*               CALL HERE VIA R0 AND WITH THE ADDRESS YOU WANT IN R14
*F*               GETADDR WILL CHECK IF WE ALREADY HAVE THAT PAGE
*F*               VIA A CHECK AGAINST THE CLM PAIR 'CURADRSS'.
*F*
*F*               IF THE ADDRESS IS ALREADY IN THE BUFFERS - GETADDR
*F*               WILL RETURN TO THE CALLER POINTING INTO THE DUMP
*F*               INPUT BUFFERS VIA R15.
*F*
*F*               IF WE DO NOT CURRENTLY HAVE THE PAGE - GETADDR
*F*               WILL CALL 'GETPAGE' TO BRING IN THE PAGE.
*F*
*F*               ONCE THE PAGE IS INCORE - GETADDR WILL RETURN TO
*F*               THE CALLER WITH R15 POINTING TO THE DUMP BUFFER
*F*               AT THE WORD THE CALLER WANTED.
*F*
GETADDR EQU       %
         CLM,R14  UHFLGR            SEE IF ADDRESS IS IN SPECIAL TABLE
         BCS,9    GETADDR1          NOPE
         LW,R15   UHFLGLOC          DO WE HAVE THE TABLE
         BEZ      GETADDR1          NOPE
         SW,R14   UHFLGR            BASE ADDRESS IN OUR TABLE
         AW,R15   R14               ADD OFFSET INTO BUFFER
         B        *R0               AND EXIT POINTING TO TABLES
GETADDR1 EQU      %
         LI,R15   0                 CLEAR R15
         STD,R0   SRETURN           SAVE SOME WORK SPACE
         LW,R1    R14               COPY ADDRESS TO R1
         SLD,R14  -9                ISOLATE PAGE # / DISPLACEMENT
         SLS,R15  -23               R15 = OFFSET INTO THE PAGE WE WANT
         MTW,0    MONFLAG           LOOKING AT REAL MONITOR
         BGZ      GETADDR2          YUP--> BETTER CHECK MAPPED AND ALL.
         CLM,R1   CURADRSS          DO WE HAVE THIS ADDRESS CURRENTLY
         BCS,9    GETADDR2          NO--> GET IT NOW
         STW,R14  OLDPAGEM          STORE REQUESTED PAGE #
         B        GETADDR3          AND EXIT TO CALLER
GETADDR2 EQU      %
         STW,R14  CRNTPAGE          SAVE THE PAGE #
         LW,R1    R14               MOVE PAGE # OVER
         BAL,R0   GETPAGE           READ/CVM IT
         LW,R14   CRNTPAGE          RESTORE THE PAGE #
         SLS,R14  9                 BASE WA OF PAGE
         STW,R14  CURADRSS          SAVE IT
         AI,R14   511               AND THEN
         STW,R14  CURADRSS+1        CREATE NEW CLM PAIR
GETADDR3 EQU      %
         AW,R15   PAGEBUF           POINT INTO BUFFER PAGE
GETADDR4 EQU      %
         LD,R0    SRETURN           RELOAD R0-R1
         STW,R0   LOOKING           PUT RETURN AWAY
         LI,R0    0
         XW,R0    LOOKING           RESET FLAG / GET RETURN ADDRESS
         LW,R14   *R15              GET OBJECT WORD
         MTW,0    MONFLAG           IN MONITOR DISPLAY MODE
         BNEZ     *R0               YES...RETURN TO CALLER
         MTB,0    M:EI+7            DID I/O COMPLETE YET
         BEZ      *R0               YES...RETURN TO CALLER
         CAL1,1   CHECK:IO          CHECK IT
         LW,R14   *R15              GET OBJECT WORD
         B        *R0               AND RETURN TO CALLER
*
*        CHECK COMPLETION OF I/O FPT
*
CHECK:IO GEN,8,24 X'29',M:EI
         GEN,2,30 3,0
         DATA     PAGERR,PAGERR     ERROR/ABNORMAL ROUTINE.
         PAGE
*F*
*F*      NAME:    GETMONPG
*F*
*F*      PURPOSE:
*F*               TO MAP ONTO THE REQUESTED ADDRESS IN REAL CORE.
*F*
*F*      DESCRIPTION:
*F*               GETADDR HAS RECEIVED A REQUEST FOR A NEW PAGE.
*F*               GETMONPG WILL TAKE THE REQUEST AND MAP ONTO
*F*               THE TARGET PAGE.
*F*
*
GETMONPG EQU      %                *
         LCFI     4                *
         PSM,R5   STACK            *SVE MINIMUM SET
         LW,R6    R1               *PAGE # REQUESTED
         CW,R6    HIGHPAGE         *COMPARE TO MAX
         BG       ADDR:ERR         ****ERROR****
         STW,R1   OLDPAGEM         *OK - REMEMBER IT
         BAL,R5   MAP:TEST         *MAKE MAP TEST
         CW,R6    OLDPAGE           *DO WE  STILL HAVE THIS PAGE
         BE       GETMONPG2         *YEP--CHECK NEXT ONE
         STW,R6   OLDPAGE          *REMEMBER PHYSICAL PAGE #
         SLS,R6   9                *INTO A WA
         BAL,R5   CVM:SETUP        *REAQUIRE CVM WINDOW PAGES
         LI,R7    X'7FE00'          *MASK TO INSERT
         STS,R6   SADCAL           *PHYSICAL WA WE WANT TO MAP ONTO
         CAL1,8   SADCAL           *MAP ONTO IT
         BCS,8    CVMERROR         ****ERROR***
GETMONPG2 EQU     %                 *
         MTW,0    LOOKING          *ONLY NEED ONE PAGE
         BNEZ     GETMONPG3         *EXIT--WE'RE ALL DONE HERE
         AI,R1    1                *NEXT PAGE #
         BAL,R5   MAP:TEST         *MAKE MAP TEST
         CW,R6    OLDPAGE2          *ARE  WE MAPPED ONTO THIS ONE NOW
         BE       GETMONPG3         *YUP--ALL DONE
         STW,R6   OLDPAGE2         *SAVE SECOND PAGE #
         SLS,R6   9                *PAGE # TO WA
         LI,R7    X'7FE00'          *MASK TO INSERT
         STS,R6   SADCAL           *STORE WA AWAY
         LI,R5    512              *UPDATE
         AWM,R5   VIRPAGE          *VIRTUAL WINDOW ADDRESS
         CAL1,8   SADCAL           *MAP ONTO PHYSICAL PAGE
         BCS,8    CVMERROR         ****ERROR***
GETMONPG3 EQU     %                 *
         LCFI     4                *
         PLM,R5   STACK            *RESTORE THE REGISTERS
         B        *R0              *AND EXIT
         PAGE
*F*
*F*      NAME:    NOSADPAGE
*F*
*F*      PURPOSE:
*F*               TO INFORM THE USER THAT ANLZ IS RUNNING WITHOUT
*F*               THE PROPER PRIVELEGE TO PERFORM CVM CALS.
*F*
*F*      DESCRIPTION:
*F*               THE 'MAP-ONTO' ROUTINE 'GETMONPG' HAS GOTTEN
*F*               AN ERROR RETURN FROM A CVM CAL- TELL THE USER
*F*               AND GO TO THE SCANNER.
*F*
CVMERROR EQU      %
         LW,R3    R6                *MOVE PAGE WA TO DISPLAY REG
         SLS,R3   -9                *MAKE IT A PAGE # AGAIN
         LI,R1    CVMERRMSG         *LOAD EROR MSG ADDRS
         BAL,R0   MTB               *PUT OUT ERROR MSG
ADRSERO  EQU      %
         BAL,R0   RE:PNT            CRASH THE POINTERS AGAIN
         B        SCANNER           * AND QUIT
*
*
CVMERRMSG TEXTC 'CVM FAILED ON PAGE# '
*
NOSADPAGE LI,R1   NOSAD:MSG
         BAL,R0   MSG%OUT
         B        SCANNER
NOSAD:MSG TEXTC 'CHANGE VIRTUAL MAP REQUEST REJECTED'
         PAGE
*
*        REQUESTED ADDRESS IS OUT OF RANGE
*
ADDR:ERR EQU      %
         LI,R1    ADERROR           ERROR MSG ADDRESS
         BAL,R0   MBB
         B        ADRSERO           AND MERGE W/COMMON EXIT
*
ADERROR TEXTC     '** REQUESTED ADDRESS IS OUTSIDE CORE LIMITS'
         BOUND    8
MAPLIMS  DATA     JXBUFVP,255
DCTLIMS  DATA     1,DCTSIZ
IOQLIMS  DATA     1,IOQ9-IOQ8
CITLIMS  DATA     1,CITSIZ
MDNUMS   DATA     '0','7'
*
         REF      DCTSIZ,IOQ9,IOQ8,CITSIZ
*
         DEF      MAPLIMS,DCTLIMS,IOQLIMS,CITLIMS
*
CVMLIM   DATA     JXBUFVP,JBUPVP-1  *SPECIAL AREA REQUIRING CVM CALS
*
         PAGE
*
*        MAKE MONITOR DISPLAY MODE MAP TEST
*
MAP:TEST EQU      %
         LW,R6    R1                PAGE # TO R6
         MTW,0    MAPFLAG           ARE WE REALLY MAPPED
         BEZ      0,R5              NOPE - RETURN
         CLM,R6   MAPLIMS           IS PAGE REALLY IN VIRTUAL MEMORY
         BCS,9    0,R5              NOPE--> RETURN
         STD,R14  OLDPAGE           ZAP THESE IF IN MAPPED CORE
         MTW,0    MAPFLAG           WHOSE MAP DO WE USE
         BGZ      MAP:TEST1         ANOTHER USERS--> GET ENTRY
         LOAD,R7  JX:CMAP,R6        OURS
         CLM,R7   NULLPAGE          IS THIS A NULL PAGE
         BCR,9    MAP:TEST2         YUP--> SHOW EM PAGE 20 THEN
         CI,R6    JBUPVP            IS IT ABOVE X'A000'
         BGE      MAP:TEST0         YUP
         CI,R6    JJITVP            ONLY THE JIT PAGE
         BNE      MAP:TEST2         IF NOT MUST CVM IT
MAP:TEST0 EQU     %
         STW,R6   OLDPAGEM          REMEMBER THE VIRTUAL PAGE #
         SLS,R6   9                 VIRTUAL PAGE TO WA
         AW,R15   R6                POINT TO THAT LOC
         LCI      4
         PLM,R5   STACK             BALANCE THE STACK
         B        GETADDR4          AND EXIT
MAP:TEST1 LOAD,R7 *USRMAP,R6        GET PHYSICAL PAGE #
         BEZ      0,R5              NO PAGE - OR ERROR
MAP:TEST2 EQU     %
         LW,R6    R7                PASSES - RETURN IT
         B        0,R5
         PAGE
*F*
*F*      NAME:    GETPAGE
*F*
*F*      PURPOSE:
*F*               TO TAKE THE REQUEST FOR I/O FROM GETADDR AND
*F*               PERFORM THE TRANSFER FROM THE DUMP FILE.
*F*
*F*      DESCRIPTION:
*F*               GETADDR CALLS HERE AND GETPAGE WILL GO DIRECTLY
*F*               TO GETMONPG IF WE ARE IN THE MONITOR DISPLAY MODE.
*F*
*F*               IF WE ARE LOOKING AT A DUMP FILE - GETPAGE WILL
*F*               TAKE AND READ INTHE REQUESTED ADDRESS INTO THE BUFFER.
*F*
*F*               IF 'LOOKING' IS SET GETPAGE WILL READ ONLY THE
*F*               REQUESTED PAGE.
*F*
*F*               IF 'LOOKING' IS RESET - GETPAGE WILL READ THE
*F*               REQUESTED PAGE AND THE ONE IMMEDIATELY FOLLOWING
*F*               IT. THIS IS DUE TO MOST ROUTINES NOT BEING AWARE
*F*               OF TABLES OVERLAPPING PAGE BOUNDARIES.
*F*
GETPAGE  EQU      %
         MTW,0    MONFLAG
         BNEZ     GETMONPG          DO CVM CAL IF MONITOR DISPLAY MODE
         STW,R1   OLDPAGEM         *REMEMBER ORIGINAL REQUESTED #
         MTW,0    MAPFLAG          *ARE WE MAPPED
         BEZ      GETPAGE1         *NO
         LOAD,R14   *USRMAP,R1      *YES--GET PHYSICAL PAGE #
         CLM,R1   MAPLIMS           IS REQUEST PAGE # IN MAPPED MEMORY
         BCS,9    %+2               NOPE--> JUMP
         LW,R1    R14              *OKAY - MOVE TO USE IT
GETPAGE1 EQU      %                *
         CLM,R1   PAGLIMS          *IS VALID PHYSICAL PAGE #
         BCS,9    *R0              *NO - NO I/O
         LCFI     4                *
         PSM,R7   STACK            *SAVE WORK AREA
         LI,R10   0                *
         STW,R10  JITSTAT          *RESET ERROR FLAGS
         CW,R1    OLDPAGE          *DO WE HAVE THIS PAGE NOW
         BE       GETPAGE2         *YES - NO I/O
         STW,R1   OLDPAGE          *NO - MAKE IT CURRENT
         LI,R7    1                *OK
         STH,R1   KEY,R7           *SET UP FILE ACCESS KEY
         CAL1,1   PAGEFPT          *AND READ THAT PAGE INTO CORE
GETPAGE2 EQU      %                *
         LW,R8    LOOKING          *CHECK OTHER FLAG
         BNEZ     GETPAGE6         *NO MORE I/O
         AI,R1    1                *STEP TO NEXT PHYSICAL PAGE #
         LW,R8    MAPFLAG          *ARE WE MAPPED
         BEZ      GETPAGE5         *NO
         LW,R7    OLDPAGEM         *ORIGINAL REQUEST (VIRTUAL PAGE#)
         AI,R7    1                *NEXT VIRTUAL INDEX
         LOAD,R8    *USRMAP,R7      *GET PHYSICAL PAGE # (IF ANY...)
         LW,R1    R8               *IT PASSES OK
GETPAGE5 EQU      %                *
         CW,R1    OLDPAGE2         *DO WE HAVE THIS PAGE
         BE       GETPAGE6         *YES - EXIT
         CLM,R1   PAGLIMS           * IS A VALID PAGE....
         BCS,9    GETPAGE6          * NO--> DONT DO ANY I/O
         STW,R1   OLDPAGE2         *NO - MAKE IT CURRENT SECCND PAGE
         LI,R7    1                *
         STH,R1   KEY,R7           *STORE NEXT PHYSICAL PAGE #
         CAL1,1   BUFL             *AND READ PAGE INTO CORE
GETPAGE6 EQU      %                *
         LCFI     4                *
         PLM,R7   STACK            *
         B        *R0              *RETURN TO CALLER
         PAGE
*
*        THE FOLLOWING FPT'S ARE USED FOR READING THE MONDMP
*        FILE - NOTE THAT NEITHER HAS THE 'WAIT' BIT SET SO THAT
*        'GETPAGE' CAN EXECUTE ITS MAIN PATH PRIOR TO HAVING TO
*        WORRY ABOUT WAITING FOR I/O TO COMPLETE.
*
PAGEFPT  GEN,8,24 X'10',M:EI
         DATA     X'38000000'
BUFLOC   GEN,1,31  1,PAGEBUF
         DATA     512+512+512+512
         DATA     KEY
BUFL     GEN,8,24 16,M:EI
         DATA     X'38000000'
         PZE      *PAGEBUF2
         DATA     2048
         DATA     KEY
         USECT    DATA
OLDPAGEM DATA     0
         BOUND    8
OLDPAGE  DATA     -1                CURRENT FIRST PAGE
OLDPAGE2 DATA     -2                CURRENT SECOND PAGE
         BOUND    8
PAGLIMS  DATA     0
HIGHPAGE DATA     255               INITIAL VALUE
         USECT    PP
SCR24:29 DATA     X'24',X'29'       SPECIAL HARDWARE SCREECHES
         PAGE
*F*
*F*      NAME:    PAGERR / PAGERR0
*F*
*F*      PURPOSE:
*F*               TO RECEIVE ANY ERROR/ABNORMAL RETURN FROM A
*F*               READ CAL TO THE MONDMP FILE.
*F*
*F*      DESCRIPTION:
*F*               AS THIS IS THE ERROR/ABNORMAL ADDRESS IN THE
*F*               FILE OPEN - WE WIND UP HERE ON ANY ERROR
*F*               OR ABNORMAL FROM A READ OP.
*F*               THESE ROUTINES WILL OUTPUT AN ERROR MSG / RESET
*F*               CERTAIN POINTERS AND GO TO THE SCANNER.
*F*
         USECT    PP
PAGERR   EQU      %
         LC       JITSTAT           TRYING TO READ A KEY FOR A JIT
         BCS,4    LOCJIT3           YES,RETURN THERE
         BCS,1    RBBREA            READING THE RBBAT RECOVERY FILE
         LB,R0    R10               GET I/O MAJOR CODE
         CI,R0    X'03'             FILE NOT OPEN
         BNE      PAGERR1         IGNORE IF NOT A NO FILE
PAGERR0  LI,1     NOFILMSG
         B        PUSHMSG           MSG OUT/GO TO SCANNER
PAGERR1  EQU      %
         LI,R0    0
         STW,R0   PTR               ** CLEAR PRINT LINE POINTERS
         STW,R0   TPTR              ** SO PRIOR PRINT BUF IS CLOBBERED
         BAL,R0   BLANK1
         LW,R3    KEY               GET KEY WE TRIED TO USE
         LI,1     PERRMSG
         BAL,R0   MTBB              PUT IT OUT
PAGERR2  LI,0     0                 IN ANY EVENT
         STW,0    DUMP:DIR          AND THIS FLAG TOO
         STW,R0   OLDPAGEM          RESET ADDRESSING CELL
         STW,R0   LOOKING           RESET OBSERVATION FLAG
         BAL,R0   RE:PNT            CLOBBER ALL POINTERS
         LW,R0    KEEPKEY           RE-INIT
         STW,R0   KEY               THE FILE ACCESS KEY
         B        SCANNER
         USECT    DATA
JITBURST DATA     0
*                                   DUMP PORTION OF FILE
GHMSG    TEXTC    ' ANLZ USING MONDMP# '
         USECT    PP
PERRMSG  TEXTC    '**FILE ACCESS KEY:  '
NOFILMSG TEXTC 'NO CRASH FILE OPEN FOR INPUT'
NOSJIT   TEXTC    '**NO JIT TO BE FOUND FOR '
*
         PAGE
*F*
*F*      NAME:    MAPMODE / MAP:USER
*F*
*F*      PURPOSE:
*F*               TO TAKE EITHER THE COMMAND REQUESTED USER #
*F*               OR THE PASSED USER NUMBER AND MAP ONTO SAME.
*F*
*F*      DESCRIPTION:
*F*               CALL HERE VIA R0 AND THESE ROUTINES WILL FIND THE
*F*               JIT BY CALLING 'RES:JIT'. ONCE THE JIT HAS BEEN
*F*               OBTAINED - THESE ROUTINES WILL MOVE THE CONTENTS
*F*               OF THE USER MAP INTO THE INTERNAL MAP 'MAP'.
*F*
*F*               THE FLAG 'MAPFLAG' WILL BE SET TO INDICATE
*F*               TO THE DUMP INPUT ROUTINES TO TRANSLATE ALL I/O
*F*               REQUESTS THRU THE MAP TABLE.
*F*
MAPMODE  PSW,0    STACK             SAVE LINK
         LI,1     1                 SEE IF USER# SPECIFIED
         BAL,0    GETHEX            GO GET EM
         PLW,0    STACK             RESTORE LINK
MAP:USER LCFI     5                 FOR VOLATILES
         PSM,0    STACK             ALL
         LW,2     2                 USER# PASSED
         BEZ      MAPME             NO,MAP MYSELF
         AND,R2   #R16              MASK ANY FLAGS IN THIS WORD
         CLM,R2   USERLIMS          IS NUMBER IN RANGE
         BCS,9    NOMAP             NOPE--> EXIT
         STW,R2   USER              SAVE USER NUMBER AND FLAGS
         BAL,R0   RES:JIT           FIND THE JIT
         BCS,4    NOMAP             NONE TO BE FOUND
         LI,R2    JXCMAP            INDEX INTO JX:CMAP
         SLS,R2   -:BIG             NOW HALF-WORD OR BYTE
         LI,R3    JXBUFVP           FIRST VPX IN B00
         BNEZ     %+2               ITS B00 FOR SURE
         LI,R3    JOVVP             OR IF ITS A00
         AW,R2    R3                R2 NOW DIRECT DISP INTO JX:CMAP
MAPLOAD  EQU      %
         LOAD,R4  *JITBUF,R2        GET ENTRY FROM JX:CMAP
         STORE,R4  *USRMAP,R3       MOVE INTO MAP IMAGE TABLE
         AI,R2    1
         AI,R3    1                 BUMP BOTH POINTERS
         CI,R3    256               VIRTUAL INDEX UP TO LIMIT YET
         BL       MAPLOAD           GO UNTIL END OF VIRTUAL LIMIT
MAPOK    EQU      %                 ALL SET UP W/VIRTUAL MAP IMAGES
         MTW,1    MAPFLAG           TURN ON THE MAP
         BAL,R0   RE:PNT            RESET DUE TO MAPPING
NOMAPGOT LCFI     5
         PLM,0    STACK             RESTORE REGS
         B        *0                AND RETURN
MAPME    LI,2     -2                                                 RL2
         STW,2    MAPFLAG                                            RL2
         B        MAPOK                                              RL2
NOMAP    BAL,0    UNMAP             INSURE ITS RESET
         LCFI     4
         STCF     JITSTAT           SET ERROR FLAGS
         B        NOMAPGOT          AND EXIT
         PAGE
*
*        KEEP DYNAMIC PAGES CORRECT FOR SAD CALS
*
CVM:SETUP EQU     %
         PSW,R9   STACK             SAVE R9
         LW,R9    PAGEBUF           GET WINDOW WORD ADDRS
         MTW,0    VIRPAGE           HAVE WE ALREADY FREE'D CVM PAGES
         BGZ      CVM:SETUP1        YEP - JUMP
         CAL1,8   FREEIT            FREE FIRST PAGE
         AI,R9    512               BUMP TO SECND
         CAL1,8   FREEIT            FREE IT
         AI,R9    -512              POINT BACK TO FIRST ONE
CVM:SETUP1 EQU    %
         STW,R9   VIRPAGE           STORE PAGE WA FOR SAD CAL'S
         PLW,R9   STACK             RESTORE R9
         B        0,R5              AND RETURN TO CALLER
         PAGE
*F*
*F*      NAME:    RES:BUF
*F*
*F*      PURPOSE:
*F*               TO RESTORE THE CVM WINDOWS THAT HAVE BEEN IN USE.
*F*
*F*      DESCRIPTION:
*F*               THE DUMP BUFFERS HAVE BEEN USED AS CVM WINDOWS
*F*               IN THE MONITOR DISPLAY MODE. THIS ROUTINE WILL
*F*               REACQUIRE THOSE WINDOW PAGES FOR USE AS DUMP
*F*               I/O BUFFERS.
*F*
RES:BUF  EQU      %
         PSW,R9   STACK
         LW,R9    PAGEBUF
         CAL1,8   FREEIT
         CAL1,8   GETIT
         AI,R9    512
         CAL1,8   FREEIT
         CAL1,8   GETIT
         LI,R9    0                 NOW LETS ERASE
         STW,R9   VIRPAGE           CVM TRACKS LEFT EARLIER
         PLW,R9   STACK             RESTORE R9
         B        *R0               RETURN TO CALER
        PAGE
         USECT    PP
*F*
*F*      NAME:    UNMAP
*F*
*F*      PURPOSE:
*F*               TO RESET THE MAP INDICATOR FLAG 'MAPFLAG' AND TO
*F*               RESET THE MAP TABLE TO ONE-TO-ONE.
*F*
*F*      DESCRIPTION:
*F*               UNMAP WILL RESET ALL THE MAP POINTERS AND RESET
*F*               THE MAP TABLE BY PLACING ALL ENTRIES BACK TO
*F*               ONE-TO-ONE SETTINGS - THEREBYE HAVING THE EFFECT
*F*               OF BEING 'UNMAPPED' INTERNALLY.
*F*
UNMAP    EQU      %
         PSW,R1   STACK
         LI,R1    (128*2)-1         255 PAGES MAX POSSIBLE....
         STORE,R1  *USRMAP,R1       MOVE INTO MAP IMAGE TABLE
         BDR,R1   %-1
         STORE,R1 *USRMAP           AND SET THE ZERO ENTRY ALSO
         STW,R1   MAPFLAG           RESET FLAG
         LI,R1    -1
         STW,R1   CURADRSS          ZAP ADRESS POINTER
         STW,R1   CURADRSS+1        BOTH OF CLM PAIR
         PLW,R1   STACK
         B        *R0
*
         USECT    DATA
*
MAPFLAG  DATA     128               >>0 SAYS WE R MAPPED MODE
*
USRMAP   DATA     0                 POINTS TO OUR MAP TABLE
*
         PAGE
         USECT    PP
*F*
*F*      NAME:    LOCJIT
*F*
*F*      PURPOSE:
*F*               TO TAKE THE REQUESTED USER NUMBER AND FIND HIS JIT.
*F*
*F*      DESCRIPTION:
*F*               'RES:JIT' HAS COME HERE IF WE ARE LOOKING AT A
*F*               DUMP FILE WI/USER NUMBER IN R2.
*F*               LOCJIT WILL FIRST CHECK TO SEE IF WE HAVE
*F*               ALREADY INPUT THAT USER AND IF SO RETURNS
*F*               NOW.
*F*               IF NOT LOCJIT WILL SEE WHERE THE JIT CAN BE FOUND
*F*               AND INPUT IT.
*F*
LOCJIT   EQU      %
         STW,R2   USER              SAVE COMPLETE WORD
         AND,R2   #R16              CLEAR FLAGS
         CW,R2    JIT#              IS USER JIT ALREADY IN CORE
         BNE      LOCJIT0           NO - HAVE TO READ IT
         LCFI     8                 YES - PASS FLAGS BACK TO CALLER
         B        *R0
LOCJIT0  EQU      %
         LCFI     4                 PUSH MINIMUM SET
         PSM,R0   STACK             OF REGS
         LI,R0    0                 RESET AND
         XW,R0    LOOKING           FLAG AS PASSED
         STW,R0   J:SRCH            FLAG INTO OUR CELL
         CI,R2    0                 OBTAINING A USER JIT
         BNEZ     LOCJIT01          YES - JUMP
         LI,R14   JJITVP            NO - MONITOR'S JIT
         B        LOCJIT15          GO READ IT NOW
LOCJIT01 EQU      %
         LC       USER              NO TABLE - FLAGS SAY TO CHK UH:FLG
         BCS,4    LOCJIT1           NO CHK OF UH:FLG; BRANCH
*
*        NO FLAG - SEE IF JIT WAS IN CORE
*
         LI,14    UH:FLG            SEE IF ITS IN CORE
         BAL,0    GETADDR           BRING IT IN
         LH,14    *15,2             GET FLAGS
         CI,R14   JIC               IS JIC IN CORE SET
         BANZ     LOCJIT1           YES,BRING IT IN NORMAL
LOOK4JIT LW,R0    M:EI              ARE WE DEALING W/FILE....
         CW,0     Y002              FOR INPUT
         BAZ      PAGERR0           NO FILE OPEN FOR INPUT - GOTO SCANNER
         STW,R2   JIT#              SAVE USER # (LESS FLAGS)
         SLS,2    16                NO,POSITION USER#
         LCI      4                 INDICATE READ BEING TRIED
         STCF     JITSTAT           AT THIS POINT
         LCFI     4
         PSM,R7   STACK
         STW,R2   JITKEY            STORE USER #
         LI,R2    3
         STB,R2   JITKEY            SET KEY BYTE COUNT
         CAL1,1   JITFPT            READ THE JIT INTO CORE
         LI,R7    -1                NOW SET FLAG
         STW,R7   J:PAGE            INDICATING SUCCESSFUL READ
         LCFI     4
         PLM,R7   STACK             RESTORE I/O REGISTERS
         LCFI     8                 SET FLAG
         B        LOCJIT2           AND EXIT
         PAGE
*
*        GET HERE IF USER'S JIT WAS IN CORE AT CRASH TIME
*
LOCJIT1  LI,14    UX:JIT            SINCE JIT WAS IN CORE
         BAL,0    GETADDR           READ IT FROM DUMP FILE
         LOAD,R14 *R15,R2           GET ADDRESS                              A00
LOCJIT15 EQU      %
         BEZ      LOCJIT31          NOBODY IN THAT USER SLOT
         CLM,R14  PAGLIMS           IS A VALID PAGE ###
         BCS,9    LOCJIT5           NOPE----> **ERROR**
         STW,14   J:PAGE            SAVE PAGE# (PHYSICAL)
         LCFI     4                 SAVE
         PSM,R7   STACK             I/O REGISTERS
         STW,R14  JITKEY            STORE # TO READ
         LI,R3    X'0300'           SET UP
         STH,R3   JITKEY            KEY BYTE COUNT/CLEAR OLD BYTE COUNT
         LCFI     4                 INDICATE WE ARE TRYING TO READ
         STCF     JITSTAT           A JIT
         STW,R2   JIT#              SAVE JIT USER #
         CAL1,1   JITFPT            READ THE JIT INTO CORE
         LCFI     4                 RESTORE
         PLM,R7   STACK             I/O REGISTERS
         LCFI     8+2               SET FLAGS
LOCJIT2  STCF     JITSTAT           SAVE CONDITION CODES
         LCFI     4
         PLM,R0   STACK             GET THE REGISTERS BACK
         LC       JITSTAT           SET CC'S
         B        *0
         PAGE
*
*
*        WE HAVE LOOKED EVERYWHERE FOR THIS JIT AND CANT
*        FIND IT - ONE LAST HOPE IS THAT IT WAS JUST SWAPPED
*        IN.
*
LOCJIT3  EQU      %
         LCFI     4
         PLM,R7   STACK             RESTORE REGS FROM I/O ERROR
         LW,R2    USER              GET USER # WE'RE WORKING ON
         AND,R2   #R16              CLEAR FLAGS
         CW,R2    ISUN              IS HE THE INSWAP USER
         BNE      LOCJIT31          NO MATCH - EXIT
         LI,R14   UX:JIT            LETS GET
         BAL,R0   GETADDR           HIS JIT PAGE #
         LOAD,R3  *R15,R2           AND GET THE JIT PAGE
         BEZ      LOCJIT31          NONE TO BE HAD
         STW,R3   J:PAGE            REMEMBER IT
         LI,R14   UH:FLG2           NOW LETS GET
         BAL,R0   GETADDR           HIS SECOND SET OF FLAGS
         LH,R3    *R15,R2
         CI,R3    X'18'             WAS JUST SWAPPED IN SET
         BAZ      LOCJIT31          NO - USER JIT IS COMPLETELY GONE
         LW,R1    J:PAGE            MOVE PAGE #
         BAL,R0   GET1ADDR          AND GO READ IT
         LW,R14   J:PAGE            GET THE PAGE # AGAIN
         B        LOCJIT15          AND GO READ IT INTO JIT BUFFER
*
*        IF WE WIND UP HERE - THERE IS NO JIT TO BE HAD AT ALL
*
LOCJIT31 EQU      %
         MTW,0    J:SRCH            WAS SOMEBODY JUST LOOKING FOR IT
         BNEZ     LOCJIT4           YES,NO ERROR MSG
         LI,1     NOSJIT
         BAL,R0   MSG               PRINT THE FIRST MSG
         LI,R1    US:MSG            NEXT MSG
         LW,R3    USER              GET USER'S NUMBER
         AND,R3   #R16              SCREEN FLAGS
         BAL,R0   MTBB              MSG / TRANSSZ / BUFOUT / BLANK1
LOCJIT4  EQU      %
         LI,R0    -1                INSURE
         STW,R0   JIT#              TRACKS ARE ALL ERASED
         LCFI     4                 AND NOW SET ERROR FLAG
         B        LOCJIT2           EXIT
         USECT    DATA
JITSTAT  DATA     0
J:PAGE   DATA     -1
J:SRCH   DATA     0                 > 0 SAYS JUST LOOKING FOR JIT
         USECT    PP
*
*        FPT USED TO READ JITS INTO CORE
*
JITFPT   GEN,8,24  16,M:EI
         DATA      X'F8000010'
         DATA     PAGERR,PAGERR     ERROR/ABNORMAL ROUTINES
         PZE      *JITBUF           BUFFER ADDRESS
         DATA     2048              SIZE
         DATA     JITKEY
         USECT    DATA
JIT#     DATA     -1                USER# FOR JIT IN JITBUF
PAGEBUF  DATA     0
JITKEY   GEN,8,24 3,-1              KEY USED TO READ JITS
PAGEBUF2 DATA     0
         USECT    PP
         PAGE
*
*        USER'S UX:JIT ENTRY IS INCORRECT OR INVALID
*
LOCJIT5  EQU      %
         MTW,0    J:SRCH            IS SOMEONE JUST LOOKING FOR IT
         BNEZ     LOOK4JIT          YES - LOOK ELSEWHERE FOR THEM
         LI,R1    UXJITERR1         ITS A GOOD TIME TO PUT OUT AN
         LW,R3    USER              GET HIS NUMBER
         AND,R3   #R16              SCREEN FLAGS
         BAL,R0   MSG
         BAL,R0   TRANSSZ
         LI,R1    UXJITERR2
         BAL,R0   MBB
         B        LOCJIT4           ERROR EXIT FROM LOCJIT
UXJITERR1 TEXTC '**USER# '
UXJITERR2 TEXTC ' UX:JIT ENTRY CONTAINS INVALID PAGE # '
         PAGE
         USECT    PP
*F*
*F*      NAME:    DUMPSOME
*F*
*F*      PURPOSE:
*F*               TO TAKE THE REQUESTED RANGE OF ADDRESSES AND
*F*               OUTPUT THEM ONTO THE LO DEVICE.
*F*
*F*      DESCRIPTION:
*F*               YOU CALL HERE VIA R0 WITH THE FOLLWING REG SETUP;
*F*
*F*      R0       LINK
*F*      R8       STARTING DUMP ADDRESS (POINTING INTO DUMP BUFFERS)
*F*      R7       # OF WORDS TO DUMP OUT
*F*      OLDPAGEM CONTAINS THE PAGE # OF THE AREA WE ARE DUMPING
*F*
*F*               DUMPSOME WILL SUPPRESS DUPLICATE LINES..ETC...
*F*
DUMPSOME LCI      9
         PSM,0    STACK
         LI,5     0
         STW,5    PFLAGS            INITIALIZE THE PRINT FLAGS
DUMP01   EQU      %
         MTW,0    DUMP:DIR          IS BUFFER ALREADY THERE ???
         BNEZ     DUMP02            NOPE
         LI,R5    X'46'
         MTW,0    JITBURST          DUMMPING A JIT
         BNEZ     %+2               ALREADY GOT RIGHT PAGE #
         LW,R5    OLDPAGEM          ELSE LOAD CURRENT PAGE #
         SLS,5    9
         LW,R6    R8                BUFFER POINTER
         AND,R6   X1FF              OBTAIN INDEX INTO PAGE
         AW,R5    R6                CREATE TARGET ADDRESS
DUMP02   EQU      %
         BAL,R0   LINESTRT          * START THE NEW PRINT LINE OFF
DUMP03   EQU      %
         BAL,R0   DMPADDR           * NO-> GET THIS ADDRESS
         LW,R3    *R15              * GET NEXT WORD
         STW,R3   CRNTWORD          * SAVE CURRENT WORD
         CI,R6    0                 * FIRST WORD IN ROW
         BGZ      %+2               * NOPE--> NO SCAN ON PARTIAL LINE
         BAL,R1   DUMP07            * SCAN ENTIRE LINE ON FIRST WORDS
         BAL,R0   TRANS             * PUT WORD INTO PRINT LINE
         BAL,R0   SPACE2            * PUT IN PROPER SPACING
         AI,R6    1                 * NEXT WORD INDEX
         BDR,R4   DUMP03            * FINISH CURRENT LINE
         SW,R7    BLKCNT            * DECREMENT AMOUNT TO DUMP STILL
         AW,R5    BLKCNT            * UPDATE CORE ADDRESS
DUMP04   EQU      %
         BAL,R0   BUFOUT            * PRINT THE LINE
         MTW,1    PFLAGS            * COUNT A LIINE PRINTED
         CI,R7    0                 * ANY MORE WORDS TO DUMP STILL
         BGZ      DUMP02            * KEEP GOING
DUMP06   EQU      %
         LI,R0    0                 * ALL DONE
         STW,R0   DUMP:DIR          * CLEAR DIRECT FLAG
         STW,R0   JITBURST          * CLEAR JIT DUMP FLAG
         LCI      9                 *
         PLM,R0   STACK             * RETRIEVE CALLER'S REGISTERS
         B        *R0               * AND RETURN TO CALLER
         PAGE
*
*        RUN OUT ALL DUPLICATE LINES HERE
*
DUMP07   EQU      %
         MTW,0    PFLAGS            * HAVE WE PRINTED A LINE YET
         BEZ      0,R1              * NO--> DO SO
         STW,R5   FIRSTADR          * FIRST LOC SCANNED
         LW,R2    R7                * MOVE # OF WORDS TO DUMP OVER
         LI,R3    0                 * CLEAR WORDS SKIPPED COUNT
DUMP08   EQU      %                 *
         AI,R6    1                 *
         BAL,R0   DMPADDR           * GET NEXT WORD
         CW,R14   CRNTWORD          * SAME AS CURRENT
         BNE      DUMP09            * NO-> STOP
         AI,R3    1                 * COUNT A WORD SKIPPED
         BDR,R2   DUMP08            * SCAN TILL END
DUMP09   EQU      %                 *
         LI,R2    0                 *
         DW,R2    BLKCNT            * CALCULATE # OF SKIPPED LINES
         CI,R3    0                 *
         BEZ      DUMP10            * DIDNT SKIP ANY LINES
         CW,R2    BLKCNT            * CHECK REMAINDER FOR ROUDING
         BL       %+2               *
         AI,R3    1                 * ROUND UP BY ONE
         LI,R0    0                 *
         STW,R0   TPTR              *
         STW,R0   PTR               * CLEAR LINE COLUMN POINTERS
         MW,R3    BLKCNT            * CALCULATE # OF WORDS FROM IT
         STW,R3   CRNTCNT           * REMEMBER # OF WORDS SKIPPED
         AW,R3    FIRSTADR          * FIRST LOC PLUS WORDS SKIPPED
         STW,R3   LASTADR           * EQUAL LAST LOC EQUAL
         LW,R3    FIRSTADR          * GET FIRST ADRS FOR PRINTING
         BAL,R0   TRANSSZ           * TO PRINT LINE
         LI,R1    DASH              *
         BAL,R0   MSG               *
         LW,R3    LASTADR
         AI,R3    -1
         BAL,R0   TRANSSZ           * AND STICK IT INTO PRINT LINE
         LI,R1    SAME              *
         BAL,R0   MSG               *
         LW,R3    CRNTWORD          * AND EQUAL WORD ALSO
         BAL,R0   TRANS             * TO PRINT LINE
         LW,R5    LASTADR           * NEW STARTING ADDRESS
         SW,R7    CRNTCNT           * NEW # OF WORDS LEFT
         LI,R1    DUMP04            * RETURN ADDRESS
DUMP10   EQU      %                 *
         BAL,R0   DMPADDR           * RESTORE POINTERS
         LW,R3    CRNTWORD          * RESTORE CURRENT WORD
         LI,R6    0                 * CLEAR ADDRESS INDEXER
         B        0,R1              * GO DO IT AGAIN
*
DASH     TEXTC    ' <---> '
SAME     TEXTC    ' ARE ALL '
         USECT    DATA
CRNTWORD DATA     0
CRNTCNT  DATA     0
FIRSTADR DATA     0
LASTADR  DATA     0
CRNTPAGE DATA     0
         USECT    PP
         PAGE
*
*        GET NEXT WORD FOR DUMP LINE SCANNER
*
DMPADDR  EQU      %
         LW,R14   R5                CORE ADDRESS
         AW,R14   R6                CURRENT INDEX INTO THAT ROW
         LW,R15   MAPFLAG
         BNEZ     GETADDR           TRANSLATE ADDRESS IF MAPPED
         LW,R15   JITBURST          DUMPING A JIT
         BNEZ     DMPADDR1          YUP
         LW,R15   DUMP:DIR          DIRECT DUMP
         BEZ      GETADDR           NO-> GET ADDRESS
         LW,R15   R14               YUP-----> MOVE POINTER TO BUF
         AW,R15   R8                AND THEN ADD BASE ADDRESS OF IT
         B        *R0               RETURN W/R15 POINTING TO NEW LOC
DMPADDR1 EQU      %
         AND,R14  X1FF              SAVE PAGE DISPLACMENT
         LW,R15   JITBUF            GET OUR JIT BUFFER ADDRESS
         AW,R15   R14               POINT INTO BUFFER
         B        *R0               AND RETURN
         PAGE
*
*        START A NEW PRINT LINE FOR THE DUMP ROUTINE
*
LINESTRT EQU      %
         PSW,R0   STACK             * SAVE LINK
         LI,R0    0                 *
         STW,R0   PTR               * CLEAR COLUMN POINTER
         LW,R0    TPTRSV            *
         STW,R0   TPTR              * STORE TRANSLATE COLUMN POINTER
         LW,R3    R5                * LOAD ADDRESS
         BAL,R0   TRANSSZ           * PUT IT ONTO LINE
         LW,R4    BLKCNT            * LOAD # OF COLUMNS TO DUMP
         LI,R6    0                 * LOAD INDEX REGISTER
         CW,R4    R7                * WHAT IS DUMP WORD COUNT
         BLE      %+2               * OK TO GO ON
         LW,R4    R7                * ADJUST # OF WORDS IN ROW THEN
         MTW,3    PTR               * 3 SPACES OVER IS FIRST WRD
         PLW,R0   STACK             * LOAD LINK
         B        *R0               * AND RETURN
         PAGE
*
*        DUMP DRIVING DATA CELLS DEFINITION
*
*        CELL     MEANING
*        ------   ----------------
*
*      PFLAG      1 = CURRENT WORD IS NE TO LAST WORD
*                 2 = LAST LINE WAS PRINTED
*                 4 = CURRENT WORD EQUALS ENTIRE PRINT LINE
*                 8 = DUMP ENTIRELY COMPLETED
*
*      DUMP:DIR   DUMP DIRECTLY FROM ADDRESS IN R8
*
         USECT    DATA
DUMP:DIR DATA     0                 NE ZERO SAYS DUMP ACTUAL CORE
PFLAGS   DATA     0
BUFSIZ   EQU      %
LASTWORD DATA     X'12345678'
         USECT    PP
*
         PAGE
*F*
*F*      NAME:    MSG / MSG1
*F*
*F*      PURPOSE:
*F*               TO TAKE EITHER THE TEXT (MSG1) OR THE TEXTC (MSG)
*F*               STRING AND MOVE IT INTO THE PRINT BUFFER.
*F*
*F*      DESCRIPTION:
*F*               YOU CALL HERE VIA R0 AND THESE ROUTINES WILL
*F*               MOVE YOUR MESSAGE INTO THE PRINT BUFFERS STARTING
*F*               AT THE COLUMN POINTED TO BY 'PTR'.
*F*
MSG1     EQU      %
         LCI      4                 *
         STM,R2   SRETURN           * SAVE WORK AREA
         LI,R3    1                 * SET FROM TEXT FLAG
         B        MSG3              * MERGE W/COMMON CODE
*
*
MSG      EQU      %
         LCI      4                 *
         STM,R2   SRETURN           * SAVE WORK AREA
         LI,R3    0                 * SET FROM TEXTC FLAG
         LB,R2    *R1               * GET BYTE COUNT
         CLM,R1   BIGBUF            * IS MSG IN SYMBOL TABLE
         BCS,9    MSG3              * NOPE
         LC       *R1               * YUP--> IS IT TRUNCATED
         BCR,8    MSG2              * NOPE
         OR,R3    BATFLAG           * POST TRUNCATED SYMBOL FLAG
MSG2     EQU      %
         AND,R2   =7                * MASK FLAGS FROM SYMBOL TABLE
MSG3     EQU      %
         LW,R4    R1                * MOVE MSG WORD ADDRS
         SLS,R4   2                 * BYTE ADDRESS
         CI,R3    1                 * IS MSG FROM TEXT OR TEXTC STRING
         BAZ      %+2               * ITS FROM A TEXTC STRING
         AI,R4    -1                * NO-- ADJUST BA
         LW,R5    PTR               * PICK UP CURRENT COLUMN POINTER
         AI,R5    BA(OBUF)          * ADD PRINT BUF BA
         CI,R5  BA(OBUF)+OBUFSIZ*4  * WILL WE OVERFLOW PRINT BUFFER
         BGE      MSG4              * YUP---> JUMP
         AWM,R2   PTR               * UPDATE COLUMN POINTER
         STB,R2   R5                * STORE COUNT FOR MBS
         MBS,R4   1                 * MOVE MSG INTO PRINT BUFFER
         LC       R3                * WAS TRUNCATED SYMBOL STRING
         BCR,4    MSG4              * NOPE
         LI,R4    '<'               * YUP
         STB,R4   0,R5              * STORE FLAG ON LISTING
         MTW,1    PTR               * BUMP COUNT OF CHARS ON PRINT LINE
MSG4     EQU      %                 *
         LCI      4                 *
         LM,R2    SRETURN           * LOAD WORK AREA
         B        *R0               *
         PAGE
*F*
*F*      NAME:    SPACES
*F*
*F*      PURPOSE:
*F*               TO SPACE OVER IN THE CURRENT PRINT LINE TO THE
*F*               COLUMN POINTED TO BY R1.
*F*
*F*      DESCRIPTION:
*F*               SPACES WILL TAKE YOUR VALUE IN R1 AND MOVE
*F*               BLANKS BETWEEN THE LAST COLUMN WE WERE AT AND THE
*F*               NEW COLUMN POINTED TO BY R1.
*F*               THE COLUMN POINTERS ARE UPDATED AND SPACES WILL
*F*               RETURN TO THE CALLER.
*F*
*
SPACES   EQU      %
         STW,R1   PTR               SAVE NEW VALUE
         B        *R0               AND EXIT
BLNKBYT  GEN,8,24 ' ',0
         PAGE
*F*
*F*      NAME:    PATCH
*F*
*F*      PURPOSE:
*F*               TO SERVE AS ANLZ'S PATCH AREA.
*F*
*F*      DESCRIPTION:
*F*               AVAILABLE TO ANY RESPONSIBLE INDIVIDUAL WHO WISHES
*F*               TO PATCH/GENMD ANLZ.
*F*
         USECT             DATA
PATCH    DO1      36
         DATA     0
         USECT    PP
         END      INITIAL         START AT INITIAL

