         DEF      KEYSUB
KEYSUB   EQU      %
         SYSTEM   UTS
         DEF      SYMCOM,SYMCOMSZ
SYMCOM   EQU      %
         PAGE
*
*                             PROGRAM NAME - BATCH MONITOR.
*
         PAGE
*                 SYMBOLIC REGISTER DEFINITIONS.
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R7       EQU      7
SR1      EQU      8
SR2      EQU      9
SR3      EQU      10
SR4      EQU      11
D1       EQU      12
D2       EQU      13
D3       EQU      14
D4       EQU      15
         PAGE
*OPERATOR-SYMBIONT COMMUNICATION ROUTINE-NONREENTRANT
*(R2) =INDEX INTO DCT TABLE (DEVICE TYPE,CHANNEL#,DEVICE#)
*(D1) =SIGNAL CHARACTER
*MAY NEED A TERMINATE AND LOCK SIGNAL
*        BAL,SR4  SYMCOM
*        RETURN
         REF      KEYERR
         REF      SYMTABCK,SAQNSERT
         REF      OCQUEUE,SSTAT,SSIG
         REF      SYMX,SCNTXT,SQUE,T:GJOBSTRT
         PUSH     SR4
         BAL,SR4  SYMTABCK          SYMBIONT IN SYSTEM
         B        SYCM01            YES
*                                   NO
*
*SYMCOM KEY ERROR TYPEOUT
*
SYCMKYER PULL     R0
         B        KEYERR
*
*SYMCOM TYPEOUT ROUTINE
*
*   -- FOR (CR)(EP)(EP) -READ- (TAB)(BLNK)(BLNK)
*
*(R1)=0,(CR)(EP)(EP)SYYNDD NOT ACTIVE(CR)
*(R1)=1,(CR)(EP)(EP)SYYNDD ACTIVE(CR)
*(R1)=2,(CR)(EP)(EP)SYYNDD NOT SUSPENDED(CR)
*(R1)=3,(CR)(EP)(EP)SYYNDD NOT AVAILABLE(CR)
*(R1)=4,(CR)(EP)(EP)SYYNDD SUSPENDED
*
SYCMTYPE1 LI,R1   3
*
SYCMTYPE LW,R7    R2                DCT INDEX TO GET YYNDD
         AI,R1    8                 STATUS INDEX+8 EQUALS MESSAGE INDEX
         BAL,SR4  OCQUEUE           MESSAGE TO OPERATOR'S CONSOLE
         B        SYCM06            EXIT
         PAGE
*
*SYMBIONT IN SYSTEM
*
SYCM01   EQU      %
         LI,R7    #SIGS
         CB,D1    SIGS,R7
         BE       %+3
         BDR,R7   %-2
         B        SYCMKYER
         LB,R1    SSTAT,R3
         BNEZ     SYCM02
         LB,D2    SQUE,R3
         BEZ      %+3
         LI,R1    1
         B        SYCM03
         LH,D2    SCNTXT,R3
         BEZ      SYCM03
         LI,R1    2
SYCM02   EQU      %
         CI,R1    3
         BGE      SYCMTYPE1
SYCM03   EQU      %
         AI,R7    -1
         MI,R7    3
         AW,R7    R1
         LB,R1    VECTOR,R7
         CI,R1    5
         BL       SYCMTYPE
         B        SYMCOM,R1
SYCMSO   EQU      %
         BAL,SR4  SYCMOCK
SYCMS    EQU      %
         STB,D1   SSIG,R3
SYCM06   PLW,SR4  TSTACK
         B        *SR4
SYCMGO   EQU      %
         BAL,SR4  SYCMOCK
SYCMG    EQU      %
         STB,D1   SSIG,R3
         BAL,SR4  SAQNSERT
         B        SYCM06
SYCMOCK  EQU      %
         LB,D2    SYMX,R3
         CI,D2    2
         BANZ     *SR4
SYCMEH   B        SYCMKYER
SYCMUNLK EQU      %
         LB,D2    SSIG,R3
         CI,D2    'L'
         BE       SYCMS
         LI,R1    1
         B        SYCMTYPE
SYCMOCP  EQU      %
         LC       SYMX,R3
         BCR,2    SYCMKYER
         STB,D1   SSIG,R3
         LD,R0    OCPGNM
         BAL,SR3  T:GJOBSTRT
         B        SYCM06
SYCMDL   EQU      %
         LB,D2    SYMX,R3
         AND,D2   NKPBT
SYCMDK   EQU      %
         CI,D2    X'21'             IN OR OCP NO GOOD FOR K OR D
         BANZ     SYCMKYER
         STB,D2   SYMX,R3
         B        SYCM06
SYCMKP   EQU      %
         LB,D2    SYMX,R3
         OR,D2    KPBIT
         B        SYCMDK
*
*
         BOUND    8
OCPGNM   TEXTC    'OCPGHST'
NKPBT    DATA     X'EF'
KPBIT    DATA     X'10'
*
*
SYMSIG   CNAME
         PROC
         GEN,8    CF(2)
         DO       AF(1)<5
INAC(SIGX) SET    AF(1)
         ELSE
INAC(SIGX) SET    AF(1)-SYMCOM
         FIN
         DO       AF(2)<5
ACT(SIGX)  SET    AF(2)
         ELSE
ACT(SIGX) SET     AF(2)-SYMCOM
         FIN
         DO       AF(3)<5
SUSP(SIGX) SET    AF(3)
         ELSE
SUSP(SIGX) SET    AF(3)-SYMCOM
         FIN
SIGX     SET      SIGX+1
         PEND
*
SIGX     SET      1
NOTAC    SET      0
ACTIV    SET      1
NOSUS    SET      2
SUSPD    SET      4
*
*
SIGS     EQU      %
         DATA,1   0
*
*
         SYMSIG,'I' SYCMG,SYCMUNLK,SYCMG INITIATE
         SYMSIG,'C' NOTAC,NOSUS,SYCMG  CONTINUE
         SYMSIG,'R' NOTAC,SYCMSO,SYCMGO RETRY-REPRINT
         SYMSIG,'X' NOTAC,SYCMS,SYCMG  ABORT
         SYMSIG,'L' SYCMSO,SYCMS,SYCMG LOCK
         SYMSIG,'S' NOTAC,SYCMS,SUSPD  SUSPEND
         SYMSIG,'Q' NOTAC,SYCMSO,SYCMGO RE-QUEUE
         SYMSIG,'A' SYCMGO,SYCMSO,SYCMGO ALIGN
         SYMSIG,'K' SYCMKP,ACTIV,ACTIV KEEP GRANULES TILL END
         SYMSIG,'D' SYCMDL,ACTIV,ACTIV DELETE AS YOU GO
         SYMSIG,'B' SYCMOCP,ACTIV,ACTIV   BOOT OCP
SIGX     SET      SIGX-1
#SIGS    EQU      SIGX
*
*
         BOUND    4
*
*
VECTOR   EQU      %
I        DO       SIGX
         GEN,8,8,8  INAC(I),ACT(I),SUSP(I)
         FIN
         BOUND    4
SYMCOMSZ EQU      %-SYMCOM
         END

