*                 CATALOG NO. 704732 - SIGMA 5/7 BPM M:CCI
       CSECT       1
         SYSTEM   SIG7FDP
         SYSTEM   BPM
DEBUG    EQU      0
*
*
*********CCI------CONTROL COMMAND INTERPETER**************************
*
*
*
*
         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 ARGU4ENT 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
         PAGE
         DEF      CCREAD,CREAD
         DEF      CCI50
         DEF      CCI120
         DEF      COUNTID
         DEF      SETCLS
         DEF      CCIPCH
         SPACE    3
         REF      TSTACK
         REF      CJOB
         REF      WDTBLSRH,SCCELF,SCCLF,EOCCSCAN,ERRLIST,LIST
         REF      MRT,;
 ONOFF,ACCBUF,CCLTFLGS,ALOCCT,CCBEF,CHSTSHFT,READBI,;
 TOPPAGE,SERRLF,LIMR,MESSR,TITLR,J:CCBUF,;
 CCLIST,Y08,SYSID
         REF      Y01,Y008,X1FFFF,Y06
         REF      Y8
         REF      J:STAR
         REF      XF,XFF
         REF      PLB,CSL,CBUF
         REF      CCRSZ
         REF      DCBCLS
         REF      X4
  REF  TREETADR,TTESIZE,LMNAME,ROMTADR,KEYHEAD
         REF      TREER,SEGSRCH,INCLR,OPNSTARF
         REF      M:X1,M:C
         REF      M:LO
         REF      M:LL
         REF      Y004
         REF      J:TELFLGS
         REF      J:TITLE
         REF      J:RNST
         REF      J:BUP
         REF      J:EXTENT
         REF      J:ASSIGN
         REF      ACCN
         REF      J:JIT
         DEF       EXITM
         REF      PTREER                                                732
         REF      RUNERCD
         REF      MODFYR,PMDR,SNAPR,IFR
         REF      POOLR
           REF        SWITCHR
  REF  ASSGR,LOADR,RUNR,TELESCPE,DEFXREFR,CCLFLAGS
         REF      BLNKERCD
  REF  X1000,XFFFF,LDSYSID,CCPL,CCP,CHSTSCAN
         REF      RLMNENTRY
         REF      MJCFLG
         REF      NAMSCAN,GETHEXVAL
         REF      LISTDCBT,LISTCNT                                      732
         REF      CPE                                                   732
DBUGF    EQU      CPE                                                   732
         REF      Y002                                                  732
         REF      PPMD,JASSIGN      ASMF REPLACED BY JASSIGN
         REF,1    JB:STEPCC
         REF      WSNSCAN
         REF      BLANK
         REF      W120
         REF,1    JB:FRS
         REF      CLOSLOG
         REF      KEYBUFF
         REF      J:UNAME
         REF      CONCAT
         REF      J:ACCN
         REF      LOGSZ
         REF      OPNFM3
         REF      JB:PRIV
         REF      NRESERR
         REF      OPLOG
         REF      J:ALB,J:ABC,HEXBCD
         REF      M:EO
         REF      INHYPHEN,EXHYPHEN
         PAGE
K0       EQU      0
K1       EQU      1
K2       EQU      2
K5       EQU      5
K100     EQU      X'100'
K200     EQU      X'200'
K40000   EQU      X'40000'
KCOMMA   EQU      ','
KBLANK   EQU      ' '
KPERIOD  EQU      '.'
LR:PW    EQU      6
SYSVER   EQU      X'2B'             SYSTEM VERSION
         SPACE    3
         DEF      JCC
JCC      RES      0
KEYTREE  TEXTC    'TREE'
OFF      TEXTC     'OFF'           DATA FOR OC MESSAGE
OFFABRT  TEXTC    'OFF  ABORTED'
TXTRES   TEXT     'RES '
RUNTBLSIZ EQU     40
FCN      EQU      7                                                     732
         PAGE
*  PROCESS RETURN FROM RESOURCE CHECKING (JOBR)
*    LIMIT AND RES CC CAN BE IN ANY ORDER AFTER JOB CC
* IF RES. CHECK OK, GO SCAN FOR RES & LIMIT CC (JOB WILL BE ABORTED
*        IF ERROR IN LIMIT CC)
* IF RES. CHECK VIOLATED, ALL RES & LIMIT CC WILL BE LISTED BEFORE
*    THE APPRO.ERR MSG. (NO CHECKING DONE FOR LIMIT CC)
*
         DEF      RESOK             FOR RETURN FROM LIMR
*
CCI29    PUSH     SR3
         LI,R4    K1                INDICATE FIELD ERROR
         BAL,SR4  SCCELF            SET CONTROL COMMAND ERROR LISTING FLAG
         BAL,SR4  EOCCSCAN          SKIP TO END OF CARD
         PULL     SR3               ZERO IF NORMAL,ELSE RES VIOLTN
CCI30    LI,R4    X'12'             *
         BAL,SR4  SCCLF             *SET FLGS  FOR RES OUTPUT TO DO&LL
         AI,SR3   0                 TEST RES ERROR
         BEZ      RESOK
         LW,R1    =X'08000000'      L/BIT 4
         STS,R1   J:ASSIGN          S/FLUSH BIT IN J:ASSIGN
         B        RESVIO
*
         BAL,SR4  EOCCSCAN
RESVIO   EQU      %
         LW,SR2   SR3               SAVE ERROR CODE
         BAL,SR4  CCREAD
         LW,SR3   SR2               RESTORE ERROR CODE
         LW,R2    PLB,R7            IS IT A LIMIT CC
         LW,R3    PLB+1,R7
         CD,R2    TXTLIMIT
         BNE      RESVIO5
         MTW,0    NRESERR           WAS THIS DUE TO A RESOURCE SPEC'D
         BEZ      RESVIO-1          ON LIMIT CC EXCEEDING MAX.
         BAL,SR4  LIMR              YES, SCAN LIMIT CC TO FLAG RESOURCE
         B        CCI90             IN ERROR FOR USER.
RESVIO5  EQU      %
         CW,R1    TXTRES
         BE       RESVIO-1
         B        CCI94             NOW, GO ABORT
*
         BAL,SR4  EOCCSCAN
RESOK    EQU      %
         BAL,SR4  CCREAD
         CW,R1    TXTRES
         BE       RESOK-1           SKIP RES CC
         LW,R2    PLB,R7            IS IT A LIMIT CC
         LW,R3    PLB+1,R7
         CD,R2    TXTLIMIT
         BNE      CCI2              NOT RES OR LIMIT
         BAL,SR4  LIMR              IF ERR FND,RTRN ON SR4
*                                   ELSE RTRN TO RESOK-1
         PAGE
*
*        RETURN  POINTS FROM CONTROL COMMAND PROCESS ROUTINES
*
*
*
CCI50    EQU      %
         B        CCI90             ERROR RETURN
         B        CCI               LIMR,STDLBR,MESSR,TITLR,ASSGR RETURN
         B        CCIFIN            GO EXIT ON FIN CC
         B        CCI200            LOADR  RETURN                RETURN
         B        CCI230            RUNR RETURN
         B        CCI30             JOBR RETURN
         PAGE
STEPR    AI,SR1   -KBLANK           CHK DELIMITER
         BEZ      STEPR1            OK
         AI,SR1   KBLANK-KCOMMA     TRY AGAIN
         BEZ      STEPR1            OPTIONAL COMMA IS OK
         AI,SR1   KCOMMA            RESTORE DELIMITER
         B        CCI120
STEPR1   BAL,SR4  NAMSCAN           GET COMPARE OPERATOR
         LI,R2    2                 MUST BE 2 CHARS
         CW,R2    CSL,R7            CHK IT
         BCS,11   CCI120            NO NAME OR .NE. 2
         LI,R4    2                 *LIST STEP CMD ON LP ONLY
         BAL,SR4  SCCLF
         LW,R2    PLB,R7            GET
         LH,R1    R2                 COMPARE OP
         PUSH     3,R1              OPEN UP STACK
         BAL,SR4  HEXSCANP          GET V1
         CI,D3    15                1HEX DIGIT CHK
         BCS,10   CCI120M           NOT HEX OR TOO BIG
         STW,D3   *TSTACK           SAVE V1
         LI,SR4   STEPR2            SET RETURN
         CI,SR1   KCOMMA            CHK DELIMITER
         BE       HEXSCANP          GET V2
         PULL     3,D2              GET OP,NO V2,V1
STEPR8   LI,R1    6                 SCAN
         CH,D2    STEPRT,1           OP
         BE       %+3                 TABLE
         BDR,R1   %-2
         B        CCI120            ILLEGAL OP
         LI,3     BA(JB:STEPCC)
         CB,D4    0,3               CHK JIT CC
         EXU      STEPRT1,R1        COND BRANCH
         CI,D3    X'FFFF0'          CHK FOR V2 SPEC'D
         BANZ     %+4               NOPE
         LW,R1    =X'01000000'      L/BIT 7
         STS,R1   J:EXTENT          SET FLAG SO STEP WON'T WIPE OUT STEPCC
         STB,D3   0,3               SET NEW JIT CC
         B        CCI-1             PROCEED WITH THIS STEP
         SPACE    3
HEXSCANP AI,SR1   -KCOMMA           CHK DELIMITER
         BEZ      GETHEXVAL         OK
         AI,SR1   KCOMMA            RESTORE DELIMITER
CCI120M  PULL     3,R1              BALANCE STACK
         B        CCI120            PUBLISH ERROR
         SPACE    3
STEPR2   CI,D3    15                1 HEX DIGIT CHK
         BCS,10   CCI120M           NOT HEX OR TOO BIG
         PULL     D4                GET V1
         PULL     R1                BALANCE STACK
         PULL     D2                GET OP
         B        STEPR8
         SPACE    3
STEPR3   LI,R1    2                 SET JIT CC
         CB,R1    0,3                TO 2
         BLE      %+2                 OR HIGHER
         STB,R1   0,3
         BAL,SR4  EOCCSCAN          FINISH UP STEP CARD
         LI,R6    0                 SET R6=JOB NOT ABORTED
         B        CCISKIP           SKIP THIS STEP
         SPACE    3
STEPRT   DATA,2   0                 OP TABLE
         DATA,2   'GT','LT','EQ','GE','LE','NE'
         SPACE    3
         BOUND    4
STEPRT1  EQU      %-1
         BGE      STEPR3
         BLE      STEPR3
         BNE      STEPR3
         BG       STEPR3
         BL       STEPR3
         BE       STEPR3
         PAGE
CCI120   LI,SR3   ILLCC
*
*        PROCESS  ERROR RETURN
*
CCI90    EQU      %
         LI,R4    X'12'             DO & LL
         BAL,SR4  SERRLF            SET ERR LIST FLAGS
         LI,R4    K0
         CI,SR3   K100
         BL       CCI92
         CI,SR3   X'200'                                                732
         BL       CCI94A
         CI,SR3   X'210'            CHECK IF RES. VIOLATION
         BL       CCI94
         CI,SR3   X'215'            RES ERRCODE:X'210'--X'214'
         BGE      CCI94
*RESOURCE VIOLATION DETECTED, GO SCAN FOR RES. CC
* BEFORE PRINTING ERR. MSG.
         B        CCI29
CCI94A   EQU      %
         LI,R4    K1
CCI92    EQU      %
         BAL,SR4  SCCELF            SET CONTROL COMMAND ERR LISTING FLAG
         BAL,SR4  EOCCSCAN          SCAN TO END OF CC
CCI94    EQU      %                                                     732
         BAL,SR4  ERRLIST           LIST ERROR MESS ON SPECIFIED DEVICES
         LW,R5    Y4
         REF      Y4
         STS,R5   J:RNST
 BAL,SR4 DCBCLS
         CAL1,9   3                 M:XXX AFTER ERROR
         PAGE
LAIDOVER EQU      %
         LD,D1    TXTCOLY           LOAD OLAY LATER
         STD,D1   LDTHIS1           SAVE  PROCESSOR  NAME
         B        LOADR
LOADRLOD EQU       %
         LD,D1    TXTCLDR           GET  'LOADER'
         B        LAIDOVER+1
LOCCTPROC EQU   %
         LD,D1    TXTCLOCT
         B        LAIDOVER+1
         PAGE
*
CCI35    LI,R3    X'40000'
         STS,R3   PPMD,R5           SET PROC PMD BIT
         BAL,SR4  EOCCSCAN
*  FALL INTO CCI
*
*  CONTROL COMMAND INTERPRETER
*
CCI      LI,R5    J:JIT
         BAL,SR4  CCREAD            GET 1ST RECORD OF CC
CCI2     LI,SR4   CCI50             SET RETURN
         LI,R3    NCC               # OF CC'S
         CW,R1    CCTBL,R3          SRCH TABLE
         BE       CCBTBL,R3         HIT
         BDR,R3   %-2               TRY AGAIN
*  FALL INTO PROCC IF NOT FOUND
*
*
*        CONTROL COMMAND NOT RECOGNIZED
*
*        ASSUME  PROCESSOR CONTROL COMMAND
*
PROCC    EQU      %
         LI,R4    2
         BAL,SR4  SCCLF
         BAL,SR4  CCLIST            LIST COMMAND
         LI,R1    ' '               BLANK
         STB,R1   J:CCBUF           FIRST CHARACTER.
         LW,R1    CSL,R7
         BNEZ     PROCC1            CHECK IF CHAR. STRING LENGTH = 0
         LI,R2    1
         LB,D2    J:CCBUF,R2        ITS A COMMENT IF 1ST CHAR. IS A
         CI,D2    KPERIOD           PERIOD
         BE       CCI
         B        CCI120            ERROR, PROBABLY A BLANK FOLLOWING !
PROCC1   EQU      %
         LW,D2    Y004              SET PCCF FLAG IN JIT
         STS,D2   CCBEF,R5
         ANLZ,R0  PROCC2            GET BUFFER ADDRESS
         LI,R2    1
         BAL,SR4  CHSTSHFT          SHIFT NAME AND INSERT BYTE COUNT
         LCI      3
PROCC2   EQU      %
         LM,R6    PLB,R7            LOAD (R6-R7-SR1) WITH PROCESSOR NAME
         CD,R6    TXTCFTRN          IS IT 'FORTRAN'
         BNE      EXITM             NO,SKIP
         LD,R6    TXTCFORT          USE 'FORT'
EXITM    RES      0                 EXIT
         LCI      2                 GET ':SYS'
         LM,D2    SYSACCT#                     ACCOUNT #.
         LI,0     0                 EXIT     EXIT     EXIT
CLS%DCB%EXIT PUSH  R1
         BAL,SR4  DCBCLS
         PULL     R1
         CAL1,9   1
         PAGE
*
*        PERFORM FUNCTIONS AFTER RECOGNIZING SHOW CC OR AFTER LIMIT ABRT.
*                 1. PUT :USERS RECORD IN COMMON PAGE AND EXIT TO
*                      SHOW PROCESSOR. IF PREVIOUS JOB WAS ABORTED DUE
*                      TO EXCEEDING ITS LIMITS, SHOW BIT SET.
*
*
SHOWR    EQU      %
         LI,SR4   K40000            SET BIT TO INDICATE SHOW WAS CALLED
         STS,SR4  J:TELFLGS         DUE TO PREV. JOB EXCEEDING LIMIT.
         LD,R6    TXTCSHOW          GET 'SHOW'
SHOWR5   EQU      %
         PUSH     3,R5              BUILD KEY FOR READING :USERS REC.
         LI,R4    0                 CLEAR COUNTER FOR KEY
         LI,R3    KEYBUFF           KEY BUFFER ADDRESS
         LI,R7    8                 LENGTH LIMIT FOR ACCOUNT
         LI,R2    J:ACCN            ACCOUNT ADDRESS
         BAL,SR1  CONCAT            PUT ACCOUNT INTO KEY
         AI,R4    1
         LI,R6    X'40'             INSERT SPACE BETWEEN ACCNT. AND NAME
         STB,R6   *R3,R4
         LI,R7    12
         LI,R2    J:UNAME           LENGTH LIMIT FOR NAME
         BAL,SR1  CONCAT            PUT NAME INTO KEY
         STB,R4   *R3
*
         LB,R4    JB:PRIV           PRESERVE USERS PRIVILEGE
         LI,R1    X'C0'             SET PRIV. TO READ :USERS
         STB,R1   JB:PRIV
         M:GCP    1                 GET COMMON PAGE FOR BUFFER
         LI,R1    1                 SET MODE=IN
         LI,R6    ERRRTN            LOAD ERROR RETURN ADDR. FOR OPEN
         LI,R7    ABNRTN            LOAD ABN. RETURN ADDR. FOR OPEN
         CAL1,1   SETEABN           SET ERR/ABN ADDRESS
SHOWR10  EQU      %
         CAL1,1   OPLOG
         CAL1,1   READLOG           READ :USERS RECORD
         CAL1,1   CLOSLOG           CLOSE
         PULL     3,R5              RESTORE JIT AND CCPARAM ADDR.
         STB,R4   JB:PRIV           RESTORE USERS PRIVILEGE
*
         LI,R4    LR:PW             BLANK OUT PASSWORD
         LW,D2    BLANK
         STW,D2   *SR2,R4
         AI,R4    1
         STW,D2   *SR2,R4
*
         CI,SR4   K40000            WAS PREV. JOB ABRTD AFT. EXC. LIMIT
         BANZ     EXITM             YES, EXIT TO SHOW PROCESSOR
         B        PROCC             NO, PRINT SHOW CC AND EXIT TO SHOW.
*
*
ABNRTN   EQU      %
         SLS,SR3  -17
         CI,SR3   X'A01'            WAS FILE BEING UPDATED
         BNE      ERRRTN            NO
         M:WAIT   1                 YES, WAIT 1 SEC. AND TRY AGAIN
         B        SHOWR10
ERRRTN   EQU      %
         LW,SR3   M:EO              CHECK IF M:EO IS OPEN
         CW,SR3   Y002
         BAZ      ERRRTN5           NO
         CAL1,1   CLOSLOG           YES, CLOSE IT
ERRRTN5  EQU      %
         LI,SR3   UNREUERM          UNABLE TO READ :USERS FILE
         PULL     3,R5              RESTORE JIT AND CCPARAM ADDR.
         B        CCI90             PUT OUT MSGE. AND ABORT
         PAGE
*
*        PERFORM FUNCTIONS AFTER PROCESSING LOAD CC:
*
*                 1. READ BI DEVICE IF OPTION SPECIFIED
*
*                 2. PROCESS TREE CC IF ONE, ELSE BUILD A ONE
*
*                    ENTRY TREE TABLE  WITH SEGMENT NAME = LOAD
*
*                    MODULE NAME
*
*
*
CCI200   EQU      %
         LW,R4    ALOCCT,R5
         LI,R1    X'800'
         AND,R1   0,R4              IF BI OPTION ON LOAD CC
         BEZ      CCI200A
         BAL,SR4  READBI            MOVE BI INFO. TO DISC FILE *IDB
         B        CCI90             ERROR RETURN
CCI200A  EQU      %
         BAL,SR4  CCREAD
         LW,R2    PLB,R7
         CLM,R2   TXTREE
         BE       CCI201
         BCS,12   CCI200B           NOT PTREE
         LI,SR4   CCI201A-1         SET RETURN
         B        PTREER            PROCESS PTREE CONT COM
CCI200B  EQU      %                                                     732
         LW,R1    Y008              SET CC
         STS,R1   CCBEF,R5                BUFFER FULL FLAG
         LW,R3    ALOCCT,R5
         LW,R1    TREETADR,R3
         LI,R2    TTESIZE
         STW,R2   0,R1
         LCI      3                    SEGMENT
         LM,D2    LMNAME,R3                        NAME
         AW,D2    Y01
         LB,R2    D2
         LI,R3    0
         STB,R3   D2,R2             SET LAST BYTE OF SEG. NAME = 0
         LCI      3
         STM,D2   1,R1                            = LOAD MODULE NAME
         STW,R3   4,R1
         STW,R3   5,R1
         B        CCI202
CCI201   EQU      %
         BAL,SR4  TREER
         B        CCI90
CCI201A  EQU      %                                                     732
         LI,R1    K200
         LW,R2    ALOCCT,R5
         STS,R1   0,R2              SET OLAY FLAG
CCI202   EQU      %
         LI,D1    K1                SET FLAG TO INDICATE LOAD
         PAGE
*
*        PERFORM  FUNCTIONS AFTER LOAD AND RUN CC
*
*                 1. PROCESS ANY DEBUGS
*
*                 2. WRITE  OUT LOAD TABLE IF LOAD CC
*
*
*
CCI203   EQU      %
         PUSH     D1                SAVE FLAG
         SLS,D1   16
         LI,D2    X'30000'
         STS,D1   CCLTFLGS,R5
         LI,R2    0                                                     732
         LI,R3    X'20000'                                              732
         STS,R2   DBUGF,R5          CLEAR PMD FLAG IN JIT               732
         LI,R4    2
         BAL,SR4  SCCLF             SET CC LIST FLAGS
*
CCI204   EQU      %
         BAL,SR4  CCREAD            READ CONTROL COMMAND
         PULL     D1
         LI,R2    CCTBL3
         LI,R3    NDEBUG1
         CI,D1    K1                CHECK IF LOAD OR RUN STUATION
         BANZ     CCI205
         LI,R3    NDEBUG2           RUN
CCI205   EQU      %
         LI,R4    CCI214
         BAL,SR4  WDTBLSRH          SEARCH DEBUG TABLE
         OR,D1    X4
         PUSH     D1
         CI,D1    K1                CHECK IF LOAD
         BANZ     CCI206
         CW,R1    TXTSNAP
         BNE      CCI206
         LW,R2    PLB+1,R7
         CW,R2    TXTC              CHECK IF SNAPC COMMAND
         BE       CCI206
         AI,R3    -1
CCI206   EQU      %
         LW,R4    ALOCCT,R5
         LW,R1    TREETADR,R4       (R1) = ADR OF TREE TABLE
         LW,R2    0,R1              (R2) = NO. OF WORDS IN TREE TABLE
         LW,D4    R1
         AW,D4    R2
         AI,R1    1                 (R1) = ADR OF 1ST ENTRY IN TREE
         CI,R2    12                CHECK IF ONLY ONE ENTRY IN TREE
         BLE      CCI207            IF MORE THAN ONE ENTRY
         CI,SR1   ' '               CHECK IF NO SEG NAME                732
         BNE      %+3
         OR,R1    Y8                FLAG IN TSTACK , DOING ALL
         B        CCI207A1
         PUSH     R3                                 THEN OVERLAY
         BAL,SR4  SEGSRCH           GET SEGMENT NAME AND SEARCH TREE
         BCS,8    CCI226
         PULL     R3
CCI207   EQU      %
         CI,SR1   ' '               CHECK FOR BLANK
         BNE      CCI224
CCI207A1 RES      0
         AI,D4    K2                (D4) = ADR OF 1ST WORD OF BUFFER
         LI,R2    K0
         STW,R2   *D4               SET 1ST WORD OF BUFFER = 0
         STB,R3   *D4               STORE COMMAND ID IN 1ST WORD
         LI,SR4   CCI208            (SR4) = RETURN ADR
         PUSH     SR4
         PUSH     R1
         STW,D4   D3                (D3) = ADR OF 1ST WORD OF BUFFER
         AI,D4    1
         PUSH     2,D3
         LW,R0    M:X1                                                  732
         CW,R0    Y002              CHECK IF M:X1 OPEN TO DEBUG FILE    732
         BANZ     CCI207A           YES                                 732
         PUSH     11,R3             NO, PERFORM OPEN                    732
*                                                                       732
*        OPEN DEBUG FILE IN OUT MODE                                    732
*                                                                       732
         LI,R2    2                 SET FUNC. OUT                       732
         LI,SR4   CCI209            SET RETURN
         B        CCI215
CCI209   RES    0
         PULL     11,R3                                                 732
CCI207A  EQU      %                                                     732
         BAL,SR4  INHYPHEN          INCLUDE HYPHEN AS A DELIMITER
         B        CCBTBL3,R3        PROCCES DEBUG CC
*
CCI208   EQU      %
         B        CCI211            NORMAL RETURN
         BAL,SR4  EXHYPHEN          EXCLUDE HYPHEN AS A DELIMITER
         PULL     D1                ERROR RETURN
         B        CCI90
CCI211   EQU      %
         BAL,SR4  EXHYPHEN          EXCLUDE HYPHEN AS A DELIMITER
         B        CCI204            NORMAL RETURN
*
CCI214   EQU      %
         CI,D1    K1                CHECK IF LOAD OR OVERLAY
         BAZ      CCI216
         CW,R1    TXTINCL           CHECK IF INCL CC
         BNE      CCI216            BRANCH IF NOT
         LW,R2    ALOCCT,R5
         LI,R1    K200
         LS,R1    0,R2              CHECK IF OVERLAY
         BEZ      CCI120
         PUSH     D1
         LI,SR4   CCI208            SET RETURN
         B        INCLR             PROCESS INCL CC
         PAGE
*
*
*        PROCESSING OF DEBUG CONTROL  COMMANDS COMPLETE,
*
*                 CLOSE  AND  SAVE   FILE
*
CCI216   EQU      %
         CW,R1    TXTDATA           CHECK IF DATA CC
         BE       CCI218
         LW,R1    Y008              IF NOT DATA CC, SET
         STS,R1   CCBEF,R5                         CC BUF FULL FLAG
CCI218   EQU      %
         LW,R0    M:X1                                                  732
         CW,R0    Y002              CHECK IF M:X1 OPEN TO DEBUG FILE    732
         BAZ      CCI218A           NO                                  732
         CAL1,1   CLSFILE           CLOSE AND SAVE FILE
         LI,R3    X'10000'                                              732
         STS,R3   DBUGF,R5          SET DEBUG FLAG                      732
         B        CCI219                                                732
CCI218A  EQU      %                                                     732
         LI,R3    X'10000'                                              732
         CW,R3    DBUGF,R5          CHECK IF OLD DEBUG FILE PRESENT     732
         BAZ      CCI219            NO                                  732
         LI,R2    0                                                     732
         STS,R2   DBUGF,R5          YES, RESET DEBUG FLAG               732
         PUSH     D1
         LI,SR4   CCI217            SET RETURN
         LI,R2    1
CCI215   RES      0
         LI,R4    'D'
         B        CCI223
CCI217   RES      0
         LW,R6    M:X1              CHECK IF M:X1 OPEN
         CW,R6    Y002
         BAZ      CCI217A
         CAL1,1   CLSRFILE
CCI217A  EQU      %
         PULL     D1
CCI219   EQU      %
*
         LW,R6    ALOCCT,R5
         AND,R6   X1FFFF            (R6) = ADR OF LOCCT
         CI,D1    2                 CHECK IF !RUN WAS PROCESSED
         BAZ      CCI221
         LI,D2    0
         CI,D1    4
         BAZ      CCI220
         LI,D2    1
CCI220   EQU      %
         STW,D2   TREETADR,R6       SET DEBUG FLAG IN RUN TABLE
         LI,R3    RUNTBLSIZ
         LW,2     ALOCCT,R5
         BAL,11   MOVEIT
         LW,6     2
 B CLS%DCB%EXIT
CCI221   EQU      %
*
         LW,R1    SYSID,R5
         AND,R1   XFFFF             (R1) = SYSTEM ID OF CUR JOB
         STW,R1   LDSYSID,R6        STORE SYSID IN LOCCT
*
*        PACK UP  LOAD TABLE, TREE TABLE, AND ROM TABLE
*
         BAL,SR4  TELESCPE
         LW,SR3   D2                CHECK IF ERROR IN TELESCPE
         BNEZ     CCI90
         LW,R2    R6                (R2)= ADR OF LOCCT                  732
         LW,R3    R0                (R3)= END ADR OF LOCCT+1            732
         LW,D1    JASSIGN,R5        (D1)=ASSGN FLGS;WAS ASMF
         LI,D2    X'200'                                                732
         STS,D1   0,R6              STORE ASSIGN PRESENT FLAG IN LOCCT  732
         SW,R3    R2                (R3) = WORD SIZE OF LOCCT
         LW,D1    R3
         LI,D2    X'1FFFF'
         STS,D1   ALOCCT,R5         STORE LOCCT SIZE IN JIT
         LCW,D2   R2
         AWM,D2   ROMTADR,R2        CHANGE ROMT ADR TO A DISPLACEMENT
         AWM,D2   TREETADR,R2       CHANGE TREE ADR TO A DISPLACEMENT
         BAL,11   MOVEIT
*
*
         LW,R4    0,R2              (R4) = 1ST WORD OF LOCCT
         CI,R4    8                 CHECK IF LOAD MODULE NAME IS PERM
         BANZ     CCI222            YES
         PUSH     R2                NO, WRITE OUT LM NAME IN SYSIDT
         LI,SR4   CCI225            SET RETURN
         LI,R4    'T'               SET NAME = T
         LI,R2    4                 SET FUNC. = INOUT
CCI223   RES      0
         LI,R3    2                 SET ORG. = KEYED
         SD,D3    D3                ERR & ABN = 0
         B        OPNSTARF          OPN SYSID FILE
CCI225   RES      0
         PULL     R2                (R2) = ADR OF LOCCT
         AI,R2    LMNAME            (R2) = ADR OF LM NAME IN LOCCT
*
         CAL1,1   WRTLMN            WRITE LM NAME AS KEY IN SYSIDT FILE
*
         CAL1,1   CLSFILE           CLOSE AND SAVE SYSIDT FILE
*
CCI222   EQU      %
         LD,R6    LDTHIS1           GET NAME OF PROC TO BE LOADED.
         B        EXITM             EX
         SPACE    3
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
MOVEIT   RES      0
         LW,R1    R3                SIZE OF LOCCT
         AI,R3    512               ROUND UP BY 1 WORD AND 1 PAGE
         SLS,R3   -9                COMPUTE NR OF PAGES
         DO       DEBUG
         OR,R3    Y08               DYNAMIC PAGES FOR DEBUG
         ELSE
         OR,R3   =X'0C000000'
         FIN
         CAL1,8   3                 COM PAGES
         BCS,8    %                 ERROR
         LW,R3    9                 TO
         AI,R1    1                 FIRST WORD OF TABLE
         STW,R1   0,R3              SHALL BE IT'S SIZE.
         AI,R3    1                 BUMP STORE POINTER
         BDR,R1   LOCCTMV           TO TABLE MOVE
LOCCTMV1 AI,R3    1
         AI,R2    1
LOCCTMV  LW,D1    0,R2              FROM
         STW,D1   0,R3              TO
         BDR,R1   LOCCTMV1          NR
*
         LW,D1   =X'090000FF'
         DO       DEBUG
         NOP
         ELSE
         CAL1,8   D1                FREE DYN
         FIN
         LW,R2    9
         AI,R2    1                 TO COMPENSATE FOR XTRA WORD.
         B        *SR4
         PAGE
*
*
*        WRITE   LOAD  MODULE NAME  PLIST
*
WRTLMN   EQU      %
         GEN,8,24 X'11',M:X1
         DATA     X'F8000070'
         DATA     0
         DATA     0
         DATA     %
         DATA     0
         GEN,8,24 X'80',R2
*
*        CLOSE   FILE  PLIST
*
CLSFILE  EQU      %
         GEN,8,24 X'15',M:X1
         DATA     X'80000000'
         DATA     2
CLSRFILE EQU      %
         GEN,8,24 X'15',M:X1
         DATA     X'80000000'
         DATA     1
*
CCI224   EQU      %
         LI,SR3   BLNKERCD
         B        CCI228
CCI226   EQU      %
         PULL     R1
CCI228   EQU      %
         PULL     R1
         B        CCI90
         PAGE
*
*        PERFORM  FUNCTIONS AFTER RUN CC
*
*                 1. VERIFY LEGAL LOAD MODULE NAME
*
*                 2. READ IN TREE FROM LOAD MODULE AFTER RUN TABLE
*
*
*
CCI230   EQU      %
         LI,R3    2                 SET ORG TO KEYED
         LW,R4    ALOCCT,R5         (R4) = ADR OF FILENAME= LOAD MODULE
         AND,R4   X1FFFF                                          NAME
         PUSH     R4
         AI,R4    RLMNENTRY
         LW,D1    3,R4              CHK IF ACCN
         BEZ      CCI230A           NO                                  732
         ANLZ,D1  %-2               SET D1=ADR OF AC#
CCI230A  EQU      %                                                     732
         LW,D2    5,R4              CHK IF PSWD
         BEZ      CCI230B                                               732
         ANLZ,D2  %-2               SET D2=ADR OF PSWD
CCI230B  EQU      %                                                     732
         LW,SR4   Y8                ALLOW OPEN OF EXECUTE ONLY FILE
         STS,SR4  J:STAR
         LI,D3    CCI236            ERR ADR FOR DCB
         BAL,SR4  OPNFM3            OPEN LM
         CI,SR3   0                 CHECK IF FILE OPENED
         BNE      CCI238            NO
         LW,R2    M:X1+5            -YES. CHECK
         LI,R3    X'FF'             .IF THE FILE IS
         CS,R2    =X'22'            ..A KEYED FILE
         BNE      CCI237            -NO.
         PULL     R2                (R2) = ADR OF RUN TABLE
         AI,R2    RUNTBLSIZ         END ADR OF RUN TABLE +1
         LI,R3    24                                                    732
         LI,R4    KEYHEAD           (R4) = ADR OF KEY FOR READ
         BAL,R1   READCAL           READ 1ST 6 WDS OF HEAD RECORD.
         LW,R3    *R2               PERFORM VALIDITY CHECK ON HEAD RECORD
         BGEZ     CCI237            ERROR IF BIT 0 NOT SET
         AND,R3   XFF
         CI,R3    X'30'             ERROR IF NOT 48 BYTES
         BNE      CCI237
         LW,R3    -RUNTBLSIZ+1,R2                                       732
         BNEZ     CCI233
         INT,R3   2,R2
         SLS,R3   1                                                     732
         STW,R3   -RUNTBLSIZ+1,R2                                       732
CCI233   RES      0
         INT,R3   5,R2              (R3) = TREE SIZE IN WORDS           732
         AI,R3     RUNTBLSIZ-1+511    COMPUTE # OF
         SLS,R3    -9                 .PAGES NEEDED.
         OR,R3    Y08               GET
         CAL1,8   R3                     PAGES.
         INT,R3   5,R2              (R3) = TREE SIZE IN WORDS
          PUSH      R2             SAVE RUN TABLE POINTER
         LW,R2    SR2               PICKUP START ADDRESS OF PAGES
         SLS,R3   2                 (R3) = TREE SIZE IN BYTES           732
         LI,R4    KEYTREE           (R4) = ADR OF KEY FOR READING TREE
         BAL,R1   READCAL           READ LOAD MODULE TREE TABLE.
         SW,R3    M:X1+13           PERFORM VALIDITY CHECK ON TREE RECORD
         BNEZ     CCI237            ERROR IF RECD. NOT SIZE SPEC'D IN HEAD
         CAL1,1   CLSFILE           CLOSE FILE
          PULL      R3             GET RUN TABLE POINTER
          STW,R2    TREETADR-RUNTBLSIZ,R3    >TORE ADR OF TREE IN
*                                          RUN TABLE
         LW,D1    R2
         AW,D1    0,R2              (D1) = END ADR OF TREE TABLE +1
         AI,R2    1                 (R2) = ADR OF 1ST ENTRY
         LI,R3    0
CCI234   EQU      %
         MTB,1    *R2               INCREMENT SEG. NAME BYTE COUNT
         LB,R4    *R2
         STB,R3   *R2,R4            SET LAST BYTE OF NEW SEG. NAME =0
         AI,R2    TTESIZE
         CW,R2    D1                CHECK IF TO END OF TREE TABLE
         BL       CCI234            NO
         LI,D1    2                 SET !RUN CC FLAG
         B        CCI203            PROCESS DEBUGS AFTER RUN
*
*        PROCESS  ERRORS IN READING RUN LOAD MODULE
*
CCI236   EQU      %
         SLS,SR3  -17
         CI,SR3   X'0700'**-1       LOST DATA
         BE       CCI233
CCI237   EQU      %
         CAL1,1   CLSFILE           CLOSE AND SAVE FILE
CCI238   EQU      %
         LI,SR3   RUNERCD           SET RUN CC ERROR CODE IN SR3
         B        CCI90             PRINT ERROR MESSAGE AND ABORT
*
*        READ RECORD, CHECK IF CORRECT KEYED RECORD WAS READ
*
READCAL  EQU      %
         CAL1,1   READLM            READ RECORD DEFINED BY
*                                   .REGISTERS R2, R3, R4
         LB,SR3   SR3               CHECK IF
         CI,SR3   X'43'             .CORRECT KEY
         BE       CCI237            ..RECORD WAS READ. -NO.
         B        *R1               -YES. EXIT.
*
*        READ  RUN  LOAD MODULE HEAD AND TREE PLIST
*
READLM   EQU      %
         GEN,8,24 X'10',M:X1
         DATA     X'F8000010'
         DATA     CCI236
         DATA     CCI236
         GEN,8,24 X'80',R2
         GEN,8,24 X'80',R3
         GEN,8,24 X'80',R4
         PAGE
*
*        DEBUG  CONTROL COMMAND TABLES
*
CCTBL3   EQU      %
TXTINCL  TEXT     'INCL'
TXTDEFX  TEXT     'DEFX'
TXTMODI  TEXT     'MODI'
NDEBUG1  EQU      %-CCTBL3-1
         TEXT     'PMD '
         TEXT     'PMDE'         EXTENDED PMD
         TEXT     'PMDI'
TXTSNAP  TEXT     'SNAP'
         TEXT     'SNAP'
         TEXT     'IF  '
         TEXT     'AND '
         TEXT     'OR  '
         TEXT     'COUN'
COUNTID  EQU      %-CCTBL3-1
NDEBUG2  EQU      %-CCTBL3-1
*
CCBTBL3  EQU      %
         B        %                 DUMMY ENTRY
         B        DEFXREFR
         B        MODFYR
         B        PMDR
         B        PMDR
         B        PMDR
         B        SNAPR
         B        SNAPR
         B        IFR
         B        IFR
         B        IFR
         B        IFR
TXTC     TEXT     'C   '
TXTDATA  TEXT     'DATA'
         PAGE
**********************************************************************
*        CCINIT   ENTRY POINT TO CCI                                 *
*                 STARTS NEW JOB OR NEXT STEP  OF JOB                *
*                 IF ENTRY AFTER EXIT FROM WAIT STATE                *
*                 (R2) = -1                                          *
*                                                                    *
*                 IF ENTRY AFTER EXIT (M:EXIT, M:ERR,OR M:XXX)       *
*                 (R2),BYTE 2 = RUN STATUS, (R2),BYTE 3 = RUN FLAG   *
*                 (R3) = ADR OF EXIT CALL                            *
*                                                                    *
*                                                                    *
**********************************************************************
*
*
*
*   SIGNIFICANCE OF BITS IF SET IN J:RNST,BYTE 0
*
*        BIT 0    M:ERR CAL WAS MADE,JOB STEP TO BE ERRORED
*        BIT 1    M:XXX CAL WAS MADE,JOB STEP TO BE ABORTED
*        BIT 2    'E' KEYIN WAS MADE,JOB STEP TO BE ERRORED
*        BIT 3    'X' KEYIN WAS MADE,ABORT JOB AND FLUSH THIS JOB STREAM
*        BIT 4    'DELETE' KEYIN WAS MADE,ABORT JOB AND FLUSH JOB STREAM
*        BIT 5    A LIMIT HAS BEEN EXCEEDED,JOB STEP TO BE ABORTED
*        BIT 6    I/O ERROR,JOB STEP TO BE ABORTED
*        BIT 7    ILLEGAL TRAP,JOB STEP TO BE ABORTED
*
*
*
************************************************************************
*
CCINIT   EQU      %
         LW,1       J:BUP
         SLS,1     9
         STW,R1   TSTACK+2          SAVE BKGRDUL IN TEMP STACK
         BUMP     18,R1             RES SPACE FOR CHAR ROUT. PLIST
         PUSH 8,R4                                                     732
         LW,R5    CJOB                                                 732
         LW,R7    TSTACK
         AI,R7    -24                                                  732
         LCI      4                 MOVE
         LM,D1    CCPL                  PLIST
         STM,D1   0,R7                       TO
         LM,D1    CCPL+4                       TEMP STACK
         STM,D1   4,R7
         DO       DEBUG
         NOP
         ELSE
         CAL1,1   OPNCDCB
         FIN
         LH,R2    J:RNST
         LI,D1    0
         LW,D2   =X'FF7E0000'
         STS,D1   J:RNST
* TESTING FOR INITIAL ENTRY ON J:TELFLGS
*        J:TELFLGS BIT 31:INSUFFICIENT 1ST TIME FLAG
*                  BIT 18: =0 FOR 1ST TIME THRU CCI;
*                          =1 FOR SUBSEQUENT
*                  BIT 17: =0 FOR LDEV NOT CALLED;
*                          =1 FOR LDEV CALLED.
*                  BIT 16: =0, WSN OK;
*                          =1, WSN NOT OK.
*                  BIT 15: =0, LOAD CC NOT READ.
*                          =1, LOAD CC READ.
*                  BIT 14: =0, RUN CC NOT READ.
*                          =1, RUN CC READ.
*                  BIT 13: =0, SHOW NOT CALLED ON LIMIT ABORT.
*                          =1, SHOW CALLED WHEN JOB ABORTED DUE TO LIMIT
*                              BEING EXCEEDED.
*
         LI,D1    X'2000'           TEST INITIAL
         XW,D1    J:TELFLGS         .ENTRY TIME
         BNEZ     CCINIT10          .NO.
         MTW,1    J:JIT+ACCN        ENSURE NON ZERO ACCOUNT#
         BUMP     -8,R1                                                 732
         LI,R3    0                 ENSURE BYTE 0 IS 0 TO INDICATE A
         STB,R3   J:TITLE           TITLE HASN'T BEEN PROCESSED
         LI,R3    K100              SET NO CC LIST FLAGS IN JIT
         STS,R3   CCLFLAGS,R5
CCINIT2  EQU      %
         BAL,SR4  CCREAD            GET CONTROL COMMAND FROM C DEVICE
         LI,SR4    CCI50
         CW,R1    TXTJOB
         BE       WSNSCAN           .PROCESS JOB CARD.
         CW,R1    TXTFIN
         BE       CCIFIN            WRAPUP
*
         LI,R3    K100
         STS,R3   CCLFLAGS,R5       SET NO CC LIST FLAG IN JIT
         BAL,SR4  EOCCSCAN          SKIP TO END OF CONTROL COMMAND
         LI,R2    K0
         LI,R3    K100
         STS,R2   CCLFLAGS,R5       RESET NO CC LIST FLAG IN JIT
         B        CCINIT2
*
CCINIT10 EQU      %
         STW,R2   R6                SAVE J:RNST TO DETER. TYPE OF OFF MSG.
         LI,D2    K40000            PRESERVE BIT 13 TO DETERMINE TYPE OF
         STS,D1   J:TELFLGS         OFF MSGE. TO BE PRINTED.
         BUMP     -8,R1
         LI,D2    X'4000'           WAS LDEV
         CW,D2    D1                .PROCESSOR
         BAZ      CCINIT12          ..CALLED. -NO.
* LDEV EXITS WITH JB:STEPCC SET AS FOLLOWS.
* IF=0(NORMAL), IF=1(ERROR)
         LI,R1    JB:STEPCC         -YES. TEST IF
         LB,D2    0,R1              .LDEV SET.
         CI,D2    K1                ..ERROR
         BAZ      W250              -NO.
         LW,R1    =X'08000000'      -YES. SET BIT
         STS,R1   J:ASSIGN          .TO FLUSH JOB.
         LI,R1    X'8000'           SET WSN ERROR
         STS,R1   J:TELFLGS         .FLAG ON.
W250     EQU      %
         B        W120              START JOB CARD PROCESSING.
CCINIT12 EQU      %                                                    732
         CI,D1    K40000            WAS SHOW CALLED AFT. LIMIT ABORT
         BANZ     FLUSH             FLUSH AS ON OTHER ABORTS
         LW,R3    =X'08000000'      L/BIT 4 (FLUSH BIT)
         CW,R3    J:ASSIGN          C/BIT4 W/J:ASSIGN
         BANZ     FLUSH             BANZ; FLUSH, IGNORE STEP COMMANDS
         CI,R2    X'5F00'           BRANCH IF ENTRY
         BAZ      CCINIT20                       FROM M:ERR OR M:EXIT
         CI,R2    X'1000'           IS THIS AN OPERATOR ABORT?
         BANZ     FLUSH             BANZ; FLUSH, IGNORING STEP COMMANDS
         CI,R2    X'0400'           HAS A LIMIT BEEN EXCEEDED?
         BANZ     SHOWR             CALL SHOW PROCESSOR
         CI,R2    X'0100'           HAS AN ILLEGAL TRAP OCCURRED.
         BANZ     ILLTRAP
CCISKIP  EQU      %                 NO, M:XXX, SKIP TO JOB OR FIN CC
         BAL,SR4  CCREAD
         LI,R3    3
         LI,R4    CCISKIP
         BAL,SR4  WDTBLSRH          CHECK IF JOB OR FIN CC
         CW,R1    TXTFIN            IF FIN, EXIT AT ENDJOB5 TO PRINT
         BE       ENDJOB5           'OFF ABORT'
         BDR,R3   CCBTBL,R3
         B        CCINIT23          PROCESS STEP COMMAND
*
*
*
CCINIT20 EQU      %
         LW,R6    R2
         BAL,SR4  CCREAD            READ NEXT  CC
         CW,R1    TXTJOB            CHECK IF  JOB  CC
         BE       CCI2              YES
         CW,R1    TXTFIN            CHECK IF  FIN  CC
         BE       CCI2              YES
         LI,SR4   0                 CLR FINAL RST
         LI,R1    JB:FRS
         STB,SR4  0,R1
CCINIT23 RES      0
         LI,R4    8                 SET LO OUTPUT BIT
         LW,R1    M:LO              DO TOP OF FORM ON M:LO
         AND,R1   XF                IF SET TO DEVICE.
         CI,R1    3
         BE       CCINIT25
         LW,R1    M:LL              OTHERWISE, DO TOP OF FORM ON M:LL
         AND,R1   XF                IF SET TO DEVICE.
         CI,R1    3
         BNE      CCINIT26
         LI,R4    K2                SET LL OUTPUT BIT
CCINIT25 EQU      %
         BAL,SR4  TOPPAGE
CCINIT26 EQU      %
         LW,R1    PLB,R7            (R1) = 1ST 4 WORD OF COMMAND
         LI,R2    CCTBL             (R2) = ADR OF COMMAND TABLE
         B        CCI2
FLUSH    EQU      %
         BAL,SR4  CCREAD            READ NEXT COMMAND
         CW,R1    TXTFIN            TEST FOR
         BE       ENDJOB5           .FIN CARD. -YES.
         B        FLUSH             NO, READ AGAIN
*
ILLTRAP  EQU      %
         LW,R3    SYSVER            CHECK IF TAURUS (BITS 24-25 SET)
         CI,R3    X'C0'
         BAZ      CCISKIP           NO
         LB,R3    J:ABC             OUTPUT ERROR MESSAGE CONTAINING LAST
         CLM,R3   A3A4              BRANCH ADDRESS FOR A3,A4,B2 ABORT
         BIL      ILLTRAP2          CODES
         CI,R3    X'B2'
         BNE      CCISKIP
ILLTRAP2 EQU      %
         LW,D1    J:ALB             CONVERT LAST BRANCH ADDRESS
         BAL,D4   HEXBCD
         LI,R1    5                 AND PUT INTO MESSAGE.
         LB,R2    LBRMESS
ILLTRAP5 EQU      %
         STB,D2   LBRMESS,R2
         SLD,D1   -8
         AI,R2    -1
         BDR,R1   ILLTRAP5
*
         LI,R2    LBRMESS           LIST ERROR MESSAGE ON LL
         LI,R4    K2
         LI,D4    K1
         BAL,SR4  LIST
         B        CCISKIP
         PAGE
*
*
ILLCC    TEXTC    '   ILLEGAL CONTROL COMMAND OR CONTROL COMMAND SEQ.'
UNREUERM TEXTC    '   UNABLE TO READ :USERS FILE'
WSNMESS  TEXTC    '   WORK STATION NAME ERROR'
         CSECT    0
LBRMESS  TEXTC    '   LAST BRANCH TAKEN FROM      '
         BOUND    8
LDTHIS1  RES      2                 PROCESSOR NAME BUFFER
*****    PATCH AREA                 *****
CCIPCH   RES      200               CCI PATCH AREA
         USECT    CCI
         PAGE
********  BEGIN DBLWD TABLE  *******
         BOUND    8
TXTLIMIT TEXT     'LIMIT'
TXTREE   TEXT     'TREE'
TXPTREE  TEXT     'PTRE'                                                732
TXTCLOCT TEXTC    'LOCCT'
TXTCLDR  TEXTC    'LOADER'
TXTCOLY  TEXTC    'OLAY'
TXTCLGON TEXTC    'LOGON'
SYSACCT# TEXT     ':SYS    '
TXTCFTRN TEXTC    'FORTRAN'
TXTCFORT TEXTC    'FORT'
TXTCSHOW TEXTC    'SHOW'
A3A4     DATA     X'A3',X'A4'
*****    END DOUBLEWORD TABLE       *****
*
*        CONTROL COMMAND  TABLE
*
CCTBL    EQU      %-1
         TEXT     'STEP'
TXTJOB   TEXT     'JOB '
TXTFIN   TEXT     'FIN '
         TEXT      'PPMD'        PROCESSOR PMD'S
         TEXT     'MESS'
         TEXT     'TITL'
         TEXT     'POOL'
           TEXT       'SWIT'
         TEXT     'ASSI'
         TEXT     'LOAD'
         TEXT     'OVER'
         TEXT     'OLAY'
         TEXT     'LOCC'
         TEXT     'RUN '
         TEXT 'EOD '
         TEXT     'SHOW'
NCC      EQU      %-CCTBL-1
*
*        CONTROL COMMAND  JUMP TABLE
*
CCBTBL   EQU      %-1
         B        STEPR
         B        CCI120
         B        ENDJOB
         B    CCI35          PROCESSOR PMD'S
         B        MESSR
         B        TITLR
         B        POOLR
           B          SWITCHR
         B        ASSGR
         B        LOADRLOD
         B        LOADRLOD
         B        LOADRLOD          TEMP FIX UNTIL OLAY IS INCLUDED IN SYS
         B        LOCCTPROC
         B        RUNR
         B        CCI
         B        SHOWR5
CCIFIN   RES      0
         LI,R6    0                 SETUP TO ENTER WAIT STATE
         B        CLS%DCB%EXIT
*                                                                       732
ENDJOB   EQU      %
         LI,R6    0                 SET R6=JOB NOT ABORTED
ENDJOB5  EQU      %
         LI,R4    2                 TOP OF PAGE
         BAL,SR4  TOPPAGE                         ON LL.
         LI,R1    0                 STOP CLOCKING
         STW,R1   MRT,R5                           THIS  JOB.
         STB,R1   J:RNST            CLEAR RUN STATUS BEFOR LOGOFF
         LI,D1    OFF               TYPE 'OFF'
         CI,R6    X'5700'           WAS JOB ABORTED
         BANZ     ENDJOB7           YES
         LW,R6    J:TELFLGS         WAS THERE A WSN OR LIMIT EXCD. ERROR?
         CI,R6    X'48000'
         BAZ      ENDJOB9           NO
ENDJOB7  EQU      %
         LI,D1    OFFABRT
ENDJOB9  EQU      %
         CAL1,2   ONOFF                         ON  OC.
         LD,R6    TXTCLGON          GO TO LOGON
         B        EXITM                            FOR ACCOUNTING.
         PAGE
SETCLS   RES      0
*        15=CLOSE PLIST
*        11=EXIT ADDRESS
*    USES REG. 0 AND 7
         LW,0     *15               GET DCB
         LW,7     *0                GET FIRST WD
         CW,7     Y002              IS IT OPEN
         BAZ      *11               NO
         CAL1,1   SETIT
         CAL1,1   *15               CLOSE FILE
IGNOR    B        *11
         SPACE    2
SETIT    GEN,1,7,24   1,6,0
         GEN,2,30          3,0
         DATA     IGNOR
         DATA     IGNOR
         PAGE
**********************************************************************
*        CCREAD   CONTROL COMMAND READ- GETS NEXT CONTROL COMMAND    *
*                 FROM THE C DEVICE  AND INITIALIZES THE CC PARAMETER*
*                 LIST                                               *
*        ENTER WITH                                                  *
*                 (R5) = JIT  POINTER                                *
*        EXIT WITH                                                   *
*                 (R7) = CC PARAMETER LIST                           *
*                 (SR1) = CUR CHAR                                   *
*                 (PARM LIST BUFFER) = 1ST FIELD OF  CC              *
*                 (CCBUF)  = 1ST RECORD OF CC                        *
*                 (R1) = 1ST 4 CHAR OF 1ST FIELD OF CC               *
*        IF DATA   RECORD IS READ, MESSAGE IS OUTPUT                 *
**********************************************************************
DMFLAG   EQU      MJCFLG
CCREAD   EQU      %
         PUSH     SR4
CCREAD1  EQU      %
         BAL,SR4  CREAD
         LB,SR3   SR3               (SR3) = READ STATUS CODE
         BNEZ     CCREAD6           CONTROL COMMAND IF NOT ZERO
         LW,R3    DMMSK
         CW,R3    DMFLAG,R5         CHECK IF DATA INFO. MESS. LISTED
         BANZ     CCREAD1           BRANCH IF YES AND GET NEXT REC.
         STS,R3   DMFLAG,R5         SET FLAG
         LI,R2    DIMESS
         LI,R4    K2
         LI,D4    K1
         BAL,SR4  LIST              LIST DATA INFO. MESS. ON LL DEV
         B        CCREAD1           GET NEXT RECORD.
*
CCREAD6  EQU      %
         LI,R2    K0
         LW,R3    DMMSK
         STS,R2   DMFLAG,R5         RESET DATA INFO. FLAG IN JIT
         CI,SR3   K5                CHECK FOR !EOD  CC
         BE       CCREAD1           READ NEXT RECORD IF EOD
*
         LI,SR1   K0                (SR1) = CUR CHAR = 0
         LI,R1    K1
         STW,R1   CCP,R7            SET CUR CHAR POS. = 1
         LW,R2    R5
         AI,R2    ACCBUF
         STW,R2   CBUF,R7           RESET FLAGS AND SET  CC BUF ADDR
         LI,R3    80                CC BYTE CNT SET TO 80
         STW,R3   CCRSZ,R7
         BAL,SR4  CHSTSCAN          GET 1ST FIELD ON CC
         PULL     SR4
         LW,R1    PLB,R7            (R1) = 1ST 4 CHAR OF FIELD
         LI,R2    CCTBL             (R2) = ADR OF COMMAND TABLE
         B        *SR4              EXIT WITH CC IN CC BUFFER
DIMESS   TEXTC    '   DATA INFORMATION-IGNORED'
DMMSK    EQU      X1000
         PAGE
**********************************************************************
*        CREAD    READ C DEVICE                                      *
*        ENTER WITH                                                  *
*                 (R5) = JIT POINTER                                 *
*        EXIT WITH                                                   *
*                 (SR3) = DATA RECORD OR CC RECORD INDICATOR         *
**********************************************************************
CREAD    EQU      %
         PUSH     2,R6
         LI,R6    M:C               (R6) = ADR OF M:C DCB
         LW,R2    J:CCBUF           L/WD 1 OF COMMAND BUFFER
         CW,R2    CCFIN             CHECK FOR FIN
         BE       CREAD0A           B/FIN; IGNORE CCBEF
         LW,R3    Y008
         AND,R3   CCBEF,R5          CHECK IF CC BUF IS FULL
         BEZ      CREAD1
         LI,R2    K0
         STS,R2   CCBEF,R5          RESET CC BUF FULL FLAG
CREAD0A  EQU      %
         LW,SR3   Y06
         B        CREAD3
*
CREAD1   EQU      %
         PUSH     SR4
         LW,R2    R5
         AI,R2    ACCBUF
         AND,R2   X1FFFF
         LI,R4    LISTCNT-1                                             732
CREAD2A  EQU      %                                                     732
         LW,R3    LISTDCBT,R4                                           732
         AI,R3    FCN                                                   732
         MTB,0    *R3                                                   732
         BNEZ     %-1                                                   732
         BDR,R4   CREAD2A                                               732
         LI,SR3   0
         PUSH     R2
         DO       DEBUG
         LI,R2    -29
         STW,SR3  J:CCBUF+29,R2
         BIR,R2   %-1
         LW,SR3   Y06
         LI,R2    J:CCBUF
         ELSE
         LI,R2    TSTACK+60
         FIN
         CAL1,1   READCDCB
CREAD4   EQU      %
          LI,R3     80
CREAD411  RES       0
          LB,R4    J:CCBUF,R3      CHECK FOR TAB CHARACTERS
          CI,R4     X'05'          IF FOUND - CHANGE TO BLANK
         BNE      CREAD422
         LI,R4    X'40'             BLNK OUT TAB CHAR
         STB,R4   J:CCBUF,R3
CREAD422  RES       0
          BDR,R3    CREAD411
          PULL      R2
         PULL     SR4
CREAD3   EQU      %
         PULL     2,R6
         B        *SR4
         PAGE
*
*        PROCESS  READ C ERROR AND  ABNORMAL   RETURNS
*
RDCERAB  EQU      %
         LB,R3    SR3
         CI,R3    5                 CHECK IF EOD
         BNE      RDCER1
         LW,R1    CCP,R7
         AND,R1   =X'08000000'
         BEZ      CREAD4
RDCER1   RES      0
         CI,R3    6                 CHECK IF CONTROL COMMAND
         BE       CKFIN             *CHECK FOR FIN(AFTER CONTN.,ETC)
*
          PULL      R2
OPNER1   RES      0
         LW,R1    CCFIN
         STW,R1   0,R2              STORE !FIN IMAGE IN CC BUF
*
         AI,R2    -1
         LI,R3    4
         STB,R3   *R2               STORE BYTE COUNT IN BUF
         LI,R4    3
         BAL,SR4  SERRLF            SET ERR LIST FLAGS FOR OC AND LL DEV
         LI,SR3   RDCERRM
         BAL,SR4  ERRLIST           OUT READ C ERROR MESSAGE
*
         B        ENDJOB
*
CKFIN    LW,R1    J:CCBUF
         CW,R1    CCFIN             SEE IF A FIN
         BNE      CREAD4
         LW,R1    Y008              YES
         STS,R1   J:RNST            SET CCBEF FLAG TO FULL
         LI,R3    4                 FORCE BYT CNT TO 4
         STW,R3   CCRSZ,R7          SET CORRECT SIZE FOR SCAN
         LI,R1    K100
         STS,R1   J:JIT+CCLTFLGS    *PREVENT FIN LISTING
         B        CREAD411
CCFIN    TEXT     '!FIN'
         PAGE
SETEABN  EQU      %
         GEN,8,24 6,M:EO
         GEN,2,30 3,0
         DATA     ERRRTN            ERROR RETURN
         DATA     ABNRTN            ABNORMAL RETURN
*
READLOG  EQU      %
         GEN,8,24 X'10',M:EO
         DATA     X'F8000010'
         DATA     ERRRTN            ERROR RETURN
         DATA     ABNRTN            ABNORMAL RETURN
         GEN,1,31 1,SR2             BUFFER ADDRESS
         DATA     LOGSZ             RECORD SIZE
         DATA     KEYBUFF           KEY ADDRESS
*
*        OPEN  C DCB  PLIST
*
OPNCDCB  EQU      %
         GEN,8,24 X'14',M:C
         DATA     X'C0000000'
         DATA     OPNER
         DATA     OPNER
*
OPNER    LI,R2    J:JIT+ACCBUF
         B        OPNER1
*
*        READ C  DCB  PLIST
*
READCDCB EQU      %
         GEN,8,24 X'10',M:C
         DATA     X'F4000010'
         DATA     RDCERAB
         DATA     RDCERAB
         GEN,8,24 X'80',R2
         DATA     120
         DAT      0
*
*
RDCERRM  TEXTC    '!!ERROR READING  C DEVICE'
         END      CCINIT
