         DEF      RBSSS:
RBSSS:   EQU      %
************************************************
* RBSSS IS THE COMMON CODE MODULE FOR ALL THE  *
*REMOTE PROCESSING HANDLERS (2780IO,HASPIO,    *
*DSCIO) IT CONTAINS THE CLOCK AND IOQ CALLED   *
*ROUTINES AND SOME OTHERS USED BY ALL THE      *
*HANDLERS  -- SMK                              *
************************************************
         SYSTEM   SIG7P
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6
R7       EQU      7
R8       EQU      8
R9       EQU      9
R10      EQU      10
R11      EQU      11
R12      EQU      12
R13      EQU      13
R14      EQU      14
R15      EQU      15
*
*
*
         DEF      HASPBIT
         DEF      SSSBIT
         DEF      RBXBIT
         DEF      OADBIT
         DEF      OFFBIT
         DEF      LIPBIT
         DEF      ACTBIT
         DEF      DISCBIT
         DEF      LOFBIT
         DEF      MORBIT
         DEF      FRBIT
         DEF      BPBIT
         DEF      DUPBIT
         DEF      EMBIT
         DEF      ALBIT
         DEF      DCBIT
*
*
         DEF      RBSS
         DEF      NXT%DEV
         DEF      RB%TDV
         DEF      RBSGCQ,RBSGCQ1,RBSGCQP
         DEF      RB%CU,REG%SET
         DEF      RB%PREX
         DEF      RB%LGER
         DEF      RBQCK
*
         REF      Y004,Y008,Y01,Y02,Y04,Y08
         REF      Y1,Y2,Y4,Y8,X1
         REF      DCT1P,DUP,RB:FLAG,RBLIMS
         REF      SGCQ,SNDDX,TSTACK
         SREF     H%SSET,D%SSET
         REF      Q15A,Y002,BOOTFLG
         REF      RBD:WSN
         SREF     RBQCKH,27SSS
         REF      DCT3,DCT13,IOQ5,DCT7
         REF      IOSERCK,IOSCU
         REF      XN2,COMLIST
         REF      TIME,ERRLOG,DCT16,DCT12
*
*
FRBIT    EQU      X1
OBBIT    EQU      1
EMBIT    EQU      2
FINBIT   EQU      4
LIPBIT   EQU      8
SSSBIT   EQU      X'10'
FIABIT   EQU      X'20'
OADBIT   EQU      X'40'
XP2BIT   EQU      X'80'
CTRBIT   EQU      X'100'
ACTBIT   EQU      X'200'
CLKBIT   EQU      X'400'            RB:FLAG BIT DEFINITIONS
HALBIT   EQU      X'800'
SYSBIT   EQU      X'1000'
LOFBIT   EQU      X'2000'
DISCBIT  EQU      X'4000'
DUPBIT   EQU      X'8000'
RBXBIT   EQU      X'10000'
OFFBIT   EQU      X'20000'
EDISBIT  EQU      X'40000'
*
*
2780BIT  EQU      Y002
XP1BIT   EQU      Y004
ALBIT    EQU      Y008
SLVBIT   EQU      Y01
HASPBIT  EQU      Y02
DCBIT    EQU      Y04
PUNBIT   EQU      Y08
HUBIT    EQU      Y1
MORBIT   EQU      Y2
IGBIT    EQU      Y4
BPBIT    EQU      Y8
HUCTOFBT DATA     X'10020100'
BSCBITS  DATA     X'02200000'
*
*
*
RBSS     EQU      %                 CLOCK DRIVEN ROUTINE DRIVER
         LW,R8    BOOTFLG           :
         BNEZ     *R14              RBSS IS CALLED BY CLOCKI EVERY
         PSW,R14  TSTACK            5 SECONDS
         LW,R7    RBLIMS+1          :
TRY%DEV  EQU      %                 IF WE ARE NOT UP YET EXIT
         LW,R13   RB:FLAG,R7        :
         CW,R13   HUCTOFBT          FOR EACH RB DEVICE THAT DOES NOT
         BANZ     NXT%DEV           HAVE HUBIT,CTRBIT OR OFFBIT SET
         CW,R13   2780BIT           CALL THE APPROPRIATE CLOCK HANDLER
         BANZ     27SSS             ROUTINE
         CW,R13   HASPBIT
         BANZ     H%SSET
         B        D%SSET
*
RB%TDV   EQU      %                 CHECK FOR HANG UP - DIAL UP
         LH,R14   DCT1P,R7          :
         TDV,R15  *R14              IF TDV CCS OR DSRDY SAY HANGUP
         BCS,8    0,R5              EXIT 0,5 IF TERM IS THERE AND
         CW,R15   Y02               WE HAVE ALREADY SEEN DIAL UP EXIT
         BANZ     0,R5              1,R5  IF THIS IS THE FIRST NOTICE
         CI,13    ACTBIT+LIPBIT     OF DIAL UP TELL RBBAT AND DONT
         BANZ     1,R5              RETURN
         LI,R12   DUP               :
RBSGCQ1  LW,R1    R7                NOTE THAT WHEN THIS IS CALLED
         BAL,R4   RBSGCQ            FROM RB%CU BELOW ACTBIT OR LIPBIT
         LI,R11   0                 MUST BE SET -- IF NOT RBBAT BUG
         STS,R11  RB:FLAG,R7
NXT%DEV  EQU      %
         AI,R7    -1
         CW,R7    RBLIMS
         BGE      TRY%DEV
         PLW,R14  TSTACK
         B        *R14
RBSGCQP  EQU      %                 CALL RBBAT PUSHING 1
         PSW,R1   TSTACK
RBSGCQ   EQU      %                 CALL RBBAT
         SLS,R1   8                 :
         OR,R12   R1                DCT INDEX TO RITE SPOT IN R12
         B        SGCQ
*
*
*
RB%CU    EQU      %                 COMMON HANDLER BACKEND CODE
         LB,R5    DCT3,R1           :
         CI,R5    X'10'             IF WE HUNG UP EXIT 0,R4
         BANZ     HNDL%TO           :
         LD,R6    DCT13,R1          IF WE TIMED OUT EXIT 1,R4
         CW,R7    Y02               :
         BAZ      %+3               IF ALL NORMAL EXIT 2,R4
         LW,R9    R4                :
         B        REG%SET           EACH WITH R5=CUR FC,R13=RB:FLAG
         BAL,R9   IOSERCK           R7=CLIST DA
         B        IOSCU             :
         BAL,R9   REG%SET           IOSERCK IS CALLED TO CHECK FOR
         B        2,R4              RARE REAL DEVICE OR IOP ERRORS
HNDL%TO  EQU      %
         BAL,R9   REG%SET
         LH,14    DCT1P,1
         BAL,5    RB%TDV+1
         B        0,R4
         LB,R5    IOQ5,R3
         B        1,R4
REG%SET  EQU      %
         LW,R13   RB:FLAG,R1
         LH,R7    DCT7,R1
         LB,R5    IOQ5,R3
         B        *R9
RB%PREX  EQU      %                 COMMON FRONTEND EXIT TO COMLIST
         CI,R13   DUPBIT            :
         BAZ      COMLIST           IF HALF DUPLEX JUST EXIT
         LH,R9    DCT1P,R1          :
         AND,R9   XN2               IF FULL PUT EVEN - ODD BIT
         OR,R9    R0                FROM R0 INTO DEV ADDR TO
         STH,R9   DCT1P,R1          SELECT CORRECT DEV CHANNEL
         B        COMLIST
*
*
*
RB%LGER  EQU      %                 LOG RP LINE ERROR
         LCI      2                 :
         PSM,R12  TSTACK            SEE RP REF FOR DESC OF
         LW,R9    R13               ERRLOG RECORD
         LH,R7    DCT7,R1
         LD,R12   *R5,R7
         LD,R10   RBD:WSN,R1
         LH,R7    DCT1P,R1
         LI,R6    X'2608'
         STH,R6   R7
         LI,R6    R7
         BAL,R5   ERRLOG
         LCI      2
         PLM,R12  TSTACK
         B        *R12
*
*
*
RBQCK    EQU      %                 IOQ ENTRY FOR INTERCEPT
         LW,4     BSCBITS           :
         CW,4     RB:FLAG,1         IF IRBT OR 2780 GO TO BSCIO TO
         BAZ      Q15A              SEE IF THIS SHOULD BE INTERCEPTED
         B        RBQCKH
         END

