*                 CATALOG NO. 704906 - SIGMA 5/7 BPM M:LIMR
       CSECT       1
         SYSTEM   SIG7FDP
*
*
*        LIMIT, STDLB, MESSAGE, AND TITLE CONTROL COMMAND PROCESSORS
*                 PROCESSORS
*
*
*
       PAGE
*                 SYMBOLIC REGISTER DEF'S.
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
         PAGE
*                 CHANGE STACK POINTER AMOUNT SPEC. BY 1ST ARGUMENT.
*                 SECOND ARGUMENT SPEC. AVAILABLE REGISTER.
BUMP     CNAME
         PROC
LF       LI,AF(2) AF(1)
         MSP,AF(2)  TSTACK
         PEND
*                 PUSH OR PULL N WORDS SPECIFIED BY 1ST ARGUMENT INTO
*                 REG'S STARTING AT 2ND ARGUMENT.
PUSH     CNAME    X'9',X'B'
PULL     CNAME    X'8',X'A'
         PROC
         DO       NUM(AF)=1
LF       GEN,1,7,4,3,17 0,NAME(1),AF(1),0,TSTACK
         ELSE
         DO       AF(1)=1
LF       GEN,1,7,4,3,17  0,NAME(1),AF(2),0,TSTACK
         ELSE
         DO       AF(1)=16
LF       LCI      0
         ELSE
LF       LCI      AF(1)
         FIN
         GEN,1,7,4,3,17  0,NAME(2),AF(2),0,TSTACK
         FIN
         FIN
         PEND
         REF      TSTACK
         PAGE
         DEF      LIMR
         DEF      MESSR
         DEF      TITLR
         DEF      POOLR
         DEF      SWITCHR
         PAGE
          REF       SL:NAME
          REF       SV:LIM
          REF       J:TITLE
          REF       TMPDCPK
          REF       TMPDPPK
         REF      SV:RSIZ,SH:RNM
         REF      MPPO
         REF      MPO
         REF      MDPO
         REF      MUPO
         REF      LMXCDCD
         REF      ATITLE
         REF      EOCCSCAN
         REF      GETDECVAL
         REF      LIST
         REF      SCCLF
         REF      WDTBLSRH
         REF      CHARSCAN
         REF      NAMSCAN
         REF      QUOTSCAN,DECSCAN
         REF      SS
         REF,1    JB:NFPOOL
         REF      CBUF
         REF      CCP
         REF      CSL
         REF      PLB
         REF      BLNKERCD
         REF      COMERCD
         REF      KWERCD
         REF      LPERCD
         REF      NAMERCD
         REF      DECERCD
         REF      RPERCD
         REF      TERMERCD
         REF      X7FFFFFFF
         REF      YFFFE
         REF      CCLIST
         REF      RAMR,WAMR
         REF      ASMGBUF           DEF IN LOGRT FOR A-M READ-WRITE
         REF      PRDCRM,PRDPRM,TMDCRM,TMDPRM
         REF      J:JIT
         REF      TSTORCD1,TSTORCD2,PSTORCD1,PSTORCD2
         REF      NRESERR
         PAGE
K0       EQU      0
K1       EQU      1
K2       EQU      2
K3       EQU      3
KC       EQU      X'C'
K11      EQU      X'11'
K4F      EQU      X'4F'
K8000    EQU      X'8000'
KN15     EQU      -X'15'
KBLANK   EQU      ' '
KCOMMA   EQU      ','
KCRET    EQU      X'15'
KEOB     EQU      X'26'
KLPAREN  EQU      '('
KPERIOD  EQU      '.'
KRPAREN  EQU      ')'
AMRAD    EQU      20
AMDIS    EQU      21
         SPACE    3
         CSECT      0
L500     DATA       0                   SL:NAME OFFSET STORED.
GETPAGE  DATA     X'08000001'
FREEPAGE DATA     X'09000001'
         CSECT      1
C1LIMR   EQU      %
TXTFPL   TEXTC    'FPOOL'
TXTIPL   TEXTC    'IPOOL'
XSET     TEXT     'SET '
XRESET   TEXT     'RESE'
TXALL    TEXTC    'ALL'
         PAGE
**********************************************************************
*        LIMR     PROCESS LIMIT  CONTROL COMMAND AND STORE           *
*                 VALUES IN JIT                                      *
*        ENTER WITH                                                  *
*                 (R5) =  JIT  POINTER                               *
*                 (R7) =  ADR OF CC PARM LIST                        *
*                 (SR1)=  CUR CHAR OR ZERO                           *
*        IF LIMIT CC IN ERROR ,  RUN STATUS IS SET FOR ABORT         *
**********************************************************************
LIMR     EQU      %
         PUSH     SR4
         LI,R4    K2
         BAL,SR4  SCCLF             SET CC LIST FLAGS FOR LL DEV
         CI,SR1   KBLANK            CHECK IF CURRENT CHAR IS A BLANK
         BNE      LBLNKERR          ERROR IF NO BLANK
LIMR1    EQU      %
         LI,SR2   KLPAREN
         BAL,SR4  CHARSCAN          CHECK FOR LEFT PAREN
         BCS,8    LLPERR            ERROR IF NO LEFT PAREN
         BAL,SR4  NAMSCAN           GET KEYWORD FOLLOWING LEFT PAREN
         BCS,8    LNAMERR           BRANCH IF ILLEGAL KEYWORD
         LW,R1     PLB,R7             (R1) = 1ST WORD OF KEYWORD.
*CHECK IF SPECIAL KEYWORD SPECIFIED.
         LI,R2    LTBL1             SCAN LIMIT KEYWORD TABLE.
         LI,R3    NLTBL1            (R3) = NO. OF KEYWORDS.
         LI,R4    LIMR5             (R4) = TRANSFER ADR IF SEARCH FAILS.
         BAL,SR4  WDTBLSRH
         EXU      LJTBL1,R3         JUMP TO SPEC'D LOC.
*CHECK IF A SERVICE LIMIT KEYWORD SPECIFIED.
LIMR5    EQU      %
         LI,R2     SL:NAME            (R2) = ADDR OF OPTION NAMES.
         LI,R3     SV:LIM             (R3) = LENGTH OF TABLE.
         LI,R4    LIMR10            (R4) = TRANSFER SDR IF SEARCH FAILS.
         BAL,SR4   WDTBLSRH           SEARCH OPTION NAME TABLE.
         STW,R3    L500               SAVE INDEX FOR LATER TEST.
         LI,R2    LTBL2             SCAN SERV. LIMIT KEYWORD TABLE.
         LI,R3    NLTBL2            (R3) = NO. OF KEYWORDS.
         LI,R4    LIMR10            (R4) = TRANSFER ADR IF SEARCH FAILS.
         BAL,SR4  WDTBLSRH          SEARCH TABLE.
         EXU      LJTBL2,R3         JUMP TO SPEC'D LOC.
         B        LIMR300
*CHECK IF A RESOURCE KEYWORD SPECIFIED.
LIMR10   EQU      %
         LH,R1    R1                IF RESOURCE SPEC. IGNORE AS ITS
         LI,R2    SV:RSIZ           BEEN PROCESSED IN LOGRT.
LIMR15   EQU      %
         CH,R1    SH:RNM,R2
         BNE      LIMR17
LIMR16   EQU      %
         PUSH     R2
         LI,R1    K8000             SCAN OVER SPEC. VALUE.
         BAL,SR4  GETDECVAL         GET VALUE ASSOCIATED WITH KEYWORD.
         PULL     R2
         LI,R3    1                 CHECK IF RESOURCE WAS FLAGGED IN
         LH,SR2   NRESERR,R3        LOGRT DUE TO EXCEED. MAX.
         CH,SR2   SH:RNM,R2
         BE       LMXCD
         B        NXOPT
LIMR17   EQU      %
         BDR,R2   LIMR15
         B        LKWERR            ILLEGAL KEYWORD SPECIFIED.
*
*
*CHECK IF TIME EXCEEDS SYSTEM MAX. TIME PUT IN JIT BY RBBAT.
*
TIMECHK  EQU      %
         BAL,SR4  GOGET             GET TIME VALUE IN R2
         LW,R1    L500
         CW,R2    J:TITLE,R1        DOES VALUE EXCEED SYSTEM MAX.
         BG       LMXCD             YES,ERROR
         B        NXOPT             GET NEXT OPTION
*
*
*MAX NUMBER OF GRANULES OF TEMPORARY RAD STORAGE USED BY JOB.
LTSTORE  EQU       %
         BAL,SR4   GOGET            GET TSTORE VALUE IN R2.
         LI,R1    J:JIT+TMDCRM      COMPARE SPEC'D VALUE AND
         BAL,SR4   SPACECHK         .ADJUSTED MAX SPACE IN JIT.
         B          LTST1           -OK
         LI,SR3    TSTORCD1         -NOT ENUF.
         B         TPABORT          .ERROR EXIT.
LTST1    EQU       %
         STW,R2    J:JIT+TMDCRM     STORE TEMP RAD SPACE.
*PEAK CELLS IN JIT ACTUALLY USED AS COUNT DOWN
         STW,R2    J:JIT+TMPDCPK    STORE PEAK TEMP RAD SPACE
         B         NXOPT            GET NEXT OPTION.
*
*MAX NUMBER OF GRANULES OF TEMPORARY DISK STORAGE USED BY JOB
LTDISK   EQU       %
         BAL,SR4   GOGET            GET TDISK VALUE IN R2.
         LI,R1     J:JIT+TMDPRM     COMPARE SPEC'D VALUE AND
         BAL,SR4   SPACECHK         .ADJUSTED MAX SPACE IN JIT.
         B         LTST2            -OK.
         LI,SR3    TSTORCD2         -NOT ENUF.
         B         TPABORT          .ERROR EXIT.
LTST2    EQU       %
         STW,R2    J:JIT+TMDPRM      STORE TEMP DISK PACK SPACE.
*PEAK CELLS IN JIT ACTUALLY USED AS COUNT DOWN
         STW,R2   J:JIT+TMPDPPK     STORE PEAK TEMP DISK PACK SPACE.
        B          NXOPT             GET NEXT OPTION.
*
*MAX NUMBER OF GRANULES OF PERMANENT RAD STORAGE USED BY JOB
LPSTORE  EQU       %
         BAL,SR4   GOGET            GET PSTORE VALUE IN R2.
         LW,R3    L500              COMPARE SPEC'D VALUE AND
         CW,R2    J:TITLE,R3        MAX SPACE IN J:TITLE
         BLE      LPST1
         LI,SR3    PSTORCD1         -NOT ENUF.
         B        TPABORT           .ERROR EXIT
LPST1    EQU       %
         STW,R2    J:JIT+PRDCRM     STORE PERM RAD SPACE.
*FOR PERMANENT SPACE, CHANGE CORRESPONDING ITEM IN A/M RECORD
         PUSH     SR1               SAVE CUR. CHAR. FOR SCAN
         CAL1,8   GETPAGE           GET BUFFER
         BAL,SR4  RAMR              READ A/M RECORD
         MTW,0    SR3               CHECK FOR A/M READ ERROR
         BNEZ     LPST3             ERROR IF SR3 NOT = 0
         LI,R1    AMRAD             STORE RAD SPACE REMAIM.
         STW,R2   *SR2,R1
         BAL,SR4  WAMR              WRITE A/M RECORD
         MTW,0    SR3               CHECK FOR A/M WRITE ERROR
         BNEZ     LPST3             ERROR IF SR3 NOT = 0
         CAL1,8   FREEPAGE
         PULL     SR1
         B         NXOPT           GET NEXT OPTION.
*
*MAX NUMBER OF GRANULES OF PERMANENT DISK STORAGE USED BY JOB
LPDISK   EQU       %
         BAL,SR4   GOGET            GET PDISK VALUE IN R2.
         LW,R3    L500              COMPARE SPEC'D VALUE AND
         CW,R2    J:TITLE,R3        MAX SPACE IN J:TITLE.
         BLE      LPST2
         LI,SR3    PSTORCD2         -NOT ENUF.
         B         TPABORT          .ERROR EXIT.
LPST2    EQU       %
         STW,R2    J:JIT+PRDPRM     STORE PERMANENT DISK SPACE
*FOR PERMANENT SPACE, CHANGE CORRESPONKING ITEM IN A/M RECORD
         PUSH     SR1               SAVE CUR. CHAR. FOR SCAN
         CAL1,8   GETPAGE           GET BUFFER
         BAL,SR4  RAMR              READ A/M ADDRESS
         MTW,0    SR3               CHECK FOR A/M READ ERROR
         BNEZ     LPST3             ERROR IF SR3 NOT = 0
         LI,R1    AMDIS             STORE DISK SPACE REMAIN.
         STW,R2   *SR2,R1
         BAL,SR4  WAMR              WRITE A/M RECORD
         MTW,0    SR3
         BNEZ     LPST3             ERROR IF SR3 NOT = 0
         CAL1,8   FREEPAGE          FREE PAGE
         PULL     SR1
        B         NXOPT           GET NEXT OPTION
LPST3    EQU      %
         CAL1,8   FREEPAGE          FREE PAGE
         PULL     SR1               RESTORE CUR. CHAR. FOR SCAN
         B        TPABORT
*
LIMR300  EQU      %
         LW,R3    YFFFE             STORE MASK FOR LO,PO,DO,UO
         LI,R2    K11               SET SHIFT COUNT = 17
         LI,R1    K8000             MAX VALUE FOR LO,PO,DO,UO
         PUSH     3,R2
         BAL,SR4  GETDECVAL         GET VALUE ASSOCIATED WITH KEYWORD
         BCS,8    LIMR370           CHECK IF OK
         PULL     2,R3
         PULL     R0
          LW,R1    L500               COMPARE SERVICE
          CW,R2    J:TITLE,R1         .LIMITS.
          BG       LMXCD              GRTR THAN SYSTEM MAXS. ERROR.
          S,R2     *R0                POSITION FIELD FOR UPPER 15 BITS.
         STS,R2   *R5,R4            STORE VALUE IN JIT
*
*
NXOPT    EQU      %
         LI,SR2   KRPAREN
         BAL,SR4  CHARSCAN          SCAN FOR RIGHT PAREN
         BCS,8    LRPERR            BRANCH IF NOT
NXOPT1   RES      0
         LI,SR2   KCOMMA
         BAL,SR4  CHARSCAN          CHECK FOR COMMA
         BCR,8    LIMR1             BRANCH IF COMMA TO GET NEXT FIELD
         CI,SR1   KPERIOD           CHECK IF CUR CHAR IS A PERIOD
         BE       LIMR350
         CI,SR1   KEOB              CHECK IF CUR CHAR IS AN EOB=X'26'
         BE       LIMR350
         CI,SR1   KCRET             CHECK IF CUR CHAR IS A CARR. RETURN
         BE       LIMR350
         LI,SR3   TERMERCD          (SR1) = ILLEGAL TERMINATOR CODE
         B        LIMR400
*
GOGET    EQU      %
         LW,R1    X7FFFFFFF         MAX. VALUE
         PUSH     SR4
         BAL,SR4  GETDECVAL
         BCS,8    GOGET1            BRANCH IF ERROR WHEN GET FIELD.
         PULL     SR4
         B        *SR4
GOGET1   PULL     SR4               ADJUST STACK AND ABORT.
*
TPABORT  EQU      %
         PULL     SR4
         B        *SR4              BO BACK TO MAIN PROGM(CCIR)
*
*   CHECK USER SPEC. SPACE (PSTORE AND/OR TSTORE) AGAINST AVAILABLE
*    SPACE AS RECORDED IN JIT
*    IF SPEC.<= VAL. IN JIT, O.K. EXIT ON SR4
*     OTHERWISE EXIT ON SR4+1
*         ENTER WITH R1=ADDR. OF ITEM IN JIT
*                   R2=USER SPEC. VAL.
*
SPACECHK EQU      %
         CW,R2    *R1
         BG       %+2
         B        *SR4              NORMAL EXIT
         AI,SR4   1
         B        *SR4
*
*
LIMR350  EQU      %
* LIMIT CC OK, GO LIST IT AND SCAN FOR OTHER LIMIT OR RES CC
*
         PULL     SR4               KEEP STACK STRAIGHT
         B        RESOK-1           B INTO CCIR
         REF      RESOK
*
LIMR370  EQU      %
         BUMP     -3,R1
         B        LIMR400
*
LNAMERR  EQU      %
         LI,SR3   NAMERCD           (SR3)= ILLEGAL NAME ERR CODE
         B        LIMR400
*
LKWERR   EQU      %
         LI,SR3   KWERCD            (SR3) = ILLEGAL KEYWORD ERR CODE
         B        LIMR400
*
LBLNKERR EQU      %
         LI,SR3   BLNKERCD          (SR3)= BLANK ERR CODE
         B        LIMR400
*
LLPERR   EQU      %
         LI,SR3   LPERCD            (SR3) = LEFT PAREN ERR CODE
         B        LIMR400
*
LMXCD    LI,SR3   LMXCDCD
         B        LIMR400
*
LRPERR   EQU      %
         LI,SR3   RPERCD            (SR3)= RIGHT PAREN ERR CODE
*
LIMR400  EQU      GETLOC20
         REF      GETLOC20
         B        GETLOC20
*
LTBL1    EQU      %-1               LIMIT KEYWORD TABLE
         TEXT     'RERU'
         TEXT     'ORDE'
         TEXT     'NORD'
         TEXT     'ACCO'
         TEXT     'MOUN'
NLTBL1   EQU      %-LTBL1-1         TABLE LEGNTH
*
LJTBL1   EQU      %-1               LIMIT JUMP TABLE
         B        NXOPT             RERUN
         B        NXOPT             ORDER
         B        NXOPT             NORDER
         B        NXOPT             ACCOUNT
         B        LMNT              MOUNT
*
LTBL2    EQU      %-1               SERVICE LIMIT KEYWORD TABLE
         TEXT     'TIME'
         TEXT     'LO  '
         TEXT     'PO  '
         TEXT     'DO  '
         TEXT     'UO  '
         TEXT     'TSTO'
         TEXT     'PSTO'
         TEXT     'PDIS'
         TEXT     'TDIS'
NLTBL2   EQU      %-LTBL2-1         TABLE LENGTH
*
LJTBL2   EQU      %-1               SERVICE LIMIT JUMP TABLE
         B        TIMECHK           TIME
         LI,R4    MPPO              LO
         LI,R4    MPO               PO
         LI,R4    MDPO              DO
         LI,R4    MUPO              UO
         B        LTSTORE           TSTORE
         B        LPSTORE           PSTORE
         B        LPDISK            PDISK
         B        LTDISK            TDISK
         SPACE    3
LMNT0    CI,SR1   KEOB              CHK END OF CARD
         BE       LIMR350
         LI,SR1   0                 CLEAR PREV CHAR
         BAL,SR4  CHARSCAN          GET 1ST RIGHT PAREN
         BCS,8    LMNT0             NOT YET
LMNT     LI,SR2   KRPAREN           GET 2ND
         BAL,SR4  CHARSCAN            RIGHT PAREN
         BCS,8    LMNT0             NOT YET
         B        NXOPT1            VOILA
         PAGE
**********************************************************************
*        MESSR    PROCESS MESSAGE CC                                 *
*                 THE CONTENTS OF THE MESSAGE CC IS OUT ON THE       *
*                 OC DEVICE PRECEEDED BY !!MESSAGE                   *
*        ENTER WITH                                                  *
*                 (R5) = JIT POINTER                                 *
*                 (R7) = CC PARAM LIST POINTER                       *
*                 (SR1) = CUR CHAR                                   *
*                                                                    *
**********************************************************************
MESSR    EQU      %
         PUSH     SR4
         BUMP     22,R1             RESERVE TEMP STORAGE FOR MESSAGE
         LW,R2    TSTACK
         AI,R2    KN15              (R2) = ADR OF TEMP STORAGE
*
         LCI      K3                MOVE
         LM,D1    MESSRM                FIRST
         STM,D1   0,R2                     OF MSG TO BFR
         LI,R4    KC-1
         BAL,R0   MESSR20           MOVE 2ND PART FROM CCBUF
         LI,R4    K1
         LI,D4    K1
         BAL,SR4  LIST              LIST ON OC DEVICE
         BUMP     -22,R1            RELEASE TEMP STORAGE
*
MESSR6   EQU      %
         LI,R4    K2
         BAL,SR4  SCCLF             SET CC LIST FLAG FOR LL
         BAL,SR4  CCLIST            LIST DON'T SCAN-THERE MAY BE A ';'
MESSR61  RES      0
         PULL     SR4
         AI,SR4   K1
         B        *SR4              EXIT
*
MESSRM   DATA    X'0B0505D4'
         TEXT    'ESSA'
         TEXT    'GE '
*
*
MESSR20  EQU      %
         LW,R1    CBUF,R7           (R1) = ADR OF CC BUFFER
         LW,R3    CCP,R7            (R3) = CUR CHAR POSITION IN CCBUF
MESSR22  EQU      %
         AI,R4    K1
         LB,D1    *R1,R3            MOVE FROM CCBUF
         STB,D1   *R2,R4                          TO TEMP STORAGE
         AI,R3    K1
         CI,D1    KCRET             CHECK OFR CARRIAGE RETURN
         BE       MESSR24
         CI,R3    K4F               CHECK FOR END OF CCBUF
         BNE      MESSR22
MESSR24  EQU      %
         STB,R4   *R2               STORE BYTE COUNT IN BUFFER
         B        *R0               EXIT
         PAGE
**********************************************************************
*        TITLR    PROCESS TITLE CC                                   *
*                 IF PREVIOUS TITLE BUFFER, MOVES NEW TITLE TO       *
*                 BUFFER, IF NO PREVIOUS TITLE, GETS NEW BUFFER      *
*                 AND STORES ADR IN JIT                              *
*        ENTER WITH                                                  *
*                 (R5) = JIT POINTER                                 *
*                 (R7) = ADR OF CC PARM LIST                         *
*                 (SR1) = CUR CHAR POSITION                          *
**********************************************************************
TITLR    EQU      %
         PUSH     SR4
         LW,R2    R5
         AI,R2    ATITLE            (R2) = ADR OF TITLE BUF
         LI,R4    0
         LI,R0    MESSR6            SET RETURN
         B        MESSR20           MOVE TITLE FRM CCBUF TO NEW BUF
         PAGE
**********************************************************************
*        POOLR    PROCESS POOL CC
*                 PROCESS COMMAND AND CALLS SETBUF TO ALLOCATE       *
*                 SPECIFIED BUFFERS                                  *
*        ENTER WITH                                                  *
*                 (SR1) = CUR  CHAR                                  *
*                 (R7) = ADR OF CC PARM LIST                         *
*                 (R5) =  JIT  ADDR                                  *
*                                                                    *
*                                                                    *
**********************************************************************
POOLR    EQU      %
         PUSH     R6
         PUSH     SR4
         LI,R4    2
         BAL,SR4  SCCLF             SET LIST FLAG FOR LL
*
         LI,SR3   BLNKERCD
         CI,SR1   ' '               CHECK IF CUR CHAR = BLANK
         BNE      POOLR22           NO, ERROR
         SD,D1    D1                SET D1,D2 TO 0
         PUSH     2,D1
POOLR2   EQU      %
         LI,SR2   '('
         LI,SR3   LPERCD
         BAL,SR4  CHARSCAN          CHECK FOR LEFT PAREN
         BCS,8    POOLR20
         LI,R6    0
         LI,SR2   TXTFPL
         LI,SR3   KWERCD
         BAL,SR4  QUOTSCAN          CHECK FOR KEYWORD  'FPOOL'
         BCR,8    POOLR4
         LI,R6    1
         LI,SR2   TXTIPL
         BAL,SR4  QUOTSCAN          CHECK FOR KEYWORD 'IPOOL'
         BCS,8    POOLR20
POOLR4   EQU      %
         LI,R1    512
         BAL,SR4  GETDECVAL         GET VALUE
         BCS,8    POOLR20
         PULL     2,D1
         STW,R2   D1,R6
         PUSH     2,D1
         LI,SR2   ')'
         LI,SR3   RPERCD            CHECK  FOR   ')'
         BAL,SR4  CHARSCAN
         BCS,8    POOLR20
         LI,SR2   ','
         BAL,SR4  CHARSCAN
         BCR,8    POOLR2
*
         LI,SR3   TERMERCD
         CI,SR1   '.'
         BE       POOLR6
         CI,SR1   X'26'
         BNE      POOLR20
POOLR6   EQU      %
         BAL,SR4  EOCCSCAN          SKIP TO END OF CC
         PULL     2,D1
         MTW,1    *TSTACK
         AW,D1    D2                SUM THE TWO VALUES
         LI,R6    BA(JB:NFPOOL)
         STB,D1   0,R6              STORE # OF FPOOL IN JIT
         B        POOLR22
*
POOLR20  EQU      %
         PULL     2,D1
POOLR22  EQU      %
         PULL     SR4
         PULL     R6
         B        *SR4              EXIT
         PAGE
**********************************************************************
*                                                                    *
*        SWITCHR  - PROCESSESS SWITCH CONTROL COMMAND AND            *
*                                                                    *
*                 STORES VALUES IN SS ENTRY IN JIT                   *
*                                                                    *
*        ENTER WITH                                                  *
*                 (R5) = JIT ADR                                     *
*                 (R7) = CHAR PLIST ADR                              *
*                 (SR1) = CUR CHAR                                   *
*                                                                    *
*                                                                    *
*                                                                    *
**********************************************************************
SWITCHR  EQU      %
         PUSH     1,SR4
         LI,R4    K2                SET CONTROL COMMAND LIST FLAG
         BAL,SR4  SCCLF               FOR LL DEVICE
         LI,SR3   BLNKERCD
         CI,SR1   KBLANK            CHECK LAST DELIMITER = BLANK
         BNE      ERREXIT             ERROR IF NOT
SWITCHR1 EQU      %
         LI,SR3   LPERCD
         LI,SR2   KLPAREN            SEARCH CHAR.
         BAL,SR4  CHARSCAN          GET NEXT ACTIVE CHARACTER
         BCS,8    ERREXIT
*
SWITCH01 BAL,SR4  NAMSCAN           GET ALPHANUMERIC NAME
         LW,R1    PLB,R7
         LI,R2    X'3F'
         LI,SR3   KWERCD
         CW,R1    XSET              WAS NAME = 'SET'
         BE       SWITCH02           BR. IF YES
         LI,R2    K0
         CW,R1    XRESET            WAS NAME = 'RESE'
         BNE      ERREXIT           NO,ERROR
*
SWITCH02 PUSH     1,R2
         LI,SR2   KCOMMA            GET NEXT ACTIVE CHARACTER
         LI,SR3   COMERCD
         BAL,SR4  CHARSCAN           AND CHECK IF = COMMA
         BCS,8    SWTCHERR
*
SWITCH03 LI,SR2   TXALL
         BAL,SR4  QUOTSCAN          WAS CHAR. STRING = 'ALL'
         BCS,8    SWITCH04           BR. IF NO
         LI,R3    X'3F'
         PULL     1,R2
         STS,R2   SS,R5
         B        SWITCH09
SWITCH04 EQU      %
         LI,SR3   DECERCD
         BAL,SR4  DECSCAN            GET INDIVIDUAL SETTINGS
         BCS,8    SWTCHERR
         LW,R1    CSL,R7            NO. OF CHARS. NOT OVER 1
         CI,R1    K1
         BNE      SWTCHERR
         LW,R1    PLB,R7
         PULL     R2
         LB,R1    R1
         AI,R1    -X'F1'
         BLZ      ERREXIT
         CI,R1    6
         BG       ERREXIT
         LI,R3    X'20'
         LCW,R1   R1
         SLS,R3   0,R1
         STS,R2   SS,R5
         PUSH     R2
*
         LI,SR2   KCOMMA             IS COMMA
         BAL,SR4  CHARSCAN
         BCR,8    SWITCH04            BR. IF YES, MORE SWITCH SETTING
         PULL     R2
SWITCH09 LI,SR2   KRPAREN
         LI,SR3   RPERCD
         BAL,SR4  CHARSCAN
         BCS,8    ERREXIT
*
         LI,SR2   KCOMMA
         BAL,SR4  CHARSCAN          COMMA NEXT
         BCR,8    SWITCHR1
         LI,SR3   TERMERCD
*
SWITCH11 CI,SR1   KPERIOD              IS IT A PERIOD ?
         BE       SWITCH12                       YES
         CI,SR1   KEOB                     NO, EOB    ?
         BE       SWITCH12                       YES
         CI,SR1   KCRET                    NO, NL     ?
         BNE      ERREXIT
SWITCH12 BAL,SR4  EOCCSCAN           END FOUND
         B        MESSR61           NORMAL EXIT
*
SWTCHERR EQU      %
         PULL     R2
ERREXIT  EQU      %
         PULL     1,SR4
         B        *SR4
         END

