         PCC      0
         TITLE    'CSES7  -  SIGMA 7 SPECIFIC CODE'
         DEF      CSES7:
CSES7:   EQU      %
         SYSTEM   UTS
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
         PAGE
         REF      CSE%BEST%END%ABORT%STEP
         REF      CSE%BEST%END%SCREECH
         REF      CSE%BEST%END%STOP
         BOUND    8
6C6D     DATA     X'6C','6D'
*
         REF      CSED%3STAT,3COUNT,ERRLOG
         REF      M7
         REF      3BUFCLR
         REF      CSEP%WHY%MPE
         REF      CSEP%WHY%WD
         REF      CSED%PSD,CSED%INST,CSED%EA%VIRT
*
         DEF      CSE%I56%FIX
*
         DEF      CSE%1:7,CSE%2:7,CSE%3:7,CSE%4:7,CSE%5:7
         DEF      CSE%6:7,CSE%7:7,CSE%8:7,CSE%9:7,CSE%A:7
         DEF      CSE%B:7,CSE%C:7,CSE%D:7,CSE%E:7,CSE%F:7
*
CSE%1:7  EQU      CSE%PPOLR
CSE%2:7  EQU      CSE%MPOLR
CSE%3:7  EQU      CSE%PLOG
CSE%4:7  EQU      CSE%MLOG          LOG ONLY 3STAT ENTRY
CSE%5:7  EQU      CSE%PDEL
CSE%6:7  EQU      DUMMY             ENTRY NOT USED
CSE%7:7  EQU      DUMMY             ENTRY NOT USED
CSE%8:7  EQU      CSE%GET%CONTENTS
CSE%9:7  EQU      CSE%T46%FIX
CSE%A:7  EQU      DUMMY             ENTRY NOT USED
CSE%B:7  EQU      DUMMY             ENTRY NOT USED
CSE%C:7  EQU      DUMMY             ENTRY NOT USED
CSE%D:7  EQU      DUMMY             ENTRY NOT USED
CSE%E:7  EQU      DUMMY             ENTRY NOT USED
CSE%F:7  EQU      DUMMY             ENTRY NOT USED
         PAGE
CSEP%I56%BIT EQU X'800'  B20 WD BIT FOR I56
*
         REF      Y1,Y8
*
*   THIS ROUTINE CONTAINS ALL THE SIGMA 7 SPECIFIC CODE
*   FOR THE HARDWARE FAULT HANDLERS
*
CSE%PPOLR  EQU    %                 PROCESSOR POLLING
CSE%PLOG  EQU     %
CSE%PDEL  EQU     %
CSE%MPOLR  EQU    %                 MEMORY POLLING
         B        *R15              NO POLLING ON SIGMA 7
         SPACE
CSE%MLOG EQU      %
         MTW,0    3COUNT            ANYTHING TO LOG ?
         BEZ      *R15              B/ NO, RETURN
         LI,R6    CSED%3STAT        ADDRESS OF ERROR LOG ENTRY
         OR,R6    Y1                SET DONT ENABLE FLAG FOR ERRLOG
         BAL,R5   ERRLOG            GO LOG IT
         LW,R5    Y8
         STS,R5   3COUNT            SET LOGGED FLAG
         B        *R15              RETURN
         SPACE
CSE%MDEL EQU      %
         MTW,0    3COUNT            HAS IT BEEN LOGGED ?
         BGEZ     *R15              B/ NO, DONT DELETE IT
         LW,R1    3BUFCLR           MBS SETUP TO CLEAR CSED%3STAT
         MBS,R0   0                 DO IT
         B        *R15              RETURN
*
*
CSE%I56%FIX  EQU  %
         LI,R11   CSEP%WHY%MPE
         BAL,R12  CSE%BEST%END%SCREECH ALWAYS SCREECH ON S7 P.E.
         B        *R15
*
*
CSE%T46%FIX  EQU  %
         LB,R1    CSED%INST         GET OP CODE
         AND,R1   M7                STRIP OFF INDIRECT BIT
         CLM,R1   6C6D              RD OR WD
         BCS,9    NOTRDWD           B/ NO
         LW,R1    CSED%EA%VIRT      GET EFF ADDRESS
         CI,R1    X'2000'           IS MODE >=2
         BL       NOTRDWD           B/ NO
         MTW,1    CSED%PSD          INCR USERS ADDRESS
         B        *R15              AND RETURN
NOTRDWD  EQU      %
         LI,R11   CSEP%WHY%WD       WHY CODE
         BAL,R12  CSE%BEST%END%ABORT%STEP  SET ABORT STEP
         B        *R15
*
CSE%GET%CONTENTS  EQU  %
*
*   ENTER WITH REAL WORD ADDRESS IN R0, LINK IN R13
*   RETURNS WITH CONTENTS IN R0, CC=1 IF PARITY ERROR, CC=0 NO PE
*
         LI,R1    CSEP%I56%BIT      WD BIT FOR I56
         RD,R2    X'0010'           CLEAR MEM FAULT INDICS
         LW,R0    *R0               PICK UP CONTENTS
         RD,R2    X'0010'           TEST & RESET INDICS
         WD,R1    X'1200'           ARM I56
         CI,R2    0                 SET CC/ R2
         BEZ      *R13              CC4=0
         LCI      X'1'              SET PARITY ERROR INDIC
         B        *R13
*
*   BAD ENTRY INTO BRANCH TABLE
*
DUMMY    EQU      %
         SCREECH  X'23'             .23
         END

