         PCC      0
*M*      HOTCARD  START UP CARD READERS
*P*      NAME:    HOTCARD
*P*      PURPOSE: TO AUTOMATICALLY START UP LOCAL-SITE CARD READERS
*P*               WHEN THEY BECOME OPERATIONAL/READY.
         SPACE    3
         SYSTEM   SIG9P
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
         TITLE    'HOTCARD - START UP LOCAL SITE CARD READERS'
         DEF      HOTCARD:
         REF      SNDDX
         REF      RBLIMS            LIMITS OF RBT STREAMS
         REF      DCT4              DEVICE TYPE
         REF      DCT3              FOR 'PARTITONED' FLAG
         REF      DCT1              FOR UNIT ADDRESS
         REF      Y1                FOR 'AUTOMATIC' BIT
         REF      SSIG              SYMBIONT SIGNAL BYTES
         REF      SAQNSERT          SYM Q INSERT - GOOSER
         REF      S:GUIS            GHOST USERS IN SYSTEM
         REF      TSTACK            MONITOR TEMP STACK
         PAGE
*D*      NAME:    HOTCARD
*D*      DESCRIPTION: HOTCARD SCANS ALL SYMBIONT DEVICES EVERY 1.2
*D*               SECONDS.  ANY CARD-READER TYPE DEVICES THAT ARE
*D*               OPERATIONAL, READY (NOT MANUAL), NOT PARTITIONED,
*D*               AND NOT BUSY WILL BE ACTIVATED (A KEYIN OF
*D*               "!SCRNDD,I" WILL BE SIMULATED).  HOTCARD IS CALLED
*D*               FROM CLOCK4 IF IT WAS INCLUDED IN THE SYSTEM
*D*               BY THE PRESENCE OF THE (HOTCARD) OPTION ON
*D*               THE PASS2 :MON CARD.
         PAGE
HOTCARD: CSECT
         PSW,R11  TSTACK            SAVE RETURN ADDRESS
         LW,R3    S:GUIS            HOW MANY GHOSTS ARE ALIVE?
         CI,R3    3                 AT LEAST 3 (RBBAT/ALLOCAT/FIX)
         BL       EXIT              IF NOT THEN BOOTING OR ZAPPING
         LB,R3    SNDDX             L/# OF SYMBIONTS TO TEST
THISCR   LB,R6    SNDDX,R3          L/DCT INDEX OF THIS SYMBIONT
         BEZ      NEXTCR            IF NONE IT'S A DUMMY; SKIP
         CLM,R6   RBLIMS            IS IT AN RBT STREAM?
         BCR,9    NEXTCR              THEN SKIP IT
         LB,R8    DCT4,R6           L/DEVICE TYPE
         CI,R8    4                 IS THIS A CARD-READER TYPE?
         BNE      NEXTCR              IF NOT SKIP IT.
         LB,R8    DCT3,R6           L/DCT3 VALUE FOR THIS ONE
         CI,R8    X'20'             IS IT PARTITIONED?
         BANZ     NEXTCR            IF SO THEN DON'T TRY TO START IT
         LH,R7    DCT1,R6           GET THE DEVICE ADDRESS
         TIO,R4   *R7               AND THEN TEST THE DEVICE
         BCS,12   NEXTCR            SKIP IF BUSY
         CW,R5    Y1                DEVICE AUTOMATIC?
         BAZ      NEXTCR            SKIP IF CR MANUAL
         LB,R1    SSIG,R3           IS THE SYMBIONT DOING SOMETHING?
         BNEZ     NEXTCR            IF SO THEN DON'T BOTHER IT
         LI,R1    'I'               "INITIATE SYMBIONT"
         STB,R1   SSIG,R3             SAVE THE CODE AND THEN
         BAL,R11  SAQNSERT              GO GOOSE THE SYMBIONT HANDLERS
NEXTCR   BDR,R3   THISCR            GO BACK FOR NEXT READER
EXIT     PLW,R11  TSTACK            GET RETURN ADDRESS
         B        *R11              AND GO HOME TO CLOCK4
         END

