MONPROC  SET      1
         SYSTEM   UTS
         DEF      STEP
STEP     EQU      %
*
*     RESIDENT PORTION OF STEP
*
         DEF      T:SCRATCH%USER
         DEF      T:DELUS
         DEF      T:DELUSZAP
         DEF      SETRNST
         DEF      T:TELDELCCI
        DEF      T:ASP
        DEF      T:EXIT
        DEF      T:ERROR
        DEF      T:ABORT
         DEF      T:ABORTM
         DEF      XCONSETUP
         DEF      STEP70
         DEF      XIT31RT
         DEF      OUTOFPGS
         DEF      KICKOFF
         DEF      T:ECCP
*        REFS
         REF      STEPOVRSEG
         REF      UX:JIT            PHYS PG # OF JIT IF IN CORE
         REF      S:CUIS            TOTAL # OF USERS
         REF      MING              #RESERVED GHOST SLOTS
         REF      UB:US             USER STATE #
         REF      UB:OV             MON OVERLAY# ASSOC W USER
         REF      PB:REP            #USERS ASSOC. W PROC/OVERLAY
         REF      PB:UC             #USERS IN CORE ASSOC W PROC/OVERLAY
         REF      UB:BL             BLINK IN STATE QUEUE
         REF      UB:FL             FLINK IN STATE QUEUE
         REF      SB:HQ             USER # OF 1ST USER IN Q
         REF      SB:TQ             USER # OF LAST USER IN Q
         REF      T:CHS             STATE CHANGE ROUTINE
         REF      T:FPP             FREE PAGE ROUTINE
         REF      T:SE              EXECUTION SCHEDULER
         REF      S:GUIS            # GHOST USERS IN SYSTEM
         REF      S:OUIS            # ONLINE USERS IN SYSTEM
         REF      S:BUIS            # BATCH USERS IN SYSTEM
         REF      T:BTSCHED         SELECTS BATCH JOB FOR EXECUTION
         REF      T:XMMC            LOADS MEMORY MAP & ACCESS CODES
         REF      T:TELDELCCI#
         REF      T:DELUS#
         REF      UH:DL
         REF      J:RNST
         REF      UB:ACP
         PAGE
*
*
*
OVER2    AI,0     -T:ERROR          SCRUB ADDR PART GET INDEX
         OVERTO   STEPOVRSEG        COMMON ENTRY TO T:OVER
*
*
*
T:EXIT          BAL,0   OVER2
T:ERROR         BAL,0   OVER2
T:ABORT         BAL,0   OVER2
XCONSETUP       BAL,0   OVER2
KICKOFF         BAL,0   OVER2
RUND            BAL,0   OVER2
T:SCRATCH%USER  BAL,0   OVER2
T:ASP           BAL,0   OVER2
ASP1            BAL,0   OVER2
OUTOFPGS        BAL,0   OVER2
T:DEL           BAL,0   OVER2
T:ECCP          BAL,0   OVER2
T:ABORTM        LI,1    1
SETRNST         STB,1   J:RNST
T:TELDELCCI     LI,0    T:TELDELCCI#
                B       OVER2+1
T:DELUSZAP      LI,15   0
                LI,0    T:DELUS#
                B       OVER2+1
T:DELUS         LI,15   -1
                B       T:DELUSZAP+1
         PAGE
************************************************************
*                                                          *
*     ROUTINE IS PART OF ASSEMBLE UNSHARED PROGRAM LOGIC   *
*                                                          *
*         UNMAPS,RELOADS THE MEMORY MAP AND ACCESS CODE    *
*         R4 = USER #,R11 ENTRY FROM STEPOVR IS SAVED      *
*         UNMAP & MAP USES R1                              *
*         T:XMMC USES R0,R2-R4,R11,R12-R15                 *
*         SETS UP ENTIRE USER'S MAPPING AND ACCESS         *
*         REGISTERS PRIOR TO EXECUTION INCLUDES            *
*         SPECIAL SHARED PROCESSOR ACCESS WHEN ASSOCIATED  *
*                                                          *
************************************************************
*
XIT31RT  PUSH     11
         UNMAP
         BAL,11   T:XMMC            RELOAD THE MAP & ACCESS
         MAP
         PULL     11
         B        *11
         PAGE
************************************************************
*                                                          *
*          REMOVAL OF USER FROM SYSTEM                     *
*                                                          *
*                                                          *
*     R2= NEW STATE, R4 = S:CUN,R3 = SCU,R8= J:JIT BYTE 0  *
*                                                          *
*        T:CHS CHANGES USER'S STATE R1 DESTROYED           *
*        T:FPP FREES JIT  PHYS PG (UX:JIT)                 *
*            R3 = PP# TO RELEASE, R4 VOLATILE              *
*        T:SE SCHEDULER ENTRANCE WITH NO CURRENT USER      *
*        T:BTSCHED ENTRANCE TO SCHEDULE A BATCH JOB IF USER*
*             WAS BATCH & INITIATE A JOB IF RUNNABLE       *
*                                                          *
************************************************************
*
STEP70   EQU      %
         LB,6     UB:OV,5           DECRE USERS ASSOC
         MTB,-1   PB:UC,6           WITH OVERLAY
         STB,2    UB:OV,5           R2=0 ZERO OVERLAY
         MTB,-1   PB:REP,6          DECREMENT USERS IN CORE
         STB,2    UB:ACP,5
         UNMAP
         LOAD,5   UX:JIT,4
         DISABLE
         MTW,-1   S:CUIS
         REF      SNULL
         LI,2     SNULL             QUEUE TO NULL STATE
         PUSH     5                 SAVE 5
         CI,4     MING              IS THIS A RESERVED SLOT
         BGE      STEP75            NO
         STB,2    UB:US,4
         LI,2     0                 ZAPPER
         STH,2    UH:DL,4           ZAP ANYTHING THATS LEFT
         LB,5     UB:BL,4           GET BACK LINK
         LB,1     UB:FL,4           AND FORWARD LINK
         BNEZ     %+2               NOT TAIL
         STB,5    SB:TQ,3           SET NEW TAIL
         AI,5     0                 CHECK FOR HEAD
         BNEZ     %+2               NO
         STB,1    SB:HQ,3           SET NEW HEAD
         STB,5    UB:BL,1           CROSS LINK
         STB,1    UB:FL,5           REMAINING QUEUE MEMBERS
         STB,2    UB:BL,4           ZERO BACK LINK
         STB,2    UB:FL,4           ZERO FORWARD LINK
         B        %+2
STEP75   EQU      %
         BAL,11   T:CHS             DROP USER SLOT IN Q
         PULL     3                 RESTORE JIT PAGE
         BAL,2    T:FPP
*
         LW,2     8
         SLS,2    -6
         EXU      DUC,2
         B        T:SE
DUC      BAL,11   BTSCHED
         MTW,-1   S:GUIS
         MTW,-1   S:OUIS
BTSCHED  MTW,-1   S:BUIS
         B        T:BTSCHED
         END

