************************************************************************
*M*      LOADR    PROCESSES THE LOAD,OVERLAY AND LOCCT CONTROL COMMANDS
***********************************************************************
*P*
*P*      NAME:    LOADR
*P*
*P*      PURPOSE: TO PROCESS THE LOAD,OVERLAY,LOCCT CONTROL COMMANDS
*P*
*P*      DESCRIPTION: LOADR IS CALLED BY CCIR WHENEVER A LOAD,OVERLAY
*P*               OR LOCCT CONTROL COMMAND IS ENCOUNTERED. A LOCCT IS
*P*               CREATED FOR SUBSEQUENT USE BY THE LOADER OR LOCCT
*P*               PROCESSOR. UPON COMPLETITION OF PROCESSING THE
*P*               COMMAND, CONTROL IS RETURNED TO CCIR WHICH EXITS TO
*P*               THE LOADER OR LOCCT PROCESSOR.
*P*
*P*      REFERENCE: BATCH PROCESSING REFERENCE MANUAL
*P*                 DATA BASE TECHNICAL MANUAL
*P*
         SYSTEM   SIG7FDP
         SYSTEM   BPM
DEBUG    EQU      0
*
*
*        LOAD  CONTROL COMMAND  PROCESSOR
*
*
*
*
         PAGE
BUMP     CNAME
         PROC
LF       LI,AF(2) AF(1)
         MSP,AF(2)  TSTACK
         PEND
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
         PAGE
R0       SET      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
K0       EQU      0
K1       EQU      X'1'
K2       EQU      X'2'
K3       EQU      3
K4       EQU      X'4'
K5       EQU      X'5'
K6       EQU      X'6'
K7       EQU      X'7'
K8       EQU      X'8'
KA       EQU      X'A'
KB       EQU      X'B'
KE       EQU      X'E'
KF       EQU      X'F'
K10      EQU      X'10'
K11      EQU      X'11'
K12      EQU      X'12'
K13      EQU      X'13'
K15      EQU      X'15'
K20      EQU      X'20'
K35      EQU      X'35'
K40      EQU      X'40'
K64      EQU      X'64'
K55      EQU      X'55'
K75      EQU      X'75'
K80      EQU      X'80'
K85      EQU      X'85'
K100     EQU      X'100'
K200     EQU      X'200'
K800     EQU      X'800'
K1000    EQU      X'1000'
K2000    EQU      X'2000'
K4000    EQU      X'4000'
K8000    EQU      X'8000'
K40100   EQU      X'40100'
KN8      EQU      -X'8'
LOCCT    EQU      K0
LOCCT1   EQU      K1
ROMTAD   EQU      ROMTADR
TREEAD   EQU      TREETADR
LDBIAS   EQU      K4
MMLMTAD  EQU      K5
EXECCT   EQU      KA
RDWTCT   EQU      KB
ETSSIZE  EQU      KE
ETBLSIZE EQU      KF
TSSIZE   EQU      K10
UNSATCT  EQU      K11
READCT   EQU      K12
WRITECT  EQU      K13
LMNM     EQU      KA
EXPDTE   EQU      K11
LIBPW    EQU      K13
READAC   EQU      K15
WRITEAC  EQU      K35
UNSATAC  EQU      K55
EXECAC   EQU      K75
EXECVE   EQU      K85
ROMTNM   EQU      KN8
CHARL    EQU      X'D3'
LPAGE    EQU      X'1FF'
KBLANK   EQU      X'40'
KCOMMA   EQU      X'6B'
KLPAREN  EQU      X'4D'
KRPAREN  EQU      X'5D'
KPERIOD  EQU      X'4B'
KEOB     EQU      X'26'
KCRET    EQU      X'15'
LR:FLG   EQU      5                 READ ALL AND FLAG FIELD IN :USERS
         PAGE
         DEF      LOADR             ENTRY POINT TO MODULE
         DEF      LDR               START OF PURE PROCEDURE WHICH IS
*,*                                 USED FOR PATCHING
         REF      JBUPVP            INPUT-USED TO SET DEFAULT LOAD BIAS
*,*                                       IN LOCCT
         REF      ACCN              INPUT-USED TO SET USER ACCOUNT
*,*                                       NUMBER IN LOCCT
         REF      ALOCCT            OUTPUT-STORE LOCCT ADDRESS FOR  USE
*,*                                        BY CCIR
         REF      CSL               INPUT-USED WHEN CHARACTER STRING
*,*                                       LENGTH NEEDED
         REF      PLB               INPUT-USED TO HOLD MOST RECENT
*,*                                       CHARACTER STRING SCANNED
         REF      ROMTADR           OUTPUT-SAVE ROM TABLE BASE ADDRESS
*,*                                        FOR USE BY CCIR
         REF      TREETADR          OUTPUT-SAVE TREE TABLE ADDRESS FOR
*,*                                        USE BY CCIR
         REF      COMERCD           ERROR CODE CONSTANT
         REF      LPERCD            ERROR CODE CONSTANT
         REF      RPERCD            ERROR CODE CONSTANT
         REF      TERMERCD          ERROR CODE CONSTANT
         REF      KWERCD            ERROR CODE CONSTANT
         REF      ALPHERCD          ERROR CODE CONSTANT
         REF      HEXERCD           ERROR CODE CONSTANT
         REF      DUPERCD           ERROR CODE CONSTANT
         REF      VALERCD           ERROR CODE CONSTANT
         REF      INSFERCD          ERROR CODE CONSTANT
         REF      MRWERCD           ERROR CODE CONSTANT
         REF      X7F               MASK
         REF      X1FF              MASK
         REF      X1FFFF            MASK
         REF      CALENDTE          GET EXPIRATION DATE FOLLOWING
*,*                                 EXPIRE KEYWORD
         REF      CHARSCAN          GET NEXT ACTIVE CHARACTER FROM
*,*                                 CONTROL COMMAND
         REF      CHSTSHFT          SHIFT CHARACTER STRING AND INSERT
*,*                                 BYTE COUNT
         REF      EOCCSCAN          SCAN TO END OF CONTROL COMMAND
         REF      NAMSCAN           GET NAME FROM COMMAND
         REF      QUOTSCAN          COMPARE TWO CHARACTER STRINGS
         REF      HEXSCAN           GET HEXADECIMAL VALUE FROM
*,*                                 THE CONTROL VALUE
         REF      GETACCN           GET ACCOUNT NUMBER FROM THE CONTROL
*,*                                 COMMAND
         REF      GETPASSW          GET PASSWORD FROM THE CONTROL
*,*                                 COMMAND
         REF      SYSID             INPUT-USED TO GENERATE DEFAULT
*,*                                       LOAD MODULE NAME (SYSID L)
         REF      Y03               CONSTANT
         REF      Y000F             CONSTANT
         REF      Y4                CONSTANT
         REF      GETDECVAL         GET DECIMAL VALUE FROM THE CONTROL
*,*                                 COMMAND
         REF      Y1                CONSTANT
         REF      Y2                CONSTANT
         REF      Y8                CONSTANT
         REF      Y08               CONSTANT
         REF      Y0C               CONSTANT
         REF      Y001              CONSTANT
         REF      Y002              CONSTANT
         REF      Y003              CONSTANT
         REF      Y004              CONSTANT
         REF      Y008              CONSTANT
         REF      Y01               CONSTANT
         REF      Y04               CONSTANT
         REF      Y05               CONSTANT
         REF      Y06               CONSTANT
         REF      Y07               CONSTANT
         REF      GETACCN0          GET ACCOUNT NUMBER FROM THE
*,*                                 CONTROL COMMAND
         REF      GETVAL4           PULL REGISTER SR4 FROM
*,*                                 THE STACK AND RETURN VIA SR4
         REF      SCCLF             SET LIST FLAG FOR LL DEVICE
         REF      NOPGERR           ERROR CODE CONSTANT
         REF      MXUNSTCD          ERROR CODE CONSTANT
         REF      MXEXECCD          ERROR CODE CONSTANT
         REF      OPERCD            ERROR CODE CONSTANT
         REF      RAMR              READS THE ASSIGN-MERGE RECORD
         REF      WAMR              WRITES THE ASSIGN-MERGE RECORD
         REF      KEYSCAN1          WORKING STORAGE CONTAINING BITS
*,*                                 WHICH INDICATE KEYWORDS SCANNED
         REF      KEYSCAN2          WORKING STORAGE CONTAINING BITS
*,*                                 WHICH INDICATE KEYWORDS SCANNED
         REF      TSTACK            PRESERVATION OF REGISTERS
         REF      WDTBLSRH          SEARCH TABLE OF LEGAL PRIV OPTIONS
         REF      AM:NAME           OUTPUT-EQU; NAME OF LAST LMN LOADED
         REF      AM:PASS           OUTPUT-EQU; PASSWORD OF LAST LM LOADED
         REF      RECORD            INPUT-DETERMINE DEFAULT READ ACCESS
         PAGE
         CSECT    0
TEMPSAVE RES      1                 TEMPORARY STORAGE
ROMTEND  RES      1                 ROM TABLE END ADDRESS
         CSECT    1
LDR      RES      0
         BOUND    8
CSYSLIB  TEXT     ':SYS    '
ZEROL    DATA     0,0
*NOTE:  THE DISPLACEMENT OF KEYWORDS WITHIN LCTABLE SHOULD NOT BE
*MODIFIED AS DETERMINATION OF OPTIONS BEING ABSENT/PRESENT IS BASED
*UPON THEIR ORDER.
LCTABLE TEXT 'GO  ','EF  ','SYSL','UNSA','LMN ','PERM';
 ,'READ','WRIT','EXPI','SL  ','TSS ','BIAS','NOSY','MAP ','BI  ','M100';
 ,'M10 ','PRIV','    ','ABS ','    ','ERTA','ERST','REF ','SEG ';
 ,'BREF','CSEC','NOTC','CORE','PAGE','REL ','LIB ','RDEF','UDEF';
 ,'LDEF','MREF','EXEC','UNDE','MAPO','NI  ','G   ','DREF','OSP '
LIB      TEXTC    'LIB'
NONE     TEXT     '    ','NONE','ALL '
NAME     TEXTC    'NAME'            *
VALUE    TEXTC    'VALUE'           *
SAVE     TEXT     'SAVE'
PERM     TEXT     'PERM'
PRIVOPT  EQU      %-1               PRIVILEGE OPTIONS
         TEXT     'P'               PROCESSOR ACCOUNTING
         TEXT     'J'               SPECIAL JIT ACCESS
         TEXT     'M'               MAXIMUM MEMORY PERMITTED
         TEXT     'X'               M:SYS CAL AUTHORIZATION
PRIVCNT  EQU      %-PRIVOPT-1
BLANKL   EQU      NONE
ALL      EQU      NONE+2
         PAGE
         SPACE    2
LCNAME   EQU      %
         B        LGO
         B        LEF
         B        LSYSL
         B        LUNSA
         B        LLMN
         B        LPERM
         B        LREAD
         B        LWRIT
         B        LEXPI
         B        LSL
         B        LTSS
         B        LBIAS
         LI,R1    2
         B        LMAP
         B        LBI
         LI,R1    K40
         LI,R1    K20
         B        LPRIV             PRIVILEGED PROCESSOR
         B        LCCFLAG1          UNUSED
         LI,R1    K100
         B        LCCFLAG1          UNUSED
         B        LERTA
         B        LERST
         B        OREF
         B        OSEG
         B        LBREF
         LI,R1    K1000
         LI,R1    K2000
         LW,R1    Y2                CORELIB
         LI,R1    K4000             PAGE
         B        LREL              REL
         B        LPERM1            LIB
         LW,R1    Y008              RDEF
         LI,R1    K1                UDEF
         LI,R1    K8000             LDEF
         B        LMREF             MREF
         B        LEXEC             EXECUTE
         B        LUNDE             UNDER
         B        LMAPONLY          MAPONLY
         LW,R1    Y08               NI
         LW,R1    Y04               G
         LW,R1    Y01               DREF
         LI,R1    K80               OSP
KEYCNT   EQU      %-LCNAME
         PAGE
*D*********************************************************************
*D*      NAME:    LOADR
*D*
*D*      REGISTERS: R5 - JIT ADDRESS
*D*               R7 - CHARACTER PARAMETER LIST ADDRESS
*D*               SR1 - CURRENT CHARACTER
*D*               SR4 - LINK
*D*               SR3 - CONTAINS ERROR CODE IF ERROR RETURN
*D*               ALL OTHERS VOLATILE
*D*
*D*      CALL:    BAL,SR4  LOADR
*D*
*D*      INTERFACE: CHARSCAN - COMPARE CURRENT CHARACTER
*D*               RAMR - READ ASSIGN-MERGE RECORD
*D*               WAMR - WRITE ASSIGN-MERGE RECORD
*D*               EOCCSCAN - SCAN TO END OF CONTROL COMMAND
*D*               CHARSCAN - GET NEXT ACTIVE CHARACTER FROM THE COMMAND
*D*               NAMSCAN - GET NAME FROM COMMAND
*D*               GETPASSW - GET PASSWORD
*D*               GETACCN - GET ACCOUNT
*D*               QUOTSCAN - COMPARE TWO CHARACTER STRINGS
*D*               CALENDTE - TEST FOR LEGAL EXPIRATION DATE
*D*               HEXSCAN - SCAN HEXADECIMAL NUMBER
*D*               GETDECVAL - GET VALUE FOLLOWING KEYWORD
*D*               CHSTSHFT - CHARACTER STRING SHIFT
*D*               GETVAL4 - PULL REGISTER SR4 AND RETURN VIA SR4
*D*
*D*      ENVIRONMENT: MAPPED,SLAVE
*D*
*D*      DATA:    LCTABLE - LOAD COMMAND OPTION TABLE
*D*               LCNAME - BRANCH TABLE
*D*      INPUT:   JBUPVP - BEGINNING VIRTUAL PAGE DISPLACEMENT
*D*               ACCN - DISPLACEMENT IN JIT FOR ACCOUNT NUMBER
*D*               CSL - DISPLACEMENT IN CRPT(CURRENT FIELD BYTE COUNT)
*D*               PLB - DISPLACEMENT IN CRPT(BUFFER CONTAINING KEYWORD)
*D*               SYSID - DISPLACEMENT IN JIT FOR SYSID
*D*
*D*      OUTPUT:  ALOCCT - DISPLACEMENT IN JIT CONTAINING LOCCT ADDRESS
*D*               ROMTADR - ROM TABLE ADDRESS
*D*               TREETADR - TREE TABLE ADDRESS
*D*               LOCCT - LOCCT TABLE(DATA BASE TECHNICAL MANUAL)
*D*               TREET - TREE TABLE( DATA BASE TECHNICAL MANUAL)
*D*               ROMT - ROM TABLE
*D*                      WORD*******************
*D*                      0   *  EF NAME IN     *
*D*                      1   *  TEXTC FORM     *
*D*                      2   *            *FLAG*
*D*                      3   *  ACCOUNT        *
*D*                      4   *  NUMBER(2 WORDS)*
*D*                      5   *  PASSWORD       *
*D*                      6   *  (2 WORDS)      *
*D*                      7   *  LINK           *
*D*                          *******************
*D*
*D*      SCRATCH: KEYSCAN1 - BITS INDICATING KEYWORDS SCANNED
*D*               KEYSCAN2 - BITS INDICATING KEYWORDS SCANNED
*D*
*D*      DESCRIPTION: THE LOAD/OVERLAY/LOCCT CONTROL COMMAND IS
*D*               PROCESSED AND OUTPUT ON THE LL DEVICE. THE PARAMETERS
*D*               ARE USED TO CREATE LOCCT AND ROMT TABLES FOR USE
*D*               BY THE LOADER OR LOCCT PROCESSORS.
*D*               THE LOCCT IS CREATED USING DYNAMIC STORAGE AND THE
*D*               ROMT CREATED USING COMMON STORAGE. MODULE NAMES
*D*               FOLLOWING THE KEYWORDS EF AND SYSLIB ARE STORED IN THE
*D*               LOCCT. THE ROMT IS BUILT FROM THE HIGH END OF COMMON
*D*               STORAGE WHILE THE LOCCT TABLE IS BUILT FROM THE LOW
*D*               END OF DYNAMIC STORAGE. ADDITIONAL PAGES OF COMMON
*D*               AND DYNAMIC STORAGE ARE ACQUIRED AS NEEDED. AFTER
*D*               RETURNING TO CCIR, THE LOCCT TABLE IS TRANSFERRED
*D*               TO COMMON STORAGE WHERE IT IS EXPECTED BY THE
*D*               LOAD AND LOCCT PROCESSORS.
*D*********************************************************************
LOADR    EQU      %
         PUSH     SR4
         LI,R4    2
         BAL,SR4  SCCLF             SET LIST FLAG FOR LL DEVICE
         PUSH     3,R6
         LI,R6    1                 GET ONE DYNAMIC PAGE FOR LOCCT
         OR,R6    Y08
         CAL1,8   6
         BCS,8  LERR108           DID NOT GET THEM
         LW,R6    SR2               (R6) = ADDRESS OF LOCCT
         LI,R1    1                 GET 1 COMMON PAGE FOR ROMT
         DO       DEBUG
         OR,R1    Y08               GET DYNAMIC PAGE FOR DEBUG
         ELSE
         OR,R1    Y0C
         FIN
         CAL1,8   1
         BCS,8    LERR108           COULDNT GET ONE
         AI,SR2   K200              (SR2) = ROMT END +1
         STW,SR2  ROMTAD,R6         DEGENERATE ROMT BASE
         STW,SR2  ROMTEND           SAVE ROM TABLE END ADDRESS+1
         PULL     2,R7
         LI,R1    EXECVE
         AW,R1    R6
         STW,R1   TREEAD,R6         EXEC. VEHICLE OR DEFAULT TREE ADR.
         LI,R1    JBUPVP            (R1)= LOAD BIAS
         SLS,R1    9
         STW,R1   LDBIAS,R6         SET LOAD BIAS = BKGROUND LOWER LIMIT
R0       SET      SR3
         LI,R0    K0                INITIALIZE LOCCT
         STW,R0   MMLMTAD,R6
         LI,R1    K40100            SET DEFAULT FOR LOAD MODULE(ABS)
         STW,R1   LOCCT,R6
         STW,R0   LOCCT1,R6         INIT. WORD1 OF LOCCT
         STW,R0   LIBPW,R6
         STW,R0   LIBPW+1,R6
         LI,R1    UNSATCT
         STH,R0   *R6,R1
         LI,R1    READCT
         STH,R0   *R6,R1
         LI,R1    WRITECT
         STH,R0   *R6,R1
         STW,R0   EXPDTE,R6         INIT. EXPDTE WORDS TO 0
         STW,R0   EXPDTE+1,R6
R0       SET      0
         PAGE
***************************************************************
*                                                             *
* (FCOMAD) = LAST ROMT LOC +1, (SCRDCBAD) = NEXT READ/WRITE   *
* ACCT NO. ADDR, AND (MMLMTAD) = TOTAL READ&WRITE COUNT UNTIL *
* ALL KEYWORDS HAVE BEEN OPERATED UPON.                       *
*                                                             *
***************************************************************
         CI,SR1   KBLANK            START INTERPRETATION
         BNE      LOADR4            BRANCH IF NO BLANK TO TERM TESTS
         LI,SR1   K0
         LI,SR2   KLPAREN
         BAL,SR4  CHARSCAN
         BCS,8    LOADR4            BRANCH IF NO KYWDS TO TERM TESTS
LOADR3   EQU      %
         BAL,SR4  LLEGALNM
         BCS,8    LERR100           ERROR IF EXPECTED KEYWORD NOT LEGAL
         BAL,SR4  LKEY                     ALPHANUMERIC NAME
         LI,SR2   KRPAREN           NORMAL RETURN
         BAL,SR4  CHARSCAN
         BCS,8    LERR004           ERROR IF KEYWORD OPERAND NOT
         LI,SR2   KCOMMA                   TERMINATED BY RIGHT PAREN
         BAL,SR4  CHARSCAN
         BCS,8    LOADR4            BRANCH IF NO COMMA TO TERM TESTS
         LI,SR2   KLPAREN
         BAL,SR4  CHARSCAN
         BCS,8    LERR003           ERROR IF NEXT KYWD OPERAND NOT
         B        LOADR3                   PRECEDED BY LEFT PAREN
LOADR4   EQU      %                 TERMINATOR TESTS
         CI,SR1   KPERIOD
         BE       LOADR5
         CI,SR1   KEOB
         BE       LOADR5
         CI,SR1   KCRET
         BNE      LERR005           ERROR IF LOAD CC NOT TERMINATED BY
LOADR5   EQU      %                        '.', 'EOB' OR CARRIAGE RET
         LW,R1    LOCCT,R6
         CW,R1    L(X'80000C00')    CHECK IF BI,EF,GO SPECIFIED
         BANZ     LOADR6            YES
         LI,R1    X'800'            NO, SET  BI  BY
         STS,R1   LOCCT,R6                       DEFAULT
         BAL,SR4  GETROMAD
         LI,D2    'B'
         BAL,SR4  STARNAME
LOADR6   EQU      %
         LW,R1    LOCCT,R6
         CI,R1    2                 CHECK IF 'NOSYSLIB' PARAMETER
         BANZ     LOADR7            YES
         LI,R1    UNSATCT           GET LOC OF NEXT UNSAT ENTRY
         LH,R4    *R6,R1
         SLS,R4   2
         AI,R4    UNSATAC
         AW,R4    R6
         LCI      4                 SYSLIB=:SYS
         LM,R0    CSYSLIB
         STM,R0   0,R4              & PSWD = 0
         MTW,1    8,R6              INCREMENT UNSAT COUNTER
LOADR7   EQU      %
         LW,R2    ROMTEND
         SW,R2    ROMTAD,R6
         SAS,R2   17                BITS 0-14 CONTAIN ROMT SIZE
         AWM,R2   ROMTAD,R6         15-31 CONTAIN ROMT WA
*                 NO SCRATCH DCB
         LD,D3    KEYSCAN1          GET FLAGS INDICATING KEYWORDS SCAN'D
         LI,R2    KA
         CW,D4    Y008
         BANZ     LOADR11
         LI,R1    ETSSIZE
         STH,R2   *R6,R1
LOADR11  EQU      %
         CW,D4    Y004
         BANZ     LOADR12
         LI,R1    ETBLSIZE
         STH,R2   *R6,R1
LOADR12  EQU      %
         CI,D4    K800
         BANZ     LOADR13           STK SIZE SPECIFIED
         LI,R0    X'40'
         LI,R1    TSSIZE                    MEMORY SIZE)
         STH,R0   *R6,R1
LOADR13  EQU      %
         CI,D4    K100              WAS WRITE ACCT SPEC'D
         BANZ     LOADR15
         LI,R1    WRITECT
         LI,R2    WRITEAC
         LI,R4    1
         BAL,SR4  STRDFLT           STORE DEFAULTS IN LOCCT
LOADR15  EQU      %
         CI,D4    K80               WAS READ ACCT SPEC'D
         BANZ     LOADR18           YES
         LI,R1    READCT
         LI,R2    READAC
         LI,R4    1                 IF EXEC. SPEC'D SET READ='NONE'
         CI,D3    K20
         BANZ     LOADR17
         LW,R4    LR:FLG+RECORD     OTHERWISE SET DEFAULT AS SPEC'D
         SLS,R4   -31               IN :USERS
         MTW,0    R4                IS ALL SPEC'D IN :USERS
         BNEZ     LOADR17
         LI,R4    2                 MUST BE NONE
LOADR17  EQU      %
         BAL,SR4  STRDFLT
LOADR18  EQU      %
         CI,D4    K20
         BANZ     LOADR20           LMN SPECIFIED
         LI,D2    CHARL             GET CHST 'L'
         LI,R4    LMNM
         AW,R4    R6
         BAL,SR4  STARNAME          MONITOR ASSIGNED LM NAME, JOB ACCT #
         LI,R3    K8                       AND ZEROED PSWD INTO LOCCT
         AND,R3   LOCCT,R6
         BNEZ     LERR107           ERROR IF PERM IS SPECIFIED AND LMN
LOADR20  EQU      %
         LI,R3    1                 GET ONE MORE DYN. PAGE
         OR,R3    Y08
         PUSH     SR1               WILL BE CHNGED BY GETPGE CAL
         CAL1,8   R3
         BAL,SR4  RAMR              READ A/M RECORD
         MTW,0    SR3               CHECK FOR A/M READ ERROR
         BNEZ     LCCIND0           ERROR IF SR3 NOT = 0
         LW,R4    SR2
         AI,R4    AM:NAME           GET LM NAME ADDRESS IN A-M
         LW,R0    R6
         AI,R0    LMNM              GET ADDR OF LMN IN TABLE
         LCI      3
         BAL,SR4  LACCTST1+1        STORE LM NAME IN A-M IMAG
         LW,R4    SR2
         AI,R4    AM:PASS           GET PASSWORD ADDRESS IN A-M
         AI,R0    5                 POSITION ADDR. IN TABLE
         BAL,SR4  LACCTST1          STORE LM PASSWORD IN A-M IMAGE
         BAL,SR4  WAMR              WRITE A/M RECORD
         MTW,0    SR3               CHECK FOR A/M WRITE ERROR
         BNEZ     LCCIND0           ERROR IF SR3 NOT = 0
*
*   RELEASE THE PAGE HERE
         LW,R3    =X'09000001'
         CAL1,8   R3
*
         PULL     SR1               PULL BACK CURRENT CHRTR
         LW,R2    R6
         LW,R3    X1FFFF
         STS,R2   ALOCCT,R5         STORE LOAD CC TABLE ADDR IN JIT
         LI,R4    K2                SET CC OUT DEVICE FLAG IN JIT
         BAL,SR4  EOCCSCAN
         LI,R0    K3
         B        LCCIND2           BRANCH TO NORMAL END OF LOADR
         SPACE    3
TCOMMA   EQU      %                 TEST FOR CURRENT DELIMETER = COMMA
         PUSH     SR4
         LI,SR2   ','
         BAL,SR4  CHARSCAN
         BCS,8    TCOMMA1
TCOMMA2  EQU      GETACCN0
         B        TCOMMA2
TCOMMA1  EQU      GETVAL4-1
         SPACE    2
GETROMAD EQU      %                 GET LOC OF NEXT ROMT ENTRY,DECREMENT
         LW,R4    ROMTAD,R6                ROMT BASE
         LW,R2    ROMTEND           GET ROMT END ADDR+1
         AI,R4    ROMTNM
         SW,R2    ROMTAD,R6
         STW,R4   ROMTAD,R6
         BEZ      BISR4
         ANLZ,R1  GETRMAD3          CHECK IF ROMT OVERFLOW
         AND,R1   X1FF              ARE WE OUT OF COMMON?
         BCS,2    GETRMAD2          NO
         PUSH,2   SR1
         LI,R1    1                 YES, GET ANOTHER PAGE
         OR,R1    Y0C
         CAL1,8   1
         BCS,8    LERR108A          DID WE GET ONE
         PULL,2   SR1               YES
GETRMAD2 EQU      %
         LW,R1    -ROMTNM,R4        MOVE ROMT DOWN BY ONE
GETRMAD3 EQU      %
         STW,R1   0,R4                            ROMT ENTRY SIZE
         AI,R4    1
         BDR,R2   GETRMAD2
BISR4    RES      0
         B        *SR4
         SPACE    2
*LLEGALNM TESTS FOR LEGAL ALPHANUMERIC NAME < OR = 10 BYTES, LLEGALPW
*TESTS FOR LEGAL CHARACTER STRING < OR = 8 BYTES IN LENGTH. ENTER WITH
*CPL ADDRESS IN R7, SR1 SET TO ZERO AND RETURN ADDR IN SR4. CC1 AFFECTED
*
LLEGALNM EQU      %                 TEST FOR FIELD A LEGAL ALPHANUMERIC
         PUSH     SR4               NAME < OR = 10 CHARS.
         BAL,SR4  NAMSCAN                  IN LENGTH, SET CC1
         LI,R1    10                NAMES CAN BE 10 LONG
         B        LLEGAL1
LLEGALPW EQU      %
         PUSH     SR4
         BAL,SR4  GETPASSW          GET PASS WORD
         LI,R1    K8                PASSWORDS CAN BE 8 LONG
LLEGAL1  EQU      %
         BCS,8    LLEGAL2           ERROR, ILLEGAL CHARACTER
         CW,R1    CSL,R7
         BL       LLEGAL2           ERROR, MAX BYTE COUNT EXCEEDED
         B        TCOMMA2
LLEGAL2  EQU      TCOMMA1
         SPACE    2
*CONEBCD CONVERTS A MAXIMUM OF 8 BYTES EBCDIC TO HEXADECIMAL CODE. ENTER
*WITH BUFFER ADDRESS IN R0, BYTE COUNT IN R1 AND RETURN ADDR IN SR4.
*EXIT WITH CONVERTED NUMBER IN R3
CONEBCD  EQU      %
         LI,R3    K0
CONEBCD1 EQU      %
         LI,R4    K4
         LW,R2    *R0               WORD TO BE CONVERTED
CONEBCD2 EQU      %
         LC       R2
         BCS,3    CONEBCD3          BRANCH IF HEX NUMBER 0 THRU 9
         MTB,9    R2                MODIFY IF HEX NUMBER A THRU F
CONEBCD3 EQU      %
         SAS,R2   K4
         SCD,R2   K4
         BDR,R1   CONEBCD4          BRANCH IF BYTE COUNT NOT EQU ZERO
         B        *SR4
CONEBCD4 EQU      %
         BDR,R4   CONEBCD2          BRANCH IF WORD NOT CONVERTED
         AI,R0    K1
         B        CONEBCD1          BRANCH TO LOAD SECOND WORD
         SPACE    2
PLBNMSH  EQU      %
         LI,R2    K1                SHIFT NAME 1 BYTE
         LW,R1    CSL,R7            BYTE COUNT
         LW,R0    R7
         AI,R0    PLB               BUF ADDR
         B        CHSTSHFT          SHIFT NAME IN BUF
         SPACE    2
*STARNAME CONSTRUCTS MONITOR ASSIGNED MODULE NAME, STORES NAME, JOB ACCN
*ZEROED PASSWORD STARTING AT SPECIFIED LOCATION. ENTER WITH DESTINATION
*ADDR IN R4, JIT ADDR IN R5, RETURN ADDR IN SR4 AND APPROPRIATE
*ALPHANUMERIC CHARACTER IN LOW ORDER BYTE OF D2.
STARNAME EQU      %                 STORE MONITOR ASSIGNED NAME AND JOB
         INT,R1   SYSID,R5          CUR SYSTEM ID
         SLS,R1   8
         AW,R1    Y03
         AW,R1    D2                FILNAM SYSIDX=LM NAME
         LW,R3    BLANKL
         STW,R1   0,R4              STORE LM NAME IN ROMT
         STW,R3   1,R4              STORE BLANKS FOR WORD 2
         STW,R3   2,R4              STORE BLANKS FOR WORD 3
STARNM1  EQU      %                 JOB ACCN, ZEROED PSWD STORED AT (R4)
         LCI      2                 STORE JOB ACCT #
         LM,R1    ACCN,R5            IN ACCT # LOC
         STM,R1   3,R4
         AI,R4    3
         B        LACCTST1-2        BLANK PASSWORD
         SPACE    2
         MTW,1    *TSTACK
         PULL     R4
         AI,R4    2
LACCTST  EQU      %                 STORE BUFFER ACCN OR PASSWORD
         LCI      K2
         LM,R1    PLB,R7
LMULTST  RES      0
         STM,R1   0,R4
         B        *SR4
         SPACE    3
         LI,R0    ZEROL
         AI,R4    2
LACCTST1 LCI      2
         LM,R1    *R0
         B        LMULTST
         SPACE    2
* STRDFLT STORES DEFAULT ACCOUNT 'NONE'/'ALL' AND SETS DEFAULT COUNT=1
* IN LOCCT FOR READ,WRITE AND EXECUTE. ENTER WITH ACCOUNT INDEX IN R2,
* COUNT INDEX IN R1, LOCCT ADDR IN R6, DEFAULT INDEX IN R4.
STRDFLT  EQU      %
         LI,R0    K1
         STH,R0   *R6,R1            SET READ/WRITE/EXEC COUNT TO 1
         LW,R3    NONE,R4
         STW,R3   *R6,R2            STORE EBCDIC 'NONE' IN FIRST ACCT IF
         AI,R2    1                 WORD AND BLANKS IN SECOND WORD
         LW,R3    BLANKL
         STW,R3   *R6,R2
         B        *SR4
         SPACE    2
LKEY     EQU      %                 IDENTIFY KEYWORD
         PUSH     SR4
         LI,R1    KEYCNT
         LW,R2    PLB,R7
         CW,R2    SAVE              *
         BNE      LKEY1             *
         LW,R2    PERM              *SAVE=PERM
LKEY1    EQU      %
         CW,R2    LCTABLE-1,R1
         BNE      LKEY2             BRANCH IF KEYWORD NOT IDENTIFIED
         LI,R2    0
         LI,R3    K1
         SLD,R2   0,R1
         CD,R2    KEYSCAN1          CHECK IF KEYWORD DUPLICATED
         BANZ     B1ER105           ERROR IF KEYWORD DUPLICATED
         OR,R2    KEYSCAN1
         OR,R3    KEYSCAN2
         STD,R2   KEYSCAN1          SAVE KEYWORD FLAGS
         EXU      LCNAME-1,R1
         B        LCCFLAGS          SET FLAGS IN LOCCT.
LKEY2    EQU      %
         BDR,R1   LKEY1
         B        B1ER100
         SPACE    2
LGO      EQU      %                 KEYWORD 'GO' IDENTIFIED
         LI,R1    X'400'
         LI,D2    'G'
LGO1     RES      0
         STS,R1   LOCCT,R6          SET 'GO' ONLY FLAG
         BAL,SR4  GETROMAD          GET NEXT ENTRY IN ROMT
         PULL     SR4
         B        STARNAME
         SPACE    2
LEF      EQU      %                 KEYWORD 'EF' IDENTIFIED
         BAL,SR4  TCOMMA
         BCS,8    B1ER002           ERROR IF MISSING COMMA
         LW,R1    Y8
         STS,R1   LOCCT,R6          SET EF PARM FLAG
LEF1     EQU      %
         LI,SR2   KLPAREN
         BAL,SR4  CHARSCAN
         BCS,8    B1ER003           ERROR IF NAME NOT PRECEDED BY LPAREN
         BAL,SR4  LLEGALNM
         BCS,8    B1ER102           ERROR IF ILLEGAL ALPHA NAME
         BAL,SR4  PLBNMSH
         BAL,SR4  GETROMAD
         PUSH     R4                SAVE ROMT ADDRESS
         LCI      3                 STORE EF NAME
         LM,R1    PLB,R7             IN ROMT
         STM,R1   0,R4
         LI,SR2   ','
         BAL,SR4  CHARSCAN          CHECK FOR COMMA
         BCS,8    LEF2              BRANCH IF NO EF ACCN SPECIFIED
         BAL,SR4  GETACCN
         BCS,8    B2ER106           ERROR IF ILLEGAL ACCN
         BAL,SR4  LACCTST-3         STR EF ACCT IN ROMT
         PUSH     R4                SAVE ADDRESS OF ACCOUNT IN ROMT
         LI,SR2   ','
         BAL,SR4  CHARSCAN          CHECK FOR COMMA
         BCS,8    LEF3              BRANCH IF NO EF PASS WORD SPECIFIED
         BAL,SR4  LLEGALPW
         BCS,8    B2ER106           ERROR IF ILLEGAL PASSWORD
         BAL,SR4  LACCTST-2         STR EF PSWD IN ROMT
         B        LEF4
LEF2     EQU      %
         PULL     R4                RESTORE ROMT ADDRESS
         BAL,SR4  STARNM1           STORE JOB ACCN, ZEROED PSWD IN ROMT
         B        LEF4
LEF3     EQU      %
         PULL     R4                RESTORE ADDRESS OF ACCOUNT IN ROMT
         BAL,SR4  LACCTST1-2        ZERO PSWD IN ROMT
LEF4     EQU      %
         LI,SR2   ')'
         BAL,SR4  CHARSCAN          CHECK FOR RIGHT PAREN
         BCS,8    B1ER004
         LI,SR2   KCOMMA
         BAL,SR4  CHARSCAN
         BCR,8    LEF1              BRANCH IF PRESENCE OF ANOTHER EF
         B        LCCFLAG1
         SPACE    2
LSYSL    EQU      %                 KEYWORD 'SYSLIB' IDENTIFIED
         BAL,SR4  TCOMMA
         BCS,8    B1ER002           ERROR IF MISSING COMMA
LSYSL1   EQU      %
         BAL,SR4  LLEGALNM
         BCS,8    B1ER102           ERROR IF ILLEGAL ALPHA NAME
         BAL,SR4  PLBNMSH
         BAL,SR4  GETROMAD
         LCI      3                 STORE SYSLIB NAME
         LM,R1    PLB,R7             IN ROMT
         STM,R1   0,R4
         LCI      4
         LM,R0    CSYSLIB           SYSLIB ACCT #
         STM,R0   3,R4              ZERO PSWD
         LI,SR2   KCOMMA
         BAL,SR4  CHARSCAN
         BCR,8    LSYSL1            BRANCH IF PRESENCE OF ANOTHER SYSLIB
         B        LCCFLAG1
         SPACE    2
LUNSA    EQU      %                 KEYWORD 'UNSAT' IDENTIFIED
         BAL,SR4  TCOMMA
         BCS,8    B1ER002           ERROR IF MISSING COMMA
LUNSA1   EQU      %
         LI,SR2   KLPAREN
         BAL,SR4  CHARSCAN
         BCS,8    B1ER003           ERROR IF ACCN NOT PRECEDED BY LPAREN
         BAL,SR4  GETACCN
         BCS,8    B1ER106           ERROR IF ILLEGAL ACCN
         LI,R1    UNSATCT           GET LOC OF NEXT UNSAT ENTRY
         LH,R4    *R6,R1
         CI,R4    K8                ERROR, IF UNSAT COUNT EXCEEDS 8
         BE       LERR006
         SLS,R4   2
         AI,R4    UNSATAC
         AW,R4    R6
         BAL,SR4  LACCTST           STORE UNSAT ACCN IN LOCCT
         LI,SR2   ','
         PUSH     R4                SAVE UNSAT ADDRESS
         BAL,SR4  CHARSCAN          CHECK FOR COMMA
         BCS,8    LUNSA2
         BAL,SR4  LLEGALPW
         BCS,8    B2ER106           ERROR IF ILLEGAL PASSWORD
         LI,SR4   LUNSA3            RETURN
         B        LACCTST-2         STR UNSAT PSWD IN LOCCT
LUNSA2   EQU      %
         PULL     R4                RESTORE UNSAT ADDRESS
         BAL,SR4  LACCTST1-2        ZERO UNSAT PSWD LOC
LUNSA3   EQU      %
         LI,SR2   ')'
         BAL,SR4  CHARSCAN          CHECK FOR ')'
         BCS,8    B1ER004
         LI,R2    UNSATCT
         MTH,1    *R6,R2            INCREMENT UNSAT COUNT
         LI,SR2   KCOMMA
         BAL,SR4  CHARSCAN
         BCR,8    LUNSA1            BRANCH IF PRESENCE OF ANOTHER UNSAT
         B        LCCFLAG1
         SPACE    2
LLMN     EQU      %                 KEYWORD 'LMN' IDENTIFIED
         BAL,SR4  TCOMMA
         BCS,8    B1ER002           ERROR IF MISSING COMMA
         BAL,SR4  LLEGALNM
         BCS,8    B1ER102           ERROR IF ILLEGAL ALPHA NAME
         BAL,SR4  PLBNMSH
         LW,R4    R6                GET LMN ADDRESS
         AI,R4    LMNM
         LCI      3                 STORE LM NAME
         LM,R1    PLB,R7             IN LOCCT
         STM,R1   0,R4
         BAL,SR4  STARNM1           STORE JOB ACCN, ZEROED PSWD IN LOCCT
         LI,SR2   ','
         BAL,SR4  CHARSCAN          CHECK FOR   ,
         BCS,8    LCCFLAG1
         PUSH     R4
         BAL,SR4  LLEGALPW
         BCS,8    B2ER106           ERROR IF ILLEGAL PASSWORD
         PULL     R4
         B        LPERM2            REPLACE PASSWORD
         SPACE    2
LPERM    EQU      %                 KEYWORD 'PERM' IDENTIFIED
         LI,R1    K8
         STS,R1   LOCCT,R6          SET FLAG TO STORE LM IN USER'S FILE
         LI,SR2   ','
         BAL,SR4  CHARSCAN          CHECK FOR   ,
         BCS,8    LCCFLAG1
         LI,SR2   LIB
         BAL,SR4  QUOTSCAN          IDENTIFY KEYWORD
         BCS,8    B1ER101           ERROR IF NOT 'LIB'
LPERM1   EQU      %
         LI,R0    X'2010'           RESET ABS FLAG(RELOC. LM)
         LI,R1    X'2110'           SET LIB AND NOTCB FLAGS
         STS,R0   LOCCT,R6          SET FLAG TO STORE LM IN :USER'S LIB
         LI,SR2   ','
         BAL,SR4  CHARSCAN          CHECK FOR   ,
         BCS,8    LCCFLAG1
         BAL,SR4  LLEGALPW
         BCS,8    B1ER106           ERROR IF ILLEGAL PASSWORD
         LW,R4    R6
         AI,R4    LIBPW
LPERM2   PULL     SR4
         B        LACCTST
         SPACE    2
LREAD    EQU      %                 KEYWORD 'READ' IDENTIFIED
         LI,R2    READAC            SET REGISTER CONTENTS TO 'READ'
         LI,R3    READCT
         B        LRDWT1
         SPACE    1
LWRIT    EQU      %                 KEYWORD 'WRITE' IDENTIFIED
         LI,R2    WRITEAC           SET REGISTER CONTENTS TO 'WRITE'
         LI,R3    WRITECT
LRDWT1   EQU      %
         STW,R2   TEMPSAVE          SAVE LOCCT OFFSET FOR STORING ACCN
         PUSH     R3
         BAL,SR4  TCOMMA
         BCS,8    B2ER002           ERROR IF MISSING COMMA
         LI,SR2   ALL
         BAL,SR4  QUOTSCAN          IDENTIFY KEYWORD
         BCS,8    LRDWT2            BRANCH IF NOT 'ALL'
         PULL     R3
         LI,R0    K1
         STH,R0   *R6,R3            SET READ/WRITE COUNT =1
         B        LRDWT3
LRDWT2   EQU      %
         BAL,SR4  GETACCN
         BCS,8    B2ER106           ERROR IF ILLEGAL ACCN
         PULL     R3
         MTH,K1   *R6,R3            INCREMENT READ/WRITE COUNT
LRDWT3   EQU      %
         LI,R0    K10
         LI,R1    RDWTCT
         CH,R0    *R6,R1
         BE       B1ER108           ERROR IF TOTAL RD-WT COUNT >15
         LW,R4    TEMPSAVE          GET OFFSET FOR STORING ACCN
         AW,R4    R6
         BAL,SR4  LACCTST           STORE 'ALL' OR ACCN IN LOCCT
         LI,R1    RDWTCT
         MTH,K1   *R6,R1
         MTW,2    TEMPSAVE          INCREMENT READ/WRITE ACCN OFFSET
         LI,SR2   ','
         BAL,SR4  CHARSCAN          CHECK FOR   ,
         BCS,8    LCCFLAG1
         PUSH     R3
         B        LRDWT2            BRANCH TO GET NEXT ACCN
         SPACE    2
LEXPI    EQU      %                 KEYWORD 'EXPIRE' IDENTIFIED
         LI,R0    EXPDTE
         AW,R0    R6
         BAL,SR4  CALENDTE
         B        LEXPI1
         B        LCCFLAG1
         SPACE    2
LSL      EQU      %                 KEYWORD 'SL' IDENTIFIED
         BAL,SR4  TCOMMA
         BCS,8    B1ER002           ERROR IF MISSING COMMA
         BAL,SR4  HEXSCAN
         BCS,8    B1ER104           ERROR IF ILLEGAL HEX NO.
         LW,R1    CSL,R7
         CI,R1    K1
         BNE      B1ER106           ERROR IF BYTE COUNT > 1
         LI,R0    PLB
         AW,R0    R7
         BAL,SR4  CONEBCD           CONVERT FROM EBCDIC TO HEX
         LW,R2    R3
         SLS,R2   16
         LW,R3    Y000F
         STS,R2   LOCCT,R6          STORE SEVERITY LEVEL IN LOCCT
         B        LCCFLAG1
         SPACE    2
LBIAS    EQU      %                 KEYWORD 'BIAS' IDENTIFIED
         BAL,SR4  TCOMMA
         BCS,8    B1ER002           ERROR IF MISSING COMMA
         BAL,SR4  HEXSCAN
         BCS,8    B1ER104           ERROR IF ILLEGAL HEX NO.
         LW,R1    CSL,R7
         CI,R1    K5
         BG       B1ER106           ERROR IF BYTE COUNT >5
         LI,R0    PLB
         AW,R0    R7
         BAL,SR4  CONEBCD           CONVERT FROM EBCDIC TO HEX
         LI,R1    LPAGE
         LS,R1    R3
         BEZ      LBIAS1            BRANCH IF BIAS A MULTIPLE OF X'200'
         LI,R1    K100
         STS,R1   LOCCT,R6          SET ABSOLUTE LOAD FLAG
LBIAS1   EQU      %
         LW,R2    R3                STORE NEW LOAD
         LI,R3    X'1FFFF'          BIAS INTO LOCCT
         STS,R2   LDBIAS,R6
         B        LCCFLAG1
         SPACE    2
LTSS     EQU      %                 KEYWORD 'TSS' IDENTIFIED
         LI,R1    TSSIZE
         B        LSIZE
         SPACE    2
LERTA    EQU      %
         LI,R1    ETBLSIZE
         B        LSIZE
         SPACE    2
LERST    EQU      %
         LI,R1    ETSSIZE
LSIZE    EQU      %
         PUSH     R1
         BAL,SR4  TCOMMA
         BCS,8    B2ER002
         BAL,SR4  HEXSCAN
         BCS,8    B2ER104
         LW,R1    CSL,R7
         CI,R1    K4
         BG       B2ER106
         LI,R0    PLB
         AW,R0    R7
         BAL,SR4  CONEBCD           CONVERT FROM EBCDIC TO HEX
         CI,R3    X'7FFF'
         BG       B2ER104
         PULL     R1
         STH,R3   *R6,R1            STORE TEMP STACK SIZE IN LOCCT
         B        LCCFLAG1
         SPACE    2
LMAPONLY EQU      %
         LI,R1    8                 KEYWORD 'MAPONLY' IDENTIFIED
         OR,R1    Y004              SET PERM AND MAPONLY BITS
         STS,R1   LOCCT,R6
         SPACE    2
LMAP     EQU      %                 KEYWORD 'MAP' IDENTIFIED
         LI,SR2   ','               *IS OPTION (MAP,XXXX,XXXX)
         BAL,SR4  CHARSCAN
         BCS,8    LMAP15            *NO
         LI,SR2   VALUE             *IS XXXX= 'VALUE'
         BAL,SR4  QUOTSCAN
         BCS,8    LMAP5             *NO, CHECK FOR 'NAME'
         LW,R1    Y002              *SET BIT 10 IN LOCCT
         STS,R1   LOCCT,R6
         B        LMAP
LMAP5    EQU      %
         LI,SR2   NAME              *IS XXXX= 'NAME'
         BAL,SR4  QUOTSCAN
         BCS,8    B1ER101           NO, ILLEGAL OPTION
         LW,R1    Y001              *SET BIT 11 IN LOCCT
         STS,R1   LOCCT,R6
         B        LMAP
LMAP15   EQU      %
         LW,R1    Y003              *SET DEFAULT FOR MAP (NAME)
         CW,R1    LOCCT,R6          *IF 'VALUE' OR 'NAME' NOT SPEC.
         BANZ     LCCFLAG1
         LW,R1    Y001
         STS,R1   LOCCT,R6
         B        LCCFLAG1
         SPACE    2
LBI      EQU      %                 KEYWORD 'BI' IDENTIFIED
         LI,R1    K800
         LI,D2    'B'
         B        LGO1
         SPACE    2
LREL     EQU      %                 KEYWORD 'REL' IDENTIFIED
         LI,R0    0
         LI,R1    K100              RESET BIT 23
         STS,R0   LOCCT,R6
         B        LCCFLAG1
         SPACE    2
OSEG     EQU      %
         CW,R3    Y05               LOOK FOR REF OR BREF
         BANZ     B1ER100           ERROR.
         CI,R2    K10               LOOK FOR MREF
         BANZ     B1ER100           ERROR
         B        LCCFLAG1
         SPACE    2
LMREF    EQU      %                 'MREF' KEYWORD IDENTIFIED
         LI,D3    0
         CW,R3    Y07               LOOK FOR BREF,SEG OR REF
         BANZ     B1ER100           ERROR.
         CI,SR1   ','               IS THERE A VALUE FOR MREF
         BE       LBREF1A           YES
         LI,R2    K64               NO, SET DEFAULT
         B        LBREF1C
         SPACE    2
         SPACE    2
OREF     EQU      %                 KEYWORD 'REF' IDENTIFIED
         LI,D3    K4
         CW,R3    Y06               LOOK FOR BREF OR SEG
         B        LBREF1
         SPACE    2
LBREF    EQU      %                 'BREF' KEYWORD SPECIFIED
         LW,D3    Y4
         CW,R3    Y03               LOOK FOR REF OR SEG
LBREF1   RES      0
         BANZ     B1ER100           ERROR.
         CI,R2    K10               LOOK FOR MREF
         BANZ     B1ER100           ERROR.
         CI,SR1   ','               IF NXT CHAR IS NOT A COMMA
         BNE      LBREF2
LBREF1A  EQU      %
         LI,R1    X'7FFF'           MAX NUM VALUE
         BAL,SR4  GETDECVAL         GET NUM SIZE
         BCS,8    LCCIND0           FOOPA
LBREF1C  EQU      %
         SLS,R2   17                SAVE NEXT
          OR,R2     LDBIAS,R6      ADD IN LOAD BIAS
          STW,R2    LDBIAS,R6      AND STORE
LBREF2   LW,R1    D3
         B        LCCFLAGS
         SPACE    2
LEXEC    EQU      %
         BAL,SR4  TCOMMA
         BCS,8    B1ER002           ERROR IF COMMA MISSING
LEXEC5   EQU      %
         BAL,SR4  GETACCN
         BCS,8    B1ER106           ERROR IF ILLEGAL ACCN
         LI,R1    EXECCT
         LH,R2    *R6,R1
         CI,R2    K7
         BG       B1ER001           ERROR IF TOTAL EXEC. COUNT >8
         MTH,1    *R6,R1
         LI,R4    EXECAC
         AW,R4    R6
         SLS,R2   1
         AW,R4    R2
         BAL,SR4  LACCTST           STORE 'ALL' OR ACCN IN LOCCT
         LI,SR2   ','
         BAL,SR4  CHARSCAN          CHECK FOR ,
         BCS,8    LCCFLAG1
         B        LEXEC5            GET NEXT ACCN
         SPACE    2
LUNDE    EQU      %
         BAL,SR4  TCOMMA
         BCS,8    B1ER002           ERROR IF COMMA MISSING
         BAL,SR4  LLEGALNM
         BCS,8    B1ER102           ERROR IF ILLEGAL ALPHA NAME
         BAL,SR4  PLBNMSH           MAKE IT TEXTC
         LI,R4    EXECVE
         AW,R4    R6
         LCI      3
         LM,R1    PLB,R7            STORE EXECUTE VEHICLE
         STM,R1   0,R4
         MTW,3    TREEAD,R6         INCREMENT TREE
         LW,R1    Y1
         B        LCCFLAGS
         SPACE    1
LPRIV    EQU      %
         BAL,SR4  TCOMMA
         BCS,8    B1ER002           ERROR IF COMMA MISSING
LPRIV5   EQU      %
         BAL,SR4  NAMSCAN           GET OPTION
         LW,R1    PLB,R7            (R1) = 1ST 4 CHAR OF KEYWORD
         LI,R2    PRIVOPT           (R2) = ADR OF KEYWORD TABLE
         LI,R3    PRIVCNT           (R3) = NUMBER OF KEYWORDS IN TABLE
         LI,R4    B1ER101           (R4) = BRANCH ADR IF SEARCH FAILURE
         BAL,SR4  WDTBLSRH          SEARCH TABLE FOR KEYWORD SCANNED
         AI,R3    -1                SET OPTION FLAGS. BITS 0,1,2,3 OF
         LCW,R3   R3                WORD 1 OF LOCCT.
         AND,R3   X7F
         LW,R1    Y8
         SLS,R1   *R3
         STS,R1   LOCCT1,R6
         LI,SR2   ','               IF COMMA FOUND, GET NEXT OPTION
         BAL,SR4  CHARSCAN
         BCR,8    LPRIV5
         B        LCCFLAG1
LCCFLAGS EQU      %
         STS,R1   LOCCT,R6          SET FLAG INDICATED BY KEYWORD
LCCFLAG1 EQU      %
         PULL     SR4
         B        *SR4
         SPACE    2
B1ER001  RES      0
*E*      MESSAGE: MAXIMUM NUMBER OF EXECUTE ACCOUNTS EXCEEDED
         LI,SR3   MXEXECCD          MAXIMUM NUMBER OF EXECUTE ACCTS
         B        LCCIND0
B2ER002  PULL     SR3
B1ER002  RES      0
*E*      MESSAGE: EXPECTED COMMA MISSING
         LI,SR3   COMERCD           EXPECTED COMMA MISSING
         B        LCCIND0
B1ER003  PULL     SR3
*E*      MESSAGE: EXPECTED LEFT PARENTHESIS MISSING
LERR003  LI,SR3   LPERCD            EXPECTED LEFT PARENTHESIS MISSING
         B        LCCIND1
B1ER004  PULL     SR3
*E*      MESSAGE: EXPECTED RIGHT PARENTHESIS MISSING
LERR004  LI,SR3   RPERCD            EXPECTED RIGHT PARENTHESIS MISSING
         B        LCCIND1
LERR006  RES      0
*E*      MESSAGE: MAXIMUM NUMBER OF UNSAT ACCOUNTS EXCEEDED
         LI,SR3   MXUNSTCD          MAXIMUM NUMBER OF UNSAT ACCTS
         B        LCCIND0
LERR005  LI,SR3   TERMERCD          EXPECTED TERMINATOR MISSING
*E*      MESSAGE: EXPECTED TERMINATOR MISSING
*E*      DESCRIPTION: THE LOAD CONTROL COMMAND WAS NOT TERMINATED BY A
*E*                   PERIOD,END OF BUFFER(X'26'), OR CARRIAGE RETURN.
         B        LCCIND1
B1ER100  PULL     SR3
LERR100  LI,SR3   KWERCD            ILLEGAL KEYWORD
*E*      MESSAGE: ILLEGAL KEYWORD
*E*      DESCRIPTION: THE SPECIFIED KEYWORD WAS NOT RECOGNIZED BY CCI
         B        LCCIND1
B1ER101  EQU      %
*E*      MESSAGE: ILLEGAL OPTION
*E*      DESCRIPTION: THE SPECIFIED OPTION WAS NOT LEGAL FOR THE
*E*                   SPECIFIED KEYWORD.
         LI,SR3   OPERCD            ILLEGAL OPTION
         B        LCCIND0
B1ER102  PULL     SR3
*E*      MESSAGE: ILLEGAL ALPHANUMERIC NAME
*E*      DESCRIPTION: THE NAME SCANNED CONTAINS AN ILLEGAL CHARACTER.
         LI,SR3   ALPHERCD          ILLEGAL ALPHANUMERIC NAME
         B        LCCIND1
B2ER104  PULL     SR3
B1ER104  RES      0
*E*      MESSAGE: ILLEGAL HEXADECIMAL NUMBER
         LI,SR3   HEXERCD           ILLEGAL HEXADECIMAL NUMBER
         B        LCCIND0
B1ER105  RES      0
*E*      MESSAGE: DUPLICATION OF FIELDS
*E*      DESCRIPTION: AN OPTION WAS SPECIFIED MORE THAN ONCE ON THE
*E*                   SAME CONTROL COMMAND.
         LI,SR3   DUPERCD           DUPLICATION OF FIELDS
         B        LCCIND0
B2ER106  PULL     SR3
B1ER106  RES      0
*E*      MESSAGE: ILLEGAL VALUE
*E*      DESCRIPTION: THE MESSAGE IS OUTPUT FOR THE FOLLOWING CONDITIONS:
*E*                   1. ACCOUNT NUMBER OR PASSWORD SPECIFIED ON THE
*E*                      LOAD CONTROL COMMAND EXCEEDS THE MAXIMUM NUMBER
*E*                      CHARACTERS
*E*                   2. SIZE SPECIFIED FOR ERTABLE OR ERSTACK OPTION
*E*                      EXCEED THE MAXIMUM
*E*                   3. VALUE SPECIFIED FOR SL OR BIAS OPTION
*E*                      EXCEED THE MAXIMUM
         LI,SR3   VALERCD           ILLEGAL VALUE
         B        LCCIND0
LERR107  LI,SR3   INSFERCD          INSUFFICIENT PARAMETERS
*E*      MESSAGE: INSUFFICIENT PARAMETERS
*E*      DESCRIPTION: THE LMN OPTION WAS NOT SPECIFIED IN CONJUNCTION
*E*                   WITH THE PERM OPTION.
         B        LCCIND1
LERR108A PULL     2,SR1
LERR108 LI,SR3    NOPGERR
*E*      MESSAGE: CAN'T GET DYNAMIC PAGES
       PULL     2,R7
         B        LCCIND1
B1ER108  RES      0
*E*      MESSAGE: MAXIMUM NUMBER OF READ AND/ WRITE ACCOUNTS EXCEEDED
         LI,SR3   MRWERCD           MAXIMUM NUMBER OF READ/WRITE ACCTS
LCCIND0  PULL     R0
LEXPI1   EQU      LCCIND0
LCCIND1  LI,R0    K0
         LI,R4    K2
LCCIND2  EQU      %
         PULL     R6
         PULL     SR4
         AW,SR4   R0
         B        *SR4              END OF INTERPRET LOAD CONTROL COMND
*                                                                      *
         END

