         DEF      ADD:
ADD:     RES
*
*
*M*      ADD      GETI: MBS-COOP COMMUNICATION ROUTINE
*
*
*P*      NAME:    ADD
*P*
*P*      PURPOSE: CONTAINS ROUTINE GETI WHICH PASSES RESOURCE
*P*               AND SYMBIONT INFORMATION FOR NEW BATCH
*P*               JOBS FROM THE GETI TABLES TO THE INPUT COOP
*P*               AND JIT.
*P*
*P*      DESCRIPTION:
*P*               THIS MODULE (NAMED ADD FOR HISTORICAL REASONS)
*P*               SHOULD REALLY BE NAMED GETI:  THE ONLY ROUTINE
*P*               IT CONTAINS.  WHEN MBS SCHEDULES A NEW BATCH
*P*               JOB IT PUTS THE SYMBIONT AND RESOURCE INFOR-
*P*               MATION FOR IT INTO ONE OF THE THREE SLOTS IN
*P*               THE GETI TABLES.  ONE PIECE OF THIS INFORMATION
*P*               IS THE USER NUMBER WHICH MBS HAS DETERMINED
*P*               THROUGH TRICKERY.  WHEN THE NEW USER IS SWAPPED
*P*               IN BY THE SWAPPER AND HIS INITIAL ENVIRONMENT
*P*               PULLED, CCI IS CALLED. HIS FIRRST ACTION IS TO
*P*               TO ATTEMPT TO READ THE JOB CARD.  THE DCB OPEN
*P*               REQUIRED TO DO THIS DRIVES INTO OPNLD TO OPEN
*P*               THE C1 STREAM.  OPNLD RECOGNIZES THIS STREAM
*P*               IS NOT OPENED AND CALLS GETI.  GETI FILLS THE
*P*               RESOURCE INFORMATION (AND SOME SYMBIONT INFO)
*P*               INTO THE JIT, RELEASES THE GETI TABLE ENTRY,
*P*               AND RETURNS THE STARTING DISC ADDRESS OF THE
*P*               SYMBIONT JOB FILE TO OPNLD SO THAT HE CAN
*P*               COMPLETE THE STREAM OPEN AND CCI CAN READ THE
*P*               JOB CARD.
*P*
*P*      REFERENCE:
*P*               THE GETI TABLES ARE IN THE MODULE COMBAT AND
*P*               ARE DESCRIBED IN THE DATA BASE TECH MANUAL.  MBS
*P*               FILLS THEM IN AND GETI IS CALLED BY OPNLD.
*
*
         SYSTEM   UTS
OC       EQU      2
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
*
*
*F*      NAME:    GETI
*F*
*F*      PURPOSE: GETS CONTROL INPUT FILES FOR OPNLD - SETS UP RESOURCE
*F*               INFORMATION FROM !LIMIT IN THE JIT WHEN A BATCH JOB
*F*               IS STARTED BY MBS.
*F*
*
*
*        BAL,11   GETI              FROM COOP
*        USES  R1,R5,R14,R15
*        RETURN SR1=DA
*GET SELECTED JOB FROM GETI TABLES AND SET
*UP THE JIT -- ENTRY FOUND WHEN S:CUN=GIB:UN -- MBS
*HAS PUT INFO IN TABLES AND STARTED JOB -- GI:FRE IS
*THE FREE ENTRY CHAIN
         SPACE 2
GETI     EQU      %
         LW,R1    S:CUN
         LI,R5    3
         CB,R1    GIB:UN,R5
         BE       GETI1
         BDR,R5   %-2
GETIX    EQU      %
         SCREECH  X'2C',0
*
*
*S*      SCREECH:          2C-00
*S*
*S*      REPORTED BY:      GETI(ADD)
*S*
*S*      TYPE:             FULL RECOVERY
*S*
*S*      MESSAGE:          BATCH SCHEDULING ERROR-MBS/CCI ERROR
*S*
*S*      REGISTERS:                 R1=CURRENT USER NUMBER
*S*                                 R2=DEVICE TYPE (CR=4)
*S*                                 R3=COOP CONTEXT ADDRESS
*S*                                 R5=0
*S*                                 R6=M:C DCB ADDRESS
*S*                                 R11=BAL RETURN
*S*
*S*      REMARKS:          A BATCH USER HAS STARTED TO RUN WITHOUT
*S*               BEING SCHEDULED.  ACTUALLY ALL RECORDED CASES OF
*S*               S.C. 2C'S HAVE BEEN CCI ATTEMPTING TO START A
*S*               SECOND JOB AFTER COMPLETING ONE WITHOUT LOGGING OFF.
*S*                        PROBLEM IS USUALLY THAT CCI CONTINUED TO
*S*               READ CARDS PAST A !FIN, BUT TABLES COULD HAVE BEEN
*S*               CLOBBERED ALSO OR MBS COULD HAVE A DISABLE PROBLEM.
*S*
*
*
GETI1    EQU      %
         LI,D3    0
         STB,D3   GIB:UN,R5
         LH,D4    GIH:TIM,R5
         MI,D3    30000
         STW,D4   J:MRT
*
         LB,D3    GIB:PRI,R5
         LI,D4    X'F'
         SLD,D3   20
         STS,D3   J:JIT+PRT         STORE PRIO IN JIT
*
*                 NEW GERM INFO
         LW,D4    5
         SLS,D4   1
         AW,D4    5                 (5)*3
         AI,D4    GI:ASPN-1
*
         LI,1     3
         LW,D3    *D4,1
         STW,D3   J:ASPIN-1,1
         BDR,1    %-2
*
         LI,1     4
         LW,D4    5
         SLS,D4   2
*                 (5)*4
         AI,D4    GI:RES-1
         LI,D3    0
         STB,D3   *D4,R1            ZAP SPECIAL PRIO INFO IN BYTE 0
         LW,D3    *D4,1
         STW,D3   JB:MAX-1,1
         BDR,1    %-2
*
         SPACE 4
         LB,D3    GIB:SLN,R5
         LI,R1    JB:SLNK
         STB,D3   0,R1
         LB,D3    GIB:XLN,R5
*                 SET UP EXCULSIVE BATCH LIST OF SERIAL #'S
*
*
         LB,R1    GIB:PRT,5
         MI,R1    SV:RSIZ+1
         STB,D3   PLB:MIN,R1       SAVE IT
*
*
         LI,R1    JB:XLNK
         STB,D3   0,R1
         LI,R1    1
         LB,D3    GIB:RID,R5
         BEZ      %+2
         MTB,2    JB:ORG,R1
         STB,D3   JRBID+J:JIT,R1
         LI,SR1   0
         XW,SR1   GI:SDA,R5
         CW,SR1   Y01
         BAZ      %+2
         MTB,1    JB:ORG,R1
         CW,SR1   Y04
         BAZ      GETI2
         LW,R1    SR3
         LW,D4    Y4
         STS,D4   1,R1    RABBIT SAID RE-RUN
GETI2    RES      0
         AND,SR1  M24
         LB,R1    GIB:PRT,R5
         DISABLE
         XW,R5    GI:FRE
         SLS,R5   8
         AWM,R5   GI:FRE
         ENABLE
         LI,R5    JB:PNR
         STB,R1   0,R5
         LH,D4    PLH:SID,R1
         LI,R5    1
         STH,D4   J:JIT,R5
         STB,5    JB:MAX            SET K (NOT PAGES) FLAG
         B        *SR4
*
*
*        REFS FOR GETI         *
*
         DEF      GETI              SET UP JIT AND COOP CONTEXT TO
*,*                                 READ IN JOB STREAM AND START JOB
         REF      Y01               RBBATS JOBENT SUBMITTED FLAG
         REF      Y04               RBBAT'S RERUN FLAG
         REF      Y4                COOPS DON'T DELETE GRANS FLAG
         REF      M24               ANDS OUT DISC ADDRESS
         REF      S:CUN             INPUT:  CURRENT USER NUMBER
         REF      PLH:SID           INPUT:  SYSID FOR THIS PARTITION
         REF      GI:FRE            OUTPUT:  GETI TABLE ENTRY IS FREED
*,*                                 TO THIS CHAIN
         REF      GI:SDA            INPUT:  ZERO,RERUN,ZERO,JOBENT,
*,*                                 STARTING DISC ADDRESS 5,1,1,1,24
         REF      GI:RES            INPUT:  !LIMIT RESOURCE VALUES
*,*                                 SV:RSIZ BYTES INDEXED BY RES INDEX
         REF      GI:ASPN           INPUT:  DEVICE OWNERSHIP FLAGS -
*,*                                 BIT TABLE INDEXED BY DCTX
         REF      GIH:TIM           INPUT: HALFWORD !LIMIT TIME
         REF      GIB:RID           INPUT:  BYTE SUBMITTERS RBID
         REF      GIB:SLN           INPUT:  BYTE HEAD OF SHARED SER#
*,*                                 CHAIN IN LSERIAL
         REF      GIB:XLN           INPUT:  BYTE HEAD OF EXCLUSIVE
*,*                                 SER# CHAIN IN LSERIAL
         REF      GIB:PRT           INPUT:  BYTE PARTITION NUMBER
         REF      GIB:UN            INPUT:  USER # USED TO FIND GETI
*,*                                 ENTRY
         REF      GIB:PRI           INPUT:  PRIORITY AT WHICH JOB WAS
*,*                                 RUN
         REF      SV:RSIZ           I/O:  NUMBER OF RESOURCES
         REF      PLB:MIN           OUTPUT:  HEAD OF EXCLUSIVE SER#S
*,*                                 FROM GIB:XLN
         REF      PRT               OUTPUT: DISP IN JIT OF WORD INTO
*,*                                 WHICH PRIO IS STORED INTO BITS
*,*                                 8-11 FROM GIB:PRI
         REF      JB:MAX            OUTPUT:  TABLE IN JIT INTO WHICH
*,*                                 RESOURCE VALUES FROM GI:RES ARE
*,*                                 STORED
         REF      J:JIT             OUTPUT:  JIT ADDRESS USED WITH
*,*                                 DISPLACEMENT REFS
         REF      JRBID             OUTPUT:  DISP IN JIT OF WORD INTO
*,*                                 WHICH RBID FROM GIB:RID IS STORED
*,*                                 INTO BYTE 1
         REF      J:ASPIN           OUTPUT:  THREE WORDS IN JIT INTO
*,*                                 WHICH THE DEVICE OWNERSHIP BITS FROM
*,*                                 GI:ASPN ARE STORED
         REF      J:MRT             OUTPUT:  CELL IN JIT INTO WHICH THE
*,*                                 !LIMIT TIME CONVERTED TO TICS IS STORED
         REF      JB:ORG            OUTPUT: WORD IN JIT INTO WHOSE BYTE
*,*                                 1 WE PUT: LOCAL BATCH=>0, JOBENT=>1
*,*                                 REMOTE BATCH=>2
         REF,1    JB:SLNK           OUTPUT: BYTE ADDR IN JIT WHERE SHARED
*,*                                 SER# HEAD FROM GIB:SLN IS PUT
         REF,1    JB:XLNK           OUTPUT:  BYTE ADDR IN JIT WHERE
*,*                                 EXCLUSIVE SER#HEAD FROM GIB:XLN
*,*                                 IS PUT
         REF,1    JB:PNR            OUTPUT:  BYTE ADDR IN JIT WHERE PART
*,*                                 NUMBER FROM GIB:PRT IS PUT
          END

