         SYSTEM   SIG7FDP
         SYSTEM   BPM
*
*
*
***********************************************************************
*M*      IMC      TO DECODE IMC CC AND TO BUILD M:IMC LOAD MODULE
***********************************************************************
*
         DEF      IMC
         REF      READSTRG,LLIST
         REF      SYNTAX,COREALLOC,MODGEN,WRITELM
         REF      SWAPUTS,SCYLPSA
         REF      BIGLOC,NOROOM,M:TM
         REF      P2ERR
         REF      LPART#
         REF      PRNTP2SI
         REF      LOGIT
DYN      CNAME
         REF      SCPUFLG
         PROC
LF       EQU      %-DYNAM
         GEN,1,15,16 AF(1),AF(2),AF(3)
         PEND
FOP      CNAME
         PROC
         GEN,1,7,8    AF(1),AF(2),AF(3)
         PEND
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6
R7       EQU      7
SR1      EQU      8
SR2      EQU      9
SR3      EQU      10
SR4      EQU      11
D1       EQU      12
D2       EQU      13
D3       EQU      14
D4       EQU      15
*
FILENAME TEXTC    'M:IMC'
         PAGE
*
*
KWDTBL0  EQU      %
         DATA     KWDTBL-KWDTBL0
         FOP      0,0,3          0  FIND LEFT (
         FOP      1,0,9          1  FIND KEYWORD
         FOP      1,0,10         2  PROCESS KEYWORD
         FOP      1,0,8          3  LOOK FOR ) OR ),( OR END OF COMMAND
         FOP      0,1,1          4  GO TO START OF FOP'S+1
         FOP      1,3,14         5  NEXT STRING MUST BE HEX IF SO
*                                   CONVERT IT. IF NOT GO TO KWDTBL+3
         FOP      0,15,18        6  STORE IT INTO *DYNAM+15,R5
         FOP      0,3,1          7  GO TO START OF FOP'S +3
*        KEYWORDS
*
KWDTBL   EQU      %
KWD      COM,32,8,24  AF(1),AF(2),AF(3)
         KWD      'RETI',1,RETLOC
         KWD      'MAXG',1,MXGLOC
         KWD      'MAXB',1,MXBLOC   DEC
         KWD      'BLOC',1,BLOCLOC  DEC
         KWD      'UNBL',1,UNBLOC   DEC
         KWD      'QUAN',1,QUANLOC  DEC
         KWD      'MINQ',1,MNQLOC   DEC
         KWD      'MINT',1,MNTLOC  DEC
         KWD      'LOGT',1,LOGLOC  DEC
         KWD      'INTI',1,TIMLOC  DEC
         KWD      'MAXO',1,MXOLOC  DEC
         KWD      'THRE',1,THRLOC  DEC
         KWD      'BPRI',2,BPLOC   HEX
         KWD      'OPRI',2,OPLOC   HEX
         KWD      'GPRI',2,GPLOC   HEX
         KWD      'RASI',1,RASLOC  DEC
         KWD      'RAMA',1,RAMLOC  DEC
         KWD      'RATO',1,RATLOC  DEC
         KWD      'AIRM',1,AIRMLOC  DEC
         KWD      'AIRT',1,AIRTLOC  DEC
         TEXT     'PI'
         GEN,8,24 1,PILOC
         TEXT     'BACK'
         GEN,8,7,17 0,1,(BCKLOC*4)+3
         TEXT     'EXPI'
         GEN,8,7,17  1,1,EXPLOC
         TEXT     'MAXE'
         GEN,8,7,17  1,1,MXELOC
         KWD      'COCB',1,COCBLOC
         KWD      'UCYL',1,UCYLOC
         KWD      'PWP ',1,PWPLOC   PHYSICAL WORK PAGES
         KWD      'SECU',8,5        GO TO FOP'S+5
DFLTS    DATA     #DFLT             #KEYWORDS TO DEFAULT
KWDPTR   GEN,15,17  DFLTS-KWDTBL,KWDTBL0    SIZE OF KEYWORD TABLE,
*                                           ADDRESS OF KEYWORD INFO
*
GHSTRT   EQU      %
         DATA     0,0
         TEXTC    'KEYIN'
         TEXTC    'ALLOCAT'
         TEXTC    'RBBAT'
         TEXTC    'FIX'
         TEXT     '    '
GHEND    EQU      %-GHSTRT
MNGVAL   EQU      (GHEND-1)**-1
         TEXTC    'ERR:FIL'         THIS IS PART OF ABOVE--
         TEXTC    'RVGHOST'
         TEXTC    'ANLZ'
GHENDF   EQU      %-GHSTRT          DON'T SEPARATE
BLKMSG   TEXTC    '*** UNBLOCK > BLOCK - SET EQUAL TO BLOCK'
MNTMSG   TEXTC    '*** MINTIME  >  QUANTA              ',;
                  '  -- QUANTA VALUE USED'
MXUMSG   TEXTC    '*** USERS > 255 - IMC ABORTED'
EXMSG    TEXTC    '*** EXPIRE OR MAXEXPIRE OUT OF RANGE',;
                  '  -- 999 DAYS, 23 HOURS USED'
MXEMSG   TEXTC    '*** MAXEXPIRE < EXPIRE              ',;
                  '  -- EXPIRE VALUE USED'
COCBMSG  TEXTC    '*** COC BUFFERS > 255               ',;
                  '  -- 255 USED'
MGLOMSG  TEXTC    '*** MAXG < 5                         ',;
                  '  -- DEFAULT (8) USED'
MGHIMSG  TEXTC    '*** MAXG > 255                      ',;
                  '  -- DEFAULT (8) USED'
UCYLMSG1 TEXTC    '*** SWAPPER NOT DP -- UCYL IGNORED'
UCYLMSG2 TEXTC    '*** UCYL VALUE INVALID -- DEFAULT (1) USED'
BPMESS   TEXTC    'BPRIO<X''C0'' OR >X''FF''. DEFAULT USED (X''FC'')'
OPMESS   TEXTC    'OPRIO<X''C0'' OR >X''FF''. DEFAULT USED (X''FC'')'
GPMESS   TEXTC    'GPRIO<X''C0'' OR >X''FF''. DEFAULT USED (X''FC'')'
RAMESS   TEXTC    'RAMAX > 63 -- DEFAULT (0) USED'
RASMESS  TEXTC    'RASIZE NOT SPECIFIED. READ AHEAD TABLES NOT',;
                  ' GENERATED'
RAMESS1  TEXTC    'RATO OUTSIDE LEGAL RANGE OF 0-32767, DEFAULT',;
                  ' (10000) USED'
RAM2LG   TEXTC    'RAMAX MUST BE LESS THAN OR EQUAL TO RASIZE.  ',;
                  'RAMAX HAS BEEN SET TO RASIZE VALUE'
AIRM2LG  TEXTC    'AIRM MUST BE LESS THAN OR EQUAL TO RAMAX. ',;
                  'AIRM HAS BEEN SET EQUAL TO RAMAX.'
AIRT2LG  TEXTC    'AIRTO IS GREATER THANT 500000. AIRTO HAS BEEN',;
                  ' SET TO 500000.'
SPECMES  TEXTC    '***TROUBLE WITH SPEC:HAND-- RA NOT INCLUDED'
MAXBMSG  TEXTC    'MAXB > # OF PARTITIONS.  DEFAULTED TO # OF',;
                  ' PARTITIONS'
MAXEX    DATA     (999*24)+23
INC      AW,8     D1                BYTE INCREMENT
         AW,8     9                 HALFWORD INCREMENT
         PAGE
*
*        LIMITS AND DEFAULTS
*
DYNAM    EQU      %
RETLOC   DYN      1,0,X'FFFF'
MXGLOC   DYN      1,8,0
MXBLOC   DYN      1,1,16
BLOCLOC  DYN      1,1,32767
UNBLOC   DYN      1,1,32767
QUANLOC  DYN      1,400,0
MNQLOC   DYN      1,40,0
MNTLOC   DYN      1,0,0
LOGLOC   DYN      1,0,655
TIMLOC   DYN      1,0,655
MXOLOC   DYN      1,0,255
PILOC    DYN      1,0,255
COCBLOC  DYN      1,15,0
#FAST    EQU      %-DYNAM
THRLOC   DYN      1,500,0
SECUTOP  DATA     SECULOC+1
SECUBOT  DATA     SECULOC
BPLOC    DYN      1,X'FC',0
OPLOC    DYN      1,X'FC',0
GPLOC    DYN      1,X'FC',0
RAMLOC   DYN      1,0,0
RASLOC   DYN      1,0,0
RATLOC   DYN      1,0,0
AIRMLOC  DYN      1,0,0
AIRTLOC  DYN      1,30000,0
EXPLOC   DYN      1,-1,0
         DYN      1,-1,0
MXELOC   DYN      1,-1,0
         DYN      1,-1,0
BCKLOC   DYN      0,0,0
UCYLOC   DYN      1,0,0
#DFLT    EQU      %-DYNAM
MXULOC   DYN      0,0,0             WILL CONTAIN MAXG+MAXB+MAXOL
PWPLOC   DYN      1,0,0
#DYNAM   EQU      %-DYNAM
SECULOC  DATA     0                 PAGE CLEARING HEX VALUE
         PZE      WRITE             ABORT RETURN FROM COREALLOC OR MODGEN
         PAGE
*
*        IMC ROUTINE
*
IMC      EQU      %
         LI,2     DYNAM
        LI,1     #DYNAM
        LW,4     KWDPTR
         BAL,SR4  SYNTAX
         LW,D2    LPART#,R3
         CW,D2    MXBLOC,R5
         BGE      CHEKSWAP
         STW,D2   MXBLOC,R5
         LI,D3    MAXBMSG
         BAL,SR4  LOGIT             TELL USER RE ERROR
CHEKSWAP EQU      %
         MTW,0    SWAPUTS,3         DP SWAPPER
         BNEZ     NXTCHKA
         MTW,0    UCYLOC,R5         UCYL SPEC ?
         BEZ      NXTCHK            NO
         LI,D2    0
         LI,D3    UCYLMSG1          NOT DP,UCYL IGNORED
         BAL,SR4  LOGIT             TELL USER RE ERROR
         B        NXTCHK-1
NXTCHKA  EQU      %
         LW,D2    UCYLOC,R5         DP SWAPPER,UCYL SPEC
         BEZ      NXTCHK-2          NO,USE DEFAULT
         CW,D2    SWAPUTS,R3        SWAPUTS = 2 OR 3
         BLE      NXTCHK            YES
         LI,D3    UCYLMSG2          UCYL INVALID DEFAULT USED
         BAL,SR4  LOGIT             TELL USER RE ERROR
         LI,D2    1
         STW,D2   UCYLOC,R5
NXTCHK   EQU      %
         LW,D2    LOGLOC,R5         LOGTIME VALUE
         BNEZ     %+2
         LI,D2    3                 DEFAULT VALUE IS 3
         MI,D2    50                CNVT TO MULT OF 1.2 SECS
         STW,D2   LOGLOC,R5         STORE VALUE
         LW,D2    TIMLOC,R5         INTIME VALUE
         BNEZ     %+2
         LI,D2    15                DEFAULT IS 15
         MI,D2    50                CNVT TO MULT OF 1.2 SECS
         STW,D2   TIMLOC,R5         STORE VALUE
         LW,D1    BLOCLOC,R5
         CW,D1    UNBLOC,R5         UNBLOCK =< BLOCK
         BGE      %+4               YES
         LI,D3    BLKMSG
         BAL,SR4  LOGIT             TELL USER RE ERROR
         STW,D1   UNBLOC,R5
         LW,D1    QUANLOC,R5        CONVERT TIMES
         SLS,D1   -1                TO NUMBER OF TICKS
         STW,D1   QUANLOC,R5
         LW,D1    MNQLOC,R5
         SLS,D1   -1
         STW,D1   MNQLOC,R5
         LW,D1    MNTLOC,R5         MINTIME SPECIFIED?
         BLEZ     %+7
         SLS,D1   -1                YES
         STW,D1   MNTLOC,R5
         CW,D1    QUANLOC,R5        IS IT <= QUANTA?
         BLE      %+5               YES
         LI,D3    MNTMSG
         BAL,SR4  LOGIT             TELL USER RE ERROR
         LW,D1    QUANLOC,R5        DEFAULT IT TO QUANTA
         STW,D1   MNTLOC,R5
         LW,D1    MXGLOC,R5
         CI,D1    5
         BGE      %+6
         LI,D1    8
         STW,D1   MXGLOC,R5
         LI,D3    MGLOMSG
         BAL,SR4  LOGIT             TELL USER RE ERROR
         B        OKCK
         CI,D1    255
         BLE      OKCK
         LI,D1    8
         STW,D1   MXGLOC,R5
         LI,D3    MGHIMSG
         BAL,SR4  LOGIT             TELL USER RE ERROR
OKCK     EQU      %
         LW,D1    MXGLOC,R5
         AW,D1    MXOLOC,R5
         AW,D1    MXBLOC,R5
         CI,D1    255
         BLE      %+4               YES
         LI,D3    MXUMSG
         BAL,SR4  LOGIT             TELL USER RE ERROR
         B        GIVEUP
         STW,D1   MXULOC,R5
         LW,D1    COCBLOC,R5
         BEZ      %+5
         CI,D1    255               LESS THAN MAX
         BLE      %+5
         LI,D3    COCBMSG
         BAL,SR4  LOGIT             TELL USER RE ERROR
         LI,D1    255
         STW,D1   COCBLOC,R5
* PROCESSING EXPIRE AND MAXEXPIRE
         LI,D1    EXPLOC
EXCHK    LW,D2    *D1,R5            DAYS CHANGED ?
         BLZ      SEC+2
         BEZ      %+2               YES
         MI,D2    24                CONVERT TO HOURS
         AI,D1    1
         AW,D2    *D1,R5            ADD TOGETHER
         CW,D2    MAXEX
         BLE      SEC
         LI,D3    EXMSG
         BAL,SR4  LOGIT             TELL USER RE ERROR
         LW,D2    MAXEX
SEC      STW,D2   *D1,R5            STORE VALUE IN HOURS ENTRY
         AI,D1    -1
         AI,D1    2
         CI,D1    EXPLOC+3
         BL       EXCHK
         LW,D2    MXELOC+1,R5
         BLZ      GPROS
         CW,D2    EXPLOC+1,R5
         BGE      GPROS
         LW,D2    EXPLOC+1,R5
         STW,D2   MXELOC+1,R5
         LI,D3    MXEMSG
         BAL,SR4  LOGIT             TELL USER RE ERROR
***      LIMIT CHECKIN GP,BP,OP
GPROS    LI,D2    X'FC'
         LD,8     LIMS
         CLR,8    BPLOC,5
         BCR,6    %+4
         LI,D3    BPMESS
         BAL,SR4  LOGIT             TELL USER RE ERROR
         STW,D2   BPLOC,5
         CLR,8    OPLOC,5
         BCR,6    %+4
         LI,D3    OPMESS
         BAL,SR4  LOGIT             TELL USER RE ERROR
         STW,D2   OPLOC,5
         CLR,8    GPLOC,5
         BCR,6    %+4
         LI,D3    GPMESS
         BAL,SR4  LOGIT             TELL USER RE ERROR
         STW,D2   GPLOC,5
***      HANDLE RAMAX AND RATO
         LW,D1    RAMLOC,R5
         LW,R1    RATLOC,R5
         AW,R1    D1
         BEZ      CHKRAS
         LW,R1    RASLOC,R5
         BNEZ     CHKRAM
         LI,D3    RASMESS
         BAL,SR4  LOGIT             TELL USER RE ERROR
         B        COREALLOW
CHKRAS   LW,R1    RASLOC,R5
         BEZ      COREALLOW
CHKRAM   CI,D1    63                CHECK RAMAX VALUE
         BLE      %+5               YES
         LI,D3    RAMESS
         BAL,SR4  LOGIT             TELL USER RE ERROR
         LI,D3    0
         STW,D3   RAMLOC,R5
         LW,D1    RASLOC,R5
         CI,D1    63
         BLE      %+3
         LI,D1    63
         STW,D1   RASLOC,R5         SET DEFAULT
         CW,D1    RAMLOC,R5
         BGE      %+4
         LI,D3    RAM2LG
         BAL,SR4  LOGIT
         STW,D1   RAMLOC,R5         SET RAMAX TO RASIZE VALUE
         MTW,0    AIRMLOC,R5        WAS THERE AN AIRM VALUE SPECIFIED
         BEZ      CHKAIRTO          BRANCH IF NOT
         LW,D1    RAMLOC,R5
         CW,D1    AIRMLOC,R5        AIRM MUST BE L.E. RAMAX
         BGE      CHKAIRTO
         LI,D3    AIRM2LG
         BAL,SR4  LOGIT
         STW,D1   AIRMLOC,R5
CHKAIRTO LI,D1    500000
         CW,D1    AIRTLOC,R5        AIRTO MUST BE IN RAGE 0-500000
         BGE      GETPAGE
         LI,D3    AIRT2LG
         BAL,SR4  LOGIT
         STW,D1   AIRTLOC,R5
GETPAGE  EQU      %
         LW,1     =X'08000001'
         CAL1,8   1
         BCS,8    NOROOM
         STW,9    PAGEA
         M:OPEN   M:TM,(FILE,'SPEC:HAND'),(KEYED),(INOUT),(SAVE),;
                  (ERR,NOH),(ABN,NOH)
         M:READ   M:TM,(BUF,*PAGEA),(SIZE,2044),(KEY,HAND),;
                  (ERR,NOH),(ABN,NOH)
         LW,1     13+M:TM           ADD RA TO HANDLER
         SLS,1    -3
         LD,14    NAME
         STD,14   *PAGEA,1
         MTW,1    *PAGEA
         AI,1     1
         SLS,1    3
         M:WRITE  M:TM,(BUF,*PAGEA),(SIZE,*1),(KEY,HAND),;
                  (ERR,NOH),(ABN,NOH)
         M:CLOSE  M:TM,(SAVE)
REC      LW,1     =X'09000001'
         CAL1,8   1                 FREE PAGE
         LW,D1    RATLOC,5
         BNEZ     %+3
         LI,D1    10000             DEFAULT RATLOC
         STW,D1   RATLOC,5
         CI,D1    32767
         BLE      %+5
         LI,D3    10000             ILLEGAL VALUE, PICK UP DEFAULT
         STW,D3   RATLOC,5
         LI,D3    RAMESS1
         BAL,SR4  LOGIT             TELL USER RE ERROR
COREALLOW EQU     %
         LI,D2    -1
         LI,D1    -1                USE REST OF CORE FOR RFDF/EXPR
         BAL,SR4  COREALLOC
         BAL,10   MODGEN
         LW,D1    8
         AI,8     #FAST
         TEXTC    'E2'              INSURE ADEQUATE SPACE
         LW,8     D1
         B        %+1
         LI,R1    #FAST             MOVE VALUES FROM RETIM THRU
         LW,D1    *R5,R1            THRESHOLD TO CSECT 0
         STW,D1   *SR1,R1
         BDR,R1   %-2
         LW,D1    0,R5              RETIM ALSO
         STW,D1   *8
         LW,D1    MXULOC,R5
         MTW,1    MXULOC,R5         INCRE MXULOC
         BAL,10   MODGEN            GEN DEFS AND MODULE
         TEXTC    'SMUIS0'
         TEXTC    'SL:RET1'
         AI,8     1
**** **** **** FROM S:GUAIS TO SL:QUAN -- ORDER SHOULD BE MAINTAINED
*                AND NO INSERTS SHOULD BE APPLIED (REQUIRED BY RECOVERY)
         TEXTC    'S:GUAIS1'        MAXG
         AI,SR1   1
         TEXTC    'S:BUAIS1'        MAXB
         AI,SR1   1
         TEXTC    'SL:TB1'          BLOCK
         AI,SR1   1
         TEXTC    'SL:UB1'          UNBLOCK
         AI,SR1   1
         TEXTC    'SL:QUAN1'        QUANTA
         AI,SR1   1
         TEXTC    'SL:QMIN1'        MINQUAN
         AI,SR1   1
         TEXTC    'SL:SQUAN1'       MINTIME
         AI,SR1   1
**** **** **** **** **** **** **** **** **** **** **** **** **** ****
         TEXTC    'SL:OLTO1'        LOGTIME
         AI,SR1   1
         TEXTC    'SL:OITO1'        INTIME
         AI,SR1   1
         TEXTC    'S:OUAIS1'        MAXOL
         AI,SR1   1
         TEXTC    'SL:PI1'          PI
         AI,SR1   1
         TEXTC    'SL:ONCB1'        COCBUF
         AI,SR1   1
         TEXTC    'SL:CORE1'        THRESHOLD
         AI,8     1
         LI,D1    6
         STW,D1   *8
         TEXTC    'SL:OXMF1'
         AI,8     1
         STW,D1   *8
         TEXTC    'SL:BXMF1'
         AI,8     1
         LI,D1    3
         STW,D1   *8
         TEXTC    'SL:OIMF1'
         AI,8     1
         STW,D1   *8
         TEXTC    'SL:BIMF1'
         AI,8     1
         TEXTC    'SL:PWP1'
         LW,D1    PWPLOC,5
         AND,D1   =X'7FFFFFFF'
         STW,D1   *8
         AI,8     1
         TEXTC    'PWPTABLE1'
         AW,8     D1
         AI,8     -1
         TEXTC    'PWPEND1'
         AI,8     1
         TEXTC    'SL:BPRIO1'
         LW,D1    BPLOC,5
         STW,D1   *8
         AI,8     1
         TEXTC    'SL:OPRIO1'
         LW,D1    OPLOC,5
         STW,D1   *8
         AI,8     1
         TEXTC    'SL:GPRIO1'
         LW,D1    GPLOC,5
         STW,D1   *8
         AI,8     1
         LW,D1    SECULOC
         STW,D1   *SR1
         TEXTC    'PGCLEAN1'        SECURITY PAGE CLEANING VALUE
         AI,SR1   1
*** SET UP READ AHEAD TABLES
         LI,D1    0
         LW,D2    RASLOC,R5
         BEZ      %+2
         LI,D1    1
         B        %+1
         BAL,10   MODGEN
         TEXTC    'RAFLAG0'
         LW,D1    D2
         TEXTC    'RASIZE0'
         CI,D1    0
         BEZ      NORA
         LW,D2    RATLOC,5
         TEXTC    'SL:RATOR1'
         STW,D2   *8
         AI,8     1
         TEXTC    'RA:CURA1'
         AI,8     1
         TEXTC    'RA:CURF1'
         AI,8     1
         TEXTC    'RA:CURR1'
         AI,SR1   1
         TEXTC    'RA:ABNTB1'
         AI,SR1   1
         TEXTC    'RA:ABNCO1'
         AI,SR1   1
         TEXTC    'RA:AINIT1'
         AI,SR1   1
         TEXTC    'RA:SINIT1'
         AI,SR1   1
         TEXTC    'RA:ABNTR1'
         AI,SR1   1
         TEXTC    'RA:ABNTA1'
         AI,SR1   1
         TEXTC    'RA:ABNWP1'
         AI,SR1   1
         TEXTC    'RA:ABNNN1'
         AI,SR1   1
         TEXTC    'RA:ASTOR1'
         AI,SR1   1
         TEXTC    'RA:SSTOR1'
         AI,SR1   1
         TEXTC    'RA:AGET1'
         AI,SR1   1
         TEXTC    'RA:GETF1'
         AI,SR1   1
         TEXTC    'RA:SGET1'
         AI,SR1   1
         TEXTC    'RA:SCHK1'
         AI,SR1   1
         TEXTC    'RA:IOWA1'
         AI,SR1   1
         TEXTC    'RA:IOW1'
         AI,SR1   1
         TEXTC    'RA:PUTF1'
         AI,SR1   1
         LW,D2    RAMLOC,R5
         STW,D2   *SR1
         TEXTC    'SL:RAMR1'
         AI,SR1   1
         TEXTC    'SL:AIRM1'
         LW,D2    AIRMLOC,R5
         STW,D2   *SR1
         AI,SR1   1
         TEXTC    'SL:RAMF1'
         LI,R1    2
         STW,R1   *SR1
         AI,SR1   1
         TEXTC    'SL:AIRTO1'
         LW,D2    AIRTLOC,R5
         STW,D2   *SR1
         LI,R1    X'F00'
         STW,R1   *SR1
         AI,SR1   1
         TEXTC    'RA:DA1'
         AI,D1    1
         AW,8     D1
         TEXTC    'RAH:TIME1'
         AI,D1    1
         SLS,D1   -1
         AW,8     D1
         TEXTC    'RAH:DCB1'
         AW,8     D1
         TEXTC    'RAX:PAGE1'
         B        %+1
         LW,R1    BIGLOC,R3         CHK IF 'BIG' SPECIFIED ON :MON CC
         BEZ      %+2
         AW,8     D1
         LW,D1    RASLOC,R5
         AI,D1    4
         SLS,D1   -2
         CI,1     0
         BNE      %+2
         AW,8     D1
         BAL,10   MODGEN
         TEXTC    'RAB:FLINK1'
         AW,8     D1
         TEXTC    'RAB:BLINK1'
         AW,8     D1
         TEXTC    'RAB:USER1'
         LW,D2    8
         AW,8     D1
         TEXTC    'E2'
         B        %+1
         XW,8     D2
         LW,D1    RASLOC,R5
         BEZ      %+5
         LW,1     D1
         AI,1     -1
         STB,D1   *8,1
         BDR,D1   %-2
         LW,8     D2
NORA     BAL,10   MODGEN
         TEXTC    'U:MISC1'
         LW,D1    MXULOC,5
         AW,8     D1
         TEXTC    'UH:FLG1'
         AI,D1    1
         SLS,D1   -1
         AW,8     D1
         TEXTC    'UH:JIT1'
         AW,8     D1
         TEXTC    'UH:AJIT1'
         AW,8      D1
         TEXTC     'UH:FLG21'
         AW,8     D1
         TEXTC    'UH:DL1'
         AW,8     D1
         TEXTC    'UH:WL1'
         AW,8     D1
         STW,D1   SR2               SAVE H.W. INCREMENT
         TEXTC    'UB:PCT1'
         AI,D1    1
         SLS,D1   -1
         AW,8     D1
         LW,R1    BIGLOC,R3         CHK IF 'BIG' SPECIFIED ON :MON CC
         LB,R1    R1                BIG IS SPECIFIED IN LEFTMOST BYTE
         TEXTC    'UX:JIT1'
         EXU      INC,1             INCRE.BY BYTE/HW
         TEXTC    'UB:SWAPI1'
         AW,8     D1
         TEXTC    'UB:NECB1'
         AW,8     D1
         TEXTC    'UB:MF1'
         AW,8     D1
         TEXTC    'UB:US1'
         LW,9     8
         AW,8     D1
         TEXTC    'UB:PRIOB1'
         B        %+1
         LW,1     D1
         BEZ      %+5
         AI,9     -1
         LW,D2    =X'1E1E1E1E'
         STW,D2   *9,1
         BDR,1    %-1
         BAL,10   MODGEN
         AW,8     D1
         TEXTC    'UB:PRIO1'
         LW,9     8
         B        %+1
         LW,1     D1
         BEZ      %+5
         AI,9     -1
         LW,D2    =X'FFFFFFFF'
         STW,D2   *9,1
         BDR,1    %-1
         BAL,10   MODGEN
         AW,8     D1
         TEXTC    'UB:FL1'
         LW,9     8
         AW,8     D1
         TEXTC    'UB:BL1'
         STW,8    1
         AW,8     D1
         TEXTC    'E2'              INSURE ADEQUATE SPACE
         LW,8     1
         MTW,-1   MXULOC,R5
         LI,1     MNGVAL
         B        %+3
STBY     STB,1    *8,1
         MTB,-1   *8,1
         CW,1     MXULOC,R5
         BE       %+5
         STB,1    *9,1
         MTB,1    *9,1
         AI,1     1
         B        STBY
         MTW,1    MXULOC,R5
         BAL,10   MODGEN
         AW,8     D1
         TEXTC    'UB:APR1'
         AW,8     D1
         TEXTC    'UB:APO1'
         AW,8     D1
         TEXTC    'UB:ASP1'
         AW,8     D1
         TEXTC    'UB:ACP1'
         AW,8     D1
         TEXTC    'UB:DB1'
         AW,8     D1
         TEXTC    'UB:OV1'
         AW,8     D1
         MTW,0    SCPUFLG,R3        CHK FOR MULTIPROCESSING SLAVE
         BEZ      CHKSWAP           CPU'S. BRANCH IF NONE
         TEXTC    'UB:MPFLG1'
         AW,SR1   D1
         TEXTC    'UB:CALR1'
         AW,SR1   D1
         TEXTC    'U:CALC1'
         AW,SR1   MXULOC,R5
         B        %+1
CHKSWAP  EQU      %
         MTW,0    SWAPUTS,3         DP SWAPPER
         BEZ      SGJOBGENT         NO
         BAL,10   MODGEN
         TEXTC    'S:UCYL1'
         LW,9     UCYLOC,R5
         STW,9    *8
         AI,SR1   1
         TEXTC    'U:P#1'
         AW,SR1   MXULOC,R5
         AI,8     1
         TEXTC    'UB:C#1'
         AW,8     D1
         TEXTC    'E2'              INSURE ADEQUATE SPACE
         AI,SR3   1
SGJOBGENT BAL,10  MODGEN
         AI,8     1
         SLS,8    -1                BOUND 8 FOR NEXT TABLE
         SLS,8    1
         TEXTC    'S:GJOBACN1'
         LW,9     8
         AW,8     MXGLOC,R5
         AW,8     MXGLOC,R5
         AI,8     2
         TEXTC    'S:GJOBTBL1'
         LI,R1    MNGVAL+3
         LD,D1    TSYS
         STD,D1   *9,1
         BDR,1    %-1
         LW,D1    MXGLOC,R5
         AI,D1    1
         SLS,D1   1
         STW,8    9                 SAVE REG 8
         AW,8     D1                FOR THE NEXT TWO TABLES-
         BAL,SR3  MODGEN
         TEXTC    'E2'              INSURE ADEQUATE SPACE
         LW,8     9                 RESTORE REG 8
         LI,D1    GHENDF
         LI,1     0
         LW,9     GHSTRT,1
         STW,9    *8,1
         AI,1     1
         BDR,D1   %-3
         LW,9     MXGLOC,R5
         AI,SR2   -MNGVAL-3
         BLEZ     %+3
         SLS,SR2  1
         AW,R1    SR2
         AW,SR1   R1
         BAL,10   MODGEN
         TEXTC    'SB:GJOBUN1'
         LW,D1    MXGLOC,R5
         AI,D1    1
         AI,D1    3
         SLS,D1   -2
         LI,1     0
         LI,9     0
         STW,9    *8,1
         AI,1     1
         BDR,D1   %-2
         AW,8     1
         AI,SR1   -1
         B        %+1
         BAL,10   MODGEN
         LI,D1    MNGVAL
         TEXTC    'MING0'
         LW,D1    MXGLOC,R5
         TEXTC    'MAXG0'
         LW,D1    MXBLOC,R5
         TEXTC    'SMBUIS0'
         LW,D1    THRLOC,R5
         TEXTC    'SL:THRS0'
         LW,D1    BCKLOC,R5
         SLS,D1   -1
         TEXTC    'SL:BKUP0'
         LW,D1    EXPLOC+1,R5
         BGEZ     %+2
         LI,D1    X'FFFF'
         AI,10    1
         BAL,10   MODGEN
         TEXTC    'SL:EX0'
         LW,D1    MXELOC+1,R5
         BGEZ     %+2
         LI,D1    X'FFFF'
         AI,10    1
         BAL,10   MODGEN
         TEXTC    'SL:MEX0'
         B        %+1
WRITE    LI,D3    FILENAME
         BAL,SR4  WRITELM
GIVEUP   LI,D1    -#DYNAM
         MSP,D1   *0
         PLW,D1   *0
         CW,D1    0
         BE       READSTRG
         PSW,D1   *0
         B        READSTRG
NOH      LW,14    =X'200000'
         CW,14    M:TM
         BAZ      %+2
         M:CLOSE  M:TM,(SAVE)
         LI,D3    SPECMES
         BAL,SR4  LOGIT             TELL USER RE ERROR
         B        REC
PAGEA    RES      1
HAND     TEXTC    'HANDLERS'
         BOUND    8
LIMS     DATA     X'C0',X'FF'
TSYS     TEXT     ':SYS    '
NAME     TEXTC    'RA'
         TEXT     '    '
PATCH    EQU      %
         LIST     0
         DO1      50
         DATA     0
         LIST     1
         END

