*                 CATALOG NO. 704743 - SIGMA 5/7 BPM M:RUNR
       CSECT       1
         SYSTEM   SIG7FDP
FRGRND   EQU      0                 RESET TO AVOID AUTHFLGS
*
*
******************  REALTIME  RUN CONTROL COMMAND PROCESSOR **********
*
*
*
*
*
*
*        RUN  CONTROL  COMMAND  PROCESSOR
*
*
*
*
       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
RLMNENTRY     EQU 3
RPASSENTRY    EQU 8
RSTARTENTRY   EQU 10
RBIASENTRY    EQU 1
RXSLENTRY     EQU 0
         DO       FRGRND=0
RUNTBLSZ EQU      12
         ELSE
RUNTBLSZ EQU      34
         FIN
         PAGE
K0       EQU      X'0'
K1       EQU      X'1'
K2       EQU      X'2'
K3       EQU      X'3'
K4       EQU      X'4'
K5       EQU      X'5'
K8       EQU      X'8'
K10      EQU      X'10'
KF       EQU      X'F'
KF0      EQU      X'F0'
K1FFFF   EQU      X'1FFFF'
K7FFFF   EQU      X'7FFFF'
K40000   EQU      X'40000'
KN2      EQU      -X'2'
KN7      EQU      -X'7'
KBLANK   EQU      ' '
KCOMMA   EQU      ','
KCRET    EQU      X'15'
KEOB     EQU      X'26'
KHYPEN   EQU      '-'
KLPAREN  EQU      '('
KPERIOD  EQU      '.'
KPLUS    EQU      '+'
KRPAREN  EQU      ')'
AMLMN    EQU      3                 DISPL. IN A-M FOR LMN
AMLMP    EQU      6                 DISPL. IN A-M FOR LM PASSWOR
         PAGE
         DEF      RUNR
         REF      TREETADR
         REF      CHARSCAN
         REF      NAMSCAN
         REF      CSL
         REF      PLB
         REF      WDTBLSRH
         REF      TERMERCD
         REF      COMERCD
         REF      KWERCD
         REF      ILLRMNCD
         REF      VALERCD
         REF      BLNKERCD
         REF      HEXERCD
         REF      EOCCSCAN
         REF      RPERCD
         REF      CHSTSHFT
         REF      GETPASSW
         REF      GETAVAL
         REF      J:AMR
         REF      RAMR
         REF      ACCN
         REF      NAMERCD
         REF      ALOCCT
         REF      GETACCN
         REF      DUPERCD
         REF      SCCLF
         REF      GETLOC2
         REF      Y08
         REF      X7FFFFFFF
         REF      RUNFLAG                                               743
         REF      PPMD
         REF      INHYPHEN,EXHYPHEN
         PAGE
**********************************************************************
*        RUNR     PROCESS RUN CONTROL COMMAND                        *
*        ENTER WITH                                                  *
*                 (R5) = JIT ADR                                     *
*                 (R7) = ADR OF PARAM LIST                           *
*                 (SR1) = CUR CHAR OR ZERO                           *
*                                                                    *
*                                                                    *
*                                                                    *
*                                                                    *
**********************************************************************
RUNR     EQU      %
         PUSH     SR4
         PUSH     R6
         LI,R2    0
         LI,R3    X'40000'
         STS,R2   PPMD,R5           RESET PROCESSOR DUMP FLAG
         LI,R4    K2                SET
         BAL,SR4  SCCLF                 CC LIST FLAGS FOR LL DEV
         CI,SR1   KBLANK
         BNE      RUNR140
         LI,R6    TSTACK+200-RUNTBLSZ
         LI,R2    TSTACK+200-RUNTBLSZ
         LI,R3    X'1FFFF'
         STS,R2   ALOCCT,R5
         LI,R2    8
         STW,R2   RXSLENTRY,R6      STORE XSL DEFAULT IN RUN TABLE
         SLS,R2   8
         LI,R3    X'F00'            STORE XSL DEFAULT VALUE IN JIT
         STS,R2   RUNFLAG,R5
         LI,R2    RUNTBLSZ          (R2) = RUN TABLE SIZE
         LI,R1    0                 INITIALIZE
RUNR1    EQU      %                           TABLE
         STW,R1   *R6,R2                           WITH
         BDR,R2   RUNR1                                ZERO
RUNR2    EQU      %
         LI,SR2   KLPAREN
         BAL,SR4  CHARSCAN          SCAN FOR A LEFT PAREN
         BCS,8    RUNR60
         BAL,SR4  NAMSCAN           GET KEYWORD
         BCS,8    RUNR110           CHECK IF LEGAL KEYWORD
         LW,R0    CSL,R7
         CI,R0    K8                CHECK IF KEYWORD <= 8 CHAR
         BG       RUNR110
*
         LW,R1    PLB,R7            (R1) =  SEARCH WORD
         LI,R2    RUNKWTBL          (R2) = ADR OF RUN KEY WORD TABLE
         LI,R3    NRUNKW            (R3) = NUMBER OF KEYWORDS
         LI,R4    RUNR110           (R4) = SEARCH FAIL RETURN ADR
         BAL,SR4  WDTBLSRH          SEARCH TABLE FOR KEYWORD
        DO       FRGRND
         CI,R3    FRGSTART          IS THIS A FOREGROUND PARAMETER
         BL       RUNR3             NO
         LW,SR4   AUTHFLGS,R5       CHECK FOR FRGD AUTHORIZATION
        CW,SR4   Y2
        BAZ      RUNRF01           NOT AUTHORIZED
RUNR3    EQU      %
         FIN
         B        RUNJPTBL,R3       GO TO SPECIFIED ROUTINE
*
*        RUN KEYWORD TABLE
*
RUNKWTBL EQU      %
         TEXT     '    '            DUMMY ENTRY
         TEXT     'LMN '
         TEXT     'STAR'
         TEXT     'BIAS'
         TEXT     'XSL '
         DO       FRGRND
         TEXT     'TIME'
         TEXT     'CLOC'
         TEXT     'INT '
         TEXT     'DIRE'
         TEXT     'IOD '
         FIN
NRUNKW   EQU      %-RUNKWTBL-1
*
*        RUN JUMP TABLE
*
RUNJPTBL EQU      %
         B        %                 DUMMY ENTRY
         B        RLMN
         B        RSTART
         B        RBIAS
         B        RXSL
         DO       FRGRND
FRGSTART EQU      %-RUNJPTBL        DISPLACEMENT TO FIRST FOREGROUND
         B        RTIME
         B        RCLOCK
         B        RINT
         B        RDIRECT
         B        RIOD
         FIN
*
RUNR50   EQU      %
         LI,SR2   KRPAREN
         BAL,SR4  CHARSCAN
         BCS,8    RUNR160
         LI,SR2   ','
         BAL,SR4  CHARSCAN
         BCR,8    RUNR2
*
RUNR60   EQU      %
         CI,SR1   KEOB
         BE       RUNR70
         CI,SR1   KPERIOD
         BE       RUNR70
         CI,SR1   KCRET
         BE       RUNR70
         LI,SR3   TERMERCD
         B        RUNR200
*
RUNR70   EQU      %
         LW,R4    R6
         DO       FRGRND=0
         AI,R4    RSTARTENTRY+17
         ELSE
         AI,R4    RIODENTY+1
         FIN
         STW,R4   TREETADR,R6
         LW,R4    RSTARTENTRY,R6
         LB,R4    R4
         AI,R4    4
         SLS,R4   -2
         AI,R4    RSTARTENTRY+1     (R4) = OMDEX TO  REALTIME PARAM
         STB,R4   *R6
RUNR71   EQU      %
         LW,R0    RLMNENTRY,R6
         BNEZ     RUNR72
*    INSERT LMN AND LMP INTO RUN TABLE,FROM A-M REC
         PUSH     SR1               WILL BE CHNGED BY GETPGE CAL
         CAL1,8   GPG               GET 1 DYNAMIC PAGE
         LW,R4    SR2               R4=PAGE ADDRESS
         BAL,SR4  RAMR              READ A/M RECORD
         MTW,0    SR3               CHECK FOR A/M READ ERROR
         BNEZ     RUNR200           ERROR IF SR3 NOT = 0
         LCI      K3
         LM,D1    AMLMN,R4          LM NAME STARTS AT WD3 IN A-M
         STM,D1   RLMNENTRY,R6
         LCI      K2
         LM,D1    ACCN,R5           MOVE ACCN TO
         STM,D1   RLMNENTRY+3,R6                 RUN TABLE
         LM,D1    AMLMP,R4          LM PASSWORD STARTS AT WD6 IN A-M
         STM,D1   RLMNENTRY+5,R6                TO RUN TABLE
         CAL1,8   RPG               RELEASE THE PAGE
         PULL     SR1               PULL BACK CURRENT CHRTR
RUNR72   EQU      %
         BAL,SR4  EOCCSCAN          SKIP TO END OF CC
         DO       FRGRND=1
*        PACK PLIST PORTION
         LW,R1    RTIND,R6
         LW,R2    RINTLOC,R6        CHECK IF INT. LOC SPECIFIED
         BNEZ     RUNR73            YES
         CI,R1    0                 NO, CHECK IF OTHER RT OPTIONS
         BE       RUNR80
RUNR73   EQU      %
         LCI      3
         LM,D1    RBLKENTY,R6       PACK
         CW,R1    Y4                    UP
         BANZ     RUNR74                   REAL
         LCI      2                          TIME
         STM,D2   RBLKENTY,R6                    PARAMETERS
         CW,R1    Y2
         BANZ     RUNR76
         STW,D3   RBLKENTY,R6
         B        RUNR76
RUNR74   EQU      %
         CW,R1    Y2
         BANZ     RUNR76
         STW,D3   RTIMENTY,R6
RUNR76   EQU      %
         LW,R1    Y8
         STS,R1   RTIND,R6          SET  START ADR  PLIST  INDICATOR
         LB,R4    *R6
         LCI      6
         LM,D1    RINTLOC,R6
         STM,D1   *R6,R4
         LW,R1    Y8
         STS,R1   0,R6              SET REALTIME PARAMETER FLAG
RUNR80   EQU      %
         FIN
         PULL     R6
         PULL     SR4
         AI,SR4   K4
         B        *SR4
         PAGE
*
RUNR100  EQU      %
         LI,SR3   COMERCD
         B        RUNR200
RUNR110  EQU      %
         LI,SR3   KWERCD
         B        RUNR200
*
RUNR120  EQU      %
         LI,SR3   ILLRMNCD
         B        RUNR200
*
RUNR130  EQU      %
         LI,SR3   VALERCD
         B        RUNR200
*
RUNR140  EQU      %
         LI,SR3   BLNKERCD
         B        RUNR200
*
RUNR150  EQU      %
         LI,SR3   HEXERCD
         B        RUNR200
*
RUNR160  EQU      %
         LI,SR3   RPERCD
         B        RUNR200
*
RUNR170  EQU      %
         LI,SR3   DUPERCD
         B        RUNR200
*
RUNR180  EQU      %
         LI,SR3   NAMERCD
         B        RUNR200
*
RUNR200  EQU      %
         LI,R4    K2
         PULL     R6
         PULL     SR4
         B        *SR4
*
*      USER NOT AUTHORIZED TO RUN FOREGROUND
*
        DO       FRGRND
RUNRF01 EQU      %
        BAL,SR4  EOCCSCAN
         LI,SR3   NOAUTERM
        B        RUNR200
NOAUTERM TEXTC    'ERROR-ACCOUNT NOT AUTHORIZED FOR FOREGROUND'
         FIN
         PAGE
*        PROCESS  LMN OPTION
RLMN     EQU      %
         LW,R0    RLMNENTRY,R6      CHECK FOR DUPLICATION
         BNEZ     RUNR170
         LI,SR2   KCOMMA
         BAL,SR4  CHARSCAN          CHECK FOR COMMA AFTER LMN KEYWORD
         BCS,8    RUNR100
         BAL,SR4  NAMSCAN           GET LOAD MODULE NAME
         BCS,8    RUNR120           CHECK IF LEGAL ALPHA NUMERIC
         LW,R1    CSL,R7
         CI,R1    K10               CHECK IF NAME <11 CHAR.
         BG       RUNR120
         LW,R0    R7                SHIFT
         AI,R0    PLB                   LMN BY ONE
         LI,R2    K1                             CHAR
         BAL,SR4  CHSTSHFT                           AND INSERT BYTE CNT
*
         LCI      K3                MOVE
         LM,R0    PLB,R7                LMN
         STM,R0   RLMNENTRY,R6               RUN TABLE
         LI,SR2   KCOMMA
         BAL,SR4  CHARSCAN          CHECK FOR A COMMA
         BCS,8    RLMN3
         BAL,SR4  GETACCN           GET ACCOUNT NUMBER
         BCS,8    RUNR200
         LCI      K2
         LM,R0    PLB,R7
RLMN1    EQU      %
         STM,R0   RLMNENTRY+3,R6    STORE ACCOUNT NUMBER
*
         LI,SR2   KCOMMA
         BAL,SR4  CHARSCAN          SCAN FOR COMMA
         BCS,8    RLMN4
         BAL,SR4  GETPASSW          GET PASS WORD
         BCS,8    RUNR130           ILLEGAL PASSWORD
         LCI      K2
         LM,R0    PLB,R7            STORE
RLMN2    EQU      %
         STM,R0   RLMNENTRY+5,R6    STORE PASSWORD
         B        RUNR50
*
RLMN3    EQU      %
         LCI      K2
         LM,R0    ACCN,R5           USE ACCN IN JIT
         B        RLMN1
*
RLMN4    EQU      %
         LI,R0    K0                SET
         LI,R1    K0                    PASSWORD = 0
         LCI      K2
         B        RLMN2
         PAGE
*
*        PROCESS  START OPTION
*
RSTART   EQU      %
         LW,R0    RSTARTENTRY,R6    CHECK FOR DUP.
         BNEZ     RUNR170
         LW,R0    RSTARTENTRY+1,R6  CHECK FOR DUP.
         BNEZ     RUNR170
         LI,SR2   KCOMMA
         BAL,SR4  CHARSCAN          SCAN FOR COMMA
         BCS,8    RUNR100
         BAL,SR4  INHYPHEN          MAKE HYPHEN A DELIMITER
         LW,R3    R6
         AI,R3    RSTARTENTRY
         BAL,SR4  GETLOC2
         B        RUNR200
         BAL,SR4  EXHYPHEN          MAKE HYPHEN A ALPHANUM. CHAR.
         STW,R3   TREETADR,R6
         B        RUNR50
         PAGE
*
*        PROCESS  BIAS OPTION
*
RBIAS    EQU      %
         LW,R0    RBIASENTRY,R6     CHECK FOR DUPLICATION
         BNEZ     RUNR170
         BAL,SR4  GETAVAL
         BCS,8    RUNR200
         STW,R2   RBIASENTRY,R6
         B        RUNR50
         PAGE
*
*        PROCESS  XSL  OPTION
*
RXSL     EQU      %
         BAL,SR4  GETAVAL
         BCS,8    RUNR200
         CI,R2    KF
         BG       RUNR130
         STW,R2   RXSLENTRY,R6
         SLS,R2   8                                                     743
         LI,R3    X'F00'                                                743
         STS,R2   RUNFLAG,R5        STORE XSL VALUE IN JIT              743
         B        RUNR50
         PAGE
         DO       FRGRND
*
*        PROCESS  TIME  OPTION
*
RTIME    EQU      %
         LW,R1    X7FFFFFFF
         BAL,SR4  GETDECVAL         GET TIME VALUE
         BCS,8    RUNR130
         LW,R1    L(X'28000000')
       XW,R2   RTIMENTY,R6         STORE TIME VALUE IN TABLE
         BNEZ     RUNR170           CHECK FOR DUPLICATION
         STS,R1   RTIND,R6
         MTW,0    RINTLOC,R6                                            743
         BNEZ     RUNR170                                               743
         B        RUNR50
         PAGE
*
*        PROCESS  CLOCK OPTION
*
RCLOCK   EQU      %
         BAL,SR4  GETAVAL           GET CLOCK ADR
         BCS,8    RUNR200
         XW,R2    RINTLOC,R6        STORE INT ADR IN TABLE
         BNEZ     RUNR170           CHECK FOR DUPLICATION
         LW,R1    X7FFFFFFF
         BAL,SR4  GETDECVAL         GET TIME VALUE
         BCS,8    RUNR200
       XW,R2   RTIMENTY,R6         STORE TIME VALUE IN TABLE
         BNEZ     RUNR170           CHECK FOR DUPLICATION
         LW,R1    Y2
         STS,R1   RTIND,R6
         B        RINT2
         PAGE
*
*        PROCESS  INT  OPTION
*
RINT     EQU      %
         BAL,SR4  GETAVAL           GET INTERRUPT ADR
         BCS,8    RUNR200
         XW,R2    RINTLOC,R6        STORE INT ADR IN TABLE
         BNEZ     RUNR170
         LW,R2    Y08                                                   743
         CW,R2    RTIND,R6                                              743
         BANZ     RUNR170                                               743
RINT2    EQU      %
         LI,SR2   ','
         BAL,SR4  CHARSCAN          CHECK FOR COMMA
         BCS,8    RUNR50
         LI,SR2   TXTDSBLE          CHECK FOR DISABLE
         BAL,SR4  QUOTSCAN
       BCS,8   RUNR110
         LI,R1    2
         STS,R1   RTIND,R6          SET DISABLE FLAG
         B        RUNR50
         PAGE
*
*        PROCESS  DIRECT OPTION
*
RDIRECT  EQU      %
         LI,R1    1
         CW,R1    RTIND,R6          CHECK FOR DUPLICATION
         BANZ     RUNR170
         STS,R1   RTIND,R6
         LI,SR2   ','
         BAL,SR4  CHARSCAN          CHECK FOR COMMA
         BCS,8    RUNR50
         BAL,SR4  GETHEXVAL         GET RBLOCK VALUE
         BCS,8    RUNR200
         CI,D3    X'40'
         BGE      RUNR130
         STW,D3   RBLKENTY,R6
         LW,R1    Y4
         STS,R1   RTIND,R6          SET  RBLOCK  INDICATOR
         B        RUNR50
         PAGE
*
*        PROCESS  IOD  OPTION
*
RIOD     EQU      %
         LI,SR2   ','                                                   743
         BAL,SR4  CHARSCAN                                              743
         BCS,8    RUNR100                                               743
         LW,R1    Y1
         CW,R1    RTIND,R6          CHECK FOR DUPLICATION
         BANZ     RUNR170
         STS,R1   RTIND,R6
         BAL,SR4  GETHEXVAL         GET IOD VALUE
         BCS,8    RUNR200
         CI,D3    X'7FF'
         BG       RUNR130
         STW,D3   RIODENTY,R6
RIOD2    EQU      %
         B        RUNR130
         PAGE
         REF      GETDECVAL,GETHEXVAL,QUOTSCAN
         REF      CJOB
         REF      Y8,Y4,Y2,Y1,X7FF
*
RINTLOC  EQU      27
RTIND    EQU      28
RBLKENTY EQU      30
RTIMENTY EQU      31
RIODENTY EQU      32
TXTDSBLE TEXTC    'DISABLE'
         FIN
*  PLIST FOR GETTING 1 PAGE
GPG      GEN,32   X'08000001'
*   PLIST FOR RELEASING 1 PAGE
RPG      GEN,32   X'09000001'
         END

