         DEF      SACT:
SACT:    EQU      %
*        D00 RJR   19:35  10/24/72.
*    ##   ONE MORE TIME   11:00 05/05/72  RJR *
*     FINAL I HOPE  ##     16:00  04/24/72 RJR *
*                     19:40  03/22/72  *
* #SACT#              09:45  11/15/71  *
*                 CATALOG NO. 704930 - SIGMA 5/7 BPM M:SACT
         SYSTEM   UTS
         DEF      SACT
SACT     EQU      %
*
*                 SYMBOLIC REGISTER DEFINITIONS.
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
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
*QUEUED SYMBIONT ACTIVATE ROUTINE,SEMI-REENTRANT
*ENTERED FROM I/O INTERRUPT CODE AFTER END ACTION RETURN
*SR1,SR2,AND SR3 VOLATILE
*        BAL,SR4  SACT
         REF      SQHD,SQUE,SQTL,SCNTXT,SRET
         REF      GSC
         REF      CNTXTSET
         REF      SYMX
         SREF     OCPTYP
         REF      MXSTRM
         REF      SAQNSERT,SNDDX,DCT4
         REF      SSIG,DCT3
         REF      NEWQ              * SYMBIONT IO ENTRY POINT
         REF      S:STLC            STEALER WIND DOWN FLAG
         REF      SPOOL             FREE SYMB CORE HEAD
         REF      SL:RSVP           THEFT RESERVATION
         REF      S:STL#            OVER STOLEN COUNT
*
         SREF     OCPFEA,OCPDVEA
*SPRC=(66*134/(SBSIZE-1)*4+1)*SBSECTS/SGSIZE                            930
         REF      SSTAT
SYMCQ    EQU      1                                                     930
         LW,R0    SQHD              SYMBIONT IN QUEUE
         BEZ      *SR4              NO,EXIT
         PUSH     SR4               YES,SAVE EXIT
         LI,R2    2                 INITIALIZE SYMBIONT QUEUE HEAD INDEX
SACT00   EQU      %                                                     930
         CI,R2    SYMCQ             SYMBIONT CORE QUEUE INDEX           930
         BNE      SACT00A           NO                                  930
*                                   YES, BUT
         LW,R0    S:STLC            * WINDING DOWN
         BLEZ     SACT01B           * YES, CANT GIVE CORE
         LW,R1    SPOOL             * NO, IS FREE POOL NON-EMPTY
         BGZ      SACT00A           * THEN QUIT FOOLING AROUND.
         AW,R0    SL:RSVP           * MT FREPOOL BUT CAN WE
         SW,R0    S:STL#            * STEAL TOO EXPAND IT
         BLEZ     SACT01B           * NO, CANT EVEN SWIPE.
*                                   * YES, GUY FROM CORE QUEUE
*                                   * WILL CAUSE THEFT.
*        NOTE: DISABLE HERE WONT HELP THEFT WINDOWS.
*
SACT00A  LI,R0    0                 NO,ZERO INDEX                       930
         DISABLE                    PRENT INTERRUPTS                    930
         LB,R1    SQHD,R2           INDEX IN SYMBIONT QUEUE HEAD        930
         STB,R0   SQTL,R2           INSERT IN SYMBIONT QUEUE TAIL
         STB,R0   SQHD,R2           INSERT INDEX IN SYMBIONT QUEUE HEAD
         ENABLE                     ALLOW INTERRUPTS
         STB,R1   R2                QUEUE CHAIN HEAD                    930
SACT01   LB,R3    R2                SYMBIONT IN QUEUE CHAIN             930
         BNEZ     SACT01A           YES                                 930
SACT01B  AI,R2    -1                NO,DECREMENT HEAD INDEX             930
         BGEZ     SACT00            LOOP IF MORE QUEUE CHAINS TO CHECK
         PULL     SR4               RESTORE EXIT
         B        *SR4              EXIT
SACT01A  LB,R1    SQUE,R3           NEXT SYMBIONT INDEX                 930
         STB,R1   R2                TO QUEUE CHAIN HEAD                 930
         PUSH     R2                SAVE QUEUE HEAD INDEX
         LI,R0    0                 ZERO INDEX                          930
         STB,R0   SQUE,R3           TO REMOVED SYMBIONT QUEUE INDEX     930
         PAGE
*
*SYMBIONT IN QUEUE
*
SACT02A  EQU      %                 NO
         LH,SR3   SCNTXT,R3         SYMBIONT CONTEXT BLOCK ADDRESS
         BEZ      SACT03            NONE - GO GET ONE AND SETUP
         SLS,SR3  1                 CONTEXT BLOCK WORD ADDRESS
         LW,R4    *SR3              SYMBIONT BASE ADDRESS
         LW,R1    SR3
         LW,R2    SRET,R3           SYMBIONT RETURN ADDRESS
         LI,SR4   SACT02B           SYMBIONT EXIT
         PUSH     SR4               TO TEMP STACK
         B        0,R2              ENTER SYMBIONT
SACT02B  PULL     R2                RESTORE QUEUE HEAD INDEX
         B        SACT01            LOOP
         PAGE
*
*SYMBIONT TO BE ACTIVATED/DEACTIVATED
*I,X,L,C,R SIGNAL CHARACTER
SACT03   EQU      %
         BAL,SR4  GSC               CONTEXT BLOCK
         BEZ      SACT07            NO
         LB,SR4   STB:TYP,R3
         B        SACT03A
DSCFQARGS GEN,8,8,8,8 0,SCFQPRI,10,0
DSCDQARGS GEN,8,8,8,8  0,X'FF',3,0
         DEF      SYMTRAN
SYMTRAN  EQU      %
DSCDQFCLP GEN,8,8,8,8  3,3,3,3
         GEN,8,8,8,8 1,1,3,3
DSCDQFCCP GEN,8,8,8,8  0,0,1,1
          GEN,8,8,8,8  0,0,1,1
*
SACT03A  EQU      %
         LI,R0    0
         LI,R2    CBSIZE-1
         STW,R0   *D3,R2
         BDR,R2   %-1
         LB,R2    SYMX,R3
         CI,R2    1   'CR'
         BANZ     SACT04
         LW,R2    D3
         LW,R0    DSCFQARGS
         STW,R0   SCFQARGS,R2
         LI,R0    SBSIZE
         SLS,R0   2
         STW,R0   SCBSIZ,R2
         LB,R0    SNDDX,R3
         AW,R0    DSCDQARGS
         STW,R0   SCDQARGS,R2
         STW,R3   SCDCDA,R2
         LI,R0    OSFEA             ***********NOT RE-LOCATABLE****
         LI,R4    OSDEA
         LC       SYMX,R3
         BCR,2    SACT03B
         LI,R0    OCPFEA            ITS AN OCP GET ENDACTION
         LI,R4    OCPDVEA           ADRESSES FOR OCP
SACT03B  EQU      %
         STW,R0   SCFEA,R2          FILE END ACTION ADDRESS
         STW,R4   SCDEA,R2          DEVICE ENDACTION ADDRESS
SACT04   LW,1     14
         STW,11   SCDEVTYP,1
         LB,R2    SYMX,R3
         AND,R2   M2
*SYMBIONT IN CORE AND IN USE
*SET UP SYMTAB AND CONTEXT BLOCK
*(R2) = WORD INDEX TO ADR OF SYMBIONT IN S1TB
*(R3)=SYMTAB INDEX
*(D3)=CONTEXT BLOCK ADDRESS
         LW,R0    S1TB,R2           SYMBIONT BEING LOADED
         STW,R0   SRET,R3
         STB,R3   R0                SYMTAB INDEX,SYMBIONT BASE ADDRESS
         STW,R0   *D3               TO CONTEXT BLOCK
         SLS,D3   -1                CNTXT BLK DOUBLE WORD ADDRESS
         STH,D3   SCNTXT,R3         TO SYMBIONT TABLE
         B        SACT02A           GO TO ENTER SYMBIONT
*
*NO CONTEXT BLOCK AVAILABLE
SACT07   EQU      %
         LI,SR4   SACT02B           EXIT ADDRESS
         B        SAQNSERT          QUEUE UP SYMBIONT
         PAGE
*
*  THIS IS A DUMMY S1TB TABLE.  INCLUDED TEMPORARILY UNTIL SYMBIONTS
*  ARE RE-CODED FOR STRUNG OUT UTM WHEN S1TB WONT BE REFERENCED
*  SYMX MUST CONTAIN INDECES 1 FOR CR, 2 FOR CP, LP
*
         REF      SYMCR
         REF      SYMPPRTY
S1TB     EQU      %
         DATA     SC2D3             *ZERO ENTRRY
*                                   *SOMETHINGS WRONG WITH SYMX
         DATA     SYMCR
         DATA     SYMPPRTY
         DATA     SC2D3             SPILL-FILL ENTRY, NOT IMPLEMENTED
SC2D3    SCREECH  X'2D',3           NEVER HAPPENS.....HERE....
         PAGE
         REF      OSDEA           *OUTSYM DEVICE END ACTION
         REF      OSFEA           *   ''  FILE    ''   ''
         REF      STB:TYP         *STREAM TYPE
         REF      M2              *=X'00000003'
         REF      NOPGFC          * NOP GHOST FUNCTION CODE
         REF      Y00FF           *=X'00FF0000'
*                                 *
         DEF      SBSIZE          * SYMBIONT BLOCK SIZE
         DEF      CBSIZE          * CONTEXT BLOCK SIZE
         DEF      SCFQPRI           * IO PRIO SYMB 2ND STORE
SCFQPRI  EQU      X'FA'             *
SBSIZE   EQU      256               *HALF GRAN SYMB BLOCKS
CBSIZE   EQU      32                *16 CNTXT BLKS PER PAGE
         DEF      COPPGS            COPTAB ALLOCATED PAGES
         DEF      DBPOOL              ''  FREE DATA BLK POOL
         DEF      LDEVCNT             ''  COUNT OF REQ CNTXT
         DEF      DBMAX               ''  MAXIMUM DB
COPPGS   EQU      0                   ''  DISP
DBPOOL   EQU      16                4 WORDS FOR DATA BUFFER POOL
LDEVCNT  EQU      20                CB0 DISP
DBMAX    EQU      21                 "    "
         DEF      SCFLDA          * CONTEXT FLINK DISC ADDRESS
         DEF      SCBLDA          *   ''    BLINK DISC ADDRESS
         DEF      SCFQARGS        *   ''    FILE NEWQ ARGUMENTS
         DEF      SCFBUF          *   ''    FILE BUFFER ADDRESS
         DEF      SCBSIZ          *   ''    BLOCK SIZE
         DEF      SCCDA           *   ''    CURRENT DISC ADDRESS
         DEF      SCDQARGS        *   ''    DEVICE NEWQ ARGUMENTS
         DEF      SCDDBI          *   ''    DEVICE DATA BYTE INDEX
         DEF      SCDBC           *   ''    DEVICE BYTE COUNT
         DEF      SCDCDA          *   ''      ''   CURRENT DISC ADDRESS
         DEF      SCTYC           *   ''    TYPE OF IO COMPLETE
         DEF      SCBUPPT         *   ''    BACK UP POINT
         DEF      SCNCBT          *   ''    NO COMM BUFF TEMP AREA(4WRDS)
         DEF      SCBUPPTS        *   ''    BACK UP POINT SAVE
         DEF      SCDQFC          *   ''    DEVICE NEWQ FUNC CODE XLATE TABLE
         DEF      SCDEVTYP        *   ''    DEVICE TYPE
         DEF      SCFCO           *   ''    FILE COUNT
         DEF      SCTOFDA         *   ''    TOP OF FORM DISC ADDRESS
         DEF      SCXTRAB         *   ''    EXTRA BUFFER LIST
         DEF      SCRCVLST        *   ''    RECOVERY LIST
         DEF      SCDALST           OUTSYM PRINT RCVRY LIST
         DEF      SCBUDA            OUTSYM BACKUP RCVRY D.A.
         DEF      SCLINES         *   ''    LINE COUNT
         DEF      SCDINFO         *   ''    DEVICE INFORMATION
         DEF      SCBESTDA        *   ''    BEST DISC ADDRESS('Q')
         DEF      SCSVDGI         *   ''    SAVED GHOST INFORMATION
*                                 *
         DEF      SCFDA           *   ''    FIRST DISC ADDRESS
         DEF      SCDBI           *   ''    DATA BYTE INDEX
         DEF      SCMINR          *   ''    MINIMUM RECORD SIZE
         DEF      SCMAXR          *   ''    MAXIMUM RECORD SIZE
         DEF      SCMISC          *   ''    MISCELLANEOUS
         DEF      SCSEQ           *   ''    SEQUENCE INFO
         DEF      SCFPC           *   ''    FORM PROJECTOR CONTROL
         DEF      SCFORM          *   ''    FORM NAME
         DEF      SCFFORM         *   ''    FUTURE FORM NAME
         DEF      SCGCO           *   ''    GRANULE COUNT
         DEF      SCRCO           *   ''    RECORD COUNT
         DEF      SCPCO           *   ''    PAGE COUNT
         DEF      SCCUN           *   ''    CURRENT USER NUMBER
         DEF      SCRPDA          *   ''    RELEASE PREVIOUS DISC ADDRESS
         DEF      SCFINFLG          *   ''    IS FIN FLAG
         DEF      SCMODE            *   ''    IS BLKING MODE
         DEF      SCAIF             *   ''    ISADD IN FIL FLG
         DEF      SCJCO             *   ''    IS JOB COUNT
         DEF      SCSYMX            *   ''    IS SYMX(SYMTABX)
         DEF      SCSWIT            *    ''    IO SWITCH
         DEF      SCDEA             *    ''    DEVICE END AC
         DEF      SCFEA             *    ''    FILE END AC
*        CDISP    SDEF
SDEF     CNAME    0
         OPEN     #
#         SET     0
*
         PROC
         LOCAL    DEFINE,I,J
         GOTO,SCOR(CF(2),ORG,RES)  ORG,RES
DEFINE   BOUND    1
I        DO       NUM(LF)
J        DO       NUM(LF(I))
LF(I,J)  EQU      #
         FIN      J
         DISP     (#/10)**28+(#-((#/10)*10))**24+#+I**16
#        SET      #+(1&(AF(I,1)=0))|AF(I,1)
         FIN      I
         GOTO     %PEND
*
ORG      SET      %
#        SET      AF(1)
         GOTO     %PEND
*
RES      SET      %
#        SET      #+AF(1)
%PEND    BOUND    1
         ERROR,,#>CBSIZE  ' DEFINITION EXCEEDS CBSIZE'
         PEND
*
         CLOSE    #
*
*
SCBNO    SDEF
SCDEVTYP SDEF
(SCFLDA,SCFDA) SDEF
SCBLDA   SDEF
SCBESTDA SDEF
SCFQARGS,SCFBUF,SCBSIZ,SCCDA,SCFEA SDEF
SCDQARGS,(SCDDBI,SCDBI),SCDBC,SCDCDA,SCDEA SDEF
(SCSVDGI,SCAIF) SDEF
(SCTYC,SCDINFO,SCMINR),;
   (SCSWIT,SCDQFC,SCMAXR)   SDEF
*       -- NOTE:  SCDINFO IS FIVE WORDS FOR INSYM --
(SCMISC,SCTOFDA),SCSEQ           SDEF
(SCFCO,SCJCO,SCBUPPT),(SCGCO,SCMODE)     SDEF
(SCRCO,SCBUPPTS),SCPCO                   SDEF
(SCGCNT,SCFPC),(SCNCBT,SCFORM,SCRTRY),(SCBUDA,SCDALST,SCFFORM),;
  SCRPDA SDEF
(SCRCVLST,SCFINFLG)    SDEF
(SCXTRAB,SCCUN,SCSYMX)  SDEF
(SCLINES,SCNAME)   SDEF
         DEF      SCNAME,SCGCNT,SCRTRY
*
         DEF      SCDALSZ
SCDALSZ  EQU      40-SCDALST        FOR 40 WORD CPOOL
         PAGE
*
*        SGC FAMILY OF SERVICE ROUTINES MOVED TO COOP
*
*                 TO ALLOW THE MONITOR TO FLOAT IN SIZE
*               ABOVE THE .8000 BOUNDARY IMPLIED BY THE
*               NEED TO HAVE MAPPED SERVICE ROUTINES EXIST
*               1-TO-1 WITH THE USER, ALL MAPPED SERVICE
*               ROUTINES NOW EXIST IN TOTALLY MAPPED SERVICE
*               MODULES,AND UNMAPPED(INTURRUPT) ROUTINES
*               EXIST IN SEPERATE MODULES THAT ARE
*               LOCCT'ED TO THE ROOT TOP AND MAY EXTEND
*               BEYOND .8000 .
*
*
*
SACTSZ   EQU      %-SACT
         END

