*        XLIMIT ROUTINE
*        PROCESS ELIMIT,BLIMIT,OLIMIT,GLIMIT
         SYSTEM   SIG7FDP
         SYSTEM   BPM
*
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
*        REFS AND DEFS
*
         REF      READSTRG,SYNTAX,COREALLOC,MODGEN
         REF      WRITELM,FETCHADR
         DEF      UBBLIMIT,UBOLIMIT,UBELIMIT,UBGLIMIT
         PAGE
PKWD     CNAME
         PROC
         GEN,8,7,17 AF(1),AF(2),AF(3)
         PEND
*
*        KEYWORD TABLE FOR SYNTAX ROUTINE
*                 FOR BLIMIT,OLIMIT,GLIMIT
BOGKWD   EQU      %
         TEXT     'TIME'
         PKWD     1,1,TIMLOC
         TEXT     'LO'
         PKWD     1,1,LOLOC
         TEXT     'PO'
         PKWD     1,1,POLOC
         TEXT     'DO'
         PKWD     1,1,DOLOC
         TEXT     'UO'
         PKWD     1,1,UOLOC
         TEXT     'PSTO'
         PKWD     1,1,PSTOLOC
         TEXT     'TSTO'
         PKWD     1,1,TSTOLOC
         TEXT     'FPOO'
         PKWD     1,1,FPOLOC
         TEXT     'TDIS'
         PKWD     1,1,TDISLOC
         TEXT     'PDIS'
         PKWD     1,1,PDISLOC
LBOGKWD  EQU      %-BOGKWD
         RES      1
**       KEYWORD TABLE FOR ELIMIT SYNTAX ROUTINE
EKWD     EQU      %
         TEXT     'TIME'
         PKWD     1,0,ETIMLOC
         TEXT     'LO'
         PKWD     1,0,ELOLOC
         TEXT     'PO'
         PKWD     1,0,EPOLOC
         TEXT     'DO'
         PKWD     1,0,EDOLOC
         TEXT     'UO'
         PKWD     1,0,EUOLOC
         TEXT     'PSTO'
         PKWD     1,0,EPSTOLOC
         TEXT     'TSTO'
         PKWD     1,0,ETSTOLOC
LEKWD    EQU      %-EKWD
         RES      1
         PAGE
DYN      CNAME
         PROC
LF       GEN,1,15,16 AF(1),AF(2),AF(3)
         PEND
*        SKELETON TEMP STACK FOR BLIMIT,OLIMIT,GLIMIT
GSYS     EQU      %                 FOR GLIMIT
TIMLOC   EQU      %-GSYS
         DYN      1,-1,0
         DYN      1,-1,0
LOLOC    EQU      %-GSYS
         DYN      1,-2,0
         DYN      1,-2,0
POLOC    EQU      %-GSYS
         DYN      1,-2,0
         DYN      1,-2,0
DOLOC    EQU      %-GSYS
         DYN      1,-2,0
         DYN      1,-2,0
UOLOC    EQU      %-GSYS
         DYN      1,-2,0
         DYN      1,-2,0
PSTOLOC  EQU      %-GSYS
         DYN      1,-1,0
         DYN      1,-1,0
TSTOLOC  EQU      %-GSYS
         DYN      1,-1,0
         DYN      1,-1,0
FPOLOC   EQU      %-GSYS
         DYN      1,4,0
         DYN      1,6,0
TDISLOC  EQU      %-GSYS
         DYN      1,-1,0
         DYN      1,-1,0
PDISLOC  EQU      %-GSYS
         DYN      1,-1,0
         DYN      1,-1,0
         RES      1
#DYNAM   EQU      %-GSYS
         PAGE
BSYS     EQU      %                 FOR BLIMIT
         DYN      1,5,0             TIME
         DYN      1,-1,0
         DYN      1,100,0           LO
         DYN      1,-2,0
         DYN      1,100,0           PO
         DYN      1,-2,0
         DYN      1,500,0           DO
         DYN      1,-2,0
         DYN      1,100,0           UO
         DYN      1,-2,0
         DYN      1,64,0            PSTORE
         DYN      1,-1,0
         DYN      1,64,0            TSTORE
         DYN      1,-1,0
         DYN      1,6,0             FPOOL
         DYN      1,127,0
         DYN      1,64,0            TDISK
         DYN      1,-1,0
         DYN      1,64,0            PDISK
         DYN      1,-1,0
         RES      1
*
OSYS     EQU      %                 FOR OLIMIT
         DYN      1,-1,0            TIME
         DYN      1,-1,0
         DYN      1,100,0           LO
         DYN      1,-2,0
         DYN      1,100,0           PO
         DYN      1,-2,0
         DYN      1,100,0           DO
         DYN      1,-2,0
         DYN      1,100,0           UO
         DYN      1,-2,0
         DYN      1,64,0            PSTORE
         DYN      1,-1,0
         DYN      1,64,0            TSTORE
         DYN      1,-1,0
         DYN      1,4,0             FPOOL
         DYN      1,127,0
         DYN      1,64,0            TDISK
         DYN      1,-1,0
         DYN      1,64,0            PDISK
         DYN      1,-1,0
         RES      1
         PAGE
ESYS     EQU      %                 FOR ELIMIT,ONLY ONE VALUE
ETIMLOC  EQU      %-ESYS
         DYN      1,30,0            TIME (IN SECONDS)
ELOLOC   EQU      %-ESYS
         DYN      1,20,0            LO
EPOLOC   EQU      %-ESYS
         DYN      1,100,0           PO
EDOLOC   EQU      %-ESYS
         DYN      1,20,0            DO
EUOLOC   EQU      %-ESYS
         DYN      1,20,0            UO
EPSTOLOC EQU      %-ESYS
         DYN      1,20,0            PSTORE
ETSTOLOC EQU      %-ESYS
         DYN      1,64,0            TSTORE
         RES      1
#EDYNAM  EQU      %-ESYS
         PAGE
*
*        LIMIT VECTORS
*
KWDPTR   EQU      %
         GEN,15,17 LBOGKWD,BOGKWD   FOR BLIMIT
         GEN,15,17 LBOGKWD,BOGKWD   FOR OLIMIT
         GEN,15,17 LBOGKWD,BOGKWD   FOR GLIMIT
         GEN,15,17 LEKWD,EKWD       FOR ELIMIT
*
DYNAM    EQU      %
         DATA     BSYS
         DATA     OSYS
         DATA     GSYS
         DATA     ESYS
         PZE      ERRORWRITE
         PAGE
*
*        XLIMIT ROUTINTES
*
UBELIMIT LI,R4    3
         LI,R1    #EDYNAM
         B        SYNSTART+1
UBGLIMIT LI,R4    2
         B        SYNSTART
UBOLIMIT LI,R4    1
         B        SYNSTART
UBBLIMIT LI,R4    0
         STW,R4   R4LOC
         LI,D1    75                FOR REDEF STACK OF SG:DLNT
         LI,D2    -1                FOR SECTOSIZE OF SG:DLNT
         BAL,SR4  COREALLOC
         LW,R4    R4LOC
         BAL,10   MODGEN
         TEXTC    'SL:BDF1'
         STW,SR1  DFTBLS
         AI,SR1   #SLNM+1
         TEXTC    'SL:BMX1'
         STW,SR1  MXTBLS
         AI,SR1   #SLNM+1
         TEXTC    'SL:ODF1'
         STW,SR1  DFTBLS+1
         AI,SR1   #SLNM+1
         TEXTC    'SL:OMX1'
         STW,SR1  MXTBLS+1
         AI,SR1   #SLNM+1
         TEXTC    'SL:GDF1'
         STW,SR1  DFTBLS+2
         AI,SR1   #SLNM+1
         TEXTC    'SL:GMX1'
         STW,SR1  MXTBLS+2
         AI,SR1   #SLNM+1
         TEXTC    'E2'              INSURE ADEQUATE SPACE
         STW,SR1  MODEND
         STW,R7   MODPLIST
         B        %+1               OUT OF MODGEN
SYNSTART LI,R1    #DYNAM
         LW,R7    FETCHADR,R3       GET SYNTAX PLIST
         LW,R2    DYNAM,R4          SET PARAMETERS FOR SYNTAX
         STW,R4   R4LOC
         LW,R4    KWDPTR,R4
         LH,SR4   R4
         SLS,SR4  -1
         STW,R1   *SR4,R4
         BAL,SR4  SYNTAX
         LW,R4    R4LOC
         CI,R4    3                 IS IT ELIMIT
         BE       ELIMPROC          YES, SEPARATE PROCESSING
         LW,R7    MODPLIST
         LI,D1    PDISLOC           STARTING PLACE IN DYNAM
         LI,R1    #SLNM             #ENTRIES
*                                   R4=INDEX OF TABLE TYPE
CHKVALS  EQU      %
         LW,D2    *D1,R5            GET DF VALUE
         BGEZ     %+5
         CI,D2    -2
         BNE      %+2
         SLS,D2   -16               CNVT TO X'FFFF'
         SLS,D2   -1                CNVT TO X'7FFF'/X'7FFFFFFF'
         AI,D1    1
         LW,D3    *D1,R5            GET MX VALUE
         BGEZ     %+5
         CI,D3    -2
         BNE      %+2
         SLS,D3   -16
         SLS,D3   -1
         CW,D2    D3                DF <= MAX
         BLE      %+3               YES
         BAL,SR4  ERR1              NO, WRITE MESSAGE
         LW,D2    D3                SET DF = MAX
         LW,D4    DFTBLS,R4         GET ADDRESS OF APPROP TABLE
         STW,D2   *D4,R1            STORE IN TABLE AT ENTRY
         LW,D4    MXTBLS,R4
         STW,D3   *D4,R1
         AI,D1    -3                BACK UP IN STACK
         BDR,R1   CHKVALS           PROCESS ALL ENTRIES
         LI,R1    -#DYNAM           RELEASE THE TEMP STACK AREA
         MSP,R1   *R0
         CI,R4    2
         BL       READSTRG          GO GET NEXT COMMAND
*                                   HAVE FINISHED PROCESSING
*                                   BLIMIT,OLIMIT,GLIMIT
         LW,SR1   MODEND
         LI,D3    SGDLNT
         BAL,SR4  WRITELM
         B        %+2
*
*        BUILD SG:LNT MODULE
*
         PZE      ERRORWRITE        ERROR RETURN COREALLOC MODGEN
         LI,D1    100
         LI,D2    -1
         BAL,SR4  COREALLOC
         LI,D1    #SLNM
         BAL,10   MODGEN
         TEXTC    'SV:LIM0'
         TEXTC    'SL:NAME1'
         STW,SR1  SR2               SAVE START ADDRESS
         AI,SR1   #SLNM+1
         TEXTC    'E2'              INSURE ADEQUATE SPACE
         B        %+1               OUT MODGEN
         LI,R2    #SLNM
         LW,D1    SLNMTB,R2         GET ENTRY
         STW,D1   *SR2,R2
         BDR,R2   %-2
         LI,D1    1
         BAL,10   MODGEN
         TEXTC    'SV:TI0'
         AI,D1    1
         TEXTC    'SV:LO0'
         AI,D1    1
         TEXTC    'SV:PO0'
         AI,D1    1
         TEXTC    'SV:DO0'
         AI,D1    1
         TEXTC    'SV:UO0'
         AI,D1    1
         TEXTC    'SV:PS0'
         AI,D1    1
         TEXTC    'SV:TS0'
         AI,D1    1
         TEXTC    'SV:FP0'
         AI,D1    1
         TEXTC    'SV:TD0'
         AI,D1    1
         TEXTC    'SV:PD0'
         B        %+1
         LI,D3    SGLNT
ERRORWRITE BAL,SR4  WRITELM
         B        READSTRG
         PAGE
         PZE      ERRWRITE
ELIMPROC EQU      %                 PROCESSING ELIMIT COMMAND
         LI,D4    LOLOC
         AW,D4    R5
         LI,D3    1                 COUNTER
         LI,D1    X'7FFF'
VCHKLUP  CW,D1    *D4               IS VALUE IN RANGE
         BL       ELIMERR           NO
ELIMCHK  AI,D4    1
         AI,D3    1
         CI,D3    ETSTOLOC          ALL DONE
         BL       VCHKLUP
         LI,D1    100
         LI,D2    -1
         BAL,SR4  COREALLOC
         BAL,10   MODGEN
         TEXTC    'SL:ETIME1'
         LW,D2    ETIMLOC,R5
         MI,D2    500
         STW,D2   *SR1
         AI,SR1   1
         TEXTC    'SL:ELO1'
         LW,D2    ELOLOC,R5
         SLS,D2   16
         STW,D2   *SR1
         AI,SR1   1
         TEXTC    'SL:EPO1'
         LW,D2    EPOLOC,R5
         SLS,D2   16
         STW,D2   *SR1
         AI,SR1   1
         TEXTC    'SL:EDO1'
         LW,D2    EDOLOC,R5
         SLS,D2   16
         STW,D2   *SR1
         AI,SR1   1
         TEXTC    'SL:EUO1'
         LW,D2    EUOLOC,R5
         SLS,D2   16
         STW,D2   *SR1
         AI,SR1   1
         TEXTC    'SL:ETS1'
         LW,D2    ETSTOLOC,R5
         STW,D2   *SR1
         AI,SR1   1
         TEXTC    'SL:EPS1'
         LW,D2    EPSTOLOC,R5
         STW,D1   *SR1
         AI,SR1   1
         LI,D3    MELIMIT
ERRWRITE BAL,SR4  WRITELM
         LI,R1    -#EDYNAM
         MSP,R1   *R0
         B        READSTRG
         PAGE
ERR1     EQU      %                 R1 = ENTRY #
         LCI      2                 R4 = TYPE OF TABLE
         PSM,D1   *R0
         LD,D1    TABTYP,R4
         STW,D1   ERR1M+3
         STW,D2   ERR1M+4
         LW,D1    SLNMTB,R1
         STW,D1   ERR1M+1
         M:PRINT  (MESS,ERR1M)
         LCI      2
         PLM,D1   *R0
         B        *SR4
ERR1M    TEXTC    '***XXXX    XXXXXXXX DEFAULT>MAX-',;
                  '-DEFAULT SET TO MAX'
ELIMERR  EQU      %                 D2 = ENTRY #
         LCI      3                 D4 = ADDRESS OF PARAMETER
         PSM,R1   *R0
         LI,R1    ESYS
         LW,R2    *D3,R1            GET DEFAULT
         SLS,R2   1
         SAS,R2   -17
         STW,R2   *D4               SET IN TABLE
         LI,R3    ELIMPAR
         XW,R3    D3                D3 NOW ELIMPAR, R3=ENTRY #
         LD,R1    *D3,R3
         STW,R1   ERR2M+1
         STW,R2   ERR1M+2
         STW,R3   D3                ENTRY #
         M:PRINT  (MESS,ERR2M)
         LCI      3
         PLM,R1   *R0
         B        ELIMCHK
ERR2M    TEXTC    '***XXXXXXXX INVALID-SYSGEN DEFAULT USED'
SLNMTB   EQU      %
         DATA     0,'TIME','LO  ','PO  ','DO  ','UO  ','PSTO'
         DATA     'TSTO','FPOO','TDIS','PDIS'
#SLNM    EQU      %-SLNMTB-1
SGLNT    TEXTC    'SG:LNT'
DFTBLS   DATA     0,0,0
MXTBLS   DATA     0,0,0
MODEND   DATA     0
R4LOC    DATA     0
MODPLIST DATA     0
SGDLNT   TEXTC    'SG:DLNT'
MELIMIT  TEXTC    'M:ELIMIT'
         BOUND    8
TABTYP   EQU      %
         TEXT     'BATCH'
         TEXT     'ONLINE'
         TEXT     'GHOST'
         BOUND    8
ELIMPAR  DATA     0,0
         TEXT     '   LO   '
         TEXT     '   PO   '
         TEXT     '   DO   '
         TEXT     '   UO   '
         TEXT     ' PSTORE '
         TEXT     ' TSTORE '
         END

