         SYSTEM   SIG7FDP
*
*
*M*      RBBATM   SYMBIONT FILE AND REMOTE PROCESSING MANAGEMENT
*
*
*P*      NAME:    RBBATM
*P*
*P*      PURPOSE: MAINTAINS AND MANAGES SYMBIONT FILE TABLES
*P*
*P*               CONTROLS REMOTE PROCESSING INCLUDING
*P*               LOGON - LOGOFF OF RP TERMINALS AND PROCESSING
*P*               REMOTE CONTROL COMMANDS
*P*
*P*               MAIN MODULE OF THE RBBAT GHOST WHICH ALSO
*P*               CONTAINS THE MULTI-BATCH RESOURCE SCHEDULER (MBS)
*P*               AND THE RBBAT RECOVERY ROUTINES (RBBATR)
*P*
*P*      DESCRIPTION:
*P*               RBBAT IS AWAKENED BY A CALL TO THE ROUTINE
*P*               SGCQ IN THE MONITOR ROOT.  THIS CALL IS MADE
*P*               SPECIFYING A GHOST FUNCTION CODE (GFC) AND
*P*               PARAMETERS USED BY RBBAT TO EXECUTE THE
*P*               REQUESTED FUNCTION.  THE GFC'S, ROUTINES CALLED,
*P*               AND FUNCTIONS PERFORMED ARE LISTED BELOW:
*P*
*P*  GFC     ROUTINE          FUNCTION
*P*
*P* NOPGFC    CTR1       RELEASE BUFFER ONLY - NO ACTION
*P* AIF       AIF        ADD CONTROL INPUT FILE (FROM SYMBIONT)
*P* AIFJE     AIFJE      ADD CONTROL INPUT FILE (FROM JOBENT)
*P* AIFNC     AIFNC      ADD NON-CONTROL INPUT FILE
*P* AOFL      AOFL       ADD LAST OUTPUT FILE FROM BATCH JOB
*P* AOF       AOF        ADD BATCH OUTPUT FILE
*P* AOFNB     AOFNB      ADD OUTPUT FILE FROM ONLINE,GHOST, OR
*P*                      JOBENT
*P* AOFP      AOFP       ADD PARTIAL OUTPUT FILE FROM SYMBIONT
*P* GOF       GOF        GET OUTPUT FILE (SYMBIONT)
*P* GIFNC     GIFNC      GET NON-CONTROL INPUT FILE (FOR OPNLD)
*P* MBSGFC    MBSCALL    CALL MBS TO MULTI-BATCH SCHEDULE
*P* PRIOGFC   KPRIO      EXECUTE PRIO KEYIN
*P* KDELGFC   KDEL       EXECUTE DELETE KEYIN
*P* KFRMGFC   KFORM      EXECUTE SYYNDD,F'XXXX' KEYIN
*P* KDISPGFC  KDISP      EXECUTE DISP, DISP OC, DISP SYMB, DISP
*P*                      OUTPUT, DISP NORUN AND DISP [SYSID] KEYINS
*P* JESTAT    JESTAT     PROCESS JOBENT STATUS REQUEST
*P* JEDEL     JEDEL      PROCESS JOBENT DELETE (CANCEL) RREQUEST
*P* SWITGFC   KSWIT      EXECUTE RBSWITCH KEYIN
*P* KCOMGFC   KCOM       EXECUTE RBCOM KEYIN
*P* SNDGFC    KSEND      EXXECUTE RBSEND KEYIN
*P* BCSTGFC   KBCST      EXECUTE RBBDCST KEYIN
*P* DUP       RB%DU      PROCESS NEW REMOTE TERMINAL CONNECTION
*P* LORR      RB%LRR     PROCESS REMOTE LOGON RECORD - LOG THE
*P*                      STATION ON
*P* HUP       RB%HU      PROCESS RP LINE DISCONNECT
*P* OCMGFC    RB%OCM     PROCESS IRBT CONSOLE INPUT MESSAGE
*P* RCVRGFC   RCVRY      CALL RBBATR TO PERFORM RBBAT RECOVERY
*P* RCVRGFC1  RCVRY1     MARKS POINT OF RECOVERY IN COMBUFS IN
*P*                      RBBAT RECOVERY FILE
*P* KFCGFC    KFFRM      EXECUTE FORM [SYSID] KEYIN
*P*
*P*      REFERENCE:
*P*               THE PARAMETERS PASSED WITH THE RBBAT CALLS
*P*               ARE DOCUMENTED IN THE DATA BASE TECH MANUAL
*
*
R0       EQU      0                 LINK TO FIND
R1       EQU      1                 PRIO OF ENTRY -- BYTE COUNT IN SCANS
R2       EQU      2                 INDEX OF EXTRY
R3       EQU      3                 GENERAL TEMP
R4       EQU      4                 GENERAL TEMP -- SUBROUTINE LINK
R5       EQU      5                 DCT INDEX
R6       EQU      6                 POINTER TO CURREND INPUT STRING
R7       EQU      7                 POINTER TO MESSAGE FILE POSITION
R8       EQU      8                 GENERAL TEM
R9       EQU      9                 RB FLAGS
R10      EQU      10                GENERAL TEMP
R11      EQU      11                GENERAL TEMP
R12      EQU      12                SYSID IN RBCC ROUTINES
R13      EQU      13                GENERAL TEMP
R14      EQU      14                GENERAL TEMP -- STRING POINTER
R15      EQU      15                GENERAL TEMP -- STRING POINTER
*
*
*
*
         DEF      RBG               BASE OF RBBAT FOR GENMDING
         DEF      RBBP              RBBAT PATCH AREA FOR GENMDING
         DEF      SDAA              BASE OF RBBAT DATA FOR GENMDING
*
         DEF      FIND              BEGIN LINKING THROUGH THE BATCH QUEUE
*,*                                 PRIORITY CHAINS
         DEF      FIND1             CONTINUE LINKING THROUGH THE BATCH
*,*                                 QUEUE PRIORITY CHAINS
         DEF      ADDFRE            LINK A FREE OUTPUT SLOT TO THE SPECIFIED
*,*                                 PRIORITY CHAIN
         DEF      GET256            GET A 256 WORD RBBAT DYNAMIC BUFFER
         DEF      FRE256            FREE A 256 WORD RBBAT DYNAMIC BUFFER
         DEF      MOVEMES           WRITE A MESSAGE TO A MESSAGE FILE
         DEF      SETHDR            OPEN A REMOTE PROCESSING MESSAGE FILE
*,*                                 AND INSERT THE HEADER IF NECESSARY
         DEF      TEL%OP1           WRITE A MESSAGE ON THE OC
         DEF      DEC               CONVERT BINARY TO EBCDIC DECIMAL
         DEF      HEXC              CONVERT BINARY TO EBCDIC HEX
*
         DEF      SVIV              SAVE SPECIAL RBBAT ENVIRONMENT
         DEF      SVIV1             SAVE SPECIAL RBBAT ENVIRONMENT AND
*,*                                 ABORT IF RECOVERY OCCURS
         DEF      SVREGS            SAVE AREA FOR RBBAT SPECIAL ENVIRONMENTS
         DEF      SVZ               ZERO IF SPECIAL RBBAT ENVIRONMENT IS
*,*                                 PRESENT
*
         DEF      ZAPM              BATCH QUEUE LOST MESSAGE
         DEF      ZAPM1             PLACE TO STORE CODE IN BATCH QUEUE
*,*                                 LOST MESSAGE
         DEF      RRM               JOB WILL BE RERUN MESSAGE
         DEF      NRRM              JOB CAN'T BE RERUN MESSAGE
         DEF      NRRM1             PLACE TO STORE ACCOUNT IN NOT TO BE
*,*                                 RERUN MESSAGE
         DEF      SYSD              PLACE (INDEX) TO STORE SYSID IN STANDARD
*,*                                 RBBAT MESSAGES (EG RRM)
*
         DEF      RUNPRI            PRIORITY CHAIN INDEX - RUNNING JOBS
         DEF      FIPRI             PRIORITY CHAIN INDEX - 'F' PRIORITY INPUT
         DEF      FREI              PRIORITY CHAIN INDEX - FREE INPUT SLOTS
         DEF      FREO              PRIORITY CHAIN INDEX - FREE OUTPUT SLOTS
         DEF      NCIPRI            PRIORITY CHAIN INDEX - NON-CONTROL INPUT
         DEF      DELPRI            PRIORITY CHAIN INDEX - FILES TO BE DELETED
         DEF      0OPRI             PRIORITY CHAIN INDEX - '0' PRIORITY OUTPUT
         DEF      BH:HPRI           PRIORITY CHAIN HEADS
         DEF      BH:TPRI           PRIORITY CHAIN TAILS
*
         DEF      BSCBTS            HASPBIT+2780BIT FOR RB:FLAG TESTS
         DEF      RRBIT             RERUN SPECIFIED BIT IN BW:SDA
         DEF      RRRBIT            ALREADY RERUN BIT IN BW:SDA
         DEF      JEBIT             JOBENT SUBMITTED BIT IN BW:SDA
*
         DEF      BI:ASPN           4 WORD AREA FOR MBS TO BUILD TEMP
*,*                                 COPY OF DEVICE OWNERSHIP BITS
         DEF      BSL:CRES          8 WORD AREA FOR MBS TO BUILD TEMP
*,*                                 AVAILABLE RESOURCES TABLE
         DEF      B8:CRES           4 WORD AREA FOR MBS TO COUNT UP
*,*                                 RESOURCE REQUIREMENTS FOR UNMOUNTED
*,*                                 SHARED SPINDLES
         DEF      BADRS             WORD ADDRESS OF B4W:RES FOR THE GUY
*,*                                 WE ARE WORKING ON
*
         DEF      TMPSTK            RBBAT'S TEMP STACK
         DEF      FINFLG            THIS JOB HAD !FIN AT END FLAG
         DEF      FLAGS             TEMP HOLDING CELL FOR RB:FLAG
         DEF      PGCNT             32- NUMBER OF 256 WORD BUFFERS ALLOCATED
         DEF      SVCBF             ADDRESS OF CURRENT COMBUF
         DEF      INVRN             BUFFER FOR RBBATR TO READ IN ENVIRONMENT
*,*                                 RECORD FROM :RBBRVR
         DEF      INVRNSZ           SIZE IN BYTES OF INVRN
         DEF      RSID              LAST USED SYSID SAVED TO UPDATE S:USID
*,*                                 AFTER A CRASH
         DEF      RCVRBUF           USED BY RBBATR TO HOLD ADDRESS OF
*,*                                 BUFFER INTO WHICH COMBUF RECORD OF
*,*                                 :RBBRVR IS READ
         DEF      RCVRFLG           WORD NOT ZERO => RECOVERY IN PROGRESS
*,*                                 BYTE0 NOT ZERO => PAST POINT OF RECOVERY
*,*                                 IN COMBUFS
         DEF      RCVRPTR           WHERE TO GO AFTER PROCESSING COMBUF
*,*                                 DURING RECOVERY
         DEF      RCVRSV            USED BY RBBATR TO STORE RECOVERY FLAGS
         DEF      RCVUN             USED BY RBBATR TO STORE CURRENT USER
*,*                                 AT TIME OF CRASH
*
         DEF      CTR1              EXIT FOR COMBUF PROCESSING - FREE COMBUF
         DEF      CTR2              RBBAT WAKEUP ADDRESS
         DEF      CTR4              EXIT FOR COMBUF PROCESSING - NO FREE
*,*                                 OF COMBUF
         DEF      CTR5              ENTRY TO BRANCH TO COMBUF PROCESSING
*,*                                 ROUTINE AFTER REGISTER SETUP
*
         DEF      FO1               EXIT FROM REMOTE STREAM PROCESSING
         DEF      BADRID1           EXIT WHEN REMOTE TERMINAL FAILS TO
*,*                                 LOGON
         DEF      DELJOB            EXIT TO GET RID OF ABORTED LOCAL JOB
         DEF      LSTSECT           EXIT TO GET RID OF ABORTED RP JOB
         DEF      RB%HU             ROUTINE THAT PROCESSES REMOTE TERMINAL
*,*                                 HANG UPS
         DEF      YFFXFF            MASK FOR CLEANING SGCHD
*
*
*
*
         REF      BB:DEV,BB:PI,BB:RID,BH:SLNK,BH:XLNK
         REF      BD:ACCT,BH:LINK,BH:SID,BH:PART
         REF      BH:TIME,B4W:RES,BW:SDA
         REF      SCNTXT
         REF      S#H:LNK,S#W:SER
         REF      BH:GRAN
         REF      DCTSIZ,DCT16,DCT4,DCT7,OCDCT
         REF      E:ABRT,E:SL,T:REG,T:RUE,E:UQA,E:SYMF,T:RE
         REF      GMB,RMB,MBS,MBSOP,GETUSER#,GBG
         REF      NEWQ,NEWQNW,OH:NM
         REF      M16,M24,M8,XF,YFFFF,Y04,Y8,Y002
         REF      Y4,Y2,Y1,Y08,Y01,M7,YFF
         REF      X80
         REF      NXTSID,S:BFIS,SGCHD,SGCBUF
         REF      SSIG,SNDDX,SAQNSERT,SSTAT,SL:BMX
         REF      RBLIMS,RBB:ID,RB:MFAD,RB:SPMF,LCLX
         SREF     RB:FLAG,RBB:CPZ,RBB:LPZ,RB:XFLG
         SREF     RBB:MXP,RBD:WSN,TOF0:DOT
         SREF     HASPIO,2780IO,HASPCU,2780CU
         REF      DCT8,DCT9,T:GJOBSTRT
         REF      M:XX,S:MBSF
         REF      RCVRABRT,LRRCVR,RCVRY,RCVRY1
         REF      INFIL,OUTFIL,BL:OFS,BL:IFS,MFS
         REF      S:CUN,MPOOL,CURBQ,MAXBQ,U:MISC
         REF      S:SBGC
         SREF     RB:BUF,RBB:HFE,RBB:SMD,RBB:BCB
         SREF     RBB:HIN,RBB:HOU,ML%CTL
         SREF     STB:LNK,STH:FLG
         REF      M5,STB:TYP,DCT%MASK,MXSTRM,RBH:MFX
         REF      TB:SZ
         SREF     STH:NM,STH:SUS
         SREF     OCPTYP,BB:JDE,STB:JDE,BW:FOVL,STW:FOV
         SREF     RBB:DSM,STB:DPD
         REF      BB:COPY,BW:FORM,STW:FORM
         REF      Y07,Y004,M15
         REF      JIT,SYMX,SMUIS,TIME,DATE,R:SYMF,SB:RQ,BOOTFLG
         REF      S:CUIS,C:ETM,S:BUIS
         REF      Y3,Y008,Y05,Y02
         REF      SV:RSIZ,SH:RNM,SB:RBMX,SB:RBDF
         REF      SV:TI,SL:BDF
         REF      S#B:TYP,OB:BTX,SH:RTOT,SB:RTY,TB:FLGS
         SREF     HAR:DOT,HSE:DOT,HRS:DOT
         REF      T:STLPP,T:RSPP,S:STLC
         REF      SWTINIT,SPOOL,SWTUC
         REF      SV:TYM,SH:SYMT    CHK ON THIS IN MON
         REF      SCSVDGI,SCSWIT,Y00FF
         SREF     H%CMP1
         REF      TSTACK,BLANK,TB:MAX
         SREF     MVREC,PSRCB
         REF      TYPMNSZ,RELCB,SWTEND
         REF      BT31TO0,LPART,PLH:FLG
         REF      UB:PRIOB
         REF      Y001
         REF      Y0008
         REF      X8000             MASK
         REF      BH:COMID          COMODE ID OF SYMBIONT FILES
         REF      STH:CMDV          COMODE ID OF FILE CURRENTLY
*,*                                 PRINTING ON SYMBIONT DEVICE
         REF      PLB:USR           USER NO. OF USER IN A PARTITION
         REF      PLH:SID           SYSID OF JOB CURRENTLY IN PARTITION
         REF      SDSIZE            IN : STATIC DATA SIZE
         REF      DDKEY             :RBBRVR DYN DATA KEY
         REF      SDKEY             :RBBRVR STAT DATA KEY
         REF      S:QUIET           IN/OUT : SYMB QUIES FLAG
         REF      S:SGCSAV          OUT : SGCHD HD SAVE
         REF      RCVRGFC           IN : RECOVER GHOST FUNCTION CODE
***************************************************
         CSECT    1
RBG      EQU      %
INITRBG  EQU      %
         LC       JIT
         BCS,4    %+2
         CAL1,9   1
         LW,R0    BOOTFLG
         BEZ      %+3
         CAL1,8   WAIT
         B        %-3
         CAL1,6   GTPG              MASTER MODE
         CAL1,8   IGTRAPS
         LW,R1    S:CUN
         MTB,-8   UB:PRIOB,R1
         LD,R0    TCAT
         BAL,R10  T:GJOBSTRT        TO GET JIT DA
KDSETM   EQU      %                 BUILD DISPLAY MESSAGES
         LI,R0    BW:FOVL
         BNEZ     KDST1
         LI,R1    NOOMSZ
         STB,R1   DISMESO
         LI,R1    SMDMNZ
         STB,R1   SYMDM
KDST1    EQU      %
         LI,R1    SV:RSIZ
         LI,R3    RESINX+SV:RSIZ
         LI,R0    DISMESIR
         BAL,7    SETDM
         LI,R1    4
         CI,R1    SV:RSIZ
         BLE      %+2
         LI,R1    SV:RSIZ
         LW,R3    R1
         AI,R3    RESINX
         LI,R0    DISMESIN
         LI,R7    CONTROL
         B        SETDM
CTR1     EQU      %                 -------------------------------
         LW,R1    RCVRFLG           RELEASE THE CURRENT COMBUF
         BNEZ     CTR4              TO THE FREE CHAIN.  IF IT
         XW,R1    SVCBF             IS THE ONLY FREE ONE,
         LI,R3    0                 :
         STB,R3   *R1               :      ( NEW TAIL )
         LI,R3    2                 :
         LI,R4    CTR4              :    ( SKIP SYMF USUALLY )
         AI,R1    -SGCBUF           :
         WD,0     X'37'             RECORD SYMFILE AVAILABLE
         LB,R2    SGCHD,R3          EVENT
         BNEZ     CTR11             :
         MTW,0    S:QUIET           :
         BNEZ     CTR12             :    ( DONT SET UP HEAD )
         STB,R1   SGCHD             :    ( SET UP FREE HEAD )
         BAL,R4   CTR12             :    ( REPORT SYMF AVAIL )
         BAL,R3   SYMF              :
         B        CTR4              :
CTR11    EQU      %                 :
         AI,R2    SGCBUF            :
         STB,R1   *R2               :    ( FLINK IN TAIL )
CTR12    EQU      %                 :
         STB,R1   SGCHD,R3          :    ( SET UP TAIL )
         WD,0     X'27'             :
         B        0,R4              :
CTR4     EQU      %                 ----------------------------------
         CLM,R5   RBLIMS            IF REQUEST INVOLVED AN RBT
         BCS,9    CTR6              COMBINE NEWLY MODIFIED GHOST
         WD,0     X'37'             FLAGS WITH LATEST HANDLER
         LW,R8    RB:FLAG,R5        FLAGS AND STORE IN RB:FLAG
         AND,R8   MSKH              SOME FLAGS ARE CONTROLED
         AND,R9   MSKG              BY THE GHOST AND OTHERS BY THE
         OR,R8    R9                HANDLER. THOSE BOTH CONTROL ARE
         STW,R8   RB:FLAG,R5        SPECIAL CASED
CTR2     EQU      %                 --------------------------------
         WD,0     X'27'             IF GHOST RECOVERY IS IN CONTROL
CTR6     EQU      %                 THE COMMUNICATION BUFFERS ARE
         LW,R1    RCVRFLG           SPECIALLY TREATED IN RCVR
         BNEZ     *RCVRPTR          :
CONTROL  EQU      %                 ----------------------------------
         LI,R7    X'FF'             GET THE NEXT COMBUF FROM THE USE
         LS,R7    SGCHD             CHAIN.  IF THERE ARE NONE GO
         BEZ      CTR3              TO SLEEP.  SET R5=DCT INDEX
         AI,R7    SGCBUF            AND R9=RBFLAGS (IF REMOTE)
         STW,R7   SVCBF             THEN GO TO APPROPRIATE ROUTINE
         WD,0     X'37'             BASED ON GHOST FUNCTION CODE
         LB,R1    *R7               :
         BNEZ     %+3               :
         LI,R2    1
         STB,R1   SGCHD,R2
         LI,R2    3
         STB,R1   SGCHD,R2
         WD,0     X'27'
         LB,R2    *R7,R2
CTR5     EQU      %
         LI,R1    1
         LB,R3    *R7,R1
         STW,R3   SYMINDX
         LI,R1    2
         LB,R5    *R7,R1
         LW,R9    RB:FLAG,R5
         CI,R2    #GFC
         BG       CTR1
         B        %+1,R2
*D*      NAME:  RBBATM    CTR   (CONTROL)
*,*
*,*      DESCRIPTION:
*,*      GFCSTRT IS THE CENTRAL JUMP TABLE FOR ALL RBBAT GHOST
*,*      FUNCTION CODES.   FORMAT OF THE ARGUMENTS IN THE COMBUF
*,*      POINTED AT BY R7 MAY BE FOUND IN THE DATA BASE TECH. MANUAL.
*,*      REGISTERS SETUP HERE FOR ALL LATER PROCESSING ROUTINES ARE:
*,*               R1                THE VALUE 2 FOR INDEXING
*,*               R2                THE GFC BEING PROCESSED
*,*               R3(SYMINDX)       USUALLY THE SYMBIONT INDEX FROM
*,*                                 COMBUF BYTE 1.
*,*               R5                USUALLY THE DCT INDEX OF THE DEVICE
*,*                                 AFFECTED BY THE GFC.
*,*               R7                POINTS AT THE COMBUF(WORD ADR).
*,*               R9                RB:FLAG,R5  THE RBT FLAG WORD.
*,*
GFCSTRT  B        CTR1         00   NOP - RELEASE BUFFER ONLY
         B        AIF          01   ADD INPUT FILE
         B        AIFJE        02   ADD INPUT FILE (JOBENT)
         B        AIFNC        03   ADD INPUT FILE (NON-CONTROL)
         B        AOFL         04   ADD OUTPUT FILE (LAST)
         B        AOF          05   ADD OUTPUT FILE FROM BATCH
         B        AOFNB        06   ADD OUTPUT FILE NON-BATCH
         B        AOFP         07   ADD PARTIAL OUTPUT FILE
         B        GOF          08   GET OUTPUT FILE
         B        GIFNC        09   GET INPUT FILE (NON-CONTROL)
         B        MBSCALL  0A  10   MULTI-BATCH SCHEDULE
         B        KPRIO    0B  11   PRIO KEYIN
         B        KDEL     0C  12   DELETE KEYIN
         B        KFORM    0D  13   KEYIN SYYNDD,F'FORM'
         B        KDISP    0E  14   DISPLAY KEYIN
         B        JESTAT   0F  15   JOBENT STATUS REQUEST
         B        JEDEL    10  16   JOBENT DELETE REQUEST
         B        KSWIT    11  17   RBSWITCH KEYIN
         B        KCOM     12  18   RBCOM KEYIN(SEND A COMMAND REMOTE)
         B        KSEND    13  19   RBSEND KEYIN
         B        KBCST    14  20   RBBDCST KEYIN
         B        RB%DU    15  21   RBT DIAL UP
         B        RB%LRR   16  22   RBT LOGON RECORD RECIEVED
         B        RB%HU    17  23   RBT HANG UP
         B        RB%OCM   18  24   OC MSG REMOTELY
         B        RCVRY    19  25   RECOVER REQUEST
         B        RCVRY1   1A  26   RECOVERY OCCURED HERE
         B        KFFRM    1B  27   SET FILE FORMS
         B        KOSTOP   1C  28   OUTPUT STOP,YYNDD KEYIN
         B        RBBSPCL  1D  29   RBBAT SPECIAL INTERNAL CODES(MAGIC)
         B        KFLUSH   1E  30   FLUSH YYNDD,ID  KEYIN
SAVBFGFC EQU      %-GFCSTRT         * THIS ONE IS LIKE NOPGFC BUT
         B        CTR4              * SAVE BUFFER DON'T FREE IT.
#GFC     EQU      %-1-GFCSTRT
********************************************
CTR3     EQU      %
         LW,R1    S:CUN
         LI,R11   X'7FFFF'
         STW,R11  U:MISC,R1         SLEEP FOREVER
         WD,0     X'37'             CHECK TO SEE IF THERE
         LI,R1    X'FF'             ARE STILL NO ACTIVE COMBUFS
         CW,R1    SGCHD             IF NOT REG TO SLEEP
         BANZ     CTR2
         LI,R6    E:SL
         LI,R11   CTR2
         B        T:REG
*********************************************
*****************************************
*
*
*F*      NAME:    RB%DU
*F*
*F*      PURPOSE: PROCESS RBBAT COMBUF WITH GFC = DUP - REMOTE LINE CONNECTED
*F*
*F*      DESCRIPTION:
*F*               THE OPERATOR IS INFORMED THAT THE LINE IS CONNECTED.
*F*               IF THE LINE HAS A WSN FROM SYSGEN (DCBIT) OR RBLOG KEYIN
*F*               (ALBIT) RB%LRR IS ENTERED AS THOUGH AN RBID COMMAND HAD
*F*               BEEN RECIEVED WITH THE WSN IN RBD:WSN ON IT.  IF THE LINE
*F*               DOESN'T ALREADY HAVE A WSN THE SALUTE MESSAGE IS SENT
*F*               TO THE HANDLER VIA NEWQ (TEL%RBT) WITH A FUNCTION CODE
*F*               OF READ-LOGON-RECORD.  DSCIO ACTUALLY SENDS THE SALUTATION
*F*               TO 7670 TERMINALS, WHILE HASPIO AND 2780IO DO NOT.  EACH
*F*               OF THE HANDLERS THEN READS THE LOGON (USUALLY RBID) RECORD
*F*               INTO THE SAME MPOOL THAT HELD THE SALUTATION AND RETURNS
*F*               IT TO RBBAT WITH GFC = LORR.  WHEN RB%DU EXITS IT CLEARS
*F*               CTRBIT ALLOWING RBSSS TO RESUME PROCESSING ON THE LINE
*F*               WHICH WAS HALTED UNTIL RB%DU COULD RUN. RB%DU (EVEN ON THE
*F*               PATH THROUGH RB%LRR EVENTUALLY EXITS TO CTR1 TO RELEASE
*F*               THE COMBUF AND PROCEED TO THE NEXT.
*F*
*
*
RB%DU    EQU      %                 TERMINAL DIAL UP
         LI,R4    DUMES             INFORM OPERATOR OF DIAL UP
         BAL,R8   TEL%OPR1          AND SALUTE RBT.
*
*
*O*      MESSAGE: *RBNDD CONNECTED
*O*
*O*      MEANING: THE DATA SET CONNECTED TO CONTROLLER RBNDD IS NOW
*O*               READY FOR DATA TRANSMISSION
*O*
*O*      ACTION:  NONE - INFORMATION ONLY
*O*
*
*
         CW,R9    AL%DCBIT
         BANZ     AUTO%LOG
         CW,R9    BSCBTS            IF ITS A 7670
         BANZ     RBDU1             WE NEED TO SET UP MAX
         LI,R4    15                RETRIES FOR ERR MAX
         STW,R4   RB:BUF,R5         BEFORE LOGON
RBDU1    EQU      %
         LI,R4    SALUTE
         BAL,R8   TEL%RBT
         AI,R9    -CTRBIT
         B        CTR1
AUTO%LOG EQU      %
         LI,R10   LRR2
         STW,R9   FLAGS
         LW,R6    R5
         SLS,R6   1
         AI,R6    RBD:WSN
A%L1     EQU      %
         LI,R1    7
         LI,R14   ' '
         CB,R14   *R6,R1
         BNE      %+2
         BDR,R1   %-2
         AI,R1    1
         SLS,R6   2
         AW,R6    R1
         B        PID0
*
*
*F*      NAME:    AIFJE
*F*
*F*      PURPOSE: PROCESS RBBAT COMBUF WITH GFC = AIFJE - ADD CONTROL INPUT
*F*               FILE FROM JOBENT
*F*
*F*      DESCRIPTION:
*F*               AIFJE SETS UP THE STANDARD LOCAL DCT INDEX, PICKS UP THE
*F*               SYSID FROM THE COMBUF, AND SETS THE JOBENT SUBMITTED
*F*               BIT WHERE IT WILL EVENTUALLY WIND UP IN BW:SDA.  IT
*F*               THEN ENTERS AIF, SKIPPING THE CALCULATION OF THE SYSID
*F*
*
*
*************************************
AIFJE    EQU      %                 ADD INPUT FILE (JOBENT)
         LI,R5    LCLX              SET DCT NON-REMOTE AND
         LW,R12   2,R7              COLLECT SYSID AND TYPE
         LW,R11   JEBIT
         STS,R11  1,R7
         B        %+2               FROM JOBENT.
*
*
*F*      NAME:    AIF
*F*
*F*      PURPOSE: PROCESS RBBAT COMBUF WITH GFC = AIF - ADD CONTROL INPUT
*F*               FILE FROM SYMBIONT DEVICE
*F*
*F*      DESCRIPTION:
*F*               AIF GETS A SYSID FOR THE NEW JOB AND SAVES IT IN CURSID
*F*               FOR  DOJOB AND RSID FOR RBBATR.  IT THEN GETS AN INPUT
*F*               BATCH QUEUE SLOT AND STORES THE DISC ADDRESS FROM THE
*F*               COMBUF INTO ITS BW:SDA.  IF THE FIN BIT IS SET IN THE
*F*               D.A., FINFLG IS SET FOR RBCCOUT. THE BATCH QUEUE SLOT
*F*               INDEX IS SAVED IN ADDX FOR EASY REFERENCE DOWN THE
*F*               AIF PATH.  IF WE ARE RECOVERING AND PAST THE POINT OF
*F*               THE RECOVERY, RBBATR IS CALLED TO DELETE THE PARTIAL FILE
*F*               AND TELL THE OPERATOR.  IF THIS IS A PARTIAL FILE FROM
*F*               A DISCONNECTED RBT IT IS DELETED.  A 256 WORD BUFFER IS
*F*               OBTAINED, THE FIRST SECTOR OF THE JOB FILE IS READ INTO
*F*               IT, AND REGISTERS ARE SET UP FOR THE SCAN OF THE RECORDS.
*F*               IF THE FILE CAME IN FROM AN RBT AIF EXITS TO RB%CCS
*F*               TO PROCESS ANY RB CONTROL COMMANDS THAT MAY BE IN THE
*F*               FRONT OF THE JOB AND CONTINUE JOB PROCESSING.  FOR LOCAL
*F*               FILES THE FIRST RECORD IS CHECKED FOR !JOB AND IF IT IS
*F*               NOT THE MISSING JOB COMMAND MESSAGE IS PRINTED AND THE FILE
*F*               IS DELETED.  IF THE JOB COMMAND IS THERE, AIF EXITS TO DOJOB
*F*               TO CONTINUE PROCESSING THE JOB.
*F*
*
*
AIF      EQU      %                 ADD INPUT FILE
         BAL,R11  NXTSID            GET NEXT SYSID (TYPE=0)
         STW,R12  CURSID            GET A QUEUE ENTRY AND PUT
         STH,R12  RSID
AIFX     EQU      %
         LI,R3    FREI              THE DISC ADDRESS AWAY.  IF
         LH,R2    BH:HPRI,R3        Y8 IS SET IN DA SET FINFLG.
         LI,R10   AIF1
GDA      EQU      %
         WD,0     X'37'
         LW,R15   1,R7              IF THIS FILE ADDED BY RECOVERY
         BGEZ     %+3               DELETE IT AND TELL THE OPERATOR
         MTW,1    FINFLG            IF FROM AN RBT THAT HAS HUNG UP
         SW,R15   Y8                DELETE IT.  OTHERWISE GET A BUFFER
         STW,R15  BW:SDA,R2         AND READ THE FIRST SECTOR
         LI,R6    0                 FROM THE RAD.  IF DCTX IS REMOTE
         STW,R6   1,R7              GO TO RB%CCS. IF NOT CHECK FOR
         WD,0     X'27'
         B        *R10
AIF1     EQU      %
         STW,R2   ADDX              JOB CARD.  IF NOT ONE TELL
         LB,R6    RCVRFLG           OPERATOR AND DELETE IT
         BNEZ     RCVRABRT          IF SO GO TO DOJOB
         CLM,R5   RBLIMS
         BCS,9    AIF2
         LB,R6    RBB:ID,R5
         BEZ      DELJOB
AIF2     EQU      %
         LW,R6    SECT
         BNEZ     %+3
         BAL,R6   GET256
         STW,R7   SECT
         BAL,R4   RESET
         CLM,R5   RBLIMS
         BCR,9    RB%CCS
         LI,R5    LCLX
         LI,R3    NO%JOB
CKJB     EQU      %                 ------------------------------
         CW,R14   TJOB              CHECK FOR JOB CARD AND RETURN
         BNE      *R3               IF NOT PRESENT.  OTHERWISE GO
         LB,R1    R15               TO DOJOB.
         CI,R1    X'40'
         BNE      *R3
         B        DOJOB
**************************************************
*
*
*F*      NAME:    AIFNC
*F*
*F*      PURPOSE: PROCESS RBBAT COMBUF WITH GFC = AIFNC - ADD NON-CONTROL
*F*               INPUT FILE
*F*
*F*      DESCRIPTION:
*F*               IF WE ARE RECOVERING, PAST THE POINT OF RECOVERY, AND
*F*               THIS IS NOT A REMOTE PROCESSING INPUT FILE TO BE DIRECT
*F*               PASSED TO AN OUTPUT DEVICE, THE FILE IS DELETED JUST AS
*F*               THOUGH IT WERE A JOB.  IF WE ARE NOT RECOVERING THE FORM
*F*               NAME AND THE DEVICE TYPE ARE OBTAINED, THE FORM NAME IS
*F*               CLEARED FROM STW:FORM, AND, FOR LOCAL FILES, CONTROL IS
*F*               TRANSFERRED TO AIFNC1.  IF IT IS A REMOTE PROCESSING FILE
*F*               THE FORMS LOCK BIT IN STH:FLG (USED TO PASS FORMS BETWEEN
*F*               CP-V SYSTEMS) IS CHECKED AND, IF SET, THE FORM NAME IN
*F*               STW:FORM IS REESTABLISHED.  IF THE FILE IS TO BE DIRECT
*F*               PASSED TO AN OUTPUT DEVICE, CONTROL IS TRANSFERRED TO RB%DPD.
*F*               OTHERWISE THE DEVICE TYPE IS ANDED WITH THE DEVICE SELECTOR
*F*               MASK TO PRODUCE THE INTERNAL DEVICE TYPE AND WE GO TO
*F*               AIFNC1.  IF WE RECIEVED THIS FILE AS A PARTIAL FILE FROM
*F*               A NOW DISCONNECTED RBT IT WILL BE DELETED.
*F*
*
*
AIFNC    EQU      %
         LB,R4    RCVRFLG
         BEZ      %+3
         LB,R4    STB:DPD,R3
         BEZ      AIFX
         LB,R4    STB:TYP,R3
         LI,R13   0
         XW,R13   STW:FORM,R3
         LI,R6    0
         LI,R14   NCIPRI
         CLM,R5   RBLIMS
         BCS,9    AIFNC1
         LI,R15   FLKBIT
         CH,R15   STH:FLG,R3
         BAZ      %+2
         STW,R13  STW:FORM,R3
         LB,R15   STB:DPD,R3
         BNEZ     RB%DPD
         LB,R10   RBB:DSM,R5
         AND,R4   R10
         LB,R6    RBB:ID,R5
         BNEZ     %+2
         LI,R14   DELPRI
*
*
*F*      NAME:    AIFNC1
*F*
*F*      PURPOSE: ADD A NON-CONTROL INPUT FILE TO THE BATCH QUEUE
*F*
*F*      DESCRIPTION:
*F*               AN OUTPUT BATCH QUEUE SLOT (WHICH NON-CONTROL INPUT USES)
*F*               IS OBTAINED AND (USUALLY) CHAINED TO THE NON-CONTROL INPUT
*F*               PRIORITY CHAIN.  A SYSID IS GOTTEN, AND IT AND THE INFORMATION
*F*               FROM THE COMBUF ARE MOVED INTO THE BATCH QUEUE TABLES.
*F*               AN APPROPRIATE MESSAGE IS CONSTRUCTED AND SENT TO THE
*F*               OPERATOR TO TELL HIM THE FILE HAS BEEN RECIEVED.  FOR
*F*               LOCAL FILES AIFNC1 NOW EXITS TO CTR1 TO RELEASE THE COMBUF
*F*               AND PROCESS THE NEXT.  FOR RP FILES A MESSAGE IS PUT IN
*F*               THE MESSAGE FILE TO TELL THE REMOTE OPERATOR THAT THE
*F*               FILE HAS BEEN RECIEVED AND AIFNC1 EXITS VIA RBCCOUT TO
*F*               COMPLETE RP FILE PROCESSING.
*F*
*
*
AIFNC1   EQU      %
         BAL,R8   ADDFRE
         AI,R13   0
         BNEZ     %+2
         LW,R13   2,R7
         STW,R13  BW:FORM,R2
         STB,R4   BB:DEV,R2
         STB,R6   BB:RID,R2
         LW,R10   3,R7
         STH,R10  BH:GRAN,R2
         LI,R10   1
         STB,R10  BB:COPY,R2
         BAL,R10  GDA
         BAL,R11  NXTSID
         STH,R12  BH:SID,R2
         LW,R15   R12
         BAL,R11  HEXC
         LD,R14   INPPTR
         MBS,R14  0
         STW,R13  INAM1
         LI,R14   BA(INAM1)
         AW,R15   Y04
         MBS,R14  0
         BAL,R4   COMEDIT
         CLM,R5   RBLIMS
         BCR,9    AIFNCRB
         LI,R14   DA(DCT16)
         AW,R14   R5
         SLS,R14  3
         AI,R14   3
         AW,R15   Y05
         MBS,R14  0
         LI,R8    CTR1
*
*
*O*      MESSAGE: *INPUT SYSID,YYNDD(,NAME)
*O*
*O*      MEANING: A NON-CONTROL INPUT FILE HAS BEEN ENTERED FROM DEVICE
*O*               YYNDD, AND HAS BEEN ASSIGNED THE GIVEN SYSID. IF THE
*O*               NAME IS PRESENT IT IS THAT FROM THE !!NCTL COMMAND OR
*O*               SYYNDD,F'XXXX' KEYIN.
*O*
*O*      ACTION:  NONE - INFORMATION ONLY
*O*
*
*
TEL%OPNC EQU      %
         CI,R1    DELPRI
         BE       AIFOUT
         LW,R13   BW:FORM,R2
         BEZ      TEL%OPJ
         BAL,R4   COMEDIT
         STW,R13  INAM3
         LI,R14   BA(INAM3)
         AW,R15   Y04
         MBS,R14  0
         STW,R13  INAM3
         B        TEL%OPJ
AIFNCRB  EQU      %
         LW,R3    TZEROS
         STW,R3   INAM3
         LW,R3    SYMINDX
         LH,R12   STH:NM,R3
         STH,R12  INAM2
         SCS,R12  -8
         BAL,R4   EDIT
         SCS,R12  8
         BAL,R4   EDIT
         BAL,R8   TEL%OPNC
*
*
*O*      MESSAGE: *RBNDD - WSN ** *INPUT SYSID,DEV(,NAME)
*O*
*O*      MEANING: A NON-CONTROL INPUT FILE HAS BEEN ACCEPTED FROM DEVICE
*O*               DEV AT WORKSTATION WSN CONNECTED TO RBNDD AND HAS BEEN
*O*               ASSIGNED THE GIVEN SYSID.  THE NAME, IF PRESENT, IS THAT
*O*               FROM THE !!NCTL COMMAND OR THE RBFORM CONTROL COMMAND
*O*
*O*      ACTION:  NONE - INFORMATION ONLY
*O*
*
*
         LW,R3    SYMINDX
         LB,R12   STB:DPD,R3
         BNEZ     AIFNCRB1
         BAL,R4   SETHDR
         NOP
         LI,R1    INAM
         BAL,R11  MOVEMES
AIFNCRB1 EQU      %
         STW,R9   FLAGS
         LI,R4    AIFOUT
         B        RBCCOUT
*
*
*F*      NAME:    RB%DPD
*F*
*F*      PURPOSE: CONVERTS NON-CONTROL INPUT FILES FROM REMOTE PROCESSING
*F*               TERMINALS INTO OUTPUT FILES FOR LOCAL DEVICES
*F*
*F*      DESCRIPTION:
*F*               RB%DPD IS CALLED WHENEVER A NON-CONTROL INPUT FILE IS
*F*               RECIEVED FROM A STREAM THAT HAS A NON-ZERO STB:DPD.
*F*               IN THESE CASES, STB:DPD CONTAINS THE LOCAL DEVICE TYPE
*F*               THE FILE IS TO BE OUTPUT ON.  IF THE SUBMITTING TERMINAL
*F*               IS NO LONGER CONNECTED AND THE DEVICE WAS OPERATING IN
*F*               KEEP MODE, THE FILE IS DELETED. IF THE TARGET DEVICE
*F*               IS A LISTING DEVICE OR CARD PUNCH, A DISC BLOCK IS WRITTEN
*F*               CONTAINING A SYMBIONT BANNER RECORD AND FLINKED TO THE
*F*               ORIGONAL STARTING DISC ADDRESS OF THE FILE.  A SPECIAL
*F*               FUNCTION CODE PREVENTS THIS BLOCK FROM CAUSING BLINK
*F*               FAILURES.  RBB:MXP IS USED AS THE OUTPUT PRIORITY,
*F*               AND RB%DPD CALLS AIFNC1 SPECIFING THIS PRIORITY INSTEAD
*F*               OF THE NON-CONTROL INPUT PRIORITY.
*F*
*
*
RB%DPD   EQU      %
         LB,R6    RBB:ID,R5
         BNEZ     %+3
         LC       SYMX,R3
         BCS,1    AIFNC1-1
         LB,R4    STB:DPD,R3
         BAL,R8   STSM1
         LW,R3    SYMINDX
         LC       TB:FLGS,R4
         BCS,4    %+3
         CI,R4    5
         BNE      RBDPD1
         LI,R10   RBDPD1
         LCI      0
         PSM,R0   TMPSTK
         LH,R2    STH:NM,R3
         STH,R2   RMTBAN1
         LD,R14   RBD:WSN,R5
         STW,R14  RMTBAN2
         STW,R15  RMTBAN2+1
         LI,R5    LCLX
         BAL,R4   BANNER
         LI,R2    BA(RMTBAN)
         AW,R3    RMTBPTR
         MBS,R2   0
         LW,R3    SYMINDX
         LB,R4    STB:DPD,R3
NEWBAN   EQU      %
         LW,R6    RB:MFAD,R5
         LI,R14   0
         STW,R14  255,R6
         LW,R14   1,R6
         CI,R4    5
         BNE      NWBAN1
         LW,R14   PUNBAN
         AI,R7    -39
         LW,R10   KOMP
         BEZ      NWBAN1
         AI,R14   -1
         LI,R10   -X'3000'
         AWM,R10  2,R6
         AI,R7    -2
         LI,R10   0
         STB,R10  0,R7
         AI,R7    -19
         LI,R10   X'D2'
         STB,R10  0,R7
         AI,R7    21
NWBAN1   EQU      %
         AI,R14   X'200'
         STW,R14  1,R6
         BAL,R10  GGRAN
         LW,R3    SVCBF
         XW,R8    1,R3
         LW,R9    1,R3
         BAL,R10  WMFS
         BAL,R8   RELMF
         LCI      0
         PLM,R0   TMPSTK
         B        *R10
RBDPD1   EQU      %
         LB,R14   RBB:MXP,R5
         AI,R14   0OPRI
         LI,R6    0
         B        AIFNC1
*
*
*F*      NAME:    PRTBAN
*F*
*F*      PURPOSE: APPENDS BANNERS TO PARTIAL OUTPUT FILES WHERE REQUIRED
*F*
*F*      DESCRIPTION:
*F*               WHEN A PARTIAL OUTPUT FILE IS RETURNED FROM OUTSYM,
*F*               PRTBAN WRITES A DISC BLOCK WITH A BANNER FLINKED TO THE
*F*               NEW STARTING D.A. OF THE FILE IF IT IS BOUND FOR A CARD
*F*               PUNCH OR LISTING DEVICE.  A SPECIAL FUNCTION CODE PREVENTS
*F*               BLINK FAILURES.  HASP COMPRESSION IS DONE IF NECESSARY
*F*
*
*
PRTBAN   EQU      %
         LI,R9    X'F'
         AND,R9   R5
         LB,R11   SYMX,R2
         CI,R9    5
         BE       PBN1
         CI,R11   X'40'
         BAZ      *R10
PBN1     EQU      %
         CI,R11   8                 HASP
         BAZ      %+2
         STW,R11  KOMP
         LCI      0
         PSM,0    TMPSTK
         BAL,R11  HEXC
         STW,R13  PBNM1
         LI,R1    PBNM2
         BAL,R8   TIMIN
         LI,R5    LCLX
         BAL,R4   BANNER
         LI,R2    BA(PBNM)
         AW,R3    PBNPTR
         MBS,R2   0
         LW,R4    R9
         B        NEWBAN
***************************************************
*
*
*F*      NAME:    GIFNC
*F*
*F*      PURPOSE: PROCESS RBBAT COMBUF WITH GFC = GIFNC - GET NON-CONTROL
*F*               INPUT FILE
*F*
*F*      DESCRIPTION:
*F*               PRIORITY CHAINS ARE SEARCHED FOR A FILE WHICH
*F*                 MATCHES THE CRITERIA PASSED IN THE COMBUF.
*F*               BASIC GIFNC (NCTL FILES) SAYS SEARCH NCIPRI CHAIN
*F*                 FOR MATCHING FORM,RBID,DEVTYPE.
*F*               OLD-STYLE SPILL SAYS SECRCH SPECIFIED CHAINS FOR
*F*                 MATCHING DEVTYPE.
*F*               NEW SPILL SAYS SEARCH SPECIFIED CHAINS FOR MATCHING
*F*                 (FORM),(SYSID),(RBID),(DEVTYPE).
*F*               IF THIS IS A TWO-BUFFER CALL, ALL FILE CHARACTER-
*F*                 ISTICS ARE PLACED IN THE COMBUFS FOR RETURN TO
*F*                 THE CALLER.
*F*               FILE FIRST DISK ADDRESS IS PLACED IN TH COMBUF VIA
*F*                 JEX, WHICH AWAKENS THE CALLER AND EXITS TO CTR4,
*F*                 PRESERVING THE BUFFER FOR CALLER INSPECTION.
*F*
GIFNC    EQU      %
         LW,R12   R5                R12= DEVTYPE
         LI,R1    4
         LB,R5    *R7,R1            R5 = USER#.
         LI,R1    7
         LB,R13   *R7,R1            R13= RBID
         LW,R14   2,R7              R14= FORM.
         BEZ      GINC1             ---> CAN'T BE SPECIAL DSP KEY.
         CW,R14   S:DSPKEY
         BNE      GINC1             ---> ISN'T SPECIAL DSP KEY.
         REF      S:DSPKEY          * =0 OR =MAGIC FORM FOR DISPLAY.
*                                   *****  DISPLAY FUNCTION  *****
         LCI      0                 * ALL REGISTERS ARE SAVED.
         PSM,R0   TMPSTK            * ..SAVEM THE REGS..
         MTW,+1   MSFLG             * SET MSG IN PROGRESS
         LI,R12   0                 * RESET DEV
         LI,R5    LCLX              * SET FUNCTION LOCAL.
         B        GINCD             * GO BUILD A DISPLAY.
*
GINCD1   EQU      %                 * BACK WITH A DISPLAY BUILT
         LI,R5    LCLX              * POINT AT LOCAL FUNCTION
         LW,R15   RB:MFAD,R5        * FETCH MS FIL POINTER
         BEZ      %+2               * NONE THERE
         BAL,R8   WMF               * ELSE WRITE IT
         LCI      0                 * RESTORE
         PLM,R0   TMPSTK            * .. THE REGS.
*
GINC1    EQU      %
         LI,R1    5
         LB,R8    *R7,R1            R8 = LOW PRIORITY TO SEARCH.
         LI,R1    6
         LB,R1    *R7,R1            R1 = HIGH PRIORITY TO SEARCH.
         CI,R1    FREI
         BL       %+2
         LI,R1    FREI-1              (FREE SLOTS AREN'T FILES)
*
         BAL,R0   FIND              * LOOK FOR FILES.
         B        JEX1              *--> NO MORE; RETURN ZERO.
         CW,R1    R8                *
         BL       JEX1              *--> NO MORE IN RANGE; RETURN 0.
         CI,R1    RUNPRI
         BE       FIND1             *--> NEVER GIVE A RUNNING JOB.
         INT,R15  3,R7              R15= SYSID CRITERION.
         BCR,8    GINC2
         CB,R13   BB:RID,R2         * RBID SPECIFIED AS CRITERION.
         BNE      FIND1             *
         INT,R15  3,R7              *
GINC2    BCR,4    GINC3             *
         CW,R14   BW:FORM,R2        * FORM SPECIFIED AS CRITERION.
         BNE      FIND1
         INT,R15  3,R7
GINC3    BCR,2    GINC4             *
         CH,R15   BH:SID,R2         * SYSID SPECIFIED AS CRITERION.
         BNE      FIND1             *
         INT,R15  3,R7              *
GINC4    BCR,1    GINC5             *
         CB,R12   BB:DEV,R2         * DEV SPECIFIED AS CRITERION.
         BNE      FIND1             *
GINC5    EQU      %                 *
         CI,R1    RUNPRI            *
         BL       GINCG1            *--> INPUT-TYPE FILE.
         MTH,0    BH:COMID,R2       *    OUTPUT-TYPE FILE.
         BNEZ     FIND1             * NO COMODE SPILL FOR NOW.
         LI,R14   FREO              *
         B        GINCC             * RETURN OUTPUT SLOTS TO FREO.
GINCG1   EQU      %                 *
         MTW,-1   S:BFIS            * INPUT FILE: DECREMENT # JOBS,
         BAL,R8   ABRS#             *     FREE UP SPINDLE SLOTS,
         LI,R14   FREI              * RETURN FILE SLOT TO FREI.
GINCC    EQU      %                 *
         BAL,R8   CHNG              * GIVE FILE AWAY.
         LI,R1    1                 *
         LB,R6    *R7,R1            * IS THIS A 2-BUFFER CALL...
         BEZ      GINCC2            *-->NO.
         MTW,0    RCVRFLG           * MUST RETURN FILE INFO TO CALLER
         BEZ      %+3               * IF IT'S A TWO-BUFFER CALL.
         AW,R6    RCVRBUF           * FIRST COMPUTE ADDRESS OF
         B        %+2               * SECOND BUFFER.
         AI,R6    SGCBUF            *
*
         LH,R8    BH:SID,R2
         LB,R9    BB:COPY,R2
         STH,R9   R8
         LB,R9    BB:RID,R2
         STB,R9   R8
         STW,R8   2,R7              B1W3= RBID,COPIES,SYSID.
         LH,R9    BH:GRAN,R2
         STB,R1   R9
         STW,R9   3,R7              B1W4= PRIO,,#GRANULES.
         LB,R8    BB:DEV,R2
         LI,R3    2
         STB,R8   *R7,R3            B1W1= ,,DEVTYPE,
         LW,R8    BW:FORM,R2
         STW,R8   1,R6              B2W2= FORM
         LI,R9    SAVBFGFC
         AWM,R9   0,R6              ** FIX TO NOT FREE 2ND BUFFER **
GINCC2   EQU      %
         LI,R4    0
         WD,0     X'37'             ***** DISABLE *****
         XW,R4    BW:SDA,R2           GET FDA OF FILE
         B        JEX               ---> ON BACK TO USER.
         PAGE
RBBSPCL  EQU      %                 * HANDLER FOR MAGIC INTERNAL CODES.
*
*
*F*      NAME:    RBBSPCL
*,*
*,*      PURPOSE:  PROCESS RBBAT COMBUF WITH GFC = SPCLGFC  -  SPECIAL
*,*               INTERNAL CODES.
*,*
*,*      DESCRIPTION:
*,*               AN ANALYST (USUALLY ONLINE) HAS REQUESTED A SPECIAL
*,*               RBBAT FUNCTION AND WAS AUTHORIZED TO DO SO.  RBBAT
*,*               WILL THEREFORE DO HIS BIDDING IN THE HOPE HE KNOWS
*,*               WHAT HE IS DOING AND CAN CORRECT WHATEVER PROBLEM
*,*               HE HAPPENS TO BE WORKING ON.
*,*
         LW,R2    R5                * SAVE THE REQUESTED FUNCTION
         LI,R1    4                 * COMBUF BYTE 4 CONTAINS
         LB,R5    *R7,R1            * ...THE USER TO UNPARK WHEN DONE.
         CI,R2    #SPCGFC           * (BUT DID HE KNOW WHAT HE DID)
         BG       SPCER             *  NOPE...BE HARD ON HIM.
         B        %+1,R2            * DOIT FOR HEEM.
SPCGFCST B        SPCER             * A NOP ENTRY.
         B        DMPRSD            * DUMP RBBAT STATIC DATA
         B        RSTRSD            * RESET RBBAT STATIC DATA
         B        SPCER             * DISPLAY RBBAT TABLES(LATER)
         B        SPCER             * SPILL FILES  (LATER)
         B        SPCER             * ETC.  LATER
#SPCGFC  EQU      %-1-SPCGFCST      * NUMBER OF SPECIALS FOR NOW
************************************************************
SPCER    EQU      %                 * RETURN ERROR
         LI,R4    X'0300'           * 'RBBAT SEZ NO DICE'
         B        JEX               *
*********************************************************************
DMPRSD   EQU      %                 * DUMP RBBAT STATIC DATA TO :RBBRVR
         LI,R10   0                 *  NO ERROR AS OF YET
         BAL,R8   SVIV1             * WE'RE LEAVING RBBAT FOR MONITOR
         CAL1,1   OPNXXIO           * CAN WE OPEN M:XX
DMPRSDS  CAL1,1   SETXXDCB          * IS OPEN SO RESET ERR/ABN
         CAL1,1   WRXXSD            * WRITE OUT THE STATIC DATA
         LW,R4    R10               * SET ERR CODE IF ANY FOR JEX
         CAL1,8   GDDL              * GET DYNAMIC LIMITS
         SW,R9    R8                * # OF POSSIBLE WORDS
         SLS,R9   -9                * CONVERT TO PAGES
         SW,R9    R10               * SUBTRACT # AVAILABLE
         SLS,R9   11                * CONVERT TO BYTE COUNT.
         CAL1,1   WRXXDD            * WRITE DYN DATA
DMPRSDC  CAL1,1   CLSXXO            * DONE WITH XX SO CLOSE
         XW,R9    2,R7              * NEED WE QUIESCE SYMB ACTIVITY ?
         BEZ      NOQUI             * NO - JUST DUMP REQUEST.
         AI,R4    0                 * ANY ERROR YET ?
         BNEZ     NOQUI             * YES, CANT QUIESCE THEN.
         MTW,0    S:QUIET           * ALREADY QUIESCIENT ?
         BNEZ     NOQUI
         MTW,-1   S:QUIET           * SET QUIESCIENT FLAG.
         WD,0     X'37'             **********DISABLE**********
         LW,R9    YFFXFF            * MASK FOR HEADS.
         LS,R8    SGCHD             HEAD OF RBBAT QUEUE.
         STW,R8   S:SGCSAV          SAVE HEADS.
         LI,R8    0
         STS,R8   SGCHD
         WD,0     X'27'             **********ENABLE**********
NOQUI    EQU      %
         B        JEX               * UNPARK THAT USER AND DO NEXT
YFFXFF   DATA     X'FF0000FF'       * MASK FOR BYTES 0,3
*********************************************************************
DMPABN   LH,R10   R10               * WAS THAT FILE DOESNT EXIST
         CI,R10   X'0300'           * ...
         BE       NORBBRVR          * IF SO CREATE IT
         STH,R10  R10               * RESTORE
DMPER    LH,R4    R10               * RIGHT JUSTIFY THE ERR CODE
*                                   : TO GIVE IT TO THE USER
         LH,R8    M:XX              * DID WE GET IT OPENED
         CI,R8    X'20'             *...
         BANZ     DMPRSDC           * IF SO CLOSE IT
         B        DMPRSDC+1         *...ELSE EXIT
***********************************************************************
NORBBRVR EQU      %                 * :RBBRVR NOT THERE SO CREATE IT
         LI,R10   0                 * THAT IS NOT AN ERROR
         CAL1,1   OPNXXO            * CREATES
         B        DMPRSDS           *
***********************************************************************
RSTRSD   EQU      %                 * RESET STATIC DATA FROM :RBBRVR.
         MTW,0    S:QUIET           * QUIESCIENT MODE ?
         BGEZ     CTR1              * IF NOT QUIET OR ALREADY IN
         BAL,R8   SVIV1             * PROGRESS, FORGET IT.
         LW,R13   2,R7              * FORMULATE FAKE RCVR BUFF.
         LI,R14   0                 * FOR NOW, NO USER SPECIFIED FLAGS.
         LI,R15   -1                * MAKE SURE FAKE.
         LI,R10   RCVRGFC           * GHOST FUNCTION CODE.
         LW,R12   0,R7              * EVERYTHIN BUT GFC.
         STB,R10  R12               *
         LW,R1    3,R7              * NEED WE EXIT ?
         LCI      4                 *
         STM,R12  0,R7              *
         LW,R6    R7                *
         AI,R6    -SGCBUF           * BYTE.
         LI,R7    X'FF'             *
         WD,0     X'37'             **********DISABLE**********
         STS,R6   SGCHD             * PUT NEWLY FORMED BUFF ON HEAD.
         AI,R1    0                 *
         BEZ      %+2               *
         STW,R6   S:QUIET           * SET FLAG FOR RCVR.
         WD,0     X'27'             **********ENABLE**********
         AI,R1    0
         STW,R11  SVZ               NO NEED FOR ENVIRON ANYMORE.
         BNEZ     %+3               *
         LI,R5    LCLX
         B        CTR4              * CONTINUE NORMAL PROCESSING.
         CAL1,9   1                 * SOMEONE SAID TO HERE.
****************************************************************************
         PAGE
*********************************************
*
*
*F*      NAME:    CHNG
*F*
*F*      PURPOSE: MOVES BATCH QUEUE SLOT FROM ONE PRIORITY CHAIN TO ANOTHER
*F*
*F*      DESCRIPTION:
*F*               CHNG FREES THE SLOT FROM ITS PRESENT CHAIN AND CALLS ADDIT
*F*               TO CHAIN IT BACK TO THE NEW CHAIN.  THE INDEX OF THE
*F*               PRECEEDING ENTRY ON THE OLD CHAIN IS SAVED IN PREV SO
*F*               THAT CHNGRSET CAN KEEP LINKING THROUGH THE OLD CHAIN
*F*               AFTER CHNG'ING ONE ENTRY
*F*
*
*
CHNG     EQU      %                 MOVE QUEUE FROM ONE CHAIN TO ANOTHER
         LI,R15   -1                :
         LH,R3    BH:HPRI,R1        FIND THE QUEUE IN R2 IN THE
         CW,R3    R2                CHAIN IN R1 AND REMOVE IT.
         BNE      CHNG1             SAVE THE PREVIOUS ENTRY IN THE CHAIN
CHNG3    EQU      %                 SO THAT CHNGRSET CAN CONTINUE
         LH,R3    BH:LINK,R2        A SEARCH.  PUT THE NEW CHAIN IN R1
         STH,R3   BH:HPRI,R1        FROM R14 AND THE OLD IN R14
CHNG2    EQU      %
         BNEZ     %+2
         STH,R3   BH:TPRI,R1
         XW,R1    R14
         STW,R3   PREV
         B        ADDIT
         LW,R3    R15
CHNG1    EQU      %
         LH,R15   BH:LINK,R3
         CW,R15   R2
         BNE      CHNG1-1
         LH,R15   BH:LINK,R2
         STH,R15  BH:LINK,R3
         B        CHNG2
*
*
*F*      NAME:    ADDFRE
*F*
*F*      PURPOSE: CHAINS A FREE OUTPUT BATCH QUEUE SLOT TO THE CALLER
*F*               SPECIFIED PRIORITY CHAIN
*F*
*
*
ADDFRE   EQU      %                 ---------------------------------
         LI,R1    FREO              GET A FREE OUTPUT ENTRY AND ADD IT
         LH,R2    BH:HPRI,R1        TO THE CHAIN IN R1. PUT ENTX IN R2
         B        CHNG3             :
*
*
*F*      NAME:    ADDJOB
*F*
*F*      PURPOSE: CHAINS THE HEAD OF THE FREE INPUT SLOT CHAIN (KEPT IN
*F*               ADDX FOR NEW BATCH JOBS) TO THE CALLER SPECIFIED PRIORITY
*F*               CHAIN
*F*
*
*
ADDJOB   EQU      %                 ----------------------------------
         LI,R1    FREI              GET THE CURRENT FREE INPUT ENTRY
         LW,R2    ADDX              AND ADD IT TO THE CHAIN IN R1
         B        CHNG3             PUT ENTX IN R2.
***********************************************
GOF      EQU      %                 GET OUTPUT FILE
         LB,R5    SNDDX,R3
         BE       GDEL              FIND THE HIGHEST PRIORITY OUTPUT
         LI,R12   -1
         STW,R12  FRMCK
         LW,R12   STW:FORM,R3
         LI,R13   0                 FILE THAT CAN BE OUTPUT ON THE
         LB,R14   STB:TYP,R3
         LH,R15   STH:CMDV,R3       COMODE ID FOR THIS DEVICE
         BGEZ     %+3               B IF CURRENTLY IN COMODE
         LI,R15   0
         STH,R15  STH:CMDV,R3       RESET TO 0 IN CASE NEGATIVE
         LI,R1    MFPRI             ZERO AS THE DISC ADDRESS. WHEN THE
         CLM,R5   RBLIMS            ENTRY HAS BEEN SET UP RESTART THE
         BCS,9    GOF4              SYMBIONT VIA SAQNSERT AND DON'T
         LB,R13   RBB:ID,R5         RELEASE THE COMBUF.  IF THE DEVICE
         LB,R0    RBB:DSM,R5
         AND,R14  R0
GOF4     EQU      %
         BAL,R0   FIND              IS REMOTE ONLY NON HELD FILES
         B        GOF1              OF THE CURRENT DEVICE TYPE ARE
         CI,R1    0OPRI
         BLE      GOF1              FOR A REMOTE DEVICE, CLEAR THE
         CB,R14   BB:DEV,R2         APPROPRIATE FLAGS IN RB:FLAG
         BNE      FIND1             IF THE DCTX IS ZERO THIS IS THE
         CB,R13   BB:RID,R2         DELETE SYMBIONT.  IF A REMOTE
         BNE      FIND1             MESSAGE FILE IS SELECTED DECREMENT
         LW,R10   BW:SDA,R2         THE MESSAGE FILE COUNT AND IF ZERO
         BAZ      %+3               CLEAR PENDING BIT
         CW,R10   XHOLDBIT          :
         BANZ     FIND1             THE INFO RETURNED TO THE SYMBIONT IS:
         LH,R11   BH:COMID,R2       COMODE ID FOR THIS FILE
         AND,R11  X7FFF             KNOCK OF LAST CHUNK FLG, IF SET
         CW,R11   R15               SAME COMID AS THIS DEVICE?
         BE       COMIDOK           YEP
         AI,R15   0                 DEV. IN COMODE AT ALL?
         BNEZ     FIND1             YEP: WE CANT OUTPUT THIS FILE
         LB,R6    SNDDX             NOPE: does another dev. have
         AI,R6    -2
         CH,R11   STH:CMDV,R6       THIS FILE'S COMID? IF SO DONT
         BE       FIND1             OUTPUT THIS FILE NOW
         BDR,R6   %-2               IF NOT, PUT DEV. INTO COMODE
*                                   ON THIS FILE'S COMID
COMIDOK  EQU      %
         CW,R12   BW:FORM,R2
         BE       GOFGOT
GOFF     EQU      %
         MTW,1    FRMCK
         BNEZ     FIND1
         LW,R11   BW:FORM,R2
         STW,R11  FRMNM
         B        FIND1
GOFGOT   EQU      %
         CI,R14   OCPTYP
         BNE      GOFGOTIT
         LI,R11   BW:FOVL
         BEZ      GOFGOTIT
         LW,R11   BW:FOVL,R2
         CW,R11   STW:FOV,R3
         BNE      GOFF
         LB,R11   BB:JDE,R2
         CB,R11   STB:JDE,R3
         BNE      GOFF
GOFGOTIT EQU      %
         LI,R3    0
         CW,R10   SWITBIT
         BAZ      GOFGO
         LW,R8    SWTINIT
         BNEZ     FIND1
         LW,R8    S:STLC
         BLZ      FIND1
         LCI      2
         PSM,R1   TMPSTK
         BAL,R11  SVIV
         LW,R11   RCVRFLG
         BNEZ     %+2
         BAL,R11  T:STLPP
         STW,R11  SVZ
         LCI      2
         PLM,R1   TMPSTK
         AI,R3    0
         BLEZ     FIND1
         STW,R3   SWTINIT
         STW,3    SAD
         MTB,7    SAD
         CAL1,8   SAD
         AI,R3    X'100'
         WD,0     X'37'
         LW,R8    SPOOL
         STW,R3   SPOOL
         STW,R8   VP+X'100'
         WD,0     X'27'
         LI,R3    SWTSIZ
         LW,R8    BASESW,R3
         STW,R8   VP,R3
         BDR,R3   %-2
         LW,R8    BASESW
         STW,R8   VP
         LW,R8    SWTINIT
         AI,R8    SWTND
         STW,R8   SWTEND
         AI,R8    BUF-SWTND
         SLS,R8   2
         STW,R8   VP+BUFBA
         CAL1,8   FVP
GOFGSW   EQU      %
         LW,R3    Y8
         LW,R11   HASPBIT
         AND,R11  BW:SDA,R2
         BEZ      %+2
         AW,R3    Y4
GOFGO    EQU      %
         LB,R11   BB:COPY,R2
         STB,R11  R10
         LH,R11   BH:SID,R2
         STH,R13  R11
         AI,R1    -0OPRI
         STB,R1   R11
         AI,R1    0OPRI
         STS,R3   R11
         LH,R15   BH:COMID,R2       GET COMID FOR THIS FILE
         BEZ      GOF2              NOT COMODE OUTPUT
         LW,R3    SYMINDX
         MTH,0    STH:CMDV,R3       START OF NEW COMODE OUTPUT?
         BNEZ     %+2               NOPE
         MTW,1    STARTCOM          LET SYSG KNOW TO PRINT MESSAGE
         STH,R15  STH:CMDV,R3       STORE COMID FOR THIS DEVICE
         LI,R15   0
         STH,R15  BH:COMID,R2       CLEAR OUT COMID (DONE WITH THIS SLOT)
         LH,R15   BH:SID,R2         PICK UP SYSID
         STW,R15  COMODM1           & SAVE IT TEMPORARILY
GOF2     EQU      %
         LI,R14   FREO
         BAL,R8   CHNG
         LH,R8    BH:GRAN,R2
         STW,R8   3,R7
         LW,R8    BW:SDA,R2
         AND,R8   YFF
         WD,0     X'37'
         STW,R8   BW:SDA,R2
GOF3     EQU      %
         STW,R10  1,R7
         WD,0     X'27'
         STW,R11  2,R7
         LW,R3    SYMINDX
         LB,R1    SSIG,R3
         LI,R8    CTR4
         CLM,R5   RBLIMS
         BCS,9    SYSG
         LI,R2    ALGBIT
         CH,R2    STH:FLG,R3
         BAZ      SYSG
         WD,0     X'37'
         LH,R2    STH:FLG,R3
         AND,R2   NALGBT
         STH,R2   STH:FLG,R3
         WD,0     X'27'
         LI,R1    'A'
         B        SYSG
GOF1     EQU      %
         MTW,1    FRMCK
         LW,R10   FRMCK
         BEZ      GOF5
         CLM,R5   RBLIMS
         BCR,9    GOFRFM
         LD,R2    DCT16,R5
         AND,R2   M8
         AW,R2    FRMMX
         STD,R2   FRMM
         LI,R4    FRMM
         BAL,R8   TEL%OP1
*
*
*O*      MESSAGE: *SYYNDD SETUP REQUIRED
*O*
*O*      MEANING: THERE ARE PRESENTLY NO OUTPUT FILES THAT CAN BE
*O*               OUTPUT ON YYNDD WITH THE PRESENT FORM, BUT IF THE
*O*               FORM WERE CHANGED FILES COULD BE OUTPUT.
*O*
*O*      ACTION:  USE THE DISPLAY OUTPUT KEYIN TO DECIDE WHICH FORM TO
*O*               MOUNT AND THE SYYNDD,F'XXXX' KEYIN TO MOUNT IT.
*O*               RESTART THE DEVICE WITH SYYNDD,I
*O*
*
*
GOF6     LW,R3    SYMINDX
         LI,R10   0
GOF5     EQU      %
         LI,R11   0
         CLM,R5   RBLIMS
         BCS,9    GOF3
         LI,R6    GOF3
RSTP     EQU      %
         WD,0     X'37'
         LH,R1    STH:FLG,R3
         AND,R1   NSTALBT
         STH,R1   STH:FLG,R3
         WD,0     X'27'
         B        *R6
GDEL     EQU      %
         LI,R1    DELPRI
         LH,R2    BH:HPRI,R1
         BEZ      GOF6
         LW,R10   BW:SDA,R2
         AND,R10  M24
         AW,R10   Y01
         LI,R11   DELPRI-0OPRI
         SCS,R11  -8
         CI,R2    INFIL
         BG       GOF2              :
         LI,R14   FREI
         B        GOF2+1
GOFRFM   EQU      %
         CI,R9    XP2BIT
         BANZ     XP2FM
         LH,R1    STH:NM,R3
         STH,R1   RFRMM1
         LI,R1    RFRMM
         BAL,R12  ONEMES
         LW,R7    SVCBF
         LW,R3    SYMINDX
         CB,R3    RBB:SMD,R5
         BNE      GOF6
         LW,R11   STW:FORM,R3
         BNEZ     GOF6
         LI,R6    GOF
         B        RSTP
******************************************
*
*
*F*      NAME:    FIND (FIND1)
*F*
*F*      PURPOSE: RUN BATCH QUEUE PRIORITY CHAINS
*F*
*F*      DESCRIPTION:
*F*               WHEN A ROUTINE WISHES TO LOOK AT ONE OR MORE BATCH QUEUE
*F*               PRIORITY CHAINS, IT CALLS FIND SPECIFYING THE STARTING
*F*               PRIORITY.  FIND LINKS THROUGH THE CHAINS UNTIL IT FINDS
*F*               A FILE OF THAT OR LOWER PRIORITY AND RETURNS TO BAL+2.
*F*               IF THE CALLER WISHES TO CONTINUE, HE CALLS FIND1 TO GET
*F*               THE NEXT ENTRY, AND SO FORTH.  WHEN THERE ARE NO MORE
*F*               ENTRIES, FIND OR FIND1 EXITS TO BAL+1.
*F*
*
*
FIND     EQU      %                 GET THE ENTRY BY PRIORITY
         AI,R0    1                 START WITH PRIO IN R1
         LH,R2    BH:HPRI,R1        ENTER A FIND TO GET FIRST ENTRY
         B        %+2               THEN RETURN TO FIND1 FOR NEXT.
FIND1    EQU      %                 RETURNS TO BAL+2 IF ENTRY FOUND,
         LH,R2    BH:LINK,R2        BAL+1 IF OUT OF ENTRIES
         BNEZ     *R0               :
         AI,R1    -1                     BAL,0  FIND
         BGEZ     FIND+1                 B      DONE
DECZ     AI,R0    -1                     IS THIS THE ONE?
         B        *R0                    BNE    FIND1
***************************************************
AOFSET   EQU      %
         LI,R1    FREO
         LH,R3    BH:HPRI,R1
         LI,R1    4
         LB,R1    *R7,R1
         BNEZ     %+2
         LI,R1    1
         STB,R1   BB:COPY,R3
         LI,R10   0
         STW,R10  KOMP
         WD,0     X'37'
         LW,R10   1,R7
         AND,R10  M24
         STW,R10  BW:SDA,R3
         WD,0     X'27'
         LW,R1    3,R7
         BNEZ     %+2
         LI,R1    1
         STH,R1   BH:GRAN,R3
         LI,R1    8
         LB,R14   *R7,R1
         CI,R14   X'80'
         BAZ      AOFSWS
         LW,R1    SWITBIT
         CI,R14   X'40'
         BAZ      %+2
         AW,R1    HASPBIT
         STS,R1   BW:SDA,R3
AOFSWS   EQU      %
         AND,R14  M5
         BNEZ     %+2
         LI,R14   1
         LW,R1    S:SBGC
         BEZ      AOFNPG
         CI,R14   X'F'
         BGE      AOFNPG
         LB,R1    BB:COPY,R3
         LW,R13   3,R7
         MW,R13   R1
         LI,R1    X'E'
         CW,R13   GRNLMS,R1
         BLE      %+3
         BDR,R1   %-2
         LI,R1    1
         LW,R14   R1
         OR,R14   Y8                  PRIO HAS BEEN MODIFIED.
AOFNPG   EQU      %
         AI,R14   0OPRI
         LI,R1    9
         LB,R13   *R7,R1
         STB,R13  BB:RID,R3
         LI,R1    5
         LH,R12   *R7,R1
         AND,R12  M16
         CH,R12   RSID
         BLE      %+2
         STH,R12  RSID
         STH,R12  BH:SID,R3
         STB,R5   BB:DEV,R3
         LW,R6    SYMINDX
         BEZ      AOFNBUF2
         MTW,0    RCVRFLG
         BEZ      AOFNRML           NOT A RECOVERY
         AW,R6    RCVRBUF
         B        AOFRCVR
AOFNBUF2 AI,R6    3ZERO-SGCBUF
AOFNRML  AI,R6    SGCBUF
AOFRCVR  EQU      %
         LW,R5    1,R6
         STW,R5   BW:FORM,R3
         LI,R5    BW:FOVL
         BEZ      AOFS2
         LW,R5    2,R6
         STW,R5   BW:FOVL,R3
         LI,R5    X'7F00'
         AND,R5   0,R6             SCRUB JUNK OFF OF JDE
         SLS,R5   -8
         STB,R5   BB:JDE,R3
AOFS2    EQU      %
         LW,R5    0,R6              GET LNK,COMID(2),JDE,0  8,8,8,8
         CI,R5    X'8000'           CHECK COMODE FLAG (BIT 0 OF JDE)
         BAZ      AOFS3             NOT COMODE
         LI,R1    4                 COPY FIELD IN COMBUF #1 IS...
         LB,R1    *R7,R1            ...REALLY COMID(1).
         STB,R1   R5                PUT IT IN ITS PLACE
         LH,R5    R5                & GET THE WHOLE COMID READY...
         LI,R1    1                 ... BUT FIRST SET COPIES TO 1
         STB,R1   BB:COPY,R3        OR ELSE
         B        %+2
AOFS3    EQU      %
         LI,R5    0                 ZERO COMID = NOT COMODE
         LI,R1    0
         STW,R1   1,R7
         STH,R5   BH:COMID,R3       ...TUCK AWAY THIS FILE'S COMID
         LI,R5    LCLX
         B        *R0
AOFP     EQU      %
         LI,R2    0
         XW,R2    SYMINDX
         INT,R15  2,R7
         BCR,2    %+3
         BCS,8    %+2
         BAL,R10  PRTBAN
         LB,R6    SNDDX,R2
         CLM,R6   RBLIMS
         BCS,9    AOFP1
         LB,R0    RBB:DSM,R6
         AND,R5   R0
AOFP1    EQU      %
         BAL,R0   AOFSET
         LW,R6    STW:FORM,R2
         STW,R6   BW:FORM,R3
         LI,R6    BW:FOVL
         BEZ      AOFP2
         LW,R6    STW:FOV,R2
         STW,R6   BW:FOVL,R3
         LB,R6    STB:JDE,R2
         STB,R6   BB:JDE,R3
AOFP2    EQU      %
         CI,R14   DELPRI
         BE       AOFADD
         LB,R0    RCVRFLG
         BEZ      %+2
         LI,R14   FOPRI
         AI,R12   0
         BNEZ     AOFP3
         LI,R14   DELPRI
         B        AOFADD
AOFP3    EQU      %
         LH,R6    STH:CMDV,R2       WAS DEV. DOING COMODE OUTPUT
         BEZ      AOF1              NOPE: NO HASSLE
         STH,R6   BH:COMID,R3       TAG FILE WITH COMID OF DEVICE
         AND,R6   X7FFF             IN CASE LAST CHUNK FLAG WAS SET
         STH,R6   STH:CMDV,R2       RE-ASSIGN DEVICE THIS COMID
         MTW,1    CHAINHD           FLAG TO CHAIN TO HEAD OF QUEUE
         B        AOF1
AOFL     EQU      %
         BAL,R0   AOFSET
         LI,R11   AOFRR               <DEL INPUTFILE FOR AOFL>
         AI,R10   0                 IS IT FAKE AOFL TO JUST DEL...
         BNEZ     AOF2              --->NO.
         LW,R14   Y8                  YES. SET FLAG FOR SAME.
         B        AOF2
AOF      EQU      %
AOFNB    EQU      %
         BAL,R0   AOFSET
AOF1     LI,R11   AOFADD              <NO DEL INPUT EXCEPT AOFL>
AOF2     LI,R1    FOPRI              SEARCH OUT & RUNNING FILES.
         CI,R14   DELPRI
         BNE      %+2
         LI,R1    RUNPRI             ONLY RUNNERS IF TO DELETE.
AOF3     LI,R10   HALBIT            (STILL HALBIT IF NO RUN FOUND)
         LW,R15   HO%DLBT           (COPY THESE BITS FROM RUNNER)
         LH,R8    BH:COMID,R3       PICK UP COMID OF FILE WE'RE ADDING
         AND,R8   X7FFF             KNOCK OFF 'LAST CHUNK' FLAG
         BAL,R0   FIND
         B        AOFADD
         CI,R1    RUNPRI
         BL       AOFADD
         CH,R12   BH:SID,R2
         BNE      FIND1
         CI,R1    RUNPRI              IS THIS OUTFILE OR INFILE...
         BE       AOF4              --->INFILE. (FOR RUNNING JOB).
         CH,R8    BH:COMID,R2         OUTFILE.  IS IT COMODE...
         BAZ      FIND1             --->NO OR NO MATCH. KEEP LOOKING.
         BNE      FIND1             --->NO MATCH. KEEP LOOKING.
         LW,R14   R1                  YES. GOTTA KEEP PRIO THE SAME.
         OR,R14   Y8                  AND REMEMBER WE DID.
         B        FIND1             --->KEEP LOOKING FOR INFILE.
AOF4     EQU      %
         AI,R14   0                   GOT INFILE ENTRY. DID WE DO
         BLZ      AOF5              --->COMODE PRIO ALREADY...YES.
         CI,R14   DELPRI
         BE       AOF5               D O N T  CHANGE DELETE PRIO.
         LW,R14   R2
         SLS,R14  2
         AI,R14   B4W:RES           GET TRUE RUN PRIO FOR OUTPUT PRIO
         LB,R14   *R14
         AI,R14   0OPRI             MAKE OUTFILE PRIO OUT OF IT
AOF5     EQU      %
         CB,R13   BB:RID,R2
         BNE      *R11
         BAZ      *R11
         LS,R15   BW:SDA,R2
         STS,R15  BW:SDA,R3
         LI,R10   0                 (HOLD BY JOBFILE, NOT BY RBID)
         CW,R15   DELBIT
         BAZ      *R11
         LI,R14   DELPRI
         B        *R11
AOFRR    EQU      %
         STW,R14  PRIO
         LI,R14   FREI
         LW,R15   RRBIT
         CW,R15   BW:SDA,R2
         BAZ      AOFRR1
         LB,R8    RCVRFLG
         BNEZ     AOFRR2
         LI,R14   DELPRI
AOFRR1   EQU      %
         BAL,R8   CHNG
         BAL,R8   ABRS#
AOFRR2   EQU      %
         LW,R14   PRIO
         AND,R14  M8                  CHOP OFF FLAG SIGN BIT.
         BEZ      CTR1              --->EXIT FOR FAKE AOFL FILE.
AOFADD   EQU      %
         BAL,R8   ADDFRE
         CI,R1    DELPRI
         BE       CTR1
         LW,R15   HOLDBIT
         CW,R15   BW:SDA,R2
         BANZ     CTR1
         LI,R8    CTR1
RBCHK    EQU      %
         AI,R13   0
         BEZ      STRTSYM
         BAL,R11  RBFND
         B        %+3
         CW,R10   RB:FLAG,R3
         BAZ      PNDBIT
         LW,R4    R8
         B        HLD
RBFND    EQU      %
         LW,R3    RBLIMS+1
         B        %+2
RBFND1   EQU      %
         AI,R3    -1
         CW,R3    RBLIMS
         BL       *R11
         CB,R13   RBB:ID,R3
         BNE      RBFND1
         B        INC11B
*************************************************
*
*
*F*      NAME:    ADDIT
*F*
*F*      PURPOSE: ADD A LOOSE BATCH QUEUE SLOT (USUALLY FREED BY CHNG) TO
*F*               A PRIORITY CHAIN
*F*
*F*      DESCRIPTION:
*F*               ADDIT CHAINS THE LOOSE ENTRY TO THE TAIL OF THE SPECIFIED
*F*               CHAIN.  IN ADDITION IT PERFORMS OTHER TASKS UNDER SOME
*F*               CONDITIONS:
*F*
*F*               IF THE ENTRY IS TO BE ADDED TO THE DELETE CHAIN, ADDIT
*F*               STARTS THE DELETE SYMBIONT IF IT IS IDLE.
*F*
*F*               IF THE ENTRY IS BEING ADDED TO THE FREE INPUT SLOT CHAIN,
*F*               ADDIT INCREMENTS BL:IFS.
*F*
*F*               IF THE ENTRY IS BEING ADDED TO THE FREE OUTPUT SLOT
*F*               CHAIN, ADDIT CHECKS TO SEE WHETHER A RESERVED MESSAGE
*F*               FILE SLOT WAS USED.  IF SO HE INCREMENTS MFFS.  IF NOT
*F*               HE INCREMENTS BL:OFS AND UNQUEUES ANY USERS WHO ARE
*F*               WAITING FOR QUEUE SLOTS (NSYMF).
*F*
*
*
ADDIT    EQU      %                 ADD A LOSE ENTRY TO THE PRIO
         AND,R1   M8
         CI,R1    DELPRI
         BNE      ADDIT4
         LB,R3    SNDDX
         MTB,0    SSIG,R3
         BNEZ     ADDIT3
         LCI      12
         PSM,R8   TMPSTK
         BAL,R8   SYSG1
         LCI      12
         PLM,R8   TMPSTK
         B        ADDIT3
ADDIT4   EQU      %
         CI,R1    FREI              CHAIN IN R1
         BL       ADDIT3            :
         LW,R3    MFBIT             REPLACE THE TAIL OF THE SELECTED
         CW,R3    BW:SDA,R2         CHAIN WITH THE NEW ENTRY IN R2.
         BAZ      %+3               :
         MTW,1    MFFS              IF THE ENTRY IS BEING FREED, INCREMENT
         B        ADDIT3            THE APPROPRIATE COUNTER.  IF THE COUNTER
         LI,R3    BL:IFS-FREI       IS BL:OFS AND IT WAS ZERO REPORT
         AW,R3    R1                SYMFILE AVAILABLE.  THERE ARE A FEW
         MTW,1    *R3
         CI,R3    BL:OFS
         BNE      ADDIT3
         LB,R3    SNDDX
         CW,R3    BL:OFS
         BG       ADDIT3
         PSW,R11  TMPSTK
         BAL,R3   SYMF
         PLW,R11  TMPSTK
ADDIT3   EQU      %
         MTW,0    CHAINHD           ADD TO HEAD OF QUEUE IF THIS IS...
         BNEZ     ADDIT3H           ...A PARTIAL COMODE FILE
         LH,R3    BH:TPRI,R1
         BEZ      ADDIT1
         STH,R2   BH:LINK,R3
ADDIT2   EQU      %
         STH,R2   BH:TPRI,R1
         LI,R3    0
         STH,R3   BH:LINK,R2
         B        *R8
ADDIT1   EQU      %
         STH,R2   BH:HPRI,R1
         B        ADDIT2
ADDIT3H  EQU      %
         LH,R3    BH:HPRI,R1
         BEZ      ADDIT1H
         STH,R3   BH:LINK,R2
ADDIT2H  EQU      %
         STH,R2   BH:HPRI,R1
         MTW,-1   CHAINHD
         B        *R8
ADDIT1H  EQU      %
         STH,R2   BH:TPRI,R1
         LI,R3    0
         STH,R3   BH:LINK,R2
         B        ADDIT2H
******************************************
RB%CCS   EQU      %                 PROCESS INPUT FILES FROM RBTS
         STW,R9   FLAGS
         LI,R4    RB%CC1-1
         STD,R14  FLD               ------------------------------------
SETHDR   EQU      %                 IF A MESSAGE FILE IS ALREADY IN
         LB,R7    RBB:SMD,R5
         BEZ      1,R4
         LW,R7    RB:MFAD,R5        PROGRESS FOR THIS GUY SET UP R7
         BNEZ     SET7              AND RETURN TO  BAL+2.  OTHERWISE
         LD,R2    RBD:WSN,R5        PUT IN THE MFILE HEADER (THUS STARTING
         STD,R2   HDR3              AN MFILE) AND RETURN TO BAL+1.
         LD,R2    DCT16,R5
         STD,R2   HDR1
         LB,R15   RBB:ID,R5
         BAL,R11  DEC
         STW,R13  HDR2
         LB,R1    RBB:SMD,R5
         LI,R11   OCBIT
         CH,R11   STH:FLG,R1
         BANZ     0,R4
         LI,R1    HDR
         BAL,R11  MOVEMES
         B        *R4
SET7     EQU      %
         SLS,R7   2
         AW,R7    RB:SPMF,R5
         B        1,R4
         LD,R14   FLD               ---------------------------------------
RB%CC1   EQU      %                 RBCCS BEING INPUT FROM RBTS
         BAL,R3   CKJB              ARE EITHER SEPERATE INPUT FILES
RB%CC2   AND,R15  YFFFF
         LI,R3    #RBCCS            INPUT FILES.  THIS CODE PICKS THEM
RBCC1    CD,R14   RBCC,R3           UP AND PROCESSES THEM UNTIL IT
         BNE      RBCC2             ENCOUNTERS A JOB AT WHICH TIME IT
         LW,R1    ARSO
         BNEZ     %+2
         BAL,R11  MOVECC            EXITS TO DOJOB.  IF A COMMAND IS
         STB,R3   COM               FOUND WHICH DOESNOT BEGIN !RB AND IS
         LI,R1    BOMSK             NOT !JOB THE FILE IS DELETED AND
         BAL,R4   TRT               THE OPERATOR IS TOLD.  SOME RB
         CI,R3    FIACOM            BITS AND WHEN ONE OF THESE IS
         BL       %+3               ENCOUNTERED FIABIT IS SET CAUSING THESE
         LI,R9    FIABIT            BITS TO BE REDETERMINED. ALL RBCCS
         STS,R9   FLAGS             ARE LISTED IN THE MESSAGE FILE.
         LB,R1    RBCCVEC,R3
         B        RBCCBSE,R1
RBCC2    BDR,R3   RBCC1
         LW,R11   OCCC
         BEZ      RBNJCK
         LW,R11   FLAGS
         CW,R11   SLVXP2BT
         BAZ      RBNJCK
         CI,R11   XP2BIT
         BANZ     RBGA3
         LW,R6    BCP
         AW,R6    ARSE
RBGA1    EQU      %
         LB,R1    0,R6
         CI,R1    EOC
         BE       RBGA2
         AI,R6    1
         LI,R1    EOCMSK
         LI,R4    RBGA1
         B        TRT
RBGA2    EQU      %
         SW,R6    BCP
         STW,R6   ARSE
RBGA3    EQU      %
         LI,R8    AIFOUT
         LW,R1    ARSE
         LI,R11   MSG1
         LW,R14   BCP
         AW,R6    BCP
         B        MSG01
RBNJCK   EQU      %
         CW,14    TEOD
         BE       NXTRBCC
         SLS,R14  -8
         CW,R14   BANGRB
         BNE      RB%NJ
BADCRD   BAL,R11  MOVECC
         LI,R1    UNKN
         BAL,R11  MOVEMES
NXTRBCC  EQU      %
         LW,R4    OCCC
         BNEZ     FOH1
         LI,R4    RB%CC1            ------------------------------------------
NXTCC    EQU      %                 PICK UP THE NEXT COMMAND FROM THE
         LW,R6    ARS               DISC BLOCK.  IF DONE WITH THIS BLOCK
         AW,R6    BCP               READ ANOTHER.  ARS IS THE RECORD BYTE
         AI,R6    2
         LB,R1    0,R6
         AI,R6    -2
         CI,R1    X'40'             ASSUMED TO BE RBCCS ONLY AND IS RELEASED.
         BNE      NXTON             IF IT IS HIT AFTER !JOB PROCESSING
NXTCX    EQU      %
         LW,R15   FLINK             CONTINUES.
         BNEZ     RESET
         CI,R4    RSL1
         BE       PJDN
         B        LSTSECT
RESET    EQU      %
         BAL,R10  RDDSK
         SLS,R6   2
NXTON    EQU      %
         LI,R15   NXTN2
NXTN1    EQU      %
         LI,R1    0
         STW,R1   STATX
         STW,R1   ALLX
         STW,R1   CCMVD
         STW,R1   MRKD
         STW,R1   OCCC
         STW,R1   CCTMP
         B        *R15
NXTN2    EQU      %
*  BC
         AI,R6    1
         LB,R1    0,R6              IS IT ALWAYS LESS **********
         STW,R1   ARS
*  RCC
         AI,R6    1
         LB,R3    0,R6
         CI,R3    X'40'
         BE       NXTCX
*  SKIP
         AI,R6    1
         LB,R3    0,R6
         REF      M3
         AND,R3   M3                SKIP IS ONLY THREE BITS
         AW,R6    R3
         AW,R1    R6
         LI,R15   EOC
         STB,R15  0,R1
         PSW,R7   TMPSTK
         LW,R7    CRDPTR
         MBS,R6   0
         PLW,R7   TMPSTK
         AI,R6    -8                IS IT ALWAYS MORE ***********
GEOCR    EQU      %
         STW,R6   BCP
         PSW,R4   TMPSTK
         PSW,R15  TMPSTK
         BAL,R11  GEOC
         PLW,R15  TMPSTK
         PLW,R4   TMPSTK
         STW,R12  ARSE
         LB,R6    RBB:SMD,R5
         BEZ      GEOCX
         LI,R12   OCBIT
         CH,R12   STH:FLG,R6
         BANZ     %+2
GEOCX    EQU      %
         LI,R1    -1
         AI,R1    1
         STW,R1   ARSO
         LW,R6    BCP
         B        *R4
RB%NJ    EQU      %
         LI,R1    NJMES
         BAL,R11  MOVEMES
LSTSECT  LI,R4    DELJOB
         B        RBCCOUT
*************************************************
RB%OCM   EQU      %
         STW,R9   FLAGS
         BAL,R8   SVIV1
         LW,R14   2,R7
         LW,R15   IDPTR
         SLS,R14  2
         MBS,R14  0
         LW,R14   2,R7
         BAL,R11  RMB
         STW,R11  SVZ
         LB,R14   ID
         BEZ      XP2COM
OCM1     EQU      %
         BAL,R15  NXTN1
         BAL,R4   SETHDR
         NOP
         LD,R14   ID
         LW,R10   ID
         SLS,R10  -8
         CW,R10   BANGRB
         BE       %+3
         SLD,R14  -24
         OR,R14   YBANGRB
         LI,R4    AIFOUT
         STW,R4   OCCC
         LI,R6    BA(ID)
         BAL,R4   GEOCR
         LW,R1    ARSE
         STW,R1   ARS
         B        RB%CC2
***************************************
RBCCBSE  EQU      %                 BASE OF RBCC VECTORS
RBSSS    EQU      %
         CW,R9    HA%SSSBT
         BAZ      BADCRD
         LB,R13   SSIGS,R3
         BAL,R11  PRODCD
         B        NXTRBCC
SSS      EQU      %
         LC       SSIG,R3
         BCR,4    0,R4
SSS1     EQU      %
         STB,R13  SSIG,R3
         CW,R9    HASPBIT
         BAZ      1,R4
         LB,R10   SSTAT,R3
         BNEZ     1,R4
         PSW,R11  TMPSTK
         BAL,R11  SAQNSERT
         PLW,R11  TMPSTK
         B        1,R4              :
*************************************************
RBLOCK   EQU      %
         BAL,R11  PRODCDA           :
         B        NXTRBCC           :
LOCK     EQU      %
         WD,0     X'37'
         LH,R10   STH:FLG,R3
         OR,R10   XLOCBT
SEB4P1   STH,R10  STH:FLG,R3
EB4P1    WD,0     X'27'
         B        1,R4
***************************************************
RBUNLOCK EQU      %
         BAL,R11  PRODCDA
         B        NXTRBCC
UNLOCK   EQU      %
         WD,0     X'37'
         LH,R10   STH:FLG,R3
         OR,R10   XSTPBIT
UL1      AND,R10  NLOCBT
         B        SEB4P1
*************************************************
RBALGN   EQU      %
         CW,R9    2780BIT
         BANZ     BADCRD
         BAL,R11  PRODCDA
         B        NXTRBCC
RALGN    EQU      %
         LC       SSIG,R3
         BCR,4    RALGU
         LB,R10   SSTAT,R3
         BNEZ     0,R4
         LI,R13   'A'
         B        SSS1
RALGU    EQU      %
         LI,R10   INBIT
         CH,R10   STH:FLG,R3
         BANZ     0,R4
         WD,0     X'37'
         LH,R10   STH:FLG,R3
         OR,R10   XALGBT
         B        UL1
**************************************************
RBFORM   EQU      %
         CI,R9    XP2BIT
         BANZ     BADCRD
         BAL,R11  PRODCDA
         B        NXTRBCC
RFRM     EQU      %
         PSW,R3   TMPSTK
         BAL,R8   COMRET
         LW,R1    MRKD
         BNEZ     RFRMX
         LC       R6
         BCS,EOC  RNFM
         LI,R1    COBLMSK
         BAL,R4   TRT
         CI,R1    4
         BG       RFRMX
         BAL,R4   GETFLD
         LW,R12   FLD
RFRM1    EQU      %
         PLW,R3   TMPSTK
         LI,R13   0
         LI,R14   0
         BAL,R4   FORMS
         B        RFRMB
         B        NXTRBCC
RNFM     EQU      %
         LI,R12   0
         B        RFRM1
RFRMX    EQU      %
         PLW,R3   TMPSTK
RFRMB    EQU      %
         BAL,R11  MOVECC
         LI,R1    BKFM
         LI,R11   NXTRBCC
         B        MOVEMES
***********************************************
RBSUSP   EQU      %
         CW,R9    HASPBIT
         BAZ      BADCRD
         BAL,R11  PRODCD
         B        NXTRBCC
SUS      EQU      %
         LC       SSIG,R3
         BCR,4    0,R4
         LI,R10   'S'
         STB,R10  SSIG,R3
         B        1,R4
***********************************************
RBCTL    EQU      %
         CW,R9    HASPBIT
         BAZ      BADCRD
         BAL,R11  PRODCDA
         B        NXTRBCC
         LI,R8    NXTRBCC
         LH,R12   STH:FLG,R3
         CI,R12   OCBIT
         BANZ     %+3
         CI,R12   INBIT+SRCB2BT
         BANZ     *R4
         BAL,R4   FINWRT
         STB,R3   RBB:SMD,R5
         LW,R10   ARSE
         CI,R12   OCBIT
         BANZ     %+3
         LI,R10   0
         BAL,R4   SETHDR
         XW,R10   ARSO
         BNEZ     NXTRBCC
         BAL,R11  MOVECC
         B        NXTRBCC
***************************************:
RBDISC   EQU      %                 PROCESS !RBDISC BY SETTING LOFBIT
         LI,R15   LOFBIT            IN THE FLAGS.
RBDISC1  EQU      %
         STS,R15  FLAGS
         B        NXTRBCC
***********************************************
RBMSG    EQU      %
         LI,R8    NXTRBCC
         B        MSG
************************************************
RBHOLD   EQU      %                 PROCESS !RBHOLD.  FOR EACH OR ALL
         BAL,R11  PROCD             SYSIDS  SET HOLDBIT IN BW:SDA.
         B        CHKHLD            IF ALL WAS SPECIFIED SET HALBIT
HLD      EQU      %                 IN RB:FLAG
         LW,R14   XHOLDBIT
HLD1     LW,R15   XHOLDBIT
         STS,R14  BW:SDA,R2
         B        *R4
CHKHLD   EQU      %
         LI,R14   HALBIT
         MTW,0    ALLX
         BEZ      NXTRBCC
         LI,R15   HALBIT
         STS,R14  FLAGS
         B        NXTRBCC
********************************************
RBRET    EQU      %                 PROCESS !RBRET  FOR EACH OR ALL
         BAL,R11  PROCD             SYSIDS RESET HOLDBIT.  IF ALL
         B        CHKREL            WAS SPECIFIED RESET HALBIT
REL      EQU      %
         LI,R14   0
         B        HLD1
CHKREL   EQU      %
         LI,R14   0
         B        CHKHLD+1
*************************************************
RBPRIO   EQU      %
         LI,R1    NBMSK
         BAL,R4   TRT
         BCS,CEB  BADCRD
         LI,R1    NXMSK
         BAL,R4   TRT
         BCR,CEB  BADCRD
         CI,R1    1
         BG       BADCRD
         LI,R3    16
         BAL,R4   CVTSID
         STW,R12  CCTMP
         BAL,R8   COMRET
         BAL,R11  PROCD
         B        NXTRBCC
         LW,R14   CCTMP
         CI,R1    RUNPRI
         BE       BADSIDP
         BG       PRIOCG
         CB,R14   RBB:MXP,R5
         BLE      PRIOCG
BADSIDP  EQU      %
         LW,R14   ALLX
         BEZ      BADSID1
         B        *R4
*********************************************
RBSTAT   EQU      %                 PROCESS !RBSTATUS  IF INDIVIDUAL
         LI,R1    0                 SYSIDS, PUSH THEM N THE STAK
         PSW,R1   TMPSTK            PRECEEDED BY STAK MARK OF ZERO
         BAL,R11  PROCD             IF ALL WAS SPECIFIED PROCESS EACH
         B        DOSTAT            SYSID AS IT IS ENCOUNTERED. (THE
STAT1    EQU      %                 PUSHING IS TO ALLOW FOR ERROR
         MTW,0    ALLX              MESSAGES WELL INTO THE CARD.  WHEN
         BNEZ     STAT              THE COMMAND IS COMPLETE CLOSE WITH
         STB,R1   R2
         PSW,R2   TMPSTK            APPROPRIATE (IF ANY) MESSAGE.
         B        *R4
DOSTAT   EQU      %                 --------------------------------------------
         LI,R8    NXTRBCC           WHEN ALL THE SYSIDS HAVE BEEN OBTAINED PULL
         LI,R4    %+1               EACH ONE OUT OF THE STAK AND PUT THE
         PLW,R2   TMPSTK            APPROPRIATE MESSAGE IN THE MESSAGE FILE.
         LB,R1    R2
         AND,R2   M16               CLEAR OUT PRIORITY.
         BNEZ     STAT
CHKSTAT  EQU      %
         LI,R1    ASTER
         MTW,0    STATX
         BNEZ     %+4
         MTW,0    ALLX
         BEZ      *R8
         AI,R1    NOSTAT-ASTER
         BAL,R11  MOVEMES
         B        *R8
*****************************************
RBSWT    B        RBSWITCH          RBSWITCH WAS TOO FAR FROM RBCCBSE
*********************************************
RBXXX    EQU      %
         LI,R15   RBXBIT+LOFBIT
         B        RBDISC1
**********************************************
RBDEV    EQU      %
         LI,R3    MXSTRM
         CB,R5    SNDDX,R3
         BE       %+3
RBDEV1   BDR,R3   %-2
         B        NXTRBCC
         LB,R10   STB:TYP,R3
         BEZ      RBDEV1
         LH,R10   STH:FLG,R3
         CI,R10   OCBIT
         BAZ      %+3
         CB,R3    RBB:SMD,R5
         BE       RBDEV2
         LI,R1    0
         LB,R12   SSTAT,R1
         BNEZ     RBDEV2
         LH,R12   SCNTXT,R1
         BNEZ     RBDEV15+1
         CI,R10   LOCBIT
         BANZ     RBDEV15
         CI,R10   STPBIT
         BANZ     RBDEV2
         AI,R1    1
RBDEV15  AI,R1    1
         AI,R1    1
RBDEV2   EQU      %
         LH,R12   STH:NM,R3
         STH,R12  DDVM1
         LD,R12   DDVMXS,R1
         STW,R12  DDVM2
         STW,R13  DDVM2+1
         LI,R4    DDVMSZ
         LW,R12   STW:FORM,R3
         BEZ      %+3
         STW,R12  DDVM3
         LI,R4    DDVMSZF
         STB,R4   DDVM
         LI,R1    DDVM
         LI,R11   RBDEV1
         B        MOVEMES
******************************************************
RBINFO   B        RBINF             NO ROOM HERE
***********************************************************
RBDEL    EQU      %                 PROCESS !RBDELETE  FOR EACH
         BAL,R11  PROCD             OR ALL SYSIDS DO THE FOLLOWING
         B        NXTRBCC           IF INPUT - DELETE THE FILE
DEL      EQU      %                 IF OUTPUT - DELETE THE FILE
         CI,R1    RUNPRI            AND DELETE THE RUNNING ENTRY SO
         BE       DEL3              THAT AOF WILL RELEASE THE OUTPUT
         BG       DEL2
DEL1     EQU      %
         MTW,-1   S:BFIS
         BAL,R8   ABRS#
DEL2     EQU      %
         LI,R14   DELPRI
         B        CHNGRSET
DEL3     EQU      %
         LW,R15   DELBIT
         STS,R15  BW:SDA,R2
         LCI      13
         PSM,R11  TMPSTK
         LW,R6    R12
         BAL,R11  SVIV
         BAL,R7   GETUSER#
         B        DEL5
         LI,R6    E:ABRT
         BAL,R11  T:RUE
DEL5     EQU      %
         LCI      13
         PLM,R11  TMPSTK
         STW,R4   SVZ
         B        *R4               ------------------------------
CHNGRSET EQU      %                 CHNGRSET AND DEL6 ALLOW YOU TO
         BAL,R8   CHNG              RELEASE AN ENTRY FROM AL CHAIN
         AI,R15   0                 WITHOUT LOSING YOUR PLACE.
         BGEZ     %+4
         AI,R14   1
         STW,R3   PREV
         STH,R3   BH:LINK
         LW,R1    R14
         LW,R2    PREV
         B        *R4
**************************************
RBSZ     EQU      %                 PROCESS !RBSIZE  SET POINTERS AND
         CW,R9    HASPBIT
         BANZ     BADCRD
         LI,R11   0
         LI,R4    SIZOPS            GO TO PROCOP
         LI,R1    SIZPTR            :
         LI,R10   NXTRBCC           -----------------------------------
PROCOP   EQU      %                 PROCESS CARDS WITH OPTIONS.
         STW,R11  PROCOPX
         STW,R4   OPTLST            :
         STW,R1   OPTBL             R4=ADDR OF LIST OF TEXT OPTIONS
         LI,R1    BOMSK             THAT ARE LEGAL - ENTRY ZERO
         BAL,R4   TRT               IS A COUNT.
         LI,R1    NBMSK             R1=ADDR OF TABLE OF ADDRS OF
         BAL,R4   TRT               PROCESSING ROUTINES  PARALLEL
         BCR,COMA %+2               TO THE OPTION TABLE
         BAL,R8   COMRET2           COMMA AND EQUALS DELIMIT FIELDS
         BCS,EOC  CHKCONT           PARENTHESES ARE IGNORED.
PROCOP1  EQU      %                 AN OPTION IS OBTAINED AND LOOKED UP
         LI,R1    COBLMSK           IN THE OPTION TABLE
         BAL,R4   TRT               THE INDEX IS USED TH FIND AN ENTRY
         BAL,R4   GETFLD            IN THE POINTER TABLE.  IF IT IS ZERO
         LI,R8    PROCOP1-1         THE OPTION AND THE NEXT FIELD (A VALUE)
         LW,R4    *OPTLST           ARE SKIPPED.  IF IT IS POSITIVE THE
         LW,R14   FLD               PROCESSING ROUTINE IS ENTERED. IF IT IS
         CW,R14   *OPTLST,R4        NEGATIVE THE NEXT FIELD IS OBTAINED AND
         BE       DOOP              CONVERTED TO BINARY AND PASSED IN R12
         BDR,R4   %-2               TO THE PROCESSING ROUTINE.  BAD OPTIONS ARE
         LW,R11   PROCOPX
         BNEZ     *R11
BADOP    EQU      %                 AND THE NEXT FIELD IS CONSIDERED
         LI,R0    '%'               TO BE AN OPTION. BAD VALUES ARE ALSO
         SLS,R1   -1                FLAGGED.  THE PROCESSING ROUTINE MAY
         SW,R6    R1                EXIT TO COMRET (R8 IS SET) NORMALLY
         B        BADSID3           OR TO BADVAL OR TBGVAL IF THE VALUE
DOOP     EQU      %                 IS UNSATISFACTORY
         LW,R11   *OPTBL,R4
         BEZ      SKIP
         BGZ      *R11
         BAL,R8   COMRET
         BCS,COME BADVAL
         LI,R8    PROCOP1-1
         LI,R1    NDMSK
         BAL,R4   TRT
         BCR,CEB  BADVAL
         LI,R3    10
         BAL,R4   CVTSID
         LI,R13   X'FF'
         LCW,R11  R11
         AI,R12   0
         B        *R11
TBGVAL   EQU      %
         AI,R6    -1
         LI,R0    '&'
         B        %+2
BADVAL   EQU      %
         LI,R0    '*'
         LI,R8    PROCOP1-1
         B        BADSID3
SKIP     EQU      %
         BAL,R8   COMRET
         LI,R1    COBLMSK
         BAL,R4   TRT
         LI,R8    PROCOP1-1
         B        COMRET
CHKCONT  EQU      %
         CI,R10   RESLIM+2
         BNE      *R10
         LB,R1    0,R6
         CI,R1    ';'
         BNE      *R10
         MTW,1    CONT
         B        *R10
*****************************************
MSG      EQU      %                 STARTING AT THE CURRENT POSITION
         LI,R1    NBMSK             OUTPUT THE CONTENTS OF THE CARD
         BAL,R4   TRT               BLANK STRIPPED ON THE OC.
         BCS,EOC  *R8
         LW,R14   R6
         LI,R11   MSG1
GEOC     EQU      %
         LI,R1    EOCMSK
         BAL,R4   TRT
         LW,R12   R1
MSG01    EQU      %
         LI,R15   X'40'
         AI,R6    -1
         CB,R15   0,R6
         BNE      %+2
         BDR,R1   %-3
         B        *R11
MSG1     EQU      %
         CI,R1    52
         BLE      MSG11
         LW,R4    R14
         AI,R4    52
         LI,R2    20
         CB,R15   0,R4
         BE       %+4
         AI,R4    -1
         BDR,R2   %-3
         B        MSG11
         LI,R15   X'15'
         STB,R15  0,R4
MSG11    EQU      %
         LI,R15   BA(RBMS1)
         STB,R1   R15
         AI,R1    RBMSZ
         STB,R1   RBMS
         MBS,R14  0
         LI,R4    RBMS
         B        TEL%OPR
*
*
*O*      MESSAGE: *RBNDD - WSN *MSG* MESSAGE
*O*
*O*      MEANING: THE MESSAGE WAS SENT FROM WORKSTATION WSN CONNECTED TO
*O*               RBNDD.
*O*
*O*      ACTION:  DEPENDS ON MESSAGE CONTENT - USE THE RBSEND KEYIN TO
*O*               REPLY IF REQUIRED
*O*
*
*
***************************************************:
STAT     EQU      %                 DETERMINE THE STATUS OF A FILE
         PSW,R11  TMPSTK            DEPENDING ON THE PRIORITY AND
         PSW,R1   TMPSTK            HOLDFLAG OF A FILE A MESSAGE IS
         LW,R13   R1                PLACED IN THE MESSAGE FILE.  IF
         MTW,0    STATX             THE FILE IS INPUT THE NUMBER AHEAD
         BNEZ     ST1               IN INCLUDED IN THE MESSAGE
         LI,R1    STATMES
         BAL,R11  MOVEMES
         MTW,1    STATX
ST1      EQU      %
         LI,R3    0
         CI,R13   RUNPRI
         BG       ST2
         BE       %+2
         AI,R3    1
         AI,R3    2
         B        ST3
ST2      EQU      %
         LW,R15   BW:FORM,R2
         BEZ      ST3
         AI,R3    1
ST3      EQU      %
         LW,R15   BW:SDA,R2
         CW,R15   XHOLDBIT
         BAZ      %+2
         AI,R3    4
         LW,R1    MSVEC,R3
         BGEZ     ST7
         BAL,R11  ST4
         BAL,R11  DEC
         LCW,R1   MSVEC,R3
         STW,R13  NTR,R1
ST7      EQU      %
         CI,R3    2
         BANZ     ST8
         LW,R15   BW:FORM,R2
         BEZ      %+2
         STW,R15  FRMX,R1
         BAL,R11  GTDVNM
         LI,R13   '??'              QUESTION MARKS
         LI,R3    SDVX
         STH,R13  *R1,R3
         LW,R13   120ASTER+1
         LH,R15   BH:GRAN,R2
         CI,R15   9999
         BG       %+2
         BAL,R11  DEC
         STW,R13  SGRNX,R1
         LB,R15   BB:COPY,R2
         BAL,R11  DEC
         STW,R13  SCPX,R1
ST8      EQU      %
         LH,R15   BH:SID,R2
         BAL,R11  HEXC
         STW,R13  SYSD,R1
         BAL,R11  MOVEMES
         PLW,R1   TMPSTK
         PLW,R11  TMPSTK
         B        *R4               ------------------------------------
ST4      EQU      %                 DETERMINE THE NUMBER AHEAD FOR AN
         PSW,R0   TMPSTK            INPUT FILE.  FILES ARE COUNTED UNTIL
         LI,R15   0                 THE SPECIFIED (R2) FILE IS FOUND BY
         LW,R13   R2                PRIORITY.
         LI,R1    FIPRI
         BAL,R0   FIND
         B        ST5
         CW,R13   R2
         BE       ST5
         AI,R15   1
         B        FIND1
ST5      PLW,R0   TMPSTK
         B        *R11
*******************************************
GTDVNM   EQU      %
         LI,R14   INBIT
GTDVNM1  EQU      %
         LB,R15   RBB:DSM,R5
         LI,R3    MXSTRM
         CB,R5    SNDDX,R3
         BE       %+3
GDNNO    BDR,R3   %-2
         B        *R11
         CH,R14   STH:FLG,R3
         BANZ     GDNNO
         LB,R13   STB:TYP,R3
         BEZ      GDNNO
         AND,R13  R15
         CB,R13   BB:DEV,R2
         BNE      GDNNO
         LH,R13   STH:NM,R3
INC11B   EQU      %
         AI,R11   1
         B        *R11
*************************************************
RBINF    EQU      %
         PSW,R5   TMPSTK
         LI,R1    ITMM1
         BAL,R8   TIMIN
         PLW,R5   TMPSTK
         LI,R1    ITMM
         BAL,R11  MOVEMES
         LW,R15   S:CUIS
         BAL,R11  DEC
         STW,R13  ICUM1
         LI,R1    ICUM
         BAL,R11  MOVEMES
         LW,R15   C:ETM
         BAL,R11  DEC
         STW,R13  IETM1
         LI,R1    IETM
         BAL,R11  MOVEMES
         LW,R15   S:BUIS
         BAL,R11  DEC
         STW,R13  IBRM1
         LI,R1    IBRM
         BAL,R11  MOVEMES
         LW,R15   S:BFIS
         BAL,R11  DEC
         STW,R13  IBWM1
         LI,R1    IBWM
         LI,R11   NXTRBCC
         B        MOVEMES
****************************************
RBSWITCH EQU      %                 PROCESS !RBSWITCH COMMAND  THE
         LI,R1    0
         STW,R1   REC
         STW,R1   REC+FLG
         STW,R1   TYPSW
         STW,R1   SWTYP
         LI,R1    NBMSK             WSN IS OBTAINED AND CHECKED FOR
         BAL,R4   TRT               VALIDITY. THEN THE DEVICE TYPE IS
         BCS,COME   BADSW           OBTAINED.  IF THESE ARE NOT O.K.
         LI,R1    NNMSK             AN ERROR MESSAGE IS PUT IN THE
         BAL,R4   TRT               MESSAGE FILE. IF NOT FOR EACH OR
         BCR,CEB  BADSW+1           ALL SYSIDS THE RBID IS CHANGED TO
         BCS,EOC  BADSW             THAT BELONGING TO THE SPECIFIED
         CI,R1    8                 WORKSTATION IF THE DEVICE TYPE IS
         BG       BADSW             CORRECT.  IF THE FILE IS SWITCHED
         BAL,R10  PROCID            LOCAL THE APPROPRIATE SYMBIONT IS
         B        BADSW             STARTED.  IF REMOTE THE HOLD BIT AND
         B        SW3
SW4      EQU      %
         LI,R1    NBMSK
         BAL,R4   TRT
         BCR,COMA BADSW+1
         AI,R6    1
         LI,R1    NBMSK
         BAL,R4   TRT
         BCS,EOC  BADSW
         BCS,COMA RBSW2
         LI,R1    NNMSK
         BAL,R4   TRT
         BCS,EOC  BADSW
         CI,R1    2
         BG       BADSW
         BAL,R4   GETFLD
         LH,R13   FLD
         STW,R13  TYPSW             SHOULD CHECK IF HE HAS IT**********
         LW,R12   TYPSW
         BAL,R4   GTDVX
         B        BADSW
         BAL,R4   CVTYP
         B        BADSW
         STW,R1   SWTYP
         LI,R1    NBMSK
         BAL,R4   TRT
         BCR,COMA BADSW
         BCS,EOC  BADSW
RBSW2    EQU      %
         AI,R6    1
         LW,R11   HASPBIT
         CI,R5    LCLX
         BE       HCHK
         LI,R4    0
         CW,R11   RB:FLAG,R5
         BAZ      HCHK
         AND,R11  FLG+REC
         BNEZ     SWITFI
         B        Y8IN
HCHK     EQU      %
         AND,R11  FLG+REC
         BEZ      %+2
Y8IN     LW,R4    Y8
SWITFI   STW,R4   SWITFLG
         BAL,R11  PROCD
         B        NXTRBCC
SW       EQU      %
         CI,R1    RUNPRI
         BG       %+3
SWX      EQU      %
         MTW,-1   FFLG
         B        0,R4
         LW,R15   SWITBIT
         CW,R15   BW:SDA,R2
         BANZ     SWX
         LCI      0
         PSM,R0   TMPSTK
         BAL,R11  GTDVNM
         B        SWOUTZ
         CW,R13   TYPSW
         BAZ      %+3
         BE       %+2
         BDR,R11  GDNNO
         LW,R1    SWTYP
         BNEZ     SWTCH
         BAL,R4   CVTYP
         BDR,R11  GDNNO
SWTCH    EQU      %
         STB,R1   BB:DEV,R2
         LB,R4    REC
         STB,R4   BB:RID,R2
         LW,R11   HASPBIT
         AND,R11  FLAGS
         STS,R11  BW:SDA,R2
         LW,R11   SWITFLG
         BEZ      SWOUT
         BLZ      %+3
         CI,R1    5
         BNE      SWOUT
         LW,R11   SWITBIT
STORO    STS,R11  BW:SDA,R2
SWOUT    EQU      %
         LB,R13   REC
         LI,R10   HALBIT
         BAL,R8   RBCHK
SWOUT1   LCI      0
         PLM,R0   TMPSTK
         B        0,R4
SWOUTZ   EQU      %
         MTW,-1   FFLG
         B        SWOUT1
SW3      EQU      %
         CW,R4    R5
         BE       BADSW
         CI,R4    LCLX
         BNE      PID0-1
         B        SW4
************************************************
CVTYP    EQU      %
         LB,R1    REC
         BEZ      CVTYPL
         LW,R1    REC+#STRM
         CH,R13   REC+NMTBL,R1
         BE       SWTX
         BDR,R1   %-2
         CH,R13   REC+NMTBL
         BNE      0,R4
SWTX     EQU      %
         LB,R1    REC+RCBTBL,R1
         LB,R8    REC+RMT#
         AND,R1   R8
         B        1,R4
CVTYPL   EQU      %
         LI,R1    SV:TYM
         CH,R13   SH:SYMT,R1
         BE       %+3
         BDR,R1   %-2
         B        0,R4
         LI,R1    TYPMNSZ
         CH,R13   OH:NM,R1
         BE       %+2
         BDR,R1   %-2
         LC       TB:FLGS,R1
         BCS,1    1,R4
         B        0,R4
BADSW    EQU      %
         AI,R6    -1
         LI,R0    '*'
         LI,R1    SWCOM1
         STB,R1   COM
         LI,R8    NXTRBCC
         B        MARKERR
***************************************
FOH1     EQU      %
         LW,R9    FLAGS
         B        FIASET
RBCCOUT  EQU      %                 PROCESS JOB STREAM END FOR AN RBT
         LW,R9    FLAGS
         CW,R9    HASPBIT
         BAZ      FO0
         LW,R10   FINFLG
         AW,R10   ARSO
         BNEZ     FIASET
FO0      EQU      %
         MTW,0    FINFLG
         BEZ      *R4               --------------------------------------
         BAL,R11  SVIV              PROCESS SUSPENDED SYMBIONT  IF THE
         CW,R9    HASPBIT
         BANZ     FO1
         LW,R9    FLAGS
         CI,R9    SSSBIT            RESTART CONTROL COMMAND WAS RECIEVED
         BAZ      FO1               AND 'R' THE DEFAULT IS PUT IN SSIG
         LB,R3    RBB:HOU,R5
         LB,R1    SSIG,R3           THE SYMBIONT IS RESTARTED.
         CI,R1    'S'
         BNE      DOSSS
         LI,R1    'R'
         STB,R1   SSIG,R3
DOSSS    EQU      %
         LI,R14   0
         STB,R14  RBB:HIN,R5
         LI,R15   SSSBIT
         STS,R14  RB:FLAG,R5
         BAL,R11  SAQNSERT          ----------------------------------------
FO1      EQU      %                 IF FIABIT IS SET CHECK TO SEE IF PRINT
         STW,R4   SVZ               AND/OR PUNCH IS PENDING AND SET THE
FIASET   EQU      %
         PSW,R4   TMPSTK
         LW,R9    FLAGS
         CI,R9    FIABIT
         BAZ      FO2
         AI,R9    -FIABIT
FIASET1  EQU      %
         LI,R13   INBIT+WFQBIT+FMSBIT
         LW,R10   HOLDBIT
         LB,R3    RBB:HFE,R5
FIA1     BEZ      FO2
         CH,R13   STH:FLG,R3
         BANZ     FIA3
         LI,R8    0
         LB,R14   STB:TYP,R3
         LB,R1    RBB:DSM,R5
         AND,R14  R1
         LI,R1    MFPRI
         LI,R11   %+3
         B        ALL2
         B        FIA2
         CI,R1    0OPRI
         BLE      FIA2
         CW,R10   BW:SDA,R2
         BANZ     *R4
         CB,R14   BB:DEV,R2
         BNE      *R4
         LI,R8    STPBIT
FIA2     EQU      %
         WD,0     X'37'
         LH,R11   STH:FLG,R3
         AND,R11  NSTPBT
         OR,R11   R8
         STH,R11  STH:FLG,R3
         WD,0     X'27'
FIA3     EQU      %
         LB,R3    STB:LNK,R3
         B        FIA1
FO2      EQU      %                 IF THERE IS PUNCH PENDING AND IT HAS NOT
         CW,R9    BSCBTS
         BANZ     FO5
         LB,R3    RBB:HFE,R5
         LB,R3    STB:LNK,R3
         LI,R12   STPBIT
         CH,R12   STH:FLG,R3
         BAZ      FO4
         CW,R9    PUNBIT            IF THERE IS NO PUNCH PENDING AND PUNCH IS
         BANZ     FO5               REQUESTED CLEAR THE REQUEST
         LI,R1    PUNMES
         BAL,R11  MOVEMES
         B        FO5
FO4      EQU      %
         LI,R14   0
         LW,R15   PUNBIT
         STS,R14  RB:FLAG,R5        ------------------------------------------
FO5      EQU      %                 IF AN !RBDISC HAS BEEN SENT TELL THE OPERATO
         CI,R9    LOFBIT            AND PUT CONFIRMATION IN THE MESSAGE
         BAZ      FO6               FILE.  THEN CHANGE LOFBIT TO DISCBIT SO
         LI,R4    OPDISCM           THAT THE TERMINAL WILL BE DISCONECTED WHEN
         BAL,R8   TEL%OPR           IT CYCLES TO READ.
*
*
*O*      MESSAGE: *RBNDD - WSN - LOGGED OFF
*O*
*O*      MEANING: WORKSTATION WSN CONNECTED TO RBNDD HAS LOGGED OFF AND
*O*               WILL BE DISCONNECTED WHEN ALL OUTPUT IS RECIEVED
*O*
*O*      ACTION:  NONE - INFORMATION ONLY
*O*
*
*
         LI,R1    DISCM
         BAL,R11  MOVEMES
         AI,R9    DISCBIT-LOFBIT
FO6      PLW,R4   TMPSTK            ----------------------------------------
FINOUT   EQU      %                 IF CARDS WERE IGNORED TELL THE RBT VIA
         LW,R15   IGBIT             THE MESSAGE FILE.
         CW,R15   RB:FLAG,R5
         BAZ      FO7
         LI,R1    IGMES
         BAL,R11  MOVEMES           -----------------------------------------
         LI,R14   0
         STS,R14  RB:FLAG,R5
FO7      EQU      %                 SET THE FLAGS,PUT A TOF  AT THE END OF
         AND,R9   NCTRBIT
FINWRT   EQU      %
         LW,R1    RB:MFAD,R5
         BEZ      *R4
         LB,R1    RBB:SMD,R5
         LI,R15   OCBIT
         CH,R15   STH:FLG,R1
         BANZ     %+3
         LI,R1    TOFM
         BAL,R11  MOVEMES
         LW,R8    R4
         B        WMF
********************************************
XP2FM    EQU      %
         WD,0     X'37'
         LH,R1    STH:FLG,R3
         AI,R1    FMSBIT
         STH,R1   STH:FLG,R3
         WD,0     X'27'
         LW,R13   FRMNM
         STW,R13  STW:FORM,R3
         LD,R14   RFXPTR
         MBS,R14  0
         LI,R15   REQFXP
         LI,R8    GOF6
TEL%XP2  EQU      %
         LI,R1    6
         LB,R2    STB:TYP,R3
         STB,R2   *R15,R1
TEL%XPX  EQU      %
         LI,R12   X'FD6C3'          HW ('OC')
         BAL,R4   GTDVX
         NOP
         LW,R4    R15
         LW,R15   R3
         LW,R12   XP2FCN
         BAL,R11  SVIV
         LW,R11   RCVRFLG
         BNEZ     *R8
         B        TEL%RBT2
XP2COM   EQU      %
         CI,R9    XP2BIT
         BAZ      OCM1
         LH,R1    ID
         CI,R1    7
         BG       OCM1
         BE       RREC
         LW,R2    ID
         AND,R2   M8
         LI,R3    MXSTRM
GTDBT    CB,R5    SNDDX,R3
         BNE      %+3
         CB,R2    STB:TYP,R3
         BE       %+3
         BDR,R3   GTDBT
         B        OCM1
         LB,R1    XP2VEC,R1
         B        XP2BSE,R1
XP2BSE   B        OCM1
RGFM     EQU      %
         WD,0     X'37'
         LH,R1    STH:FLG,R3
         AI,R1    -FMSBIT
         OR,R1    XSTPBIT
         STH,R1   STH:FLG,R3
         WD,0     X'27'
         B        CTR1
RRFM     EQU      %
         WD,0     X'37'
         LH,R1    STH:FLG,R3
         OR,R1    XFLKBIT
         STH,R1   STH:FLG,R3
         WD,0     X'27'
         LW,R13   ID+1
         STW,R13  STW:FORM,R3
         LI,R15   GFXP
         LI,R8    CTR1
         B        TEL%XP2
RREC     EQU      %
         LI,R1    RBXBIT
         STS,R1   RB:FLAG,R5
         LI,R4    RRECM
         LI,R8    CTR1
         B        TEL%OP
*
*
*O*      MESSAGE: *RBNDD - WSN - RECOVERING!!
*O*
*O*      MEANING: THE OTHER CP-V SYSTEM CONNECTED TO RBNDD AS WORKSTATION
*O*               WSN HAS CRASHED AND THE LINE WILL BE DISCONNECTED
*O*
*O*      ACTION:  ALLOW TIME FOR THE RECOVERY AND RECONNECT THE MACHINES
*O*               ACCORDING TO INSTALATION PROCEEDURES
*O*
*
*
**************************************************
MOVEMES  EQU      %
         BAL,R10  SMDCK
         LW,R6    R1
         SLS,R6   2
         LB,R1    0,R6
         AI,R6    1
MOVE1    EQU      %
         PSW,R6   TMPSTK
         MTW,0    RB:MFAD,R5
         BNEZ     MFCK2
         BAL,R6   GET256
         STW,R7   RB:MFAD,R5
         LI,R10   MOVE15
MFCK1    EQU      %
         LI,R6    0
         STW,R6   RB:SPMF,R5
         MTW,5    RB:SPMF,R5
         AI,R7    1
         STB,R6   *R7
         SLS,R7   2
         AI,R7    1
         B        *R10
MFCK2    EQU      %
         LI,R6    1024-8-1-3-5-4    SZ-2DA-EOB-CTL-HSP-SAFE
         SW,R6    R1
         CW,R6    RB:SPMF,R5
         BGE      MOVE15
         LI,R10   MOVE15
FORCE    EQU      %
         PSW,R8   TMPSTK
         BAL,R8   WMFF
         PLW,R8   TMPSTK
         LW,R7    RB:MFAD,R5
         B        MFCK1
MOVE15   EQU      %
         PLW,R6   TMPSTK
         STB,R1   0,R7
         MTB,1    0,R7
         AWM,R1   RB:SPMF,R5
         MTW,0    KOMP
         BNEZ     HSPCMP
         CI,R5    LCLX
         BE       MOVE17
         LW,R10   HASPBIT
         AND,R10  RB:FLAG,R5
         BNEZ     HSPCMP
MOVE17   EQU      %
         STB,R1   R7
         LI,R10   MOVE2
MVSET    EQU      %
         AI,R7    1
         LI,R1    IOFCN
         STB,R1   0,R7
         AI,R7    1
         LI,R1    1
         STB,R1   0,R7
         AI,R7    1
         LI,R1    X'C0'
         CI,R6    BA(HDR)+1
         BE       MVSET1
         CI,R6    BA(120ASTER)+1
         BE       MVSET1
         CI,R6    BA(TOFM)+1
         BNE      *R10
MVSET1   EQU      %
         LI,R1    X'F1'
         B        *R10
MOVE2    EQU      %
         STB,R1   0,R7
         AI,R7    1
         MBS,R6   0
MOVE3    EQU      %
         PLW,R6   TMPSTK
         LI,R1    0
         STB,R1   0,R7
         AI,R7    1
         MTW,5    RB:SPMF,R5        BC+RCC+SKP+VFC+BC
         B        *R11
MOVECC   EQU      %
         MTW,0    CCMVD
         BNEZ     *R11
         BAL,R10  SMDCK
         LW,R6    BCP
         LW,R1    ARSO
         BEZ      MVCC1
         LI,R10   XP2BIT
         CW,R10   RB:FLAG,R5
         BANZ     MVCC2
         B        %+2
MVCC1    EQU      %
         LW,R1    ARS
         MTW,1    CCMVD
         B        MOVE1
MVCC2    EQU      %
         PLW,R6   TMPSTK
         B        *R11
HSPCMP   EQU      %
         LCI      2
         PSM,R2   TMPSTK
         LW,R2    R7
         LW,R3    R1
         BAL,R10  MVSET
         AND,R1   X12
         AI,R1    X'A1'
         STB,R1   0,R7
         AI,R7    1
         MTB,2    0,R2
         MTW,2    RB:SPMF,R5
HSCP1    EQU      %
         LW,R10   R3
         CI,R10   63
         BLE      %+2
         LI,R10   63
         STB,R10  R7
         AI,R10   X'C0'
         STB,R10  0,R7
         AI,R7    1
         MBS,R6   0
         AI,R3    -63
         BGZ      HSCP2
         LI,R1    0
         STB,R1   0,R7
         AI,R7    1
         LCI      2
         PLM,R2   TMPSTK
         B        MOVE3
HSCP2    EQU      %
         MTB,1    0,R2
         MTW,1    RB:SPMF,R5
         B        HSCP1
SMDCK    EQU      %
         CI,R5    LCLX
         BE       %+3
         MTB,0    RBB:SMD,R5
         BEZ      *R11
         PSW,R6   TMPSTK
         B        *R10
*****************************************
CVTSID   EQU      %                 CONVERT EBCDIC FIELD TO BINARY
         STW,R3   CVT               :
         LW,R14   R1                BASE OF FIELDS NUMBER SYSTEM IN R3.
         LW,R3    R6                LENGTH IN R1 END OF FIELD IN R6.
         LI,R13   0                 CONVERTS DIRECTLY FROM BUFFER INTO
         SW,R3    R1                R12.
CVTHEX   EQU      %
         LB,R15   0,R3
         AI,R15   -X'F0'
         BGEZ     %+2
         AI,R15   X'F0'-X'C1'+10
         MW,R13   CVT
         AW,R13   R15
         AI,R3    1
         BDR,R14  CVTHEX
         LW,R12   R13
         B        *R4
*************************************
CHKALL   EQU      %                 CHECK BAD SYSID TO SEE IF IT IS
         CI,R1    1                 ALL. IF SO GO TO ALLRET, IF NOT
         BNE      BADSID2           FALL INTO BADSID.
         AI,R6    2
         LI,R1    3
         BAL,R4   GETFLD
         LW,R4    TALL
         CW,R4    FLD
         BE       ALLRET
         AI,R6    -2
BADSID   EQU      %                 -------------------------------------
         SLS,R1   -1                FLAG BAD FIELD ON CC. THEN GO TO
         SW,R6    R1                NEXT FIELD.  VARIOUS AJUSTMENTS TO
BADSID2  LI,R0    '#'               POINTER ARE AVAILABLE.  DEFAULT
BADSID3  PSW,R8   TMPSTK            FLAG IS '#' BUT OTHER ENTRIES ALLOW
         BAL,R8   MARKERR           OTHER FLAGS.
         PLW,R8   TMPSTK
BADSID4  EQU      %
         LI,R1    COBLMSK
         BAL,R4   TRT
         B        COMRET
BADSID1  AI,R6    -1
         B        BADSID2
*********************************************
MARKERR  EQU      %                 PUT NEW FLAG INTO FLAG LINE
         MTW,0    MRKD              :
         BNEZ     REMARK            THE FLAG IN R0 IS PLACED UNDER
         LCI      2                 THE APPROPRIATE FEILD IN THE LISTED
         PSM,R10  TMPSTK            CC.  IF THIS IS THE FIRST ERROR, THE
         BAL,R11  MOVECC            FLAG LINE IS CREATED AND A MESSAGE
         LW,R1    CCMVD
         BEZ      MKER1
         LW,R1    RB:SPMF,R5        APPROPRIATE TO THE TYPE OF CC IS
         AW,R1    ARSE
         CI,R1    1024-8-8-100      PLACED IN THE MESSAGE FILE FOLLOWING
         BLE      %+4               THE FLAG LINE.  IF THERE IS NOT ROOM
         PSW,R6   TMPSTK            FOR BOTH THE FLAG LINE AND MESSAGE
         BAL,R10  FORCE             THE CURENT BUFFER IS WRITTEN AND A
         PLW,R6   TMPSTK            NEW ONE STARTED.
         STW,R7   MRKD
         LW,R1    ARSE
         AI,R1    3
         STB,R1   80BLNK
         LI,R1    80BLNK
         BAL,R11  MOVEMES
MKER1    MTW,3    MRKD
         LB,R1    COM
         LB,R1    MKMES,R1
         AI,R1    MSBSE
         BAL,R11  MOVEMES
         LCI      2
         PLM,R10  TMPSTK
REMARK   EQU      %
         LW,R1    CCMVD
         BEZ      *R8
         LW,R1    R6
         SW,R1    BCP
         CI,R5    LCLX
         BE       %+4
         CI,R1    64
         BL       %+2
         AI,R1    1
         AW,R1    MRKD
         STB,R0   0,R1
         B        *R8
********************************************
FINDSID  EQU      %                 FIND AND CHECK ALL ENTRIES WITH A
         LI,R2    0                 GIVEN SYSID
         STW,R2   NYID              :
         STW,R2   FFLG              ENTER WITH THE SYSID IN R12.  R11
         LI,R1    FOPRI             POINTS TO A ROUTINE TO BE ENTERED
         BAL,R0   FIND              FOR EACH LEGAL ENTRY.  IF THE SYSID IS
         B        FSID3             NOT FOUND AT ALL IT IS FLAGGED WITH
         CH,R12   BH:SID,R2         A '*' IF NO ENTRY HAS THE RIGHT RBID
         BNE      FIND1             THE SYSID IS FLAGGED WITH A '%'.
         LB,R14   RBB:ID,R5         EXIT IS TO COMRET1 WHICH FINDS THE
         CB,R14   BB:RID,R2         NEXT FIELD AND EXITS TO PROCD.
         BE       FSID2
         MTW,1    NYID
         B        FIND1
FSID2    MTW,1    FFLG
         BAL,R4   CKGO
         CI,R1    RUNPRI
         BG       FIND1
FSID3    EQU      %
         MTW,0    FFLG
         BNEZ     COMRET1
         LI,R8    PROCD2-1
         MTW,0    NYID
         BEZ      FSID7
FSID4    EQU      %
         LI,R0    '%'
FSID6    EQU      %
         AI,R6    -1
         PSW,R8   TMPSTK
         BAL,R8   MARKERR
         PLW,R8   TMPSTK
         AI,R6    1
         B        COMRET
FSID7    EQU      %
         LI,R0    '*'
         B        FSID6
*******************************************
ALL1     AI,R11   1                 FIND ALL SYSIDS FOR AN RBID.
ALL      EQU      %                 :
         LI,R1    FOPRI             ENTER WITH R11 POINTING TO A
ALL2     EQU      %                 ROUTINE TO BE ENTERED FOR EACH SYSID.
         LI,R4    FIND1             EXIT TO R11-1 WHEN ALL SYSIDS HAVE BEEN
         LB,R12   RBB:ID,R5         FOUND.
         BAL,R0   FIND
         B        ALLOUT
         CB,R12   BB:RID,R2
         BNE      FIND1
CKGO     EQU      %
         CI,R1    RUNPRI
         BNE      *R11
         LW,R15   DELBIT
         CW,R15   BW:SDA,R2
         BANZ     FIND1
         MTW,1    FFLG
         B        *R11
ALLOUT   AI,R11   -1
         B        *R11
*****************************************
GETFLD   EQU      %                 GET FIELD FROM CC AND MOVE IT TO
         LI,R15   BA(FLD)           FLD.  FLD IS CLEARED TO BLANKS
         LW,R14   80BLNK+1          AND MOVFLD IS ENTERED TO MOVE THE FIELD.
         STW,R14  FLD
         STW,R14  FLD+1
         AND,R1   XF                ---------------------------------
MOVFLD   EQU      %                 MOVE A FIELD FROM A CC TO A
         STB,R1   R15               SPECIFIED BUFFER.  R6 IS THE ADDR
         LW,R14   R6                OF THE END OF THE FIELD, R1 IS THE
         SW,R14   R1                BYTE COUNT. R15 IS THE ADDR OF THE
         MBS,R14  0                 DESTINATION BUFFER.
         B        *R4
************************************************:
TRT      EQU      %                 SEARCH BYTE STRING FOR GIVEN CHARACTER
         PSW,R7   TMPSTK            TYPE.  ENTER WITH MASK IN R1, CURENT
         LI,R7    BA(TRTBL)         POSITION IN R6.  EXIT WITH R1= SCAN
         XW,R6    R7                BYTE COUNT,R6 AJUSTED TO NEW POSITION
         STB,R1   R6                ANDED MASK IN TOP BYTE OF R6 AND
         LI,R1    X'FF'             DELIMITER BITS IN THE CONDITION CODES.
         STB,R1   R7                SEE TRTBL FOR EXPLANATION OF MASKS
         TTBS,R6  0
         LB,R0    R7
         SW,R1    R0
         XW,R6    R7
         LB,R0    R7
         STB,R0   R6
         PLW,R7   TMPSTK
         LC       R6
         B        *R4
************************************
PROCD    EQU      %                 PROCESS STRINGS OF SYSIDS ON CCS
         LI,R8    PROCD2-1          :
         AI,R11   1                 ENTERED AS FOLLOWS:
         LI,R1    NBMSK             :
         BAL,R4   TRT                          BAL,11  PROCD
         BCS,EOC  ALLRET                       B       END OF SYSIDS
         BCS,EOC  ALLOUT                       ROUTINE TO PROCESS EACH SYSID
PROCD2   EQU      %                 :
         BCS,COMA BADSID1           THE CARD IS SCANNED AND THE CALLERS
         LI,R1    NXMSK             ROUTINE IS ENTERED FOR EACH SYSID
         BAL,R4   TRT               FOUND(IF IT IS LEGAL)  ILLEGAL SYSIDS
         BCR,CEB  CHKALL            ARE FLAGGED IN THE MESSAGE FILE.
         BCS,EOC  %+2
         BCS,PAR  BADSID
PROCD3   CI,R1    4
         BG       BADSID
         LI,R3    16
         BAL,R4   CVTSID
         CI,R12   X'5A5B'
         BG       BADSID
         CI,R12   0
         BLE      BADSID
         B        FINDSID
***********************************************
PRODCDA  STW,R11  STATX
PRODCD   EQU      %
         LW,R9    FLAGS
         LI,R8    PRDC1
         AI,R11   1
         LI,R1    NBMSK
         BAL,R4   TRT
         BCS,EOC  PRDC3
PRDC1    EQU      %
         BCS,EOC  ALLOUT
         BCS,COMA BADSID1
         LI,R1    COBLMSK
         BAL,R4   TRT
         BCS,PAR  BADSID
         CI,R1    2
         BG       BADSID
         BAL,R4   GETFLD
         LH,R12   FLD
         LW,R3    STATX
         BNEZ     PRDCA1
         LI,R3    BA(RBB:HOU)-BA(STB:LNK)
         AW,R3    R5
PRCDX    EQU      %
         LB,R3    STB:LNK,R3
         BEZ      PRDC4
         MTB,0    STB:TYP,R3
         BEZ      PRCDX
         CH,R12   STH:NM,R3
         BNE      PRCDX
PRDC2    EQU      %
         BAL,R4   *R11
         B        FSID4
         B        COMRET
PRDC4    EQU      %
         BAL,R4   GTDVX
         B        FSID7
         B        FSID4
PRDC3    EQU      %
         CW,R9    HASPBIT
         BANZ     BADCRD
         LB,R3    RBB:HOU,R5
         BEZ      BADCRD
         B        PRDC2
PRDCA1   EQU      %
         BAL,R4   GTDVX
         B        FSID7
         B        PRDC2
GTDVX    EQU      %
         LI,R3    MXSTRM
         CB,R5    SNDDX,R3
         BE       %+3
GTDVXX   EQU      %
         BDR,R3   %-2
         B        0,R4
         MTB,0    STB:TYP,R3
         BEZ      GTDVXX
         CH,R12   STH:NM,R3
         BNE      GTDVXX
         B        1,R4
****************************************
COMRET1  LI,R8    PROCD2-1          SKIP ACROSS COMMA TO NEXT FIELD
COMRET   EQU      %                 :
         LI,R1    NBMSK             GOES FROM MARK (') TO MARK
         BAL,R4   TRT               :
         BCR,COME BADSID2                ...FIELD   ,   FIELD...
COMRET2  EQU      %                             '       '
         BCS,EOC  *R8               :
         AI,R6    1                 IF IMPROPERLY DELIMITED FIELDS ARE
         LI,R1    NBMSK             FOUND THE ARE MARKED (#) AND THE NEXT
         BAL,R4   TRT               FIELD IS FOUND.
         B        *R8               ---------------------------------------
ALLRET   EQU      %                 SET ALL FLAG AND GO TO ALL IF ALL
         MTW,1    ALLX              IS SPECIFIED OR IMPLIED ON THE CC.
         B        ALL
*****************************************
PROCID   EQU      %                 PROCESS WSN ON CC.
         AI,R10   1                 :
         BAL,R4   GETFLD            ENTERED AS FOLLOWS:
         LI,R4    LCLX              :
         LD,R12   FLD                       BAL,10 PROCID
         CD,R12   TLCL                      B      BAD WSN
         BE       *R10                      B      WSN IS 'LOCAL' OR CONNECTED
         LW,R4    RBLIMS+1                  RBID IS IN R15 RECORD IS IN REC.
PRIDC0   EQU      %
         CD,R12   RBD:WSN,R4        :
         BNE      PRIDC
         LW,R14   IDUBTS
         CW,R14   RB:FLAG,R4
         BANZ     *R10
PRIDC    EQU      %
         AI,R4    -1                AND R1 IS THE BYTE COUNT.  THE WSN IS
         CW,R4    RBLIMS            CHECKED TO SEE IF IT IS LOCAL OR ALREADY
         BGE      PRIDC0
         AI,R10   1                 DCT INDEX OF THE LOGGED ON RBT IN R4.
PID0     EQU      %
         LI,R15   BA(FLD)+1         OTHERWISE A KEYED READ IS DONE ON :RBLOG
         BAL,R4   GETFLD+1          USING THE WSN AS THE KEY.  IF THE READ IS
         STW,R10  SV10              SUCCESSFUL THE RBID IS PUT IN R15 AND PROCID
         STB,R1   FLD               EXITS.  IF NOT AND THE ERROR CODE IS X'43'
PID1     EQU      %                 (NO RECORD WITH THAT KEY) THE ERROR RETURN
         BAL,R11  SVIV              IS TAKEN.  THE OPERATOR IS INFORMED OF
         CAL1,1   OPNXX             UNEXPECTED ERROR CODES.
         CAL1,1   RDXX
         LB,R15   REC
PIDN     EQU      %
         CAL1,1   CLSXX
         STW,R4   SVZ
         B        *SV10
PIDEA    EQU      %
         LH,R15   R10
         CI,R15   X'4300'
         BE       PIDNG
         CI,R15   X'1402'
         BNE      PIDUNK
         CAL1,8   WAIT
         AI,R8    -1
         B        *R8
PIDUNK   EQU      %
         BAL,R11  HEXC
         STW,R13  ABNM1
         LI,R4    ABNM
         BAL,R8   TEL%OP1
*
*
*O*      MESSAGE: CANNOT ACCESS :RBLOG! CODE = ERR/ABN
*O*
*O*      MEANING: THE SYSTEM CANNOT LOG ON REMOTE PROCESSING TERMINALS
*O*               BECAUSE THE :RBLOG REMOTE AUTHORIZATION FILE CANNOT BE
*O*               ACCESSED.
*O*
*O*      ACTION:  USE THE ERR/ABN CODE TO CORRECT THE PROBLEM WITH :RBLOG
*O*               AND ASK THE REMOTE TERMINAL TO RETRY HIS LOGON
*O*
*
*
PIDNG    EQU      %
         MTW,-2   SV10
         LW,R8    Y002
         CW,R8    M:XX
         BANZ     PIDN
         B        PIDN+1
***********************************************:
DEC      EQU      %                 CONVERT A BINARY NUMBER TO EITHER DEC.
         LI,R13   10                OR HEX EBCDIC.  THE NUMBER TO CONVERT
         B        %+2               IS IN R15 THE CONVERTED NUMBER RIGHT
HEXC     EQU      %                 AJUSTED BLANK PADDED IS IN R13 ON EXIT.
         LI,R13   16
         STW,R13  CVT
         LI,R13   0
DH1      EQU      %
         LI,R14   0
         DW,R14   CVT
         CI,R14   10
         BGE      %+2
         AI,R14   '0'-'A'+10
         AI,R14   'A'-10
         SLS,R13  -8
         STB,R14  R13
         CI,R15   0
         BG       DH1
         CI,R13   X'40'
         BANZ     %+3
         SLS,R13  -8
         B        %-3
         OR,R13   80BLNK+1
         B        *R11
**************************************************
PROCJOB  EQU      %                 PROCESS !JOB COMMAND
         AI,R6    5                 :
         LI,R1    NBMSK             GET THE NAME,ACCOUNT,PRIORITY,AND WSN
         BAL,R4   TRT               FIELDS AND TYPE THEM WITH THE SYSID ON
         BCS,COME BADXIT            THE OPERATORS CONSOLE.  SKIP OVER THE
         LI,R1    NNMSK             EXTENDED ACCOUNTING IF PRESENT.
         BAL,R4   TRT               IF THE JOB IS REMOTE CHECK FOR MAX PRIO
         BCR,CEB  BADXIT            AND :SYS ACCOUNT.  IF ANYTHING BUT THE
         CI,R1    8                 MAX PRIO IS IN ERROR PUT A MESSAGE IN THE
         BG       BADXIT            MESSAGE FILE AND SET THE ABORT FLAG.  THE
         BAL,R4   GETFLD            ACCOUNT IS PUT IN BD:ACCT AND THE PRIO IS
         LD,R12   FLD               SAVED TO USE ADDING THE FILE LATER.  IF
         CD,R12   SYS               THE JOB CAME FROM JOBENT THE ORIGON IS
         BNE      PJ1               IN THE TOP BYTE OF CURSID AND AN APPRO-
         CI,R5    LCLX              PRIATE JOB MESSAGE IS CHOSEN.
         BE       PJ1
         LW,R9    FLAGS
         CI,R9    SYSBIT
         BANZ     PJ1
         LI,R1    NOSYS
         LI,R11   LSTSECT
         B        MOVEMES
PJ1      EQU      %
         LW,R2    ADDX
         STD,R12  BD:ACCT,R2
         LI,R3    0
         LH,R15   CURSID
         BEZ      PJ3
         LI,R3    1
         CI,R15   SMUIS
         BLE      %+2
         LI,R3    2
         BAL,R11  HEXC
         LD,R14   SIDPTR
         MBS,R14  0
PJ3      EQU      %
         LD,R14   JBMS,R3
         MBS,R14  0
         BAL,R4   MOVFLD
         BAL,R4   COMEDIT
         BAL,R8   COMRET
         BCS,EOC  BADXIT
         LI,R1    NNMSK
         BAL,R4   TRT
         BCR,CEB  BADXIT
         CI,R1    12
         BG       BADXIT
         BAL,R4   MOVFLD
         BAL,R4   COMEDIT
         LI,R14   BA(RBJOBM1)
         AW,R15   Y04
         MBS,R14  0
         BAL,R4   COMEDIT
         LI,R1    NBPMSK
         BAL,R4   TRT
         BCR,CEP  BADXIT
         BCR,PAR  %+3
         LI,R1    COMMSK
         BAL,R4   TRT
         BAL,R8   COMRET
         BCS,EOC  DFLTPRI
         LI,R1    NXMSK
         BAL,R4   TRT
         BCR,CEB  BADXIT
         CI,R1    1
         BG       BADXIT
         BL       DFLTPRI
         AI,R6    -1
         LB,R3    0,R6
         AI,R6    1
         AI,R3    -'0'
         BGEZ     %+2
         AI,R3    '0'-'A'+10
         BAL,R4   MOVFLD
         CI,R5    LCLX
         BE       PRIN
         CB,R3    RBB:MXP,R5
         BLE      PRIN
         LB,R3    RBB:MXP,R5
         MTB,1    R3
PRIN     EQU      %
         STW,R3   PRIO
         BAL,R8   COMRET
         BCS,EOC  JOBDN
         BAL,R4   COMEDIT
         LI,R1    NNMSK
         BAL,R4   TRT
         BCR,CEB  BADXIT
         CI,R1    8
         BG       BADXIT
         BAL,R4   MOVFLD
JOBDN    EQU      %
         MTB,0    PRIO
         BEZ      %+3
         LI,R1    BADPRI
         BAL,R11  MOVEMES
         LI,R8    RESLIM
*
*
*O*      MESSAGE: *(RBNDD - WSN **) JOB ACCOUNT,NAME,SYSID,PRIORITY,(WSN)
*O*                (ID:TERMINAL)
*O*                (ID:PROCESSOR)
*O*
*O*      MEANING: A BATCH JOB HAS BEEN ENTERED INTO THE BATCH QUEUE AND
*O*               ASSIGNED THE GIVEN SYSID. IF ONE OF THE LEADING OPTIONS
*O*               IS PRESENT IT DESCRIBES EITHER THE REMOTE PROCESSING
*O*               STATION OR THE USER THAT SUBMITTED THE JOB
*O*
*O*      ACTION:  NONE - INFORMATION ONLY
*
*
TEL%OPJ  EQU      %
         AI,R15   -BA(OPBUF)-1
         LI,R1    ' '
         STB,R1   OPBUF
         LI,R4    OPBUF
         CLM,R5   RBLIMS
         BCS,9    %+3
         LI,R4    RBOPBUF
         AI,R15   RBOPSZ
         STB,R15  *R4
         B        TEL%OP            --------------------------------------------
RESLIM   EQU      %                 PROCESS !RES AND !LIMIT COMMANDS
         LI,R1    RESCOM
         STB,R1   COM               PROCESS THE COMMAND BY BALING TO PROCOP
         MTW,0    MRKD              IF ERRORS ARE FLAGGED SET THE ABORT FLAG
         BEZ      %+2               IF THEL JOB IS LOCAL LIST ALL CCS IN THE
         MTW,1    ABORT             MESSAGE FILE. WHEN OUT OF THESE CCS EXIT TO
         BAL,R4   NXTCC             PJDN.
RSL1     EQU      %
         LB,R1    R14
         CI,R1    '!'
         BNE      PJDN
         CD,R14   PASSWORD
         BE       NXTCC
         MTW,0    CONT
         BEZ      %+3
         MTW,-1   CONT
         B        DORES
         SLD,R14  8
         CW,R14   RES
         BE       DORES
         CW,R14   LIMIT1
         BNE      PJDN
         SLD,R14  16
         CW,R14   LIMIT2
         BNE      PJDN
DORES    CI,R5    LCLX
         BNE      %+2
         BAL,R11  MOVECC
         LW,R2    ADDX
         LI,R4    RESOPTS
         LI,R1    RESPTR
         LI,R10   RESLIM+2
         LI,R11   CHKRS
         B        PROCOP
*******************************************
DFLTPRI  EQU      %                 IF NO PRIORITY IS SPECIFIED ON THE JOB CC
         LI,R12   '1'               PUT THE DEFAULT (1) IN THE JOB MESSAGE
         BAL,R4   EDIT              AND USE IT TO ADD THE FILE.
         LI,R3    1
         B        PRIN              --------------------------------------------
COMEDIT  EQU      %                 EDIT IN VARIOUS CHARACTERS INTO A MESSAGE
         LI,R12   ','               CHARACTER IN R12 CURENT POINTER IN R15.
EDIT     LW,R3    R15
         STB,R12  0,R3
         AI,R15   1
         B        *R4
*****************************************
BADXIT   EQU      %                 HANDLE ERRORS ON JOB CCS
         AI,R6    -1                :
         LI,R0    '#'               FLAG THE ERROR WITH A '#' AND IF LOCAL
         BAL,R8   MARKERR           TEL THE OPERATOR.
         CI,R5    LCLX
         BNE      RESLIM
         LI,R4    ILJOBM
         LI,R8    RESLIM
         B        TEL%OP1           DONE WITH ALL !JOB AND RES COMMANDS
*
*
*O*      MESSAGE: *ILLEGAL JOB COMMAND
*O*
*O*      MEANING: THE JOB JUST INPUT FROM A LOCAL DEVICE HAS AN ILLEGAL
*O*               JOB COMMAND AND IS BEING ABORTED.
*O*
*O*      ACTION:  IF POSSIBLE, CORRECT THE JOB COMMAND AND RE-SUBMIT THE
*O*               JOB
*O*
*
*
PJDN     EQU      %                 :
         LW,R2    ADDX              GET BATCH INDEX
         LH,R2    BH:SLNK,R2
         BEZ      NOSH
         LI,R1    SV:RSIZ
         LB,R13   *BADRS,R1
         AND,R13  M7
         STH,R13  BSL:CRES,R1
         BDR,R1   %-3
         LB,R4    S#B:TYP,R2
         MTH,1    BSL:CRES,R4
         LH,R2    S#H:LNK,R2
         BNEZ     %-3
         LI,R4    SV:RSIZ
PJDN3    EQU      %
         LH,R13   BSL:CRES,R4
         CH,R13   SH:RTOT,R4
         BLE      PJDN2
         LH,R11   SH:RNM,R4
         STH,R11  TXRLE+1
         LI,R1    TXRLE
         BAL,R11  MOVEMES
         STW,R11  ABORT
PJDN2    EQU      %
         BDR,R4   PJDN3
NOSH     EQU      %
         MTW,0    ABORT             IF THE ABORT FLAG IS SET GO TO JOBABRT.
         BNEZ     JOBABRT           IF NOT PUT THE ENTRY ON THE APPROPRIATE
         LW,R14   PRIO              PRIORITY CHAIN,SET THE BITS IN BH:PART
         STB,R14  *BADRS
         BAL,R8   ADDJOB            (MBSOP), AND BUMP S:BFIS.
         BAL,R11  MBSOP             IF THE JOB IS LOCAL RELEASE THE MESSAGE
         MTW,1    S:BFIS
         BAL,R8   PRTCK
         CH,R13   BH:PART,R2
         BANZ     %+3
         LI,R4    NRMES
         BAL,R8   TEL%OP1
*
*
*O*      MESSAGE: *ABOVE JOB NEEDS PARTITION CHANGE
*O*
*O*      MEANING: THE JOB JUST SUBMITTED CANNOT RUN WITH THE CURRENT
*O*               PARTITION ATTRIBUTES
*O*
*O*      ACTION:  IF IT IS REQUIRED THAT THE JOB RUN, USE THE DISPLAY
*O*               KEYIN TO DETERMINE THE PARTITION SETTINGS REQUIRED
*O*               AND CONTROL TO SET THEM
*O*
*
*
         LI,R8    PJDN1
         CI,R5    LCLX
         BE       RELMF
         LI,R1    ACCPTM
         BAL,R11  MOVEMES
         BAL,R4   RBCCOUT
PJDN1    EQU      %
         LI,R11   AIFOUT
         B        MBS               ---------------------------------------
JOBABRT  EQU      %                 JOB ABORTED FOR JOB OR RES ERRORS.
         LI,R4    ABORTM            :
         BAL,R8   TEL%OP1           TEL THE OPERATOR AND THE USER VIA THE
*
*
*O*      MESSAGE: *JOB ABORTED
*O*
*O*      MEANING: THE JOB JUST SUBMITTED IS BEING ABORTED FOR JOB OR
*O*               LIMIT CARD ERRORS.
*O*
*O*      ACTION:  IF POSSIBLE CORRECT THE CARDS IN ERROR OR INFORM THE
*O*               SUBMITTER OF THE JOB.  AN ABORT LISTING WILL BE PRINTED
*O*
*
*
         LW,R2    ADDX              MESSAGE FILE. IF THE JOB IS REMOTE GO
         BAL,R8   ABRS#             TO RBCCOUT THEN TO DELJOB. IF THE JOB
JBAB1    EQU      %                 IS LOCAL WRITE THE MESSAGE FILE AND
         LI,R1    ABORTM            EXIT TO DELJOB
         BAL,R11  MOVEMES
         CI,R5    LCLX
         BNE      LSTSECT
         BAL,R8   WMF
DELJOB   EQU      %                 RELEASE BAD JOB FILE
         LI,R14   DELPRI            :
         BAL,R8   ADDJOB            CHAIN THE ENTRY TO THE DELETE CHAIN
AIFOUT   EQU      %                 ------------------------------------------
         LI,R6    0                 CLEAN UP AFTER PROCESSING AN INPUT FILE
         STW,R6   FINFLG            AND RELEASE THE DISC BUFFER.
         STW,R6   ABORT
         STW,R6   CONT
         STW,R6   ARSO
         XW,R6    SECT
         BEZ      CTR1
         LI,R4    CTR1
         B        FRE256            -----------------------------------------
********************************************************
PRTCK    EQU      %
         LI,R3    LPART
         LI,R13   0
         LI,R14   1                 PARTITION LOCK FLAG
         CH,R14   PLH:FLG,R3
         BANZ     %+2
         OR,R13   BT31TO0,R3
         BDR,R3   %-3
         B        *R8
ABRS#    EQU      %                 RELEASE THE SERIAL NUMBER ENTRIES FOR
         LH,R14   BH:SLNK,R2        AN INPUT FILE ENTRY.
         BNEZ     ABS#1
         LH,R14   BH:XLNK,R2
         BEZ      *R8
         LI,R15   0
         STH,R15  BH:XLNK,R2
ABS#1    EQU      %
         LH,R15   S#H:LNK
         STH,R14  S#H:LNK
         LW,R3    R14
         LH,R14   S#H:LNK,R3
         BNEZ     %-2
         STH,R15  S#H:LNK,R3
         B        ABRS#+2
******************************************
RB%LRR   EQU      %                 REMOTE BATCH LOGON RECORD RECIEVED
         STW,R9   FLAGS             :
         BAL,R11  SVIV              GET THE RECORD FROM THE MONITOR BUFFER
         LW,R11   RCVRFLG           AND RELEASE IT.  CHECK TO BE SURE THIS
         BNEZ     LRRCVR            IS AN RBID COMMAND.  IF NOT PRINT AN
         LW,R14   2,R7              ERROR MESSAGE.  GET THE WSN AND IF VALID
         SLS,R14  2                 SYNTACTICALLY (SIC) BAL TO PROCID TO CHECK
         LW,R15   IDPTR             IT.  IF NOT O.K. PRINT AN ERROR MESSAGE.
         MBS,R14  0                 OTHERWISE GET THE INFO FROM THE RECORD
         LW,R14   2,R7              AND PUT IT WHERE IT BELONGS.  THEN WRITE
         BAL,R11  RMB               A MESSAGE FILE TO TEL THE USER THAT HE
         STW,R11  SVZ               IS LOGGED ON AND INCLUDE THE STATUS
         LI,R6    0
         CW,R9    2780BIT
         BANZ     27LRR
         CW,R9    HASPBIT
         BAZ      LRR4
         LI,R6    5
         LB,R2    ID,R6
         CI,R2    X'F0'
         BNE      NOTID
         LI,R6    6
         LB,R2    ID,R6
         CI,R2    'A'
         BNE      NOTID
         LI,R6    7
         LB,R1    ID,R6
         LD,R2    ID+2
         SLD,R2   -8
         STB,R1   R2
         B        LRR3
LRR4     EQU      %
         LD,R2    ID
LRR3     EQU      %
         LI,R1    EOC
         STB,R1   ID+20,R6
         AI,R6    8
         CD,R2    TSGON
         BE       LRR5
         AI,R6    5-8
         AND,R3   YFFFF
         CD,R2    TRBID
         BNE      NOTID
LRR5     EQU      %
         AI,R6    BA(ID)
         LI,R1    NBMSK
         BAL,R4   TRT
         BCS,CEB  ILID
         LI,R1    NNMSK
         BAL,R4   TRT
         BCR,CEB  ILID
         CI,R1    8
         BG       ILID
         BAL,R10  PROCID
         B        ILID
         B        SAMID
LRR2     EQU      %
         LW,R13   BSCBTS
         LW,R12   RB:FLAG,R5
         CS,R12   FLG+REC
         BE       LRR9
         CW,R13   FLG+REC
         BAZ      ILID
         CW,R12   AL%DCBIT
         BAZ      ILID
         LI,R1    1
         LW,R10   2780BIT
         CW,R10   FLG+REC
         BANZ     %+2
         LI,R1    0
         LD,R10   HNDL,R1
         BEZ      ILID
         STW,R10  DCT8,R5
         STW,R11  DCT9,R5
         LW,R12   TBTS,R1
         STS,R12  RB:FLAG,R5
         STS,R12  FLAGS
LRR9     EQU      %
         STB,R15  RBB:ID,R5
         LB,R1    MXPRI+REC
         STB,R1   RBB:MXP,R5
         LB,R1    REC+RMT#
         STB,R1   RBB:DSM,R5
         LW,R15   FLG+REC
         STS,R15  FLAGS
         STS,R15  RB:FLAG,R5
         LI,R1    0
SET%STRM EQU      %
         LI,R15   2
         LB,R3    STB:LNK
         BEZ      NO%STRM
         LB,R10   SSIG,R3
         BEZ      SS01
         CAL1,8   WAIT
         BDR,R15  %-3               I'M ASHAMED OF THIS
         B        NO%STRM5
SS01     EQU      %
         STB,R5   SNDDX,R3
         LB,R10   STB:LNK,R3
         STB,R10  STB:LNK
         LI,R11   RBB:HFE
         LH,R15   REC+NMTBL,R1
         STH,R15  STH:NM,R3
         LB,R14   REC+RCBTBL,R1
         CW,R14   REC+SMD
         BNE      %+2
         STB,R3   RBB:SMD,R5
         STB,R14  STB:TYP,R3
         LB,R15   REC+MXTBL,R1
         CI,R14   6
         BNE      %+2
         STB,R15  RBB:LPZ,R5
         CI,R14   5
         BNE      %+2
         STB,R15  RBB:CPZ,R5
         LH,R15   REC+SUSTBL,R1
         STH,R15  STH:SUS,R3
         LH,R15   REC+F1TBL,R1
         CI,R15   OCBIT
         BAZ      STRM1
         LI,R13   6
         LI,R11   RBB:HOU
         CW,R14   REC+SMD
         BNE      STRM2
         STW,R11  ARSO
         B        STRM2
STRM1    EQU      %
         LI,R13   X'1'
         CI,R15   INBIT
         BANZ     %+3
         LI,R13   X'82'
         LH,R10   REC+F2TBL,R1
         CI,R15   XSETBIT
         BAZ      STRM2
         AI,R13   4
STRM2    EQU      %
         CI,R15   X'1000'
         BAZ      %+2
         AI,R13   X'10'
         CI,R10   X'40'
         BAZ      %+2
         AI,R13   X'40'
         AND,R15  M15
STRM15   EQU      %
         LW,R9    FLAGS
         CW,R9    HASPBIT
         BAZ      %+2
         AI,R13   8
         STB,R13  SYMX,R3
         STH,R15  STH:FLG,R3
         LI,R15   0
         STW,R15  STW:FORM,R3
         LB,R15   REC+DPDTBL,R1
         STB,R15  STB:DPD,R3
         LB,R14   *R11,R5
         STB,R14  STB:LNK,R3
         STB,R3   *R11,R5
         AI,R1    1
         CW,R1    REC+#STRM
         BLE      SET%STRM
         LD,R0    REC+GJOB
         BEZ      STRM3
         LCI      0
         PSM,R0   TMPSTK
         BAL,R10  T:GJOBSTRT
         LCI      0
         PLM,R0   TMPSTK
STRM3    EQU      %
         LW,R9    FLAGS
         CW,R9    BSCBTS
         BANZ     GRBPGR
         LB,R11   REC+RTY
         STW,R11  RB:BUF,R5
         B        LRR1
GRBPGR   EQU      %
         BAL,R11  SVIV
         LW,R14   RCVRFLG
         BNEZ     NO%STRM1
GRBPG    EQU      %
         BAL,R11  T:STLPP
         AI,R3    0
         BGZ      PGOK
         BEZ      GRPG1
         AI,R14   0                 CAN WE DECREMENT S:STLC ??
         BNEZ     GRPG1             NO.
         WD,0     X'37'
         AWM,R3   S:STLC
         BLZ      %+2
         STW,R3   S:STLC
         WD,0     X'27'
         LI,R14   1                 INDICATE S:STLC ALREADY MODIFIED.
GRPG1    EQU      %
         CAL1,8   GTPG
         CAL1,8   FREPG
         B        GRBPG
PGOK     EQU      %
         STW,R3   RB:BUF,R5
         STW,R3   SAD
         MTB,7    SAD
         CAL1,8   SAD
         BCR,8    %+3               IF WE DIDN'T GET IT
         CAL1,8   FVP               MUST NOT HAVE FREED IT
         B        %-3               OR LETS SEE DUMP OF LOOP
         LW,R1    ZERPTR
         MBS,0    ZERO
         LB,R1    REC+RTY
         STW,R1   VP+RTRY
         LI,R1    0
         LW,R9    FLAGS
         CW,R9    2780BIT
         BAZ      H%STCXT
         AI,R3    X'100'
         LI,R4    37BUFDIF            .
         CW,R9    3780BIT             .
         BANZ     80%ST2              .
         LI,R4    0
         WD,0     X'37'
         LW,R8    SPOOL
         STW,R3   SPOOL
         STW,R8   VP+X'100'
         WD,0     X'27'
         B        80%ST1              .
80%ST2   EQU      %                   .
         LI,R14   IRS                 .
         STW,R14  VP+OCRCB            .
80%ST1   EQU      %                   .
         STW,R1   VP+SPB+BUFSZ,R4     .
         AI,R3    SPB-X'100'
         STW,R3   VP+HRB
         AI,R3    BUFSZ
         AW,R3    R4
         STW,R3   VP+SPB
         MTW,1    TTYP+VP
         LB,R1    REC+BUFX
         STW,R1   VP+CONTCK
         B        LRR10
H%STCXT  EQU      %
         STW,R1   VP+BUF2
         STW,R1   VP+BUF4
         STW,R1   VP+BUF1
         AI,R3    BUF1+1
         STW,R3   VP+CRB
         AI,R3    BUFSZ-1
         STW,R3   VP+HRB
         AI,R3    BUFSZ
         STW,R3   VP+HBB
         AI,R3    BUFSZ
         STW,R3   VP+BUF3
         LI,R3    ARFCN
         STW,R3   VP+CFC
         LW,R13   REC+OCIN
         STW,R13  VP+OCRCB
         LI,R15   ACTBIT-LIPBIT
         AWM,R15  RB:FLAG,R5
         LI,R0    ML%CTL
         LI,R15   0
         CW,R9    AL%DCBIT
         BAZ      H%STRT2
         CW,R9    SLVBIT
         BANZ     H%STRT1
         LW,R12   MAFCN
         B        H%STRT
H%STRT1  EQU      %
         LW,R3    RB:BUF,R5
         AI,R3    BUF4+1
         STW,R3   VP+CWB
         STW,R15  VP+BUF3
         LD,R2    SLSGBPT
         MBS,R2   0
         LD,R2    SLSGEPT
         MBS,R2   0
         LW,R1    REC+LGN
         BEZ      %+3
         LI,R2    BA(REC+LGN)
         B        H%S4
         LD,R2    RMTCLR
         LW,R1    REC+RMT#
         AND,R1   M16
         BEZ      H%S3
         LW,R2    RMTPUT
         STH,R1   RMTNUM+2
H%S3     MBS,R2   0
         LI,R2    BA(REC+SGON)
         LW,R3    SLSGSPTR
         MBS,R2   0
         LI,R2    SLSGM
H%S4     EQU      %
         LW,R3    SLSGPTR
         MBS,R2   0
         LI,R2    2+(VP+BUF4+2)**2
         LI,R9    SLSGCSZ
         PSW,R5   TMPSTK
         LI,R12   0
         BAL,R11  CRCH
         PLW,R5   TMPSTK
         STB,R12  0,R2
         SLS,R12  -8
         AI,R2    1
         STB,R12  0,R2
         LI,R14   SLSGWSZ
         LW,R12   SLFCN
         B        H%STRT
H%STRT2  EQU      %
         LW,R12   MNFCN
H%STRT   EQU      %
         LW,R13   RB:BUF,R5
         AI,R13   CRB
         OR,R12   R5
         BAL,R11  NEWQNW
         NOP
LRR10    EQU      %
         CAL1,8   FVP
         STW,R11  SVZ
LRR1     EQU      %
         LD,R14   REC+KEY
         STD,R14  YOURON3
         STD,R14  RBD:WSN,R5
         BAL,R4   SETHDR
         STW,R13  YOURON2
         STD,R2   YOURON1
         LI,R2    '  '
         STH,R2   YOURON1
         LI,R1    YOURON
         BAL,R11  MOVEMES
         LI,R4    ONMES
         BAL,R8   TEL%OP
*
*
*O*      MESSAGE: *RBNDD - WSN - LOGGED ON
*O*
*O*      MEANING: THE REMOTE PROCESSING TERMINAL CONNECTED TO RBNDD HAS
*O*               LOGGED ON AS WORKSTATION WSN
*O*
*O*      ACTION:  NONE - INFORMATION ONLY
*O*
*
*
         LW,R9    FLAGS
         BAL,R11  ALL1
         B        LRRD
         CW,R9    SLVXP2BT
         BAZ      STAT
         BAL,R4   REL
         LI,R4    FIND1
         B        STAT
LRRD     EQU      %
         MTW,1    ALLX
         BAL,R8   CHKSTAT
         LW,R9    FLAGS
         CW,R9    AL%DCBIT
         BANZ     %+2
         BAL,R8   MSG
         AI,R9    ACTBIT
         AND,R9   NA%LGBT
         LI,R4    CTR1
         CW,R9    SLVXP2BT
         BAZ      FINOUT
         PSW,R4   TMPSTK
         B        FIASET1
27LRR    EQU      %
         LI,R6    1
         LB,R1    ID+2
         LD,R2    ID
         SLD,R2   8
         OR,R3    R1
         B        LRR3
*************************************************
CRCH     EQU      %
         LI,R1    2
         LB,R5    0,R2
         CI,R5    DLE
         BE       CRCH1
         LB,R13   R12,R1
         AND,R12  M8
         EOR,R5   R12
         LH,R12   CRCTBL,R5
         EOR,R12  R13
CRCH1    EQU      %
         AI,R2    1
         BDR,R9   CRCH+1
         B        *R11
******************************************************
NOTID    EQU      %
         LI,R10   NOTIDM
         B        BADRID1
ILID     EQU      %
         LI,R10   ILIDM
         B        BADRID1
SAMID    EQU      %
         LI,R10   SAMIDM
BADRID1  EQU      %
         LI,R4    NOLOGM
         BAL,R8   TEL%OPR1
*
*
*O*      MESSAGE: *RBNDD FAILED TO LOG STATION ON!
*O*
*O*      MEANING: AN ATTEMPT TO LOG ON BY THE REMOTE TERMINAL CONNECTED
*O*               TO RBNDD HAS BEEN REJECTED BY THE SYSTEM.
*O*
*O*      ACTION:  IF THE MESSAGE IS PROCEEDED BY ANOTHER INDICATING A
*O*               CENTRAL SITE PROBLEM, CORRECT IT.  IF THE MESSAGE IS
*O*               REPEATED SEVERAL TIMES DISCONNECT THE LINE
*O*
*
*
         LW,R9    FLAGS
         LW,R3    AL%DCBIT
         AND,R3   RB:FLAG,R5
         BEZ      BADRID2
         LI,R2    0
         STS,R2   RB:FLAG,R5
         CW,R9    SLVBIT
         BANZ     BADRID2A
         B        RBDU1
BADRID2  EQU      %
         LI,R8    RBDU1
         CW,R9    BSCBTS
         BAZ      BADRID3
BADRID2A EQU      %
         LI,R1    RBXBIT
         STS,R1   RB:FLAG,R5
         LI,R8    CTR1
BADRID3  EQU      %
         LW,R4    R10
         LW,R12   RBTMSK
         B        TEL%RBT1
NO%STRM  EQU      %
         LI,R4    NSTRMM
         BAL,R8   TEL%OPR1
*
*
*O*      MESSAGE: *RBNDD INSUFFICIENT STREAMS
*O*
*O*      MEANING: THE REMOTE TERMINAL CONNECTED TO RBNDD CANNOT BE LOGGED
*O*               ON BECAUSE IT HAS MORE DEVICES THAN THE REMAINING
*O*               SYMBIONT STREAMS ON THE SYSTEM
*O*
*O*      ACTION:  INFORM THE WORKSTATION THAT HE CANNOT LOG ON AT THIS
*O*               TIME.  SUPER CAN BE USED TO REMOVE DEVICES FROM THE
*O*               WORKSTATION.  THIS MESSAGE MAY MEAN THAT NOT ENOUGH
*O*               STREAMS WERE SPECIFIED IN THE SYSGEN OF THE SYSTEM.
*O*
*
*
NO%STRM1 EQU      %
         LI,R3    0
         LB,R1    RBB:HFE,R5
         LB,R4    RBB:HOU,R5
         STB,R1   STB:LNK,R4
         BEZ      %+2
         STB,R4   STB:LNK
         STB,R3   RBB:ID,R5
         LI,R1    0
         STB,R1   RBB:HOU,R5
         STB,R1   RBB:HFE,R5
         LB,R1    STB:LNK,R1
         BEZ      %+3
         STB,R3   SNDDX,R1
         B        %-3
         LI,R10   NSTRRM
         B        BADRID1
NO%STRM5 EQU      %
         LB,R1    RBB:HFE,R5
         STB,R3   RBB:HFE,R5
         LB,R3    STB:LNK,R3
         BNEZ     %-1
         STB,R1   STB:LNK,R3
         B        NO%STRM
***************************************************
TEL%OP   EQU      %                 SEND A MESSAGE TO THE OPERATOR
         CLM,R5   RBLIMS            :
         BCS,9    TEL%OP1           THE MESSAGE CAN BE SENT WITH OR WITHOUT
TEL%OPR  EQU      %                 A DEVICE NAME AND/OR WSN.
         LD,R2    RBD:WSN,R5
         STW,R2   SPRID,R4
         STW,R3   SPRID+1,R4
TEL%OPR1 EQU      %
         LW,R15   R5
         LW,R12   RTYFCN
         B        %+2
TEL%OP1  EQU      %
         LW,R12   LTYFCN
TEL%HIM  EQU      %                 SEND A MESSAGE VIA NEWQ (NO WAIT)
         BAL,R11  SVIV              :
         LW,R11   MPOOL
         BEZ      WTQ
         LW,R11   *R11
         BEZ      WTQ
         LW,R11   *R11
         BEZ      WTQ
         LI,R11   -MAXBQ
         SAS,R11  -2
         AI,R11   MAXBQ
         CW,R11   CURBQ
         BGE      %+3
WTQ      CAL1,8   WAIT
         B        TEL%HIM+1
         BAL,R11  GMB               GET A MONITOR BUFFER AND PUT IN THE MESSAGE
         BEZ      WTQ
         LW,R3    R14               LINE FEED PRECEEDING THE MESSAGE.  THEN
         LW,R1    R14               GO TO NEWQNW TO OUTPUT.
         LW,R2    R4
         SLD,R2   2
         LW,R13   R3
         AI,R2    1
         LB,R14   *R4
         AND,R14  M7
         STB,R14  R3
         LB,R11   R12
         CI,R11  1
         BNE      TEL%H1
         LI,R0    X'15'
         STB,R0   0,R3
         AI,R3    1
         AI,R14   1
TEL%H1   EQU      %
         MBS,R2   0
         LI,R0    RMB
         BAL,R11  NEWQNW
         NOP
         STW,R11  SVZ
         B        *R8
***********************************************
TEL%RBT  EQU      %                 SEND A MESSAGE TO THE RBT DIRECTLY (VIA TEL%
         LW,R12   LGNMSK
TEL%RBT1 EQU      %
         LI,R15   0
TEL%RBT2 EQU      %
         AW,R12   R5
         B        TEL%HIM
*************************************************
STRTSYM  EQU      %
         LB,R15   BB:DEV,R2
         LW,R13   BW:FORM,R2
         LH,R12   BH:COMID,R2
         LH,R11   BH:SID,R2
         STW,R11  COMODM1           SAVE FOR COMODE MESSAGE
         LI,R11   X'7FFF'
         AND,R11  R12               KNOCK OFF 'LAST CHUNK' FLAG
         B        STSM1A
STSM1    EQU      %
         LI,R11   0
         LI,R12   0                 IN CASE WE COME IN FROM AIFNC
STSM1A   EQU      %
         LI,R3    0
         STW,R3   FRMCK
         LB,R3    SNDDX
         AI,R3    -2
STSM2    EQU      %
         MTH,0    STH:CMDV,R3
         BGEZ     %+3
         LI,R2    0
         STH,R2   STH:CMDV,R3
         CI,R3    MXSTRM
         BLE      STSM3+1
         LB,R2    SNDDX,R3
         BEZ      STSM3
         CB,R15   STB:TYP,R3
         BNE      STSM3
         LC       SYMX,R3
         BCS,8    STSM3
         LB,R2    SSIG,R3
         BNEZ     STSM3
         CH,R11   STH:CMDV,R3       DOES THE COMID FOR THIS FILE...
         BE       STSM2A            ...MATCH THAT FOR THIS DEVICE (YES)
         MTH,0    STH:CMDV,R3       NO: IS THE DEVICE IN COMODE
         BNEZ     STSM3             SURE IS, & ITS SOMEBODY ELSE'S COMODE
         LB,R1    SNDDX             LOOK TO SEE IF THIS FILE IS MATCHED
CMDVCHK  BDR,R1   %+2               ...TO ANY OTHER DEVICE
         B        STSM2A            NO: SO START THIS DEVICE IN COMODE
         CH,R11   STH:CMDV,R1       KEEP LOOKING...
         BE       STSM3             GOT A MATCH, DONT START ANOTHER...
         B        CMDVCHK           ...DEVICE ON THE SAME COMID.
STSM2A   EQU      %
         CW,R13   STW:FORM,R3
         BE       SYSG1
         STW,R3   FRMCK
STSM3    BDR,R3   STSM2
         LW,R3    FRMCK
         BEZ      *R8
SYSG1    EQU      %
         LI,R1    'I'
SYSG     EQU      %
         BAL,R11  SVIV
         LW,R11   RCVRFLG
         BNEZ     *R8
         STB,R1   SSIG,R3
         BAL,R11  SAQNSERT
         STW,R11  SVZ
         MTW,0    STARTCOM          WAS THIS START OF COMODE
         BEZ      *R8               NOPE
         PSW,R5   TMPSTK
         LCI      2
         PSM,R8   TMPSTK
         MTW,-1   STARTCOM
         LW,R15   COMODM1           GET HEX SYSID SAVED IN GOF
         BAL,R11  HEXC              CONVERT TO EBCDIC CHARS...
         STW,R13  COMODM1           PLACE IN MESSAGE TEXT
         LW,R3    SYMINDX
         LB,R3    SNDDX,R3          GET DCT INDEX
         LD,14    DCT16,R3          DEVICE MNEM
         SLD,R14  8                 ALIGN YYNDD & SHIFT OFF TAB CHAR
         LI,R3    1
         STH,R14  COMODM2,R3
         STW,R15  COMODM3           PUT INTO MESSAGE TEXT
         LI,R4    COMODMSG
         BAL,R8   TEL%OP1           PRINT MSG ON OC
         LCI      2
         PLM,R8   TMPSTK
         PLW,R5   TMPSTK
         B        *R8
PNDBIT   EQU      %
         LI,R0    0
         STW,R0   FRMCK
         LW,R0    BW:FORM,R2
         LW,R5    R3
         LI,R14   STPBIT+INBIT+WFQBIT+LOCBIT+FMSBIT
         BAL,R11  GTDVNM1
         B        PNBO
         CW,R0    STW:FORM,R3
         BE       PNB2
         STW,R3   FRMCK
         BDR,R11  GDNNO
PNBO     EQU      %
         LI,R5    LCLX
         LW,R3    FRMCK
         BEZ      *R8
PNB2     LI,R5    LCLX
PNB3     EQU      %
         WD,0     X'37'
         LH,R15   STH:FLG,R3
         OR,R15   XSTPBIT
         STH,R15  STH:FLG,R3
         WD,0     X'27'
         B        *R8
*********************************************:
NO%JOB   EQU      %                 FOR LOCAL INPUT FILES WITH NO JOB COMMAND
         LI,R4    NOJOBM            TELL THE OPERATOR AND DELETE THE FILE.
         LI,R8    DELJOB
         B        TEL%OP1
*
*
*O*      MESSAGE: *MISSING JOB COMMAND - JOB IGNORED
*O*
*O*      MEANING: THE JOB JUST READ IN FROM A LOCAL SYMBIONT DEVICE HAD
*O*               NEITHER A JOB OR !!NCTL COMMAND AS ITS FIRST CARD
*O*
*O*      ACTION:  CORRECT THE PROBLEM AND RE-SUBMIT THE JOB
*O*
*
*
********************************************
RDDSK    EQU      %                 READ A DISC SECTOR
         PSW,R4   TMPSTK            :
         LH,R1    R15               GO TO NEWQ TO READ THE SECTOR WHOS D.A. IS
         AND,R1   DCT%MASK
         AND,R15  M24
         LW,R12   DSKFCN            IN R15.  AFTER THE SECTOR IS READ SAVE THE
         AW,R12   R1                FLINK AND MOVE R6 TO POINT TO THE
         LI,R14   1024              BEGINING OF DATA.
         LW,R13   SECT
         SLS,R13  2
         LI,R0    0
         BAL,R11  SVIV
         BAL,R11  NEWQ
         NOP
         STW,R11  SVZ
         LW,R6    SECT
         LW,R1    *R6
         CW,R1    YFF
         BAZ      %+2
         LI,R1    0
         STW,R1   FLINK
         AI,R6    1
         PLW,R4   TMPSTK
         B        *R10
****************************************
SVIV     EQU      %                 SAVE AN ENVIRONMENT FOR RECOVERY WHEN BALING
         MTW,0    SVZ
         BEZ      *R11
         WD,0     X'37'             INTO THE MONITOR.  SVZ=ZERO WHEN THE
         LCI      0                 ENVIRONMENT IS VALID.  SVIV1 SAYS TO ABORT
         STM,R0   SVREGS            THE CURRENT TASK IF A RECOVERY OCCURS DURING
         LI,R11   0                 IT.
         STW,R11  SVZ
         WD,0     X'27'
         B        *SVREG11
SVIV1    EQU      %
         BAL,R11  SVIV
         LW,R11   RCVRFLG
         BNEZ     *RCVRPTR
         B        *R8
****************************************
DOJOB    EQU      %                 INITIALIZE INPUT FILE ENTRY.
         LI,R1    JOBCOM            :
         STB,R1   COM               IF THE JOB IS LOCAL PUT THE BURST INTO
         CI,R5    LCLX              THE MESSAGE FILE. IN ANY CASE PUT IN THE
         BNE      NOBRST            JOB RECEIPT MESSAGE.  THEN PUT THE DEFAULT
         BAL,R4   BANNER
         LW,R2    BCP
         AW,R3    BRSTPTR
         MBS,R2   0
NOBRST   EQU      %
         LW,R14   BCP
         LW,R15   ARSO
         BNEZ     %+2
         LW,R15   ARS
         LW,R2    R15
         SLS,R15  24
         AI,R15   BA(RBJOBM2)
         MBS,R14  0
         LW,R15   CURSID
         AND,R15  M16
         BAL,R11  HEXC
         STW,R13  RBJOBM1
         AI,R2    RBJOBMSZ
         STB,R2   RBJOBM
         LI,R1    RBJOBM
         BAL,R11  MOVEMES
         LW,R2    ADDX
         LW,R4    R2                SET DEFAULT VALUES
         SLS,R4   2                 WITH HI-ORDER BIT
         AI,R4    B4W:RES
         STW,R4   BADRS
         LI,R1    SV:RSIZ
         LB,12    SB:RBDF,R1
         OR,12    X80
         STB,12   *R4,R1
         BDR,R1   %-3
         LI,R1    SV:TI
         LW,R12   SL:BDF,R1
         STH,R12  BH:TIME,R2
         LI,R12   0
         STH,R12  BH:SLNK,R2
         STH,R12  BH:XLNK,R2
         STB,R12  BB:PI,R2
         LB,R12   RBB:ID,R5
         STB,R12  BB:RID,R2
         LW,R12   CURSID
         STH,R12  BH:SID,R2
         B        PROCJOB
*********************************************:
BANNER   EQU      %
         LI,R1    120ASTER
         BAL,R11  MOVEMES
         LW,R3    RB:MFAD,R5
         LW,R14   1,R3
         AI,R14   X'8002'-X'20000'
         STW,R14  1,R3
         LI,R1    6
         LB,R1    TB:SZ,R1
         SCS,R1   -8
         AW,R1    BRSTW2
         MTW,0    KOMP
         BEZ      %+2
         AW,R1    BRSTWH
         STW,R1   2,R3
         SLS,R3   2
         B        0,R4
**************************************
SYMF     EQU      %                 REPORT SYMFILE AVAILABLE EVENT FOR
         PSW,R3   TMPSTK
         LI,R3    R:SYMF
         LB,R3    SB:RQ,R3
         BEZ      SYMF1+1
         BAL,R11  SVIV              COMMUNICATION BUFFERS AND OUTPUT
         LW,R11   RCVRFLG           FILE SLOTS.
         BNEZ     SYMF1
         LI,R6    E:SYMF
         BAL,R11  T:RE
         LCI      0
         LM,R0    SVREGS
SYMF1    STW,R11  SVZ
         PLW,R3   TMPSTK
         B        *R3
******************************************
CP       EQU      %                 :
         BLEZ     BADVAL            :
         CI,R12   80                THE FOLLOWING ROUTINES PROCESS VARIOUS OPTIO
         BG       BADVAL            ON !RBSIZE,!LIMIT, AND !RES COMMANDS.
         STB,R12  RBB:CPZ,R5
         B        COMRET
LP       EQU      %
         BLEZ     BADVAL
         CI,R12   128
         BG       BADVAL
         STB,R12  RBB:LPZ,R5
         B        COMRET
EM       EQU      %
         LW,R12   0
         LI,R13   EMBIT
         STS,R12  FLAGS
         B        COMRET
NOEM     EQU      %
         LI,R12   EMBIT
         B        EM+1
****************************************
CHKRS    EQU      %
         LI,R4    SV:RSIZ
         SAS,R14  -16
         CH,R14   SH:RNM,4
         BE       RESFOUND
         BDR,4    %-2
         CI,R14   X'FF7E3'          -7T
         BE       DUMRES
         CI,R14   X'FF9E3'          -9T
         BE       DUMRES
         CI,R14   X'FE2D7'          -SP
         BNE      BADOP
DUMRES   EQU      %
         LI,R11   -DUMRCK
         B        DOOP+1
RESFOUND EQU      %
         STW,R4   RESX
         LI,R11   -RESCHK
         B        DOOP+1
RESCHK   EQU      %
         LW,R4    RESX
         CH,R12   SH:RTOT,R4
         BG       TBGVAL            TES,ERR
         CI,R12   127
         BG       TBGVAL
         STB,R12  *BADRS,R4
         B        COMRET
DUMRCK   EQU      %
         AI,R12   0
         BNEZ     TBGVAL
         B        COMRET
ORDER    EQU      %
         LW,R13   ORDBIT
ORDN     EQU      %
         STS,R13  BW:SDA,R2
         B        COMRET
NORDR    EQU      COMRET
ACCNT    EQU      %
         LW,R13   ACCTBIT
         B        ORDN
RERUN    EQU      %
         LW,R13   RRBIT
         B        ORDN
TIMEL    EQU      %
         STH,R12  BH:TIME,R2
         B        COMRET
MOUNT    EQU      %
         BAL,R8   COMRET
MNT1     EQU      %
         LI,R1    COBLMSK
         BAL,R4   TRT
         BCS,EOC  BADSYN
         BAL,R4   GETFLD
         LW,R9    FLD
         LI,R8    0
         SLD,8    8
         LI,R4    BH:XLNK
         CI,R8    'X'
         BE       XORS
         CI,R8    'S'
         BNE      SKIPSER
         LI,R4    BH:SLNK
XORS     EQU      %
         STW,R4   XS
         LH,R9    R9                OR S.
         CI,R9    '  '              IS THERE DEV. TYPE
         BNE      %+2
         LI,R9    X'FE2D7'          SIGN EXTENDED 'SP'
         LI,R3    SV:RSIZ           SEARCH SH:RNM
         CH,R9    SH:RNM,R3
         BE       FOUND
         BDR,3    %-2
         LI,R8    SKIPSER
         B        BADOP
FOUND    EQU      %
         STW,R3   IJTYPE
         LB,R3    SB:RTY,R3
         LB,R3    TB:FLGS,R3
         CI,R3    X'C0'
         BGE      GETSER
SKIPSER  EQU      %
         LI,R1    PARMSK
         BAL,R4   TRT
         BCS,EOC  BADSYN
         B        ENDC1
GETSER   EQU      %
         BAL,R8   COMRET
GS1      EQU      %
         BCS,EOC  BADSYN
         LI,R8    ENDCHK
         LI,R1    COBLMSK
         BAL,R4   TRT
         LI,R0    '*'
         CI,R1    4
         BG       BADVAL+2
         BAL,R4   GETFLD
         LW,R14   FLD
         LW,R15   IJTYPE
         LH,R3    BH:SLNK,R2
         BAL,R11  CKSERX
         LH,R3    BH:XLNK,R2
         BAL,R11  CKSERX
         LH,R1    S#H:LNK
         BNEZ     NOMORE
         BAL,R11  MOVECC
         LI,R1    NOSERM
         STW,R1   ABORT
         LW,R11   R10
         B        MOVEMES
NOMORE   EQU      %
         LH,R3    S#H:LNK,R1
         STH,R3   S#H:LNK
         LH,R3    *XS,R2
         STH,R3   S#H:LNK,R1
         STH,R1   *XS,R2
         STW,R14  S#W:SER,R1
         STB,R15  S#B:TYP,R1
ENDCHK   EQU      %
         LI,R8    GS1
         LI,R1    NBPMSK
         BAL,R4   TRT
         BCS,EOC  BADSYN
         BCS,COMA COMRET2
         BCR,PAR  BADSID2
ENDC1    EQU      %
         LB,R1    0,R6
         CI,R1    ')'
         BNE      BADSYN
OUTCHK   EQU      %
         AI,R6    1
         LI,R1    NBPMSK
         BAL,R4   TRT
         BCR,PAR  MOUNT
         LB,R1    0,R6
         CI,R1    ')'
         BNE      BADSYN
         LI,R8    PROCOP1-1
         B        COMRET
BADSYN   EQU      %
         LI,R0    '#'
         B        BADVAL+1
CKSERX   EQU      %
         BEZ      *R11
         CW,R14   S#W:SER,R3
         BNE      CKSR2
         CB,R15   S#B:TYP,R3
         BNE      CKSR2
         PSW,R10  TMPSTK
         BAL,R11  MOVECC
         STW,R14  TXNRSN+1
         LI,R1    TXNRSN
         BAL,R11  MOVEMES
         STW,R11  ABORT
         PLW,R10  TMPSTK
         B        ENDCHK
CKSR2    EQU      %
         LH,R3    S#H:LNK,R3
         B        CKSERX
**************************************************
GET256   EQU      %                 GET A 256 WORD BUFFER
         LCI      2                 :
         PSM,R8   TMPSTK            PGMAP IS A BIT MAP SHOWING AVAILABLE
         LW,R8    PGMAP             BUFFERS.  THE LOWEST ADDRESSED BUFFER IS
         BEZ      G4                CHOSEN SO THAT HIGHER ONES CAN BE
         LW,R7    FRSTPG            RELEASED SOONER.  IF THERE ARE NO CURRENT
         LI,R9    1                 FREE BUFFERS A PAGE IS OBTAINED AND
         SLS,R9   *PGCNT            BROKEN INTO TWO NEW BUFFERS.
G1       EQU      %
         CW,R9    PGMAP
         BANZ     G2
         AI,R7    256
         SLS,R9   1
         B        G1
G2       EQU      %
         EOR,R9   PGMAP
G3       EQU      %
         STW,R9   PGMAP
         LCI      2
         PLM,R8   TMPSTK
         B        *R6
G4       EQU      %
         CAL1,8   GTPG
         LW,R7    R9
         MTW,-2   PGCNT
         LW,R9    Y8
         MTW,0    FRSTPG
         BNEZ     G3
         STW,R7   FRSTPG
         B        G3                --------------------------------------------
FRE256   EQU      %                 FREE A 256 WORD BUFFER
         SW,R6    FRSTPG            :
         SLS,R6   -8                THE APPROPRIATE BIT IS SET IN PGMAP
         LI,R15   1                 SHOWING THAT THE BUFFER IS FREE.  THEN
         SLS,R15  *PGCNT            WHOLE PAGES ARE RELEASED FROM THE TOP
         SLS,R15  *R6               OF THE GHOSTS MEMORY UNTIL ONE IS HIT
         STS,R15  PGMAP             WHICH HAS AT LEAST ONE BUFFER STILL IN USE.
F1       EQU      %
         LW,R15   PGMAP
         BGEZ     *R4
         SLS,R15  2
         BOD      *R4
         CAL1,8   FREPG
         MTW,2    PGCNT
         STW,R15  PGMAP
         B        F1
*******************************************
WMFF     EQU      %
         STW,R8   WMFA
WMF      EQU      %                 WRITE A MESSAGE FILE
         LCI      0                 :
         PSM,R0   TMPSTK            A SLOT AND GRANULE ARE OBTAINED IN ANY
         LH,R4    RBH:MFX,R5
         BNEZ     WMF5
         LI,R6    0                 POSSIBLE WAY THEN THE ENTRY IS BUILT
         MTW,-1   BL:OFS            APPROPRIATE TO THE TYPE OF MESSAGE FILE.
         BGEZ     WMF1              (REMOTE,RES-ABORT,DISPLAY).  THE ENTRY
         MTW,1    BL:OFS            IS CHAINED TO THE MESSAGE FILE PRIORITY
         LW,R6    MFBIT             CHAIN AND THE GRANULE IS WRITTEN.  THE
         MTW,-1   MFFS              SYMBIONT IS CLOSED WITH A FLINK OF ZERO
         BGEZ     WMF1              AND MULTI-GRANULE MESSAGE FILES ARE ACTUALLY
         MTW,1    MFFS              SEPERATE OUTPUT FILES.
         LI,R4    NOSLM
         LI,R8    WMFX
         B        TEL%OP1
*
*
*O*      MESSAGE: OUT OF MFILE SLOTS - MFILE LOST
*O*
*O*      MEANING: ALL OF THE OUTPUT BATCH QUEUE SLOTS WERE FULL SO A
*O*               MESSAGE FILE (DISPLAY FOR LP OR JOB ABORT LISTING)
*O*               COULD NOT BE OUTPUT
*O*
*O*      ACTION:  NONE - INFORMATION ONLY.  IF THIS MESSAGE OCCURS AND
*O*               THE OUTPUT BATCH QUEUE IS NOT FULL THERE IS A SERIOUS
*O*               SYSTEM PROBLEM - BOOT FROM RAD
*O*
*
*
WMF1     EQU      %
         LI,R3    FREO
         LH,R4    BH:HPRI,R3
         LH,R11   BH:LINK,R4
         STH,R11  BH:HPRI,R3
         STH,R4   RBH:MFX,R5
         CI,R5    LCLX
         BE       WMF2
         LB,R11   RBB:ID,R5
         LB,R1    RBB:SMD,R5
         LB,R1    STB:TYP,R1
         LB,R0    RBB:DSM,R5
         AND,R1   R0
         LI,R0    0
         B        WMF3
WMF2     EQU      %
         LI,R11   0
         LW,R0    CURSID
         LI,R1    6                 *********
WMF3     EQU      %
         STH,R0   BH:SID,R4
         STB,R1   BB:DEV,R4
         STB,R11  BB:RID,R4
         LI,R10   0
         STW,R10  BW:FORM,R4
         LI,R11   BW:FOVL
         BEZ      %+3
         STW,R10  BW:FOVL,R4
         STB,R10  BB:JDE,R4
         LI,R10   1
         STB,R10  BB:COPY,R4
         STH,R10  BH:GRAN,R4
         BAL,R10  GGRAN
         LW,R1    RB:MFAD,R5
         STW,R8   0,R1
         AW,R8    R6                ******RCVRY*****
         STW,R8   BW:SDA,R4
         LI,R2    0
         STW,R2   255,R1
WMF5     EQU      %
         LW,R6    RB:MFAD,R5
         LW,R9    0,R6
         LW,R8    WMFA
         BEZ      WMF6
         CI,R9    1
         BAZ      %+4
         BAL,R10  GGRAN
         MTH,1    BH:GRAN,R4
         B        WMF6
         LW,R8    R9
         AI,R8    1
WMF6     EQU      %
         LI,R10   WMF8
WMFS     EQU      %
         LI,R1    X'40'
         AI,R7    1
         STB,R1   0,R7
WMF7     EQU      %
         STW,R8   0,R6
         LW,R15   R9
         LH,R8    R9
         AND,R8   DCT%MASK
         LW,R12   WDSKFCN
         AW,R12   R8
         LW,R13   RB:MFAD,R5
         SLS,R13  2
         LI,R14   1024
         LI,R0    0
         BAL,R11  SVIV
         BAL,R11  NEWQ
         NOP
         STW,R11  SVZ
         B        *R10
WMF8     EQU      %
         STW,R9   255,R6
         LI,R9    0
         XW,R9    WMFA
         BNEZ     WMFX
         LH,R2    RBH:MFX,R5
         BAL,R8   CLEARMF
         LI,R1    X'FF'             * MASK FOR GFC
         AND,R1   *SVCBF            * GET CUR GFC
         CI,R1    9  GIFNC GFC      * IS IT GIFNC
         BNE      GINCWMF           * NOPE CONTINUE
         LW,R1    S:DSPKEY          * GET MAGIC NAME
         STW,R1   BW:FORM,R2        * ..MARK IT
         LI,R1    4                 * SET TO 'CR' NCTL
         STB,R1   BB:DEV,R2         *
         LI,R1    NCIPRI            * MOVE ENTRY TO NCTL CHAIN
         LI,R8    WMFX              * SET ADDIT EXIT TO WMF XIT
         B        ADDIT             *
GINCWMF  EQU      %                 *
         LI,R1    MFPRI
         BAL,R8   ADDIT
         LI,R8    WMFX
         CI,R5    LCLX
         BE       STRTSYM
         LB,R3    RBB:SMD,R5
         LI,R1    OCBIT
         CH,R1    STH:FLG,R3
         BAZ      PNB3
         LB,R1    SSIG,R3
         BEZ      SYSG1
WMFX     EQU      %
         LCI      0
         PLM,R0   TMPSTK
         B        *R8               --------------------------------------------
GGRAN    EQU      %
         BAL,R11  SVIV
         LI,R0    X'70B00'
         BAL,R11  GBG
         BNEZ     %+3
         CAL1,8   WAIT
         B        GGRAN+1
         STW,R8   SVZ
         B        *R10
RELMF    EQU      %
         LH,R10   RBH:MFX,R5
         BEZ      CLEARMF
         LCI      2
         PSM,R8   TMPSTK
         LI,R8    0
         LW,R6    RB:MFAD,R5
         LW,R9    0,R6
         BAL,R10  WMF7
         LH,R2    RBH:MFX,R5
         LI,R1    DELPRI
         BAL,R8   ADDIT
         LCI      2
         PLM,R8   TMPSTK
CLEARMF  EQU      %
         LI,R6    0
         STH,R6   RBH:MFX,R5
         XW,R6    RB:MFAD,R5
         BEZ      *R8
         PSW,R8   TMPSTK
         BAL,R4   FRE256
         PLW,R8   TMPSTK
         B        *R8
*************************************************
RB%HU    EQU      %                 REMOTE BATCH HANG UP
         STW,R9   FLAGS
         CI,9     ACTBIT+LIPBIT     :
         BAZ      HU1
         CW,R9    DIALBIT
         BANZ     %+3
         LI,R1    OADBIT
         STS,R1   RB:FLAG,R5
         CI,R9    EDISBIT
         BAZ      HU1
         LI,R4    EDISM
         BAL,R8   TEL%OPR1
*
*
*O*      MESSAGE: *RBNDD ERROR MAX
*O*
*O*      MEANING: RBNDD IS ABOUT TO BE DISCONNECTED BECAUSE THE MAXIMUM
*O*               LINE ERRORS WERE EXCEEDED
*O*
*O*      ACTION:  IF THIS OCCURS REPEATEDLY ON THE SAME LINE INVESTIGATE
*O*               THE MODEMS AND DATA SET CONTROLLERS
*O*
*
*
HU1      EQU      %
         LB,R3    RBB:ID,R5
         BEZ      HU25
         LI,R1    MFPRI
         LI,R11   %+3
         B        ALL2
         B        HU2
         CI,R1    MFPRI
         BE       DEL
         B        HLD
HU2      EQU      %
         LB,R4    STB:LNK
         BEZ      GOTTAIL
         LB,R10   STB:LNK,R4
         BEZ      GOTTAIL
         LW,R4    R10
         B        %-3
GOTTAIL  EQU      %
         CW,R9    BSCBTS            WAIT ON 2780 & HASP.
         BAZ      GTT1
         LB,R3    RBB:HOU,R5
         BNEZ     %+3
         LB,R3    RBB:HIN,R5
         BEZ      GTT1
         CAL1,8   WAIT
         B        GOTTAIL
GTT1     EQU      %
         LB,R3    RBB:HFE,R5
         BEZ      SYMDON
         LB,R10   STB:LNK,R3
         STB,R10  RBB:HFE,R5
         LB,R10   SSIG,R3
         BNEZ     FXSYM
CLSSYM   EQU      %
         LI,R10   0
         STB,R10  STB:TYP,R3
         STB,R3   STB:LNK,R4
         LW,R4    R3
         B        GTT1
FXSYM    EQU      %
         LB,R10   SSTAT,R3
         BNEZ     CLSSYM
         LH,R1    SCNTXT,R3
         BEZ      CLSSYM
         LI,R1    'Q'
         LI,R8    CLSSYM
         B        SYSG
SYMDON   EQU      %
         LI,R3    0
         STB,R3   STB:LNK,R4
HU25     EQU      %
         CW,R9    BSCBTS
         BAZ      HU3
         BAL,R11  SVIV
         XW,R3    RB:BUF,R5
         BEZ      HU3
         CW,R9    2780BIT
         BAZ      HU3-1
         CW,R9    3780BIT
         BAZ      %+3
         SW,R9    3780BIT
         B        HU3-1
         STW,R3   SAD
         MTB,7    SAD
         CAL1,8   SAD
         WD,0     X'37'
         LW,R8    SPOOL
         STW,R8   VP
         STW,R3   SPOOL
         WD,0     X'27'
         CAL1,8   FVP
         B        HU3
         BAL,R11  T:RSPP
HU3      EQU      %
         STW,R11  SVZ
         BAL,R8   RELMF
         LI,R6    0
         STB,R6   RBB:ID,R5
         STB,R6   RBB:SMD,R5
         STB,R6   RBB:HOU,R5
         STB,R6   RBB:HIN,R5
         STB,R6   RBB:HFE,R5
         STB,R6   RBB:BCB,R5
         CW,R9    HASPBIT
         BANZ     HU4
         LI,R1    80
         STB,R1   RBB:CPZ,R5
         LI,R1    120
         STB,R1   RBB:LPZ,R5
HU4      EQU      %
         CI,R9    ACTBIT+LIPBIT
         BAZ      CTR1
         LW,R9    SGBITS
         AND,R9   RB:FLAG,R5
         CI,R9    OADBIT
         BAZ      %+2
         AI,R9    OFFBIT-OADBIT
         CW,R9    HASPBIT
         BAZ      HU%5
         LI,R1    2780IO
         BEZ      HU%5
         STW,R1   DCT8,R5
         LI,R1    2780CU
         STW,R1   DCT9,R5
         SW,R9    HASPBIT
         OR,R9    2780BIT
HU%5     EQU      %
         STW,R9   RB:FLAG,R5
         LI,R4    HUMES
         LI,R8    CTR1
         B        TEL%OPR1
*
*
*O*      MESSAGE: *RBNDD DISCONNECTED
*O*
*O*      MEANING: THE REMOTE TERMINAL CONNECTED TO RBNDD HAS DISCONNECTED
*O*               OR BEEN DISCONNECTED BY THE SYSTEM
*O*
*O*      ACTION:  NONE - INFORMATION ONLY
*O*
*
*
**************************************************
KBCST EQU % PROCESS RBBDCST KEYIN VIA KMES
         LI,R5    LCLX
         LW,R3    BCSTPTR
         BAL,R10  KMES
         LI,R1    ML%CTL
         BEZ      CTR1
         LI,R13   OCBIT
         LW,R5    RBLIMS
         B        %+2
KBH1     EQU      %
         AI,R5    -1
         CW,R5    RBLIMS+1
         BL       KBHD
         LB,R10   RBB:ID,R5
         BEZ      KBH1
         LB,R2    RBB:SMD,R5
         BEZ      KBH1
         CH,R13   STH:FLG,R2
         BAZ      KBH1
         LW,R1    CCTMP
         BNEZ     KBH2
         LW,R2    BCSTPTR
         LW,R3    SNDPTR
         STB,R4   R3
         MBS,R2   0
         AI,R4    OPMSZ
         STB,R4   OPMES
         LI,R1    OPMES
         STW,R1   CCTMP
KBH2     EQU      %
         BAL,R11  MOVEMES
         LI,R8    KBH1
         B        WMF
KBHD     EQU      %
         LI,R5    LCLX
         LI,R4    0
         STW,R4   CCTMP
         B        CTR1
KMES     EQU      %                 MOVE KEYIN MESSAGE TO APPROPRIATE BUFFER
         BAL,R8   SVIV1             :
         LW,R15   R3                THE BUFFER IS BLANK FILLED THEN THE MESSAGE
         LI,R2    BA(80BLNK)+1      (IF ANY) IS MOVED IN AND THE MONITOR
         MBS,R2   0                 BUFFER IS RELEASED
         LW,R14   2,R7
         BEZ      *R10
         LB,R4    *R14
         SLS,R14  2
         AI,R14   1
         STB,R4   R15
         MBS,R14  0
         LW,R14   2,R7
         BAL,R11  RMB
         STW,R11  SVZ
         B        *R10              --------------------------------------------
KSEND    EQU      %                 PROCESS RBSEND KEYIN
         LW,R3    SNDPTR            GO TO KMES TO PUT THE MESSAGE IN THE OPERATO
         BAL,R10  KMES              MESSAGE. MOVE THE MESSAGE TO THE MFILE
         LB,R3    RBB:ID,R5
         BEZ      CTR1
         AI,R4    OPMSZ
         STB,R4   OPMES
         LI,R1    OPMES
         LI,R12   CTR1
ONEMES   EQU      %
         PSW,R1   TMPSTK
         BAL,R4   SETHDR
         LW,R4    R12
         PLW,R1   TMPSTK
         BAL,R11  MOVEMES
         CW,R4    R12
         BNE      *R12
         B        FINWRT
************************************************::
KCOM     EQU      %
         LW,R3    IDCPTR
         BAL,R10  KMES
         LB,R3    RBB:ID,R5
         BEZ      CTR1
         STB,R4   ID
         CW,R9    SLVXP2BT
         BAZ      KCOMERR
         LI,R1    ID
         LB,R3    RBB:SMD,R5
         BEZ      KCOMX
         LI,R2    OCBIT
         CH,R2    STH:FLG,R3
         BAZ      KCOMX
         LI,R12   CTR1
         B        ONEMES
KCOMX    EQU      %
         LI,R12   X'FD6C3'          'OC'
         BAL,R4   GTDVX
         B        KCOMERR
         PSW,R5   TMPSTK
         PSW,R3   TMPSTK
         LI,R5    LCLX
         STW,R5   KOMP
         BAL,R11  MOVEMES
KCOMM    EQU      %
         BAL,R8   WMF
         PLW,R3   TMPSTK
         PLW,R5   TMPSTK
         LI,R1    MFPRI
         LH,R2    BH:TPRI,R1
         LI,R1    0
         STW,R1   KOMP
         STH,R1   BH:SID,R2
         LB,R1    STB:TYP,R3
         LB,R4    RBB:DSM,R5
         AND,R1   R4
         STB,R1   BB:DEV,R2
         LB,R1    RBB:ID,R5
         STB,R1   BB:RID,R2
         LB,R1    SSIG,R3
         BNEZ     CTR1
         LI,R8    CTR1
         B        SYSG1
KCOMERR  EQU      %
         LI,R4    KCOMEM
         LI,R8    CTR1
         B        TEL%OP1
*
*
*O*      MESSAGE: *RBCOM ILLEGAL FOR THIS STATION
*O*
*O*      MEANING: AN RBCOM KEYIN HAS SPECIFIED A WORKSTATION THAT IS
*O*               NEITHER SLAVE (SLV) OR ANOTHER CP-V SYSTEM (X2)
*O*
*O*      ACTION:  CHECK WHETHER THE WORKSTATION SPECIFIED WAS CORRECT.
*O*               IF SO, RBSEND IS PROBALY THE CORRECT KEYIN
*O*
*
*
**************************************************
KFFRM    EQU      %
         LW,R14   2,R7
         BAL,R11  KFND
         CI,R1    RUNPRI
         BG       %+4
         LW,R4    SYMINDX
         BEZ      KNF1
         B        LCLCTR1
         MTH,0    BH:COMID,R2       IS THIS A COMODE FILE?
         BNEZ     0,R4              YES: CAN'T CHANGE FORM CAUSE...
*                                   MORE MAY BE ON THE WAY
         STW,R14  BW:FORM,R2
         MTW,1    SYMINDX
         B        0,R4
KPRIO    EQU      %                 PROCESS PRIO KEYIN
         BAL,R11  KFND
         LW,R14   2,R7              BAL TO KFND TO GET CORRECT ENTRY(S)
PRIOCG   EQU      %
         CI,R1    RUNPRI            NO NOT ALLOW ZERO PRIORITY OUTPUT.
         BLE      PRIO1             ZERO BB:PI.  IF NO CHANGE DO NOTHING
         MTH,0    BH:COMID,R2       IN COMODE
         BEZ      %+2               NOPE: JUST A NICE NORMAL FELLOW
         LI,R6    0
         AI,R14   0OPRI
         B        PRIO2
PRIO1    EQU      %
         LW,R10   R2
         SLS,R10  2
         AI,R10   B4W:RES
         STB,R14  *R10              SAVE NEW PRIO IN RESOURCE TBL
         CI,R1    RUNPRI            IS THIS THE RUNNING JOB???
         BE       *R4               SURE DON'T WANT TO PRIO HIM
         LI,R10   0
         STB,R10  BB:PI,R2
         STW,R11  S:MBSF
         LW,R10   R2
         SLS,R10  2
         AI,R10   B4W:RES
         STB,R14  *R10
PRIO2    EQU      %
         CW,R1    R14
         BE       *R4
         B        CHNGRSET
KDEL     EQU      %                 PROCESS DELETE KEYIN BY POINTING KFND
         LI,R11   DEL               TO DEL
KFND     EQU      %                 -------------------------------
         LI,R5    LCLX              FIND APPROPRIATE FILE FOR KEYIN ACTION
         LI,R1    3
         LH,R12   *R7,R1            GET SYSID AND DEVICE TYPE FROM COMBUF
         LI,R1    4                 AND USE THEM TO FIND FILES REQUESTED
         LB,R6    *R7,R1            FOR EACH VALID FILE FOUND BAL ON R4 TO
         BNEZ     KF4
         CI,R11   DEL
         BNE      KF4
         LI,R1    NCIPRI
         B        KF3
KF4      EQU      %
         CI,R6    4                 THE ROUTINE POINTED TO BY R11. IF
         BNE      %+3               THE APPROPRIATE FILE DOESNT EXIST OR
         LI,R6    1                 IS RUNNING GO TO KNF.
         AI,R1    FIPRI-MFPRI
         AI,R1    MFPRI-4
KF3      EQU      %
         LI,R4    0
         BAL,R0   FIND
         B        KNF
         CH,R12   BH:SID,R2
         BNE      FIND1
         CI,R1    RUNPRI
         BNE      KF3B
         CI,R11   KPRIO+1           GET HERE VIA PRIO KEYIN?
         BNE      KDR+1             NOPE
         LI,R4    CTR1
         B        *R11              YEP: DON'T MATTER IF HE'S RUNNING
KF3B     EQU      %
         BG       KF1
         CI,R6    1
         BG       KNF
         LI,R4    CTR1
         B        *R11
KF1      EQU      %
         AI,R6    0
         BEZ      KF2
         CB,R6    BB:DEV,R2
         BNE      FIND1
KF2      LI,R4    FIND1
         B        *R11              -------------------------------
KSWIT    EQU      %                 PROCESS RBSWITCH KEYIN
         LW,R6    SYMINDX
         AI,R6    SGCBUF+1
         LI,R1    0
         STW,R1   REC
         STW,R1   REC+1
         STW,R1   KSW#
         SLS,R6   2
         AW,R6    R5
         LW,R1    R5
         LI,R5    LCLX
         BAL,R10  PROCID
         B        BKSW
         B        KSW1
KSW2     EQU      %
         LW,R13   2,R7
         BAL,R4   CVTYP
         B        BKSW
         STW,R13  TYPSW
         STW,R1   SWTYP
         LB,R1    REC
         STW,R1   SWRID
         LW,R1    REC+1
         AND,R1   HASPBIT
         STS,R1   SWRID
         LI,R1    3
         LH,R12   *R7,R1
         LI,R1    FOPRI
         BAL,R0   FIND
         B        KSWDN
         CI,R1    RUNPRI
         BLE      KSWDN
         CH,R12   BH:SID,R2
         BNE      FIND1
         LW,R7    SWITBIT
         CW,R7    BW:SDA,R2
         BANZ     FIND1
         INT,R7   SWRID
         CB,R7    BB:RID,R2
         BE       FIND1
         LB,R7    BB:RID,R2
         BNEZ     KSWR
         LB,R7    BB:DEV,R2
         LH,R10   OH:NM,R7
         CW,R10   TYPSW
         BNE      FIND1
         LH,R13   SWRID
         BNEZ     KSWGO
         CI,R7    5
         BNE      KSWGO1
KSWGO    LW,R13   SWITBIT
         STS,R13  BW:SDA,R2         HOW BOUT SW OF SW
KSWGO1   LW,R13   SWTYP
         STB,R13  BB:DEV,R2
         INT,R13  SWRID
         STB,R13  BB:RID,R2
         LI,R10   HALBIT
         LCI      3
         PSM,R0   TMPSTK
         BAL,R8   RBCHK
         LCI      3
         PLM,R0   TMPSTK
         MTW,1    KSW#
         B        FIND1
KSWR     EQU      %
         LW,R13   KSWFLG
         BNEZ     KSWR2
         LI,R10   KSBR1+2
         STW,R10  SV10
         CAL1,8   GTPG
         STW,R9   KSWFLG
         CAL1,1   OPNXX
         CAL1,1   RSXX
         CAL1,1   CLSXX
KSWR2    CB,R7    REC
         BE       KSWR1
         PSW,R1   TMPSTK
         LW,R6    KSWFLG
         AW,R6    R7
         AW,R6    R7
         LI,R10   KSWR1-1
         B        A%L1
         B        KSBR
         B        KSBR
         PLW,R1   TMPSTK
KSWR1    EQU      %
         LW,R13   TYPSW
         PSW,R1   TMPSTK
         BAL,R4   CVTYP
         B        PF1
         LW,R7    R1
         PLW,R1   TMPSTK
         CB,R7    BB:DEV,R2
         BNE      FIND1
         LW,R13   HASPBIT
         AND,R13  REC+1
         STS,R13  BW:SDA,R2
         EOR,R13  SWRID
         LB,R13   R13               AVOID RBID ( AHA ! )
         BNEZ     KSWGO
         B        KSWGO1
KSW1     EQU      %
         CI,R4    LCLX
         BNEZ     PID0-1
         B        KSW2
KSWDN    EQU      %
         BAL,R4   FRECK
         LW,R4    KSW#
         BNEZ     CTR1
         LI,R4    BKSW1M
         B        KNF3
*
*
*O*      MESSAGE: *NOTHING VALID FOR RBSW FOUND
*O*
*O*      MEANING: A FILE WITH THE CORRECT SYSID AND DEVICE THAT HAD NOT
*O*               ALREADY BEEN RBSWITCHED COULD NOT BE FOUND FOR AN RBSWITCH
*O*               KEYIN
*O*
*O*      ACTION:  REPEAT THE KEYIN CORRECTING THE PROBLEM
*O*
*
*
PF1      PLW,R1   TMPSTK
         B        FIND1
FRECK    EQU      %
         LI,R10   0
         XW,R10   KSWFLG
         BEZ      0,R4
         CAL1,8   FREPG
         B        0,R4
KNF      EQU      %                 THE APPROPRIATE FILE WAS NOT FOUND
         AI,R4    0                 OR IS RUNNING.  TELL THE OPERATOR.
         BNEZ     CTR1
KNF1     AI,R4    NONEX-SMRIN
KNF2     AI,R4    SMRIN
         LW,R15   R12
         BAL,R11  HEXC
         STW,R13  SYSD,R4
KNF3     EQU      %
         LI,R8    CTR1
         B        TEL%OP1
*
*
*O*      MESSAGE: *SYSID=XXXX DOESN'T EXIST
*O*
*O*      MEANING: THE SYSID SPECIFIED ON A PRIO, DELETE, RBSWITCH, FORM
*O*               OR DISPLAY KEYIN IS NO LONGER IN THE SYSTEM
*O*
*O*      ACTION:  CORRECTLY REPEAT THE KEYIN IF NECESSARY
*O*
*
*
*O*      MESSAGE: *SYSID=XXXX RUNNING
*O*
*O*      MEANING: THE SYSID SPECIFIED ON A PRIO,DELETE, FORM, RBSWITCH,
*O*               OR DISPLAY KEYIN IS RUNNING
*O*
*O*      ACTION:  CORRECTLY REPEAT THE KEYIN IF NECESSARY
*O*
*
*
KSBR     EQU      %
         PLW,R1   TMPSTK
KSBR1    BAL,R4   FRECK
BKSW     EQU      %
         LI,R4    BKSWM
         B        KNF3
*
*
*O*      MESSAGE: *BAD WSN OR DEV ON !RBSW
*O*
*O*      MEANING: THE WSN SPECIFIED ON AN RBSWITCH KEYIN DOES NOT EXIST
*O*               OR THE DEVICE SPECIFIED  DOES NOT EXIST AT IT
*O*
*O*      ACTION:  CORRECT AND REPEAT THE KEYIN
*O*
*
*
*********************************************
JEDEL    EQU      %                 PROCESS JOBENT DELETE
         LI,R1    RUNPRI            :
         LI,R4    X'3A'             ERROR CODE IS 3A IF FILE NOT INPUT
         BAL,R11  JEFND             AND 39 IF WRONG ACCOUNT.  GO TO
         LI,R4    X'39'             JEFND TO GET SYSID AND IF THE
         LW,R6    SYMINDX           ACCOUNT IN THE SECOND COMBUF IS
         AI,R6    SGCBUF+1
         LW,R14   *R6               THE SAME RELEASE THE FILE AND SET
         LW,R15   1,R6              ERROR CODE=0
ANLZACCT CD,R14   BD:ACCT,R2
         BNE      JEX
         BAL,R4   DEL
JEX1     EQU      %
         LI,R4    0                 ----------------------------------------
JEX      EQU      %                 PUT INFO FROM PROCESSING ROUTINE INTO
         AND,R4   M24               (SCRUB THE DA IF ANY)
         STW,R4   1,R7              *
         LI,R6    E:UQA             WORD 1 OF COMBUF AND UNQUEUE THE USER
         BAL,R8   SVIV1             SO THAT HE CAN GET THE INFO.  DONT
         BAL,R11  T:RUE             RELEASE THE BUFFER.
         STW,R11  SVZ
         LI,R5    LCLX
         B        CTR4              ------------------------------------------
JESTAT   EQU      %                 PROCESS JOBENT STATUS REQUEST
         LI,R1    MFPRI             :
         LI,R4    0                 GO TO JEFND TO GET THE SYSID REQUESTED
         BAL,R11  JEFND             THEN USING THE PRIORITY TO GET THE
         CI,R1    RUNPRI            STATUS CODE.  A CODE OF ZERO MEANS COMPLETED
         BL       JES1              JOBENT IN CORE SEES DOESN'T EXIST.
         BE       %+2               IF THE FILE IS INPUT GO TO ST4 TO GET
         AI,R4    3                 THE NUMBER AHEAD AND PUT IT IN WORD2 OF
         AI,R4    1                 THE COMBUF.
         B        JEX
JES1     EQU      %
         BAL,R11  ST4
         STW,R15  2,R7
         LI,R4    2
         B        JEX               GET THE SYSID AND USER NUMBER FROM THE
JEFND    EQU      %                 COMBUF AND USE THE SYSID TO FIND ONE
         LI,R3    3                 ELEGIBLE FILE. (ANY SYSID IS IN ONLY
         LH,R12   *R7,R3            ONE JOBENT STATUS STATE).  WHEN FOUND
         LI,R3    4                 GO TO THE APPROPRIATE ROUTINE.  IF NOT
         LB,R5    *R7,R3            FOUND GO DIRECTLY TO JEX SINCE ERROR
         BAL,R0   FIND              CODE IS ALREADY IN R4.
         B        JEX
         CH,R12   BH:SID,R2
         BNE      FIND1
         B        CKGO
**********************************************
MBSCALL  EQU      %                 MULTI BATCH SCHEDULE REQUEST.
         BAL,R11  MBS
LCLCTR1  EQU      %
         LI,R5    LCLX
         B        CTR1
************************************************
KFORM    EQU      %
         LW,R12   1,R7
         CI,R12   -1
         BNE      %+2
         LW,R12   STW:FORM,R3
         LW,R13   2,R7
         CI,R13   -1
         BNE      %+2
         LW,R13   STW:FOV,R3
         LW,R14   R5
         CI,R14   X'FF'
         BNE      %+2
         LB,R14   STB:JDE,R3
         BAL,R4   FORMS
         B        KFBD
         LI,R5    LCLX
         B        CTR1
KFBD     EQU      %
         LI,R4    BKFM
         LI,R8    CTR1
         B        TEL%OP1
*
*
*O*      MESSAGE: *ILLEGAL FORMS CHANGE
*O*
*O*      MEANING: AN ATTEMPT WAS MADE TO CHANGE THE FORM ON AN ACTIVE
*O*               OUTPUT DEVICE
*O*
*O*      ACTION:  USE SYYNDD,L TO TERMINATE THE DEVICE, THEN REPEAT THE
*O*               SYYNDD,F'XXXX' KEYIN
*O*
*
*
FORMS    EQU      %
         LB,R15   SYMX,R3
         CI,R15   1
         BANZ     FORM1
         LB,R15   SSIG,R3
         CI,R15   'L'
         BE       FORM1
         CI,R15   2
         BG       0,R4
FORM1    EQU      %
         STW,R12  STW:FORM,R3
         LI,R15   STW:FOV
         BEZ      1,R4
         STW,R13  STW:FOV,R3
         STB,R14  STB:JDE,R3
         B        1,R4
*********************************************
KDISP    EQU      %                 PROCESS DISPLAY KEYINS
         LI,R5    LCLX              :
         LW,R12   2,R7              WORDS 1 AND 2 OF COMBUF ARE
         LI,R6    KDSY              :
         LW,R4    1,R7              DISPLAY   0,0
         B        %+4,R4
         B        KDOUP
         B        KDSYMB
         B        KDNR              DISPLAY ID   1,ID
GINCD    EQU      %
         LI,R6    KDAL              DISPLAY NORUN -1,-5
         LI,R1    NCIPRI            :
KDISF    EQU      %                 FIRST DETERMINE TYPE OF DISPLAY  AND
         BAL,R0   FIND              SET R6 TO THE ROUTINE FOR PROCESSING
         B        KDSPDN            THIS OPTION.  THEN GO TO FIND AND ENTER
         B        *R6               ROUTINE FOR EACH SYSID FOUND.  EVERY TYPE
KDNR     EQU      %                 BUT NORUN SEARCHES WHOLE CHAIN.  NORUN
         LI,R6    KDNR1             SEARCHES INPUT ONLY.
         BAL,R8   PRTCK
         STW,R13  PLKXX
         LI,R1    FIPRI
         B        KDISF             --------------------------------------------
KDSY     EQU      %                 PROCESS DISPLAY ID BY DECIDING WHETHER THE I
         CH,R12   BH:SID,R2         IS INPUT OR OUTPUT AND PRINTING APPROPRIATE
         BNE      FIND1             MESSAGE ON THE OC W/HEADING.  IF THE GUY IS
         LI,R5    DISMESO           RUNNING TELL THE OPERATOR. (IF HE'S OUTPUT
         CI,R1    RUNPRI            DISPLAY ALL THE ENTRIES.
         BE       KDR
         BG       KDOPMES
         LI,R5    DISMESIN
         B        KDOPMES
KDOUP    EQU      %
         BAL,R6   KDISF-1
         CI,R1    RUNPRI
         BLE      KDSPDN
         LI,R5    DISMESO
         BAL,R4   COMSELCT          #CPV+ MODIFIED DISPLAY
         B        FIND1             #CPV+ MODIFIED DISPLAY
         B        KDOPMES
KDR      EQU      %
         LI,R5    LCLX
KNF2A    EQU      %
         LI,R4    0                 --------------------------------------------
         B        KNF2              DISPLAY NORUN -- DISPLAY ALL INPUT GUYS
KDNR1    EQU      %                 WHOSE BH:PART=ZERO. ON THE OC
         LH,R15   BH:PART,R2
         CW,R15   PLKXX
         BANZ     FIND1
         LI,R5    DISMESIN
KDOPMES  EQU      %                 PRINT DISP MESSAGE TO OPERATOR FOR NORUN
         LI,8     4
         CI,8     SV:RSIZ
         BLE      %+2
         LI,R8    SV:RSIZ
         STW,R8   RES#
         LCI      7                 AND ID IF A HEADING IS NECESSARY PRINT
         PSM,R12  TMPSTK            IT TOO.
         PSW,R5   TMPSTK
         BAL,R8   KDBLDMES
         PLW,R5   TMPSTK
         LW,R8    MSFLG
         BNEZ     KDMO1
         XW,R5    R4
         BAL,R8   TEL%OP1
         LW,R4    R5
         MTW,1    MSFLG
KDMO1    EQU      %
         BAL,R8   TEL%OP1
         LCI      7
         PLM,R12  TMPSTK
         B        FIND1             --------------------------------------------
KDAL     EQU      %                 PROCESS DISP OR DISP OC
         CI,R1    RUNPRI            :
         BE       FIND1             PRINT OR TYPE DISP MESSAGE FOR EACH SYSID
         LW,R9    R1                FOUND PUT IN HEADINGS WHEN APPROPRIATE.
         LW,R8    MSFLG             IF DISPLAY (NO OPTION) DISPLAY WILL BE A
         BNEZ     KDAL1             MESSAGE FILE WITH SYSID=ZERO.  THE BURST
         AI,R12   0                 HEADER IS PUT IN TO IDENTIFY THE PRINT OUTPU
         BNEZ     KDAL01
         STW,R8   CURSID
         BAL,R4   BANNER
         LI,R8    KDALB1
         LI,R1    DISPB2
TIMIN    EQU      %
         LH,R5    TIME
         SLS,R5   8
         AND,R5   M24
         AW,R5    TMESET
         STW,R5   -1,R1
         LW,R5    TIME
         STH,R5   *R1
         LCI      2
         LM,R4    DATE
         SCD,R4   -16
         SCS,R5   -8
         AW,R5    SLASLA
         SCD,R4   16
         STW,R4   1,R1
         STW,R5   2,R1
         B        *R8
KDALB1   EQU      %
         LW,R5    R3
         AW,R5    DBRPTR
         LI,R4    BA(DISP)
         MBS,R4   0
         LI,R5    LCLX
KDAL01   EQU      %
         MTW,1    MSFLG
         CI,R9    RUNPRI
         BL       KDAL3
         LI,R4    DISMESO
         LI,R15   KDAL2
         B        KDALOUT
KDAL1    EQU      %
         CI,R9    RUNPRI
         BG       KDAL2
         LB,R8    MSFLG
         BNEZ     KDAL2
KDAL3    EQU      %
         LI,R4    DISMESIR
         AI,12    0
         BEZ      KDAL35
         LI,R4    DISMESIN
         LI,R8    4
         CI,R8    SV:RSIZ
         BLE      %+2
KDAL35   LI,R8    SV:RSIZ
         STW,R8   RES#
         BAL,R15  KDALOUT
         MTB,1    MSFLG
KDAL2    EQU      %
         LW,R1    R9
         BAL,R4   COMSELCT
         B        KDAL25
         BAL,R8   KDBLDMES
         BAL,R15  KDALOUT
         CI,R9    RUNPRI
         BGE      KDAL25
         AI,R12   0
         BNEZ     KDAL25
         LH,R3    BH:SLNK,R2
         BEZ      %+3
         LI,R1    SERDS
         BAL,R11  DISPSER
         LH,R3    BH:XLNK,R2
         BEZ      KDAL25
         LI,R1    SERDX
         BAL,R11  DISPSER
KDAL25   EQU      %
         LW,R1    R9
         B        FIND1             --------------------------------------------
KDSPDN   EQU      %                 DONE WITH DISPLAY
         LI,R5    LCLX              :
         LW,R3    SVCBF             IF NO FILES WERE FOUND SEND NOTHING TO
         LI,R4    0                 DISPLAY TO OPERATOR.  IF A MESSAGE FILE WAS
         XW,R4    MSFLG             BUILT WRITE AND ADD IT. IF THIS WAS
         BEZ      KDSPDN1           DISP ID AND THE ID WAS NOT FOUNT TYPE SYSID
         LW,R15   0,R3              * CHECK FOR SPCL NCI FUNCTION
         AND,R15  M8                *
         CI,R15   9  GIFNC GFC      *
         BE       GINCD1            * IF SO DERAIL BACK TO SPCL FUNCTION.
         LW,R15   1,R3              SOESN'T EXIST.
         AW,R15   2,R3
         BNEZ     CTR1
         LI,R8    CTR1
         B        WMF
KDSPDN1  EQU      %
         LW,R15   1,R3              :
         BGZ      KNF1
         LI,R4    NODIS
         LI,R8    CTR1
         B        TEL%OP1           --------------------------------------------
*
*
*O*      MESSAGE: *NOTHING TO DISPLAY
*O*
*O*      MEANING: THERE ARE NO ENTRIES IN THE BATCH QUEUE OF THE TYPE
*O*               A DISPLAY KEYIN REQUESTED DISPLAYED
*O*
*O*      ACTION:  NONE - INFORMATION ONLY
*
*
KDBLDMES EQU      %                 BUILD INPUT OR OUTPUT DISPLAY MESSAGE FROM
         LI,R4    DIM               PRIO IN R1 AND ENTX IN R2.  THE MESSAGE ADDR
         LW,R15   R1                IS IN R4.
         CI,R1    RUNPRI
         BL       %+3
         LI,R4    DOM
         AI,R15   -0OPRI
         LI,R13   'I'
         CI,R1    MFPRI
         BL       KDBI5
         BG       KDBI5+1
         LI,R13   'M'
         B        %+2
KDBI5    EQU      %
         BAL,R11  HEXC
         LI,R3    3
         STB,R13  *R4,R3
         LH,R15   BH:SID,R2
         BAL,R11  HEXC
         STW,R13  SYSDX,R4
         LB,R15   BB:RID,R2
         BAL,R11  DEC
         STW,R13  RIDX,R4
         LW,R13   F1B2
         LW,R15   BW:SDA,R2
         LC       R15
         BCS,1    %+2
         AI,R13   -X'100'
         STW,R13  HLDX,R4
         CI,R1    RUNPRI
         BL       KDBI
         LB,R13   BB:RID,R2
         BEZ      KDBI3
         BAL,R11  RBFND
         B        KDBI35
         LI,R14   INBIT
         CI,R1    NCIPRI
         BNE      %+2
         LI,R14   0
         LW,R5    R3
         BAL,R11  GTDVNM1
KDBI35   LI,R13   'RB'
         B        KDBI4
KDBI3    EQU      %
         LB,R3    BB:DEV,R2
         LH,R13   OH:NM,R3
KDBI4    EQU      %
         AND,R13  M16
         OR,R13   80BLNK+1
         STW,R13  DEVX,R4
         LI,R14   0
         LH,R15   BH:GRAN,R2
         AND,R15  M16
         CI,R15   9999
         BLE      KDODG
         DW,R14   TEN
         AI,R14   X'F0'
         SCS,R14  -8
KDODG    EQU      %
         LW,R10   R14
         OR,R10   80BLNK+1
         BAL,R11  DEC
         LW,R11   R13
         OR,R11   TZEROS
         SCD,R10  16
         STW,R10  GRNX,R4
         STW,R11  GRNX1,R4
         LW,R13   BW:FORM,R2
         BNEZ     %+2
         LW,R13   80BLNK+1
         STW,R13  DFMX,R4
         LB,R15   BB:COPY,R2
         BAL,R11  DEC
         STW,R13  COPX,R4
         LH,R15   BH:COMID,R2       #CPV+ -- EXTENDED DISPLAY
         AND,R15  X7FFF             #CPV+ -- EXTENDED DISPLAY
         BNEZ     %+3               #CPV+ -- EXTENDED DISPLAY
         LW,R13   80BLNK+1          #CPV+ -- EXTENDED DISPLAY
         B        %+2               #CPV+ -- EXTENDED DISPLAY
         BAL,R11  HEXC              #CPV+ -- EXTENDED DISPLAY
         STW,R13  COMIDX,R4         #CPV+ -- EXTENDED DISPLAY
         LI,R3    4+COMIDX**2       #CPV+ -- EXTENDED DISPLAY
         LI,R5    BW:FOVL
         BEZ      KDBI45
         LB,R15   BB:RID,R2
         BNEZ     KDBI45
         LB,R5    BB:DEV,R2
         CI,R5    OCPTYP
         BNE      KDBI45
         LW,R15   BW:FOVL,R2        #CPV+ -- EXTENDED DISPLAY
         BNEZ     %+2
         LW,R15   80BLNK+1          #CPV+ -- EXTENDED DISPLAY
         LW,R14   80BLNK+1          #CPV+ -- EXTENDED DISPLAY
         SCD,R14  16                #CPV+ -- EXTENDED DISPLAY
         STW,R14  FOVLX,R4          #CPV+ -- EXTENDED DISPLAY
         STW,R15  FOVLX+1,R4        #CPV+ -- EXTENDED DISPLAY
         LB,R15   BB:JDE,R2
         BAL,R11  DEC
         SCS,R13  16                #CPV+ -- EXTENDED DISPLAY
         STW,R13  JDEX,R4
         LI,R3    4+JDEX**2
KDBI45   EQU      %
         AI,R3    -1
         STB,R3   *R4
         LI,R5    LCLX
         B        *R8
KDBI     EQU      %
         LW,R13   ORDAC
         LC       R15
         BCS,4    %+2
         AI,R13   -X'100'
         LC       R15
         BCS,8    %+2
         SW,R13   Y01
         STW,R13  OAX,R4
         LB,R11   BB:RID,R2
         BNEZ     KDBI01
         LW,R13   TXTT
         CW,R15   JEBIT
         BANZ     %+2
         LW,R13   TXTL
         STW,R13  RIDX,R4
KDBI01   EQU      %
         LH,R15   BH:TIME,R2
         BAL,R11  DEC
         STW,R13  TIMX,R4
         LW,R3    R2
         SLS,R3   2
         AI,R3    B4W:RES
         STW,R3   BADRS
         LW,R10   RES#
         LI,R3    RESINX
         LI,R5    1
KDBI1    EQU      %
         LB,R15   *BADRS,R5
         CI,R15   X'80'
         BAZ      %+3
         LB,R15   SB:RBDF,R5
         AND,R15  M7
         BAL,R11  DEC
ANLZ43   STW,R13  *R4,R3
         AI,R3    1
         AI,R5    1
         BDR,R10  KDBI1
         ANLZ,R14 ANLZACCT
         SLS,R14  3
         ANLZ,R15 ANLZ43
         SLS,R15  2
         AW,R15   ACCTPTR           :
         LI,R10   3
         LW,R13   80BLNK+1
         STW,R13  *R4,R3
         AI,R3    1
         BDR,R10  %-2
         STW,R13  *R4,R3
         MBS,R14  0
         SLS,R3   2
         LH,R15   BH:PART,R2
         SLS,R15  16
         LI,R10   16
KDBI2    EQU      %
         LI,R13   '.'
         SLS,R15  1
         BEV      %+2
         LI,R13   '1'
         STB,R13  *R4,R3
         AI,R3    1
         BDR,R10  KDBI2
         B        KDBI45
KDALOUT  EQU      %                 DETERMINE WHETHER THIS DISPLAY OR DISPLAY OC
         AI,R12   0                 AND OUTPUT MESSAGE TO OPERATOR OR MESSAGE
         BEZ      KDALOU1           FILE AS APPROPRIATE.
         LCI      7
         PSM,R12  TMPSTK
*
*
*O*      MESSAGE: BATCH QUEUE DISPLAYS
*O*
*O*      MEANING: RESPONSE TO VARIOUS DISPLAY KEYINS
*O*
*O*      ACTION:  NONE - INFORMATION ONLY
*O*
*
*
         BAL,R8   TEL%OP1
         LCI      7
         PLM,R12  TMPSTK
         B        *R15
KDALOU1  EQU      %
         LW,R11   R15
         LW,R1    R4
         B        MOVEMES
SETDM    EQU      %
         LCI      7
         LM,R9    ACCTPRT
         STM,R9   *R0,R3
         LW,R15   R3
         AI,R15   7
         SLS,R15  2
         AI,R15   -1
         STB,R15  *R0
SETDM1   EQU      %
         AI,R3    -1
         LH,R5    SH:RNM,R1
         AND,R5   M16
         OR,R5    80BLNK+1
         STW,R5   *R0,R3
         BDR,R1   SETDM1
         B        *R7
DISPSER  EQU      %
         LI,R5    SERX
         LB,R4    S#B:TYP,R3
         LH,R13   SH:RNM,R4
         AND,R13  M16
         OR,R13   CMAB
         SCS,R13  8
         STW,R13  *R1,R5
         AI,R5    1
         LW,R13   S#W:SER,R3
         STW,R13  *R1,R5
         AI,R5    1
         LH,R3    S#H:LNK,R3
         BEZ      DSRO
         CI,R5    EOSER
         BL       DISPSER+1
         AI,R11   -2
DSRO     EQU      %
         SLS,R5   2
         AI,R5    -1
         STB,R5   *R1
         LI,R5    LCLX
         B        MOVEMES
KDSYMB   EQU      %
         LB,R5    SNDDX
         AI,R5    -2
KDSYM1   EQU      %
         CI,R5    MXSTRM
         BLE      LCLCTR1
         LB,R6    SNDDX,R5
         BEZ      KDSYM3
         LD,R14   DCT16,R6
         LI,R3    3
         STB,R14  SYMDM,R3
         STW,R15  SYMDM+1
         LW,R14   STW:FORM,R5
         BNEZ     %+2
         LW,R14   F0B2
         STW,R14  SYMDM1
         LH,R15   STH:CMDV,R5       #CPV+ -- EXTENDED DISPLAY
         BGZ      %+3               #CPV+ -- EXTENDED DISPLAY
         LW,R13   80BLNK+1          #CPV+ -- EXTENDED DISPLAY
         B        %+2               #CPV+ -- EXTENDED DISPLAY
         BAL,R11  HEXC              #CPV+ -- EXTENDED DISPLAY
         STW,R13  SYMDM2            #CPV+ -- EXTENDED DISPLAY
         LI,R4    STW:FOV
         BEZ      KDSYM2
         LW,R15   STW:FOV,R5
         BNEZ     %+2
         LW,R15   F0B2
         STW,R15  SYMDM3            #CPV+ -- EXTENDED DISPLAY
         LB,R15   STB:JDE,R5
         BAL,R11  DEC
         LI,R14   '='
         STB,R14  R13
         STW,R13  SYMDM4            #CPV+ -- EXTENDED DISPLAY
KDSYM2   EQU      %
         LI,R4    SYMDM
*
*
*O*      MESSAGE: SYYNDD FORMS= XXXX (FOVLY= XXXX JDE= XX)
*O*
*O*      MEANING: REPEATED FOR EACH SYMBIONT DEVICE AS RESPONSE TO THE
*O*               DISPLAY SYMBIONTS KEYIN
*O*
*O*      ACTION:  NONE - INFORMATION ONLY
*O*
*
*
         BAL,R8   TEL%OP1
KDSYM3   EQU      %
         AI,R5    -1
         B        KDSYM1
*************#CPV+**************#CPV+******************#CPV+*********
COMSELCT EQU      %
         CI,R1    RUNPRI
         BLE      1,R4              CHECK ONLY COMODE OUTPUT FILES
         LH,R14   BH:COMID,R2       GET COMID
         BEZ      1,R4              NONE
         LI,R15   X'7FFF'
         LW,R8    R2
         LCI      3
         PSM,R0   TMPSTK
         BAL,R0   FIND              CHECK OTHER ENTRIES AT THIS PRIO.
         B        PRNTXIT           ...FOR ONE WITH SAME COMID
         CI,R1    RUNPRI
         BE       PRNTXIT           DONE LOOKING
         CW,R8    R2                HAVE WE COME UP TO THIS FILE
         BE       PRNTXIT           YEP
         LH,R13   BH:COMID,R2       GET FILE'S COMID
         CS,R14   R13               SAME?
         BNE      FIND1             NOPE
         LCI      3
         PLM,R0   TMPSTK
         B        0,R4              GOT A MATCH...DON'T DISPLAY THIS...
*                                   COMID AGAIN
PRNTXIT  EQU      %
         LCI      3
         PLM,R0   TMPSTK
         B        1,R4
*************#CPV+**************#CPV+******************#CPV+*********
BASESW   EQU      %
         LW,2     SWTINIT
         LB,5     SNDDX,3
         CLM,5    RBLIMS
         BCS,9    STORSW1,2
         LI,12    L%HSP
         LW,9     Y02               HASPBIT IN CORE
         CW,9     RB:FLAG,5
         BANZ     STORSW,2
         LI,12    L%RBT
         LW,9     SCSVDGI,1
         LC       R9
         BCR,4    STORSW,R2
STORSW1  EQU      %-BASESW
         LI,12    H%LCL
STORSW   EQU      %-BASESW
         LI,9     QPNT
         AW,9     2
         STB,12   9
         STW,9    SCSWIT,1
         B        *11
QPNT     EQU      %-BASESW
         LCI      7
         PSM,5    TSTACK
         LW,2     SWTINIT
         LW,10    SCSWIT,1
         LW,3     15
         LB,5     SNDDX,3
         LB,4     10
         AW,4     2
         B        0,4
L%RBT    EQU      %-BASESW
         LW,11    RB:FLAG,5
         CI,11    EMBIT
         BAZ      NQOUT,2
         CI,14    80
         BGE      NQOUT,2
         LW,8     13
         LW,9     BUFBA,2
         STB,14   9
         MBS,8    0
         LI,8     81
         SW,8     14
         PSW,1    TSTACK
         LW,1     9
         STB,8    1
         MBS,0    BA(BLANK)
         PLW,1    TSTACK
         LI,14    80
BUFOUT   EQU      %-BASESW
         LW,13    BUFBA,2
NQOUT    EQU      %-BASESW
         LCI      7
         PLM,5    TSTACK
         B        NEWQ
H%LCL    EQU      %-BASESW
         LCI      3
         PSM,15   TSTACK
         LB,4     STB:TYP,3
         PSW,R4   TSTACK
         LI,11    PSRCB
         CLM,5    RBLIMS
         BCS,9    H%L1,2
         LI,9     128
         CI,4     6
         BE       H%L3,2
         LI,9     80
         B        H%L2,2
H%L1     EQU      %-BASESW
         LB,9     TB:MAX,4
         LC       TB:FLGS,4
         BCS,4    H%L3,2
H%L2     EQU      %-BASESW
         LI,11    MVREC
H%L3     EQU      %-BASESW
         LW,3     BUFBA,2
         LI,R4    0
         LW,2     13
         LB,15    0,2
         AI,2     1
         BAL,0    *11
         LW,R2    SWTINIT
         SW,3     BUFBA,2
         LW,14    3
         PLW,R4   TSTACK
         LCI      3
         PLM,15   TSTACK
         CLM,5    RBLIMS
         BCS,9    BUFOUT,2
         CI,4     5
         BNE      BUFOUT,2
         LW,13    BUFBA,2
         B        L%RBT,2
L%HSP    EQU      %-BASESW
         CI,14    0
         BEZ      NQOUT,2
         LCI      9
         PSM,12   TSTACK
         LH,5     STH:FLG,3
         AND,R5   XC,2
         BNEZ     %+2-BASESW,R2
         LI,5     8
         SLS,5    14
         LB,1     12
         CI,1     3
         BNE      L%H2,2
         LW,1     13
         LB,4     0,1
         AND,4    XF3,2
         STB,4    0,1
         LI,8     2
         B        L%H3,2
L%H2     EQU      %-BASESW
         LI,8     X'20'
         CI,1     0
         BE       L%H3,2
         LI,8     X'22'
L%H3     EQU      %-BASESW
         STB,8    8
         LW,1     14
         LI,14    BUF
         AW,14    2
         SCS,13   -2
         LB,4     13
         SLS,4    -6
         LW,15    13
         AND,15   M24
         LI,3     0
H%L4     EQU      %-BASESW
         LCI      5
         PSM,R1   TSTACK
         LI,2     BUFSZSW
         BAL,11   H%CMP1
         LI,R11   0
         LW,8     2
         LCI      5
         PLM,R1   TSTACK
         CI,R11   0
         BNE      H%L4,2
         LCI      9
         PLM,12   TSTACK            GET FCN RIGHT
         LW,14    8
         B        BUFOUT,2
SWTND    EQU      %-BASESW
         LI,R14   0
         XW,14    SWTINIT
         PLW,11   TSTACK
         B        RELCB
XC       EQU      %-BASESW
         DATA     X'C'
XF3      EQU      %-BASESW
         DATA     X'F3'
BUFBA    EQU      %-BASESW
         DATA     0
BUF      EQU      %-BASESW
BUFSZSW  EQU      255
SWTSIZ   EQU      %-BASESW+1
*********************************************
*F*      NAME:    KOSTOP
*F*      PURPOSE: PROCESS RBBAT COMBUF WITH GFC=KOSTOP -
*F*               REMOVE A SYMBIONT DEVICE FROM CONCURRENT OUTPUT MODE
*F*      DESCRIPTION: THE PASSED SYMBIONT INDEX IS USED TO CHECK IF
*F*               THE ASSOCIATED DEVICE IS IN CONCURRENT OUTPUT MODE.
*F*               IF IT IS, A FLAG IS SET WHICH WILL CAUSE THE DEVICE
*F*               TO HAVE NORMAL PRIORITY SCHEDULING RESUMED WHEN
*F*               THE CURRENT FILE IS DONE PRINTING.  IF THE DEVICE
*F*               IS NOT IN CONCURRENT MODE, A  MESSAGE TO THAT EFFECT
*F*               IS SENT TO THE OPERATOR.
*
KOSTOP   EQU      %
         LH,R11   STH:CMDV,R3       COMODE ID FOR DEVICE
         BEZ      NOTGOING          SYMB DEVICE NOT IN CONCURRENT MODE
         OR,R11   LASTCHNK          SET LAST CHUNK FLAG TO FREE DEV.
         STH,R11  STH:CMDV,R3
         B        CTR1              DONE
NOTGOING LI,R8    CTR1
         LI,R4    CANTSTOP
         B        TEL%OP1           COMPLAIN TO OPERATOR
*F*      NAME:    KFLUSH
*F*      PURPOSE: TO PROCESS RBBAT COMBUF WITH GFC=KFLUSH;
*F*               FLUSH COMODE OUTPUT (GET RID OF IT ENTIRELY)
*F*      DESCRIPTION: THE OUTPUT PRIORITY CHAIN IS SEARCHED FOR ALL
*F*               FILES HAVING THE SYSID AND DEVICE TYPE PASSED IN THE
*F*               COMBUF.  ALL SUCH FILES ARE MOVED TO THE DELETE CHAIN.
*F*               IF THE DEVICE INDICATED BY THE PASSED SYMBIONT INDEX
*F*               IS ACTIVE, IT IS 'X'ED AND THE DEVICE IS THEN REMOVED
*F*               FROM CONCURRENT OUTPUT MODE.
*
KFLUSH   EQU      %                 DEV. TYPE PASSED IN R5 FROM CTR1
         LI,R1    3
         LH,R12   *R7,R1            PICK UP SYSID FROM COMBUF
         LI,R1    FOPRI             AND START LOOKING FOR OUTPUT FILES
         BAL,R0   FIND              ...
         B        FLUSHX            NO MORE ANYTHING
         CI,R1    RUNPRI            ARE WE STILL IN OUTPUT FILE CHAIN
         BLE      FLUSHX            NOPE
         CH,R12   BH:SID,R2         IS THIS THE SYSID WE'RE LOOKING FOR
         BNE      FIND1             NO
         CB,R5    BB:DEV,R2         IS THIS FILE FOR THE RIGHT DEV. TYPE
         BNE      FIND1             NO
         LI,R4    FIND1             RETURN ADDR. FOR CHNGRSET
         LI,R14   DELPRI            GO MOVE THE FILE WE JUST FOUND...
         B        CHNGRSET          ...TO THE DELETE CHAIN.
FLUSHX   EQU      %
         LW,R3    SYMINDX
         LB,R4    SSTAT,R3          GET THIS DEVICE'S STATUS BITS
         CI,R4    1                 IS THE BEAST ACTIVE
         BNE      KOSTOP            NOPE: DON'T BOTHER X-ING IT.
         LI,R4    'X'               YES: BOTHER X-ING IT
         STB,R4   SSIG,R3
         B        KOSTOP            AND REMOVE DEVICE FROM COMODE.
*********************************************
*            DATA                           *
*********************************************
*
*
GTPG     GEN,8,24 8,1
FREPG    GEN,8,24 9,1
WAIT     GEN,8,24 X'F',1
IGTRAPS  GEN,8,24 X'14',0
         DATA     3
FVP      GEN,8,24 5,VP
RBJOBMPTR GEN,8,24 80,BA(RBJOBM2)
RMTBPTR  GEN,8,24 38,40
BRSTPTR  GEN,8,24 80,27
PBNPTR   GEN,8,24 40,30
BCSTPTR GEN,8,24 80,BA(HDRM)
SNDPTR GEN,8,24 80,BA(OPM1)
IDCPTR   GEN,8,24 80,BA(ID)+1
ACCTPTR  GEN,8,24 8,2
IDPTR    GEN,8,24 120,BA(ID)
DBRPTR   GEN,8,24 32,53
SLSGSPTR GEN,8,24 8,BA(SLSG+8)+3
SLSGPTR  GEN,8,24 SLSGSZ,SLSGGO+SLSGBSZ
RMTPUT   DATA     BA(RMTNUM)+2
ZERPTR   GEN,8,24 160,VP**2
CRDPTR   GEN,8,24 8,R14**2
BANGRB   DATA     C'!RB'
YBANGRB  DATA     X'5AD9C200'
         BOUND    8
TCAT     TEXTC    'ALLOCAT'
PASSWORD TEXT     '!PASSWOR'
HNDL     EQU      %
         DATA     HASPIO
         DATA     HASPCU
         DATA     2780IO
         DATA     2780CU
RMTCLR   DATA     BA(80BLNK+1)
         GEN,8,24 8,BA(SLSG)+SLSGRMT
RFXPTR   DATA     BA(FRMNM)
         GEN,8,24 4,BA(REQFXP+1)+3
TLCL     TEXT     'LOCAL'
SYS      TEXT     ':SYS    '
SLSGBPT  DATA     SLSGB
         GEN,8,24 SLSGBSZ,SLSGGO
SLSGEPT  DATA     SLSGE
         GEN,8,24 SLSGESZ,SLSGGO+SLSGBSZ+SLSGSZ
LIMIT1   TEXT     'LIMI'
LIMIT2   TEXT     'MIT '
RES      TEXT     'RES '
TJOB     TEXT     '!JOB'
TALL     TEXT     'ALL'
TEOD     TEXT     '!EOD'
TZEROS   TEXT     '0000'
X80S     DATA     X'80808080'
SLASLA   DATA     X'21000021'
TMESET   DATA     X'4000007A'
F1B2     DATA     X'4040F140'
F0B2     TEXT     '  0 '
ORDAC    DATA     X'F140F140'
FRMMX    DATA     X'165CE200'
TXTT     TEXT     '   T'
TXTL     TEXT     '   L'
BRSTW2   DATA     X'02C1F15C'
BRSTWH   DATA     X'02A2B1FD'-X'02C1F15C'
CMAB     DATA     X'6B400000'       COMMA,BLANK,0,0
3ZERO    DATA     0,0,0
X12      DATA     X'12'
PUNBAN   DATA     X'508A04'
XF0      DATA     X'F0'
X7FFF    DATA     X'7FFF'
TEN      DATA     10
LTYFCN   GEN,8,8,8,8  1,255,3,OCDCT
RTYFCN   GEN,8,8,8,8  2,255,3,OCDCT
DSKFCN   GEN,8,8,8,8 0,255,3,0
XP2FCN   GEN,8,8,8,8  3,255,3,0
LGNFCN   EQU      8                 COMMON RP LOGON FUNCTION
RBTMSK   GEN,8,8,8,8 TOF0:DOT,255,15,0
LGNMSK   GEN,8,8,8,8 LGNFCN,255,15,0
WDSKFCN  GEN,8,8,8,8 1,255,3,0
MAFCN    GEN,8,8,8,8 HRS:DOT,255,15,0
MNFCN    GEN,8,8,8,8 HAR:DOT,255,15,0
SLFCN    GEN,8,8,8,8 HSE:DOT,255,15,0
SSIGS    EQU      %-1
         TEXT     'CRXQ'
LASTCHNK EQU      X8000
**********************************   PRIORITYS ARE AS FOLLOWS:
0IPRI    EQU      X'00'             0 PRIO INPUT
FIPRI    EQU      X'0F'             F PRIO INPUT
RUNPRI   EQU      X'10'             RUNNING
0OPRI    EQU      X'11'             0 PRIO OUTPUT
FOPRI    EQU      X'20'             F PRIO OUTPUT
MFPRI    EQU      X'21'             MESSAGE FILES
NCIPRI   EQU      X'22'             NON-CONTROL INPUT
DELPRI   EQU      X'23'             TO BE DELETED
FREI     EQU      X'24'             FREE INPUT
FREO     EQU      X'25'             FREE OUTPUT
*******************************************
ORDBIT   EQU      Y8                FLAG BITS KEPT IN BW:SDA
ACCTBIT  EQU      Y4
XHOLDBIT EQU      Y1
MFBIT    EQU      Y08
DELBIT   EQU      Y2
HO%DLBT  EQU      Y3
HOLDBIT  EQU      Y1
RRBIT    EQU      Y04
RRRBIT   EQU      Y02
JEBIT    EQU      Y01
SWITBIT  EQU      Y01
*****************************************************
IOFCN    EQU      6                 SYMBIONT FORMAT PRINT FUNCTION CODE
BRSTFCN  EQU      X'86'             SYMBIONT BURST FUNCTION CODE
BOMSK    EQU      X'A0'             -------------------------------------
CEB      EQU      X'E'              SCANNER MASKS AND BRANCH CONDITIONS
CEP      EQU      X'D'              SEE TRTBL FOR EXPLANATION
COBLMSK  EQU      X'E0'
COMA     EQU      4
COME     EQU      X'C'
COMMSK   EQU      X'C0'
EOCMSK   EQU      X'80'
EOC      EQU      8
PAR      EQU      1
NBMSK    EQU      X'C1'
NXMSK    EQU      X'F4'
NDMSK    EQU      X'F2'
NNMSK    EQU      X'F8'
NBPMSK   EQU      X'DF'
PARMSK   EQU      X'90'
*****************************************************
GRNLMS   EQU      %-1
         DATA     1000
         DATA     900
         DATA     800
         DATA     700
         DATA     600
         DATA     500
         DATA     400
         DATA     300
         DATA     200
         DATA     150
         DATA     100
         DATA     50
         DATA     25
         DATA     10
************************************************************
***************************************************
*          OPERATOR MESSAGES              *
*******************************************
DUMES    TEXTC    '  CONNECTED'
NOJOBM   EQU      S:UFV(NJMES)
ILJOBM   EQU      S:UFV(BDJM)
NOLOGM   TEXTC    '  FAILED TO LOG STATION ON!'
BKSWM    TEXTC    '*BAD WSN OR DEV ON !RBSW'
BKSW1M   TEXTC    '*NOTHING VALID FOR !RBSW FOUND'
KCOMEM   TEXTC    '*RBCOM ILLEGAL FOR THIS STATION'
OPDISCM  EQU      S:UFV(DISCM)
HUMES    TEXTC    '  DISCONNECTED'
NSTRMM   TEXTC    '  INSUFFICIENT STREAMS'
EDISM    TEXTC    '  ERROR MAX'
SPRID    EQU      1
*******************************************
*        REMOTE  MESSAGES                 *
*******************************************
SALUTE   DATA     X'45F10C40'
         TEXT     '****** CP-V REMOTE BATCH AT YOUR SERVICE',;
                  '  --  LOGON PLEASE! ******'
         BOUND    8
120ASTER DATA X'785C5C5C'
 TEXT '****************'
80BLNK   TEXTC    '                                        ',;
                  '                                          '
 TEXT '**********************'
NOTIDM   DATA     X'2FF10C5C'
         TEXT     '** CARD READ NOT !RBID -- CANNOT ',;
                  'LOG YOU ON!'
NSTRRM   DATA     X'30F10C5C'
         TEXT     '** INSUFFICIENT STREAMS -- CANNOT ',;
                  'LOG YOU ON!'
ILIDM    DATA     X'34F10C5C'
         TEXT     '** ILLEGAL WORK STATION NAME -- CANNOT ',;
                  'LOG YOU ON'
SAMIDM   DATA     X'33F10C5C'
         TEXT     '** WORK STATION NAME IN USE -- CANNOT ',;
                  'LOG YOU ON'
MSBSE    EQU      %
BDFLD    TEXTC    '*CC FIELDS BAD:  ILLEGAL(#), NONEXISTANT',;
                   '(*), OR NOT YOUR(%) SYSID'
BDDEV    TEXTC    '*CC FIELDS BAD: ILLEGAL(#),UNKNOWN(*)',;
                  ',OR INVALID(%) DEVNAME'
BDSWM    TEXTC    '*BAD RBSWITCH:  ILLEGAL WSN OR SWITCH TYPE'
TOFM     TEXTC    '   '
BSZFLD   TEXTC    '*CC ERROR:  BAD OPTION(%), SYNTAX(#), OR ',;
                  'VALUE(*)'
BDJM     TEXTC    '*ILLEGAL JOB COMMAND'
BDRESM   TEXTC    '*!LIMIT ERROR: SYNTAX(#), OPTION(%), OR ',;
                  'VALUE(*) BAD; OR VALUE TOO BIG FOR SYSTEM(&)'
NOSERM   TEXTC    '*OUT OF SERIAL NUMBER SPACE'
NOSLM    TEXTC    '*OUT OF MFILE SLOTS - MFILE LOST'
ACCPTM   TEXTC    '*JOB ACCEPTED'
ABORTM   TEXTC    '*JOB ABORTED'
JOBMT    TEXT     ':TERMINAL JOB '
JOBMP    TEXT     ':PROCESSOR JOB '
INPTM    TEXT     'INPUT '
NRMES    TEXTC    '*ABOVE JOB NEEDS PARTITION CHANGE'
ASTER    TEXTC    '        ******************'
NOSYS    TEXTC    '*NO :SYS AUTHORIZATION -- JOB DELETED'
IGMES    TEXTC    '*CARDS FOLLOWING FIN/RBID IGNORED'
PUNMES   TEXTC    '*PUNCHED OUTPUT READY -- PRESS ''SIGNAL ',;
                  'REMOTE'' WHEN READY TO PUNCH'
UNKN     TEXTC    '*ABOVE CC UNRECOGNIZED OR ILLEGAL - SKIPPED'
BADPRI   TEXTC    '*PRIORITY OF JOB > STATION MAX - SET TO MAX'
NJMES    TEXTC    '*MISSING JOB COMMAND - JOB IGNORED'
BKFM     TEXTC    '*ILLEGAL FORMS CHANGE'
STATMES  TEXTC    '     ********  STATUS  ********'
NOSTAT   TEXTC    '*** STATUS:  NO FILES IN SYSTEM ***'
CANTSTOP TEXTC    '*DEVICE NOT IN CONCURRENT OUTPUT MODE'
*******************************************************
CCRB     COM,48,16  AF(1),0
VEC      COM,8    AF(1)-VECBSE
         BOUND    8
***DANGER: THE ORDER OF THE FIRST SEVEN COMMANDS IS CRITICAL
RBCC     EQU      %-2
         CCRB     '!RBMSG'
         CCRB     '!RBDIS'
         CCRB     '!RBSIZ'
         CCRB     '!RBCON'
         CCRB     '!RBREP'
         CCRB     '!RBABO'
         CCRB     '!RBSAV'
         CCRB     '!RBSTA'
         CCRB     '!RBSUS'
         CCRB     '!RBCTL'
         CCRB     '!RBPRI'
         CCRB     '!RBLOC'
         CCRB     '!RBALI'
         CCRB     '!RBINF'
         CCRB     '!RBDEV'
         CCRB     '!RBXXX'
FIACOM   EQU      DA(%)-DA(RBCC)
         CCRB     '!RBUNL'
         CCRB     '!RBFOR'
         CCRB     '!RBHOL'
         CCRB     '!RBRET'
         CCRB     '!RBDEL'
         CCRB     '!RBSWI'
#RBCCS   EQU      DA(%)-DA(RBCC)-1
JOBCOM   EQU      #RBCCS+1
RESCOM   EQU      JOBCOM+1
SWCOM1   EQU      RESCOM+1
TRBID    CCRB     '!RBID '
TSGON    TEXT     '/*SIGNON'
JBMS     EQU      %
         DATA     BA(ACCPTM)+2
         GEN,8,24 4,BA(OPBUF)+2
         DATA     BA(JOBMT)
         GEN,8,24 14,BA(OPBUF+1)+2
         DATA     BA(JOBMP)
         GEN,8,24 15,BA(OPBUF+1)+2
INPPTR   DATA     BA(INPTM)
         GEN,8,24 6,BA(OPBUF)+2
SIDPTR   DATA     R13**2
         GEN,8,24 4,BA(OPBUF)+2
VECBSE   SET      RBCCBSE
RBCCVEC  EQU      %
         VEC      RBCCBSE
         VEC      RBMSG
         VEC      RBDISC
         VEC      RBSZ
         VEC      RBSSS
         VEC      RBSSS
         VEC      RBSSS
         VEC      RBSSS
         VEC      RBSTAT
         VEC      RBSUSP
         VEC      RBCTL
         VEC      RBPRIO
         VEC      RBLOCK
         VEC      RBALGN
         VEC      RBINFO
         VEC      RBDEV
         VEC      RBXXX
         VEC      RBUNLOCK
         VEC      RBFORM
         VEC      RBHOLD
         VEC      RBRET
         VEC      RBDEL
         VEC      RBSWT
         BOUND    4
************************************************:
MSVEC    EQU      %
         DATA     SMPR
         DATA     SMPU
         DATA     SMRIN
         DATA     -SMIN
         DATA     SMHPR
         DATA     SMHPU
         DATA     SMRINH
         DATA     -SMHIN
VECBSE   SET      MSBSE
MKMES    EQU      %
         VEC      UNKN
         VEC      UNKN
         VEC      UNKN
         VEC      BSZFLD
         VEC      BDDEV
         VEC      BDDEV
         VEC      BDDEV
         VEC      BDDEV
         VEC      BDFLD
         VEC      BDDEV
         VEC      BDDEV
         VEC      BDDEV
         VEC      BDDEV
         VEC      BDDEV
         VEC      UNKN
         VEC      UNKN
         VEC      UNKN
         VEC      BDDEV
         VEC      BDFLD
         VEC      BDFLD
         VEC      BDFLD
         VEC      BDFLD
         VEC      BDFLD
         VEC      BDJM
         VEC      BDRESM
         VEC      BDSWM
         BOUND    4
*********************************************
VECBSE   SET      XP2BSE
XP2VEC   EQU      %
         VEC      XP2BSE
         VEC      RRFM
         VEC      RGFM
         VEC      XP2BSE
         VEC      XP2BSE
         VEC      XP2BSE
         VEC      XP2BSE
         VEC      RREC
         BOUND    4
***********************************************
SIZOPS   EQU      %
         DATA     #SIZOPS
         TEXT     'CP'
         TEXT     'LP'
         TEXT     'NOEM'
         TEXT     'EM'
#SIZOPS  EQU      %-SIZOPS-1
SIZPTR   EQU      %-1
         DATA     -CP
         DATA     -LP
         DATA     NOEM
         DATA     EM
***********************************************
CLSXX    EQU      %
         GEN,8,24 X'15',M:XX
         DATA     X'80000000'
         DATA     2
RDXX     EQU      %
         GEN,8,24 X'10',M:XX
         DATA     X'F8000010'
         DATA     PIDEA
         DATA     PIDEA
         DATA     REC
         DATA     RECSZ
         DATA     FLD
OPNXX    EQU      %
         GEN,8,24 X'14',M:XX
         DATA     X'C7400209'
         DATA     PIDEA
         DATA     PIDEA
         DATA     2
         DATA     2
         DATA     1
         DATA     2
         DATA     X'01000202'
         TEXTC    ':RBLOG'
         DATA     X'02000202'
         TEXT     ':SYS  '
         DATA     X'03010202'
         DATA     X'DFEF803F'
         DATA     X'AFC0BF9F'
RSXX     EQU      %
         GEN,8,24 X'10',M:XX
         DATA     X'F8000010'
         DATA     PIDEA
         DATA     PIDEA
         PZE      *KSWFLG
         DATA     2048
         DATA     RSXXK
RSXXK    TEXTC    '///'
OPNXXO   GEN,8,24 X'14',M:XX
         DATA     X'C7480009'     BITS,ACCT IS HERE,FILE ASN
         DATA     DMPER             ERR
         DATA     DMPER             ABN
         DATA     2                 KEYED
         DATA     2                 DIRECT
         DATA     2                 OUT
         DATA     2                 SAVE
         DATA     7                 KEYM
         DATA     X'01000202'       FILE NAME
         TEXTC    ':RBBRVR'
         DATA     X'02000202'       ACCOUNT
         TEXT     ':SYS    '
         DATA     X'03010002',0,0   CLEAR M:XX PASSWORD
OPNXXIO  GEN,8,24 X'14',M:XX
         DATA     X'C7400009'       BITS, ACCT IS HERE, FILE ASN
         DATA     DMPER             ERR
         DATA     DMPABN            ABN HANDLER FOR 03-00
         DATA     2                 KEYED
         DATA     2                 DIRECT
         DATA     4                 INOUT
         DATA     2                 SAVE
         DATA     X'01000202'       FILE NAME
         TEXTC    ':RBBRVR'
         DATA     X'02010202'       ACCOUNT
         TEXT     ':SYS    '
SETXXDCB GEN,8,24 6,M:XX            M:SETDCB
         DATA     X'C0000000'
         DATA     DMPER             ERR
         DATA     DMPER             ABN
CLSXXO   GEN,8,24 X'15',M:XX        M:CLOSE M:XX,(SAVE)
         DATA     X'80000000'
         DATA     2                 SAVE
WRXXSD   GEN,8,24 X'11',M:XX        M:WRITE M:XX, ETC
         DATA     X'F8000040'       OWNEWKEY
         DATA     DMPER             ERR
         DATA     DMPER             ABN
         DATA     SDAA              STATIC DATA BASE
         DATA     SDSIZE            BYTE COUNT
         DATA     SDKEY             KEY FOR THE RECORD
WRXXDD   GEN,8,24 X'11',M:XX        M:WRITE,M:XX,ETC.
         DATA     X'F8000040'       ONEWKEY
         DATA     DMPER             ERR
         DATA     DMPER             ABN
         PZE      *R8               START ADDRESS
         PZE      *R9               SIZE
         DATA     DDKEY             KEY
GDDL     GEN,8,24 X'1B',0           GET DYN DATA LIMITS
********************************************************************
************************************************
RESOPTS  EQU      %
         DATA     #RESOPTS
         TEXT     'TIME'
         TEXT     'ORDE'
         TEXT     'NORD'
         TEXT     'ACCO'
         TEXT     'MOUN'
         TEXT     'LO'
         TEXT     'PO'
         TEXT     'DO'
         TEXT     'UO'
         TEXT     'SCRA'
         TEXT     'PSTO'
         TEXT     'TSTO'
         TEXT     'TDIS'
         TEXT     'PDIS'
         TEXT     'TI  '
         TEXT     'RERU'
#RESOPTS EQU      %-RESOPTS-1
RESPTR   EQU      %-1
         DATA     -TIMEL
         DATA     ORDER
         DATA     NORDR
         DATA     ACCNT
         DATA     MOUNT
         DO1      9
         DATA     0
         DATA     -TIMEL
         DATA     RERUN
*****************************************************
*REMOTE BATCH FLAGS (RB:FLAG)
BPBIT    EQU      Y8                BLOCK PROTECT TOGGLE
DUPBIT   EQU      X'8000'           FULL DUPLEX
EMBIT    EQU      2                 =1 => NOEM
FINBIT   EQU      4                 FIN ENCOUNTERED
FRBIT    EQU      1                 FIRST READ
LIPBIT   EQU      8                 LOGON IN PROCRESS
MORBIT   EQU      Y2                CONTINUED JOB STREAM
SSSBIT   EQU      X'10'             SUSPEND AND SWITCH SYMBIONT
HUBIT    EQU      Y1                HUNG UP
FIABIT   EQU      X'20'             FILES ALTERED
OADBIT   EQU      X'40'
XP2BIT   EQU      X'80'
PUNBIT   EQU      Y08               OK TO PUNCH
CTRBIT   EQU      X'100'            GHOST BLOCKS RBSS
ACTBIT   EQU      X'200'            ACTIVE
CLKBIT   EQU      X'400'
IGBIT    EQU      Y4                CARDS WERE IGNORED
HALBIT   EQU      X'800'            HOLDALL
SYSBIT   EQU      X'1000'           CAN USE :SYS
LOFBIT   EQU      X'2000'           LOGGED OFF
DISCBIT  EQU      X'4000'           DISCONNECT ON READ
RBXBIT   EQU      X'10000'          DISCONNECT NOW
OFFBIT   EQU      X'20000'          RBSS IGNORE THIS GUY
EDISBIT  EQU      X'40000'          DISCED FOR ERRORS
ALBIT    EQU      Y008
DCBIT    EQU      Y04
DIALBIT  EQU      Y0008
IBMBIT   EQU      Y001
TBTS     EQU      %
HASPBIT  DATA     X'02000000'
2780BIT  DATA     X'00200000'
IRS      EQU      X'1E'
3780BIT  DATA     X'00100000'
SLVBIT   EQU      Y01
XP1BIT   EQU      Y004
SLVXP2BT DATA     X'01000080'
AL%DCBIT DATA     X'04800000'
HA%SSSBT DATA     X'02200010'
NA%LGBT  DATA     X'FF7FFFF7'
IDUBTS   DATA     X'04800200'
SGBITS   DATA     X'06288040'
BSCBTS   DATA     X'02200000'
NCTRBIT  DATA     -1-CTRBIT
MSKH     DATA     X'FC878455'
MSKG     DATA     X'03787BAA'
*****************************************************:
* HASP CONTEXT PAGE DESCRIPTION
HPB      EQU      1
HBB      EQU      2
HRB      EQU      3
HWB      EQU      4
CPB      EQU      5
CBB      EQU      6
CRB      EQU      7
CWB      EQU      8
* .
OCRCB    EQU      13
* .
CFC      EQU      21
* .
* .
CONTCK   EQU      31
*.
TTYP     EQU      36
RTRY     EQU      37
*.
SPB      EQU      38
BUF1     EQU      73
BUF2     EQU      183
BUF3     EQU      293
BUF4     EQU      403
BUFSZ    EQU      110
37BUFDIF EQU      30
*OTHER HASP INFO
DLE      EQU      X'10'
ARFCN    EQU      2
BKSBIT   EQU      X'200'
NBKSBIT  DATA     -1-BKSBIT
INBIT    EQU      1
OCBIT    EQU      2
SRCB2BT  EQU      8
LOCBIT   EQU      X'10'
ALGBIT   EQU      X'4000'
FLKBIT   EQU      X'20'
XLOCBT   DATA     LOCBIT
XALGBT   DATA     ALGBIT
NLOCBT   DATA     -1-LOCBIT
NALGBT   DATA     -1-ALGBIT
STPBIT   EQU      X'400'
XSTPBIT  DATA     STPBIT
NSTPBT   DATA     -1-STPBIT
NSTALBT  DATA     -1-STPBIT-ALGBIT
FMSBIT   EQU      X'40'
XFLKBIT  DATA     FLKBIT
WFQBIT   EQU      X'800'
XSETBIT  EQU      X'8000'
**********************************************************
ACCTPRT  TEXT     '  ACCOUNT  16 *PARTITIONS* 1'
NODIS    TEXTC    '*NOTHING TO DISPLAY'
*************************************************
TRTBL    EQU      %                 THE SCANNER WORKS AS FOLLOWS:
         DATA,1   X'FF'
         DO1      7                 :
         DATA,1   X'F'              TRT SCANS DOWN THE BYTE STRING STARTING
         DATA,1   X'FF'             WITH THE CURRENT BYTE POSITION IN R6.
         DO1      4                 EACH BYTE IS USED AS AN INDEX INTO TRTBL
         DATA,1   X'F'              THE TRANSLATION BYTE THUS OBTAINED
         DATA,1   X'FF'             IS ANDED WITH THE MASK PASSED TO TRT IN R1.
         DO1      7                 IF THE AND IS ZERO THE SCAN CONTINUES.  IF
         DATA,1   X'F'              NOT THE ANDED MASK IS PUT INTO THE TOP
         DATA,1   X'FF'             BYTE OF R6,THE REST OF R6 IS THE B.A. OF
         DO1      42                THE CHARACTER STOPPED ON AND THE TOP
         DATA,1   X'F'              FOUR BITS OF THE ANDED MASK ARE PUT IN
         DATA,1   X'20'             THE CONDITION CODES.
         DO1      10                :
         DATA,1   X'F'              :
         DATA,1   X'FF'             :
         DATA,1   X'F'              TRTBL IS CONSTRUCTED AS FOLLOWS:
         DATA,1   X'3A'             :
         DO1      13                FOR EACH CHARACTER X'00' TO X'FF' THE
         DATA,1   X'F'              TRANSLATION BTYE IS CHOSEN BY THE
         DO1      2                 FOLLOWING CHARACTERISTICS.
         DATA,1   7                 :
         DATA,1   X'3C'             X'01' - NOT A DELIMITER
         DATA,1   X'FF'             X'02' - NOT LEGAL DECIMAL
         DATA,1   X'F'              X'04' - NOT LEGAL HEX
         DATA,1   7                 X'08' - NOT A LEGAL NAME CHARACTER
         DO1      10                X'10' - THIS IS A PARENTHESIS
         DATA,1   X'F'              X'20' - THIS IS A BLANK
         DATA,1   X'40'             X'40' - THIS IS A COMA
         DATA,1   7                 X'80' - THIS IS END OF CARD
         DATA,1   7                 :
         DO1      12                THE TRANSLATION IS THE 'OR' OF THE
         DATA,1   X'F'              APPROPRIATE CHARACTERISTICS OF THE SOURCE
         DO1      3                 BYTE.  '(' AND ')' ARE SPECIAL CASED TO LOOK
         DATA,1   7                 LIKE BLANKS UNLESS SPECIFICALLY LOOKED FOR.
         DATA,1   X'F'              :
         DATA,1   X'40'             :
         DO1      2                 :
         DATA,1   X'F'              THE MASKS ARE AS FOLLOWS:
         DO1      9                 :
         DATA,1   7                 X'A0' - STOP ON BLANK OR EOC ONLY (BOMSK)
         DO1      7                 X'C0' - STOP ON ',' OR EOC ONLY (COMMSK)
         DATA,1   X'F'              X'80' - STOP ON EOC ONLY (EOCMSK)
         DO1      9                 X'90' - STOP ON PAREN OR EOC ONLY (PARMSK)
         DATA,1   7                 X'C1' - STOP ON NON-BLANK (NBMSK)
         DO1      8                 X'DF' - STOP ON NON-BLANK INCL. PARENS (NBPM
         DATA,1   X'F'              X'F2' - STOP ON NON-DEC (NDMSK)
         DO1      8                 X'F4' - STOP ON NON-HEX (NXMSK)
         DATA,1   7                 X'F8' - STOP ON NON-NAME (NNMSK)
         DO1      23                X'E0' - STOP ON ANY DELIMITER (COBLMSK)
         DATA,1   X'F'              :
         DO1      6                 '=' IS CONSIDERED TO BE ','
         DATA,1   3                 0,'.' , ';' , AND X'08' ARE EOC
         DO1      3                 ALL SCANS STOP ON EOC.
         DATA,1   7                 :
         DO1      7                 :
         DATA,1   X'F'              :
         DO1      9                 THE CONDITION CODES AFTER TRT ARE
         DATA,1   7                 AS FOLLOWS:
         DO1      8                 :
         DATA,1   X'F'              X'8' - EOC WAS HIT    (EOC)
         DO1      8                 X'4' - COMMA WAS HIT  (COMA)
         DATA,1   7                 X'2' - BLANK WAS HIT
         DO1      6                 X'1' - PAREN WAS HIT  (PAR)
         DATA,1   X'F'              X'C' - COMMA OR EOC  (COME)
         DO1      10                X'D' - COMA,EOC OR PAREN (CEP)
         DATA,1   1                 X'E' - COMA,EOC OR BLANK  (CEB)
         DO1      6                 :
         DATA,1   X'F'              :
********************************************
CRCTBL   EQU      %
         DATA     X'0000C0C1'
         DATA     X'C1810140'
         DATA     X'C30103C0'
         DATA     X'0280C241'
         DATA     X'C60106C0'
         DATA     X'0780C741'
         DATA     X'0500C5C1'
         DATA     X'C4810440'
         DATA     X'CC010CC0'
         DATA     X'0D80CD41'
         DATA     X'0F00CFC1'
         DATA     X'CE810E40'
         DATA     X'0A00CAC1'
         DATA     X'CB810B40'
         DATA     X'C90109C0'
         DATA     X'0880C841'
         DATA     X'D80118C0'
         DATA     X'1980D941'
         DATA     X'1B00DBC1'
         DATA     X'DA811A40'
         DATA     X'1E00DEC1'
         DATA     X'DF811F40'
         DATA     X'DD011DC0'
         DATA     X'1C80DC41'
         DATA     X'1400D4C1'
         DATA     X'D5811540'
         DATA     X'D70117C0'
         DATA     X'1680D641'
         DATA     X'D20112C0'
         DATA     X'1380D341'
         DATA     X'1100D1C1'
         DATA     X'D0811040'
         DATA     X'F00130C0'
         DATA     X'3180F141'
         DATA     X'3300F3C1'
         DATA     X'F2813240'
         DATA     X'3600F6C1'
         DATA     X'F7813740'
         DATA     X'F50135C0'
         DATA     X'3480F441'
         DATA     X'3C00FCC1'
         DATA     X'FD813D40'
         DATA     X'FF013FC0'
         DATA     X'3E80FE41'
         DATA     X'FA013AC0'
         DATA     X'3B80FB41'
         DATA     X'3900F9C1'
         DATA     X'F8813840'
         DATA     X'2800E8C1'
         DATA     X'E9812940'
         DATA     X'EB012BC0'
         DATA     X'2A80EA41'
         DATA     X'EE012EC0'
         DATA     X'2F80EF41'
         DATA     X'2D00EDC1'
         DATA     X'EC812C40'
         DATA     X'E40124C0'
         DATA     X'2580E541'
         DATA     X'2700E7C1'
         DATA     X'E6812640'
         DATA     X'2200E2C1'
         DATA     X'E3812340'
         DATA     X'E10121C0'
         DATA     X'2080E041'
         DATA     X'A00160C0'
         DATA     X'6180A141'
         DATA     X'6300A3C1'
         DATA     X'A2816240'
         DATA     X'6600A6C1'
         DATA     X'A7816740'
         DATA     X'A50165C0'
         DATA     X'6480A441'
         DATA     X'6C00ACC1'
         DATA     X'AD816D40'
         DATA     X'AF016FC0'
         DATA     X'6E80AE41'
         DATA     X'AA016AC0'
         DATA     X'6B80AB41'
         DATA     X'6900A9C1'
         DATA     X'A8816840'
         DATA     X'7800B8C1'
         DATA     X'B9817940'
         DATA     X'BB017BC0'
         DATA     X'7A80BA41'
         DATA     X'BE017EC0'
         DATA     X'7F80BF41'
         DATA     X'7D00BDC1'
         DATA     X'BC817C40'
         DATA     X'B40174C0'
         DATA     X'7580B541'
         DATA     X'7700B7C1'
         DATA     X'B6817640'
         DATA     X'7200B2C1'
         DATA     X'B3817340'
         DATA     X'B10171C0'
         DATA     X'7080B041'
         DATA     X'500090C1'
         DATA     X'91815140'
         DATA     X'930153C0'
         DATA     X'52809241'
         DATA     X'960156C0'
         DATA     X'57809741'
         DATA     X'550095C1'
         DATA     X'94815440'
         DATA     X'9C015CC0'
         DATA     X'5D809D41'
         DATA     X'5F009FC1'
         DATA     X'9E815E40'
         DATA     X'5A009AC1'
         DATA     X'9B815B40'
         DATA     X'990159C0'
         DATA     X'58809841'
         DATA     X'880148C0'
         DATA     X'49808941'
         DATA     X'4B008BC1'
         DATA     X'8A814A40'
         DATA     X'4E008EC1'
         DATA     X'8F814F40'
         DATA     X'8D014DC0'
         DATA     X'4C808C41'
         DATA     X'440084C1'
         DATA     X'85814540'
         DATA     X'870147C0'
         DATA     X'46808641'
         DATA     X'820142C0'
         DATA     X'43808341'
         DATA     X'410081C1'
         DATA     X'80814040'
***************************************************************
RBBP     EQU      %
PTSZ     SET      ((ABSVAL(RBBP)+X'1FF')&(X'1FE00'))-ABSVAL(RBBP)
         DO       PTSZ>64
         RES      PTSZ-14
         ELSE
         RES      512
         FIN
************************************:
         CSECT    0                 BEGINNING OF STATIC DATA
SDAA     DATA     BW:SDA-%          DISPLACEMENT TO BW:SDA FOR RECOVERY
SDAS     DATA     INFIL+OUTFIL      SIZE OF BW:SDA FOR RECOVERY
SVCBF    DATA     0                 CURRENT COMBUF (USED BY RECOVERY)
ALZ      COM,32   AF(1)-SDAA
* RELATIVE ADDRESSES FOR ANLZ TO DUMP RBBAT TABLES
         DATA     INFIL
         DATA     OUTFIL
         ALZ      BB:COPY
         ALZ      BB:DEV
         ALZ      BB:PI
         ALZ      BB:RID
         ALZ      BD:ACCT
         ALZ      BH:HPRI
         ALZ      BH:LINK
         ALZ      BH:PART
         ALZ      BH:SID
         ALZ      BH:SLNK
         ALZ      BH:TIME
         ALZ      BH:TPRI
         ALZ      BH:XLNK
         ALZ      BW:FORM
         ALZ      BW:SDA
         ALZ      B4W:RES
         ALZ      BB:JDE
         ALZ      BW:FOVL
         ALZ      BH:GRAN
         ALZ      RB:MFAD
         ALZ      RB:SPMF
         ALZ      RBH:MFX
         ALZ      RBB:DSM
         ALZ      RBB:MXP
         ALZ      RBB:SMD
         ALZ      STW:FORM
         ALZ      STB:DPD
         ALZ      STB:JDE
         ALZ      STH:NM
         ALZ      STW:FOV
RCVLOC   DATA     X'8A814A40'       FOR RCVR TO TEST GOOD DATA
***********************************************
BH:HPRI  EQU      %                 PRIORITY CHAIN HEADS
         DO1      X'24'
         DATA,2   0
         DATA,2   1                 INPUT FREE HEAD
         DATA,2   INFIL+1           OUTPUT FREE HEAD
*********************************************
BH:TPRI  EQU      %                 PRIORITY CHAIN TAILS
         DO1      X'24'
         DATA,2   0
         DATA,2   INFIL             INPUT FREE TAIL
         DATA,2   INFIL+OUTFIL      OUTPUT FREE TAIL
*********************************************
ABORT    DATA     0                 ABORT JOB FLAG
ADDX     DATA     0                 ENTRY INDEX FOR AIF,AIFJE
ALLX     DATA     0                 ALL WAS SPECIFIED ON A COMMAND
ARS      DATA     0                 BYTE COUNT OF CC (PROBABLY ALWAYS 80)
ARSE     DATA     0                 REC LENGTH TO EOC
ARSO     DATA     0                 REC LENGTH - USEFUL INFO
BCP      DATA     0                 BEGINING ADDR OF CC
COM      DATA     0                 COMMAND BEING PROCESSED
CONT DATA 0 CONTINUATION FLAG
CCMVD    DATA     0                 CC IN MESSAGE FILE FLAG
CURSID   DATA     0
CVT      DATA     0                 CONVERSION BASE
FFLG     DATA     0                 FILE FOUND FLAG FOR FINDSID
FINFLG   DATA     0                 LAST JOB OF BLOCK FLAG
FRMCK    DATA     0                 COUNTER FOR FORMS MESSAGE
FRMNM    DATA     0                 NAME OF HIGEST PRIO FORMS
FLAGS    DATA     0                 SAVED RB:FLAG
FLINK    DATA     0                 DISC SECTOR FLINK
PLKXX    DATA     0
FRSTPG   DATA     0                 BASE OF DYNAMIC DATA
KOMP     DATA     0
PROCOPX  RES      1
XS       RES      1
IJTYPE   RES       1
BSL:CRES RES      8
B8:CRES  RES      4
BI:ASPN  RES      3
BADRS    RES      1
RESX     DATA     0
RSID     GEN,16,16  SMUIS+1,0
TYPSW    DATA     0
SWTYP    DATA     0
SWITFLG  DATA     0
SWRID    DATA     0
KSW#     DATA     0
KSWFLG   DATA     0
         BOUND    8                 :
INVRN    EQU      %                 INVIRONMENT READ IN BY RCVR
         DO1      18
         DATA     0
INVRNSZ  EQU      72
TMPSTK   DATA     %+2               TEMP STACK
         DATA,2   55,0              :
         RES      56                :
MFFS     DATA     MFS               COUNTER OF SPECIAL MESSAGE FILE SLOTS
MRKD     DATA     0                 CC HAS BEEN FLAGGED AS IN ERROR
MSFLG    DATA     0                 HEADING FLAG FOR DISPLAY
NXTFCN   DATA     0                 SAVED SYMBIONT FUNCTION CODE FROM DISC BLOCK
NYID     DATA     0                 NOT YOUR ID FLAG FOR FINDSID
OCCC     DATA     0                 INPUT FROM OC FLAG
OPTLST   DATA     0                 OPTION LIST POINTER FOR PROCOP
OPTBL    DATA     0                 ROUINE LIST POINTER FOR PROCOP
PGCNT    DATA     32                PAGE COUNTER FOR DYN. BUFFERING
PGMAP    DATA     0                 PAGE MAP FOR DYN. BUFFERING
PREV     DATA     0                 ENTX USED BY CHNGRSET
PRIO     DATA     0                 PRIO OF JOB BEING ADDED
RCVRSV   DATA     0                 RBBATR SAVED FLAGS AND COMBUF ADDR
RCVRFLG  DATA     0                 RBBATR RECOVERY IN PROGRESS FLAG
RCVRPTR  DATA     0                 RBBATR PLACE TO RETURN
RCVRBUF  DATA     0                 POINTER TO RBBATR DYN. BUFFER
RCVUN    DATA     0                 CUN OF LST CRASH
RES#     DATA     0
SECT     DATA     0                 ADDR OF CURENT DISC BUFFER
STATX    DATA     0                 FLAG FOR STATUS HEADINGS
STAK     DATA     TMPSTK            POINTER TO TEMPSTK (SHOULD BE REMOVED)
SV10     DATA     0                 GENERAL TEMP SAVE CELL
SVZ      DATA     1                 FLAG FOR ENVIRONMENT SAVED
SVREGS   EQU      %                 ENVIRONMENT SAVE AREA
         DO1      11
         DATA     0
SVREG11  DATA     0,0,0,0,0
SYMINDX  DATA     0
CCTMP    DATA     0
ZERO     EQU      BA(SDAA)
WMFA     DATA     0
VP       EQU      X'10000'
SAD      DATA     0
         DATA     VP
STARTCOM DATA     0
CHAINHD  DATA     0
RBMS     TEXTC    ' - XXXXXXXX  *MSG* '
RBMS1    RES      30
RBMSZ    EQU      19
RBOPBUF  TEXTC    ' - XXXXXXXX ** '
OPBUF    TEXTC    '*   '            :
         RES      19
RBOPSZ   EQU      16
ONMES    TEXTC    ' - XXXXXXXX - LOGGED ON'
ABNM     TEXTC    'CANNOT ACCESS :RBLOG CODE= XXXX'
ZAPM     TEXTC    '*BATCH QUEUE LOST! - CODE= XXXX'
ZAPM1    EQU      ZAPM+7
REQFXP   DATA     X'0B80C800',X'0100FFFF',X'FFFFFF00'
GFXP     DATA     X'0780C400',X'0200FF00'
INAM     TEXTC    '*SYSID=XXXX DEVICE=XX NAME=0000 INPUT',;
                  ' FILE ACCEPTED'
INAM3    EQU      INAM+7
INAM1    EQU      INAM+2
INAM2    EQU      INAM+5
SLSG     DATA     X'32323232'
         DATA     X'100290BF'
         DATA     X'FFF0C161'
         TEXT     '*SIGNON       REMOTENN XXXXXXXX '
         TEXT     '                    '
         TEXT     '                        '
         DATA     X'40404000'
         DATA     X'10260000'
         DATA     -1
SLSGRMT  EQU      26
SLSGSZ   EQU      80
SLSGBSZ  EQU      11
SLSGESZ  EQU      6
SLSGWSZ  EQU      SLSGBSZ+SLSGSZ+SLSGESZ
SLSGCSZ  EQU      SLSGWSZ-9
SLSGB    EQU      BA(SLSG)
SLSGM    EQU      SLSGB+SLSGBSZ
SLSGE    EQU      SLSGM+SLSGSZ
SLSGGO   EQU      (VP+BUF4+1)**2
RMTNUM   TEXT     '  REMOTENN'
NONEX    TEXTC    '*SYSID=XXXX DOESNT EXIST'
RRM      TEXTC    '*SYSID=XXXX WILL BE RERUN'
NRRM     TEXTC    '*SYSID=XXXX ACCT = AAAAAAAA CANNOT BE RERUN'
NRRM1    EQU      NRRM+5
         BOUND    8
DDVMXS   EQU      %
         TEXT     'ACTIVE'
         TEXT     'SUSP''ED'
         TEXT     'LOCKED'
         TEXT     'INACTIVE'
DDVM     TEXTC    '*DEV = XX  YYYYYYYY FORMS= FFFF'
DDVM1    EQU      DDVM+2
DDVM2    EQU      DDVM+3
DDVM3    EQU      DDVM+7
DDVMSZ   EQU      19
DDVMSZF  EQU      DDVMSZ+12
***************
*RBINFO MESSAGES
**************
*
ITMM     TEXTC    '*TIME = HH:MM  MM/DD/YY'
ITMM1    EQU      ITMM+3
ICUM     TEXTC    '*USERS IN SYSTEM = XXXX'
ICUM1    EQU      ICUM+5
IETM     TEXTC    '*ETMF =NNNN'
IETM1    EQU      IETM+2
IBRM     TEXTC    '*BATCH JOBS: RUNNING = XXXX'
IBRM1    EQU      IBRM+6
IBWM     TEXTC    '*            WAITING = XXXX'
IBWM1    EQU      IBWM+6
         BOUND    8
FRMM     TEXTC    'XXXXXXX SETUP REQUIRED'
RFRMM    TEXTC    '*SETUP NEEDED DEV= XX'
RFRMM1   EQU      RFRMM+5
RRECM    TEXTC    ' - XXXXXXXX - RECOVERING!!'
RMTBAN   TEXT     'REMOTE OUTPUT WSN = XXXXXXXX DEVICE=XX'
RMTBAN1  EQU      RMTBAN+9
RMTBAN2  EQU      RMTBAN+5
ABNM1    EQU      ABNM+7
         BOUND    8
HDR TEXTC '  *****XXXXXXXX RBID = XXXX -- ',;
  'XXXXXXXX ** *CP-V REMOTE PROCESSING* ',;
                  '                              ',;
                  '                         '
OPMES    TEXTC    '***MSG***  ',;
                  '                                        ',;
                  '                                        '
OPM1     EQU      OPMES+3
OPMSZ    EQU      11
HDR1     EQU      HDR+2
HDR2     EQU      HDR+6
HDR3     EQU      HDR+8
HDRM     EQU      HDR+11
RBJOBM   DATA     X'5F5CE2E8'
         TEXT     'SID=XXXX ** '
         RES      20
RBJOBM1  EQU      RBJOBM+2
RBJOBM2  EQU      RBJOBM+4
RBJOBMSZ EQU      X'F'
         BOUND    8
YOURON   TEXTC    '*****  XXXXXXXX LOGGED ONTO DSCXXXXXXXX AS RBIDXXXX'
YOURON1  EQU      YOURON+8
YOURON2  EQU      YOURON+12
YOURON3  EQU      YOURON+2
DISCM    TEXTC    ' - XXXXXXXX - LOGGED OFF'
DISCM1   EQU      DISCM+1
TXRLE    EQU      %
         TEXTC    '* #XX REQUESTED EXCEEDS SYSTEM MAX'
TXNRSN   TEXTC    '*  XXXX REPEATED SERIAL NUMBER'
         BOUND    8
FLD      TEXT     '                '
********************************************
         BOUND    8
RECSZ    EQU      360
REC      RES      RECSZ/4
RID      EQU      0
FLG      EQU      1
KEY      EQU      2
MXPRI    EQU      4
BUFX     EQU      5
SGON     EQU      6
RMT#     EQU      8
OCIN     EQU      9
#STRM    EQU      10
SMD      EQU      11
NMTBL    EQU      12
RCBTBL   EQU      20
F1TBL    EQU      24
F2TBL    EQU      32
SUSTBL   EQU      40
MXTBL    EQU      48
MNTBL    EQU      52
PRIVTBL  EQU      56
DPDTBL   EQU      60
GJOB     EQU      64
RTY      EQU      66
LGN      EQU      67
********************************************
ID       EQU      %
         RES      31
*************************************************
************************************************
*      STATUS  MESSAGES                        *
************************************************
NTR      EQU      5
SYSD     EQU      2
SMRINH   TEXTC    '*SYSID=XXXX RUNNING - OUTPUT WILL',;
                  ' BE HELD'
SMRIN    TEXTC    '*SYSID=XXXX RUNNING'
SMHPR    TEXTC    '*SYSID=XXXX DEV= XX #GRAN =XXXX COPIES=XXXX HELD'
SGRNX    EQU      7
SCPX     EQU      10
FRMX     EQU      13
SDVX     EQU      9
SMHPU    TEXTC    '*SYSID=XXXX DEV= XX #GRAN =XXXX COPIES=XXXX',;
                  ' FORMS= XXXX HELD'
SMHIN    TEXTC    '*SYSID=XXXX WAITINGXXXX TO RUN - ',;
                  'OUTPUT WILL BE HELD'
SMPR     TEXTC    '*SYSID=XXXX DEV= XX #GRAN =XXXX COPIES=XXXX WAITING'
SMPU     TEXTC    '*SYSID=XXXX DEV= XX #GRAN =XXXX COPIES=XXXX',;
                  ' FORMS= XXXX WAITING'
SMIN     TEXTC    '*SYSID=XXXX WAITINGXXXX TO RUN'
PBNM     TEXT     'PARTIAL FILE SYSID =XXXX HH:MM  MM/DD/YY'
PBNM1    EQU      PBNM+5
PBNM2    EQU      PBNM+7
COMODMSG TEXTC    '*SYSID=XXXX IN CONCURRENT OUTPUT MODE ON YYNDD'
COMODM1  EQU      COMODMSG+2
COMODM2  EQU      COMODMSG+10
COMODM3  EQU      COMODMSG+11
DISP     TEXT     'D I S P L A Y    HH:MM  MM/DD/YY'
DISPB1   EQU      DISP+4
DISPB2   EQU      DISP+5
DISPB3   EQU      DISP+6
DISMESO  TEXTC    '*PRIO SYSID RBID H DEVICE FORMS #GRANS COPIES ',;
                  ' COMID FOVL JDE' #CPV+ -- EXTENDED DISPLAY
NOOMSZ   EQU      X'34'
DISMESIR TEXTC    '*PRIO SYSID ORIG H O A TIME'
         RES      22
DISMESIN TEXTC    '*PRIO SYSID ORIG H O A TIME'
         RES      11
DOM      TEXTC    '                        ',;
                  '           ',;   CPV+ -- DISPLAY
                  '                        '
DIM      TEXTC    '                              ',;
                  '                              ',;
                  '                              ',;
                  '                              '
SERDS    TEXTC    '*SHARED:'
         RES      18
SERDX    TEXTC    '*EXCLUSIVE:'
         RES      18
SYMDM    TEXTC    '*SYYNDD FORMS= XXXX COMID= XXXX FOVLY= XXXX JDE= XX'
SYMDM1   EQU      SYMDM+4
SYMDM2   EQU      SYMDM+7
SYMDM3   EQU      SYMDM+10          #CPV+ -- EXTENDED DISPLAY
SYMDM4   EQU      SYMDM+12          #CPV+ -- EXTENDED DISPLAY
SMDMNZ   EQU      31                #CPV+ -- EXTENDED DISPLAY
SYSDX    EQU      2
RIDX     EQU      3
HLDX     EQU      4
DEVX     EQU      5
OAX      EQU      5
TIMX     EQU      6
RESINX   EQU      7
DFMX     EQU      7
GRNX     EQU      8
GRNX1    EQU      9
COPX     EQU      10
COMIDX   EQU      12
FOVLX    EQU      13                #CPV+ -- EXTENDED DISPLAY
JDEX     EQU      14                #CPV+ -- EXTENDED DISPLAY
SERX     EQU      3
EOSER    EQU      21
*********************************************
         END      INITRBG

