         PCC      0                                                             
         SYSTEM   SIG9P                                                         
         SYSTEM   OPTIONS                                                       
         DEF      A:TRAPS                                                       
         DEF      TRAP5,TRTY,TEXIT,TRAPCRSH                                     
         DEF      TRAP70,JTRAP,TRTN                                             
         DEF      EXTRAPS,EXTRTN,EXTRAP7X,EXTRAP70,EXTRAPAB                     
         DEF      EXTEXIT                                                       
*                                                                               
OLAYFLAG EQU      'TRAP'                                                        
         SYSTEM   CPRMON                                                        
TRAPS    RES      0                 ENTY                                        
A:TRAPS  EQU      TRAPS                                                         
*                                   R1=COND. CODES, ADD. OF STORED PSD          
TRAP2    LI,R12   1                 SET FLAG THAT TS FULL                       
         BIFRBM   TRAP6             TRAP DURRING RBM TASK-NO PCB                
         LI,R4    -1                                                            
         LB,R3    *R1,R4            GET TRAP CONTROL BYTE                       
         CI,R3    X'51'             IS IT BREAK CONTROL                         
         BE       TRAP12            B IF YES                                    
         DO       #TJE                                                          
         CI,R3    X'52'             IS IT CONTROL Y                             
         BE       TRAP13            B IF YES                                    
         FIN      #TJE                                                          
         LW,R3    PCBPOINT          GET ADDRESS OF TRAP ADDR                    
         AI,R3    4                                                             
         LB,R2    *R3               GET USERS TASK LVL TRAPS                    
         LI,R4    -4                                                            
         CB,R2    *R1,R4            WILL USER PROCESS THIS TRAP                 
         BANZ     TRAP3             NO TASK LEVEL TRRAP ADDR                    
         LB,R2    TCBPOINT          GER TRAP ADDR FROM JCB                      
         LB,R2    STIJID,R2                                                     
         LW,R3    SJI1,R2                                                       
         AI,R3    2                 SECONDARY TRAP ADDR IN JCB+2                
         BIFMAP   %+2               PRIMARY ADDR IN JCB+3                       
         AI,R3    1                 R3 POINTS TO PRIMARY TRAP ADDR              
         LB,R2    *R3                                                           
         CB,R2    *R1,R4            COMPARE TRAP FLAGS                          
         BAZ      TRAP6                                                         
TRAP3    EQU      %                                                             
         LW,R2    *R3               GET USER TRAP ADDR                          
         AND,R2   M17                                                           
         BEZ      TRAP6             NO ADDRESS                                  
         LW,R9    R2                ADR TO VAL1DATE                             
         BAL,R8   TMVADR            OKAY                                        
         B        TRAP6             NO                                          
TRAP3A   EQU      %                                                             
         LI,R6    X'FF'                                                         
         AND,R6   -1,R1             GET TRAP LOCATION                           
TRAP4    LW,R1    *PCBPOINT         GET TOP OF STACK                            
         STW,R6   *R1               STORE TRAP ADD. INTO TOP OF STACK           
         AI,R1    -18               R1=WORD 0 OF 19 WORD STACK                  
         LB,R4    TCBPOINT          CLEAN UP RTS IF IN A CAL                    
         LD,R6    STIRTSB,R4                                                    
         BEZ      TRAP4B            NOT IN A CAL                                
         LI,R2    -19                                                           
         MSP,R2   *PCBPOINT                                                     
         PLW,R2   *PCBPOINT         PULL OFF FIRST WORD OF FILLER               
         CI,R2    0                 LAST ONE                                    
         BE       %+2               YES                                         
         PLW,R2   *PCBPOINT         ONE MORE                                    
         B        TRAPX             BACK OUT OF CAL                             
*                                                                               
TRAP4B   LI,R3    X'1FFFF'          SET R3=ADDRESS MASK                         
         LD,R4    *R1               GET OLD PSD                                 
         STS,R2   R4                CHANGE ADDRESS IN OLD PSD                   
         STB,R10  R4                SET CC FOR RETURN TO USER                   
EXTRAPS  LPSD,0   R4                EXIT TO USERS TRAP HANDLER                  
*                                                                               
TRAP5    EQU      %                                                             
         BIFSEC   TRAP5A            B IF SECONDARY                              
         LI,R3    8                 OFFSET TO INTERMIEDATE PSD                  
         LCF      *TCBPOINT,R3      GET NUMBER OF REGS SAVED                    
         BCS,15   EXTRAPAB          B IF LESS THAN 16 REGS SAVED                
TRAP5A   EQU      %                                                             
         LW,R11   *R1               GET ADDERSS FROM OLD PSD                    
         DO       #INSTSIM                                                      
         AND,R11  M17               CHECK FOR ATTEMP TO OPEN STACK FOR          
         CI,R11   TRAP12C           UNIMPLEMENTED INSTR.                        
         BNE      TRAP5B              BRANCH IF NOT                             
         LW,R1    TRAP90                                                        
         LW,R11   *R1                                                           
         FIN                                                                    
TRAP5B   ENABLE                                                                 
         LI,R12   0                 SET NO. CELLS STORED IN TS                  
         B        TRAP6B                                                        
TRAP6    LW,R11   *PCBPOINT         GET CURRENT TOP OF STACK                    
         AI,R11   -18               SET TO BOTTOM OF STACK                      
         LW,R11   *R11              R11=ADDRESS WHERE TRAP OCCURRED             
TRAP6B   RES      0                                                             
TRAP8    AND,R11  M17               MASK OUT ADDRESS                            
         BIFFGD   TRAP8A            BRANCH IF FOREGROUND                        
         STW,R11  K:ABTLOC          YES, SAVE ABORT LOC. FOR ABORT              
         LI,R11   X'EE'                                                         
         STB,R11  K:PMD1            FLAG TO DUMP:  BKG TRAP ABORT               
TRAP8A   BAL,R5   TRAPMSG           CONSTRUCT TRAP MESSAGE                      
         CI,R12   0                 WAS ANYTHING PUSHED INTO TS                 
         BE       TRAP9             NO                                          
         LI,R2    -19               YES,CLEAN TS                                
         MSP,R2   *PCBPOINT                                                     
         PLW,R2   *PCBPOINT         PULL OFF FIRST OF FILLER WORDS              
         CI,R2    0                 IS IT LAST ONE                              
         BE       %+2               YES                                         
         PLW,R2   *PCBPOINT         NO,PULL ONE MORE                            
TRAP9    LB,R1    TCBPOINT          STI INDEX                                   
         LW,R1    STIPRIO,R1                                                    
         LB,R1    R1                                                            
         LI,R3    2                                                             
         LH,R2    *K:RTS,R3         GET SPACE REMAINING                         
         CI,R2    22                IS THERE ROOM IN TS FOR ALARM               
         BL       EXTRAPAB          NO,NO ALARM,ABORT TASK                      
         LI,R7    LL                DCB(1) = LL OPLBL                           
TRAP11C  EQU      %                                                             
         LB,R4    TCBPOINT          STI INDEX                                   
         LW,R13   STIPRIO,R4        GET PRIORITY                                
         LB,R13   R13               HARDWARE                                    
         LI,R8    3                 DCB(0) = (ASN=3)                            
         BAL,R4   GETDCTX           GET DCT INDEX IN R7 FOR QUEUE               
         B        EXTRAPAB          ERR, MUST SKIP MESSAGE                      
         CI,R7    0                 IS IT THE NULL ASSIGNMENT                   
         BE       TRAP11F           YES, EXIT                                   
         CI,R7    X'80'             IS IT A RAD FILE                            
         BANZ     TRAP11F           YES, EXIT                                   
         LB,R4    DCT4,R7           GET DEV TYPE                                
         LB,R4    FCTBL,R4          GET FUNCTION CODE                           
         CI,R4    KFF               IS IT OK FOR THIS DEVICE                    
         BE       TRAP11F           NO, BRANCH                                  
         LI,R11   39                BET BYTE COUNT                              
         LI,R6    0                 SET TO NO RETRIES                           
         LW,R8    CUPCOD4           SET TO NO WAIT                              
         STW,R0   R10               STORE ADDRESS OF ALARM IN R10               
         DO       #SYMB                                                         
         LI,R3    3                 FIX FAKE FPT PTR FOR COOP                   
         LI,R5    X'11'                                                         
         STB,R5   R3                R3= X'11000003'                             
         BAL,R5   COOP              CALL COOPERATIVE ROUTINE                    
         B        EXTRAPAB          ERROR, IGNORE                               
         B        EXTRAPAB          SYMBIONT I/O DONE                           
         FIN      #SYMB                                                         
         BAL,R5   QUEUE             GO Q ALARM                                  
         B        %+1                                                           
         B        EXTRAPAB          EXIT ABORTING THE TASK                      
TRAP11F  EQU      %                                                             
         LI,R7    OC                LL FAILED,SO TRY OC                         
         B        TRAP11C                                                       
EXTRAPAB B        TMABORT           ABORT THE TASK                              
         PAGE                                                                   
*                                                                               
*   FUNCTION CODE TABLE                                                         
*   THIS IS A DUPLICATE COPY OF TABLE IN PRINT OLAY.                            
*   FUNCTION CODES ARE ACCESSED BY DEVICE TYPE AS AN INDEX.                     
*                                                                               
FCTBL    RES      0                                                             
         DATA,1   -1                IOEX      TYPE 0                            
         DATA,1   FCWKPWNL          TY        TYPE 1                            
         DATA,1   -1                PR        TYPE 2                            
         DATA,1   -1                PP        TYPE 3                            
         DATA,1   -1                CR        TYPE 4                            
         DATA,1   -1                CP        TYPE 5                            
         DATA,1   FCWLPWOF          LP        TYPE 6                            
         DATA,1   -1                DC        TYPE 7                            
         DATA,1   FCWMT             9T        TYPE 8                            
         DATA,1   FCWMT             7T        TYPE 9                            
         DATA,1   -1                CPLC      TYPE 10                           
         DATA,1   FCWLPWOF          LPLC      TYPE 11                           
         DATA,1   -1                DP        TYPE 12                           
         DATA,1   -1                PL        TYPE 13                           
         DATA,1   -1                                                            
         DATA,1   FCWLPWOF          LP,BDP    TYPE 15                           
         DATA,1   FCWMT             9T        TYPE 16                           
         DATA,1   -1                RB        TYPE 17                           
         DATA,1   1                 SP        TYPE 18                           
         DATA,1   1                 LD        TYPE 19                           
         BOUND    4                                                             
         PAGE                                                                   
TRAP12   EQU      %                                                             
         LB,R2    TCBPOINT                                                      
         LB,R2    STIJID,R2                                                     
         LW,R3    SJI1,R2           GET JCB ADDRESS                             
         AI,R3    JCBREAK           GET BREAK CONTROL WORD                      
         MTW,0    0,R3              BREAK CONTROL ESTABLISHED                   
         BNEZ     TRAP3             B IF YES                                    
         B        TRAP6             ABORT HIM                                   
         DO       #TJE                                                          
TRAP13   EQU      %                                                             
         LI,R2    TELCNTRL          ADDRESS OF TEL ENTRY                        
         B        TRAP3A                                                        
         FIN      #TJE                                                          
         TITLE    '** TRAPS **'                                                 
         TITLE    '** TRAPS - TRAP MESSAGE BUILDER **'                          
*                                                                               
* INPUT  R1       TRAP PTR                                                      
*        R5       LINK                                                          
*        R11      TRAPPED LOCATION                                              
* OUTPUT R2, R6-R11 USED                                                        
*        R0       BYTE ADDRESS OF MESSAGE                                       
*        R3       WORD ADDRESS OF MESSAGE                                       
*                                                                               
TRAPMSG  RES      0                                                             
         LI,R2    -2                                                            
         LB,R3    *R1,R2            GET TRAP MESSAGE INDEX                      
         BNEZ     TRAPMSG1          BRANCH IF OK                                
*                                   NAO TRAP, COMPUTE INDEX                     
         LB,R3    R1                GET TRAP CC                                 
         SLS,R3   -4                                                            
         AI,R3    -1                                                            
         LB,R3    TRAPMSGX,R3       GET TRAP MESSAGE INDEX                      
TRAPMSG1 RES      0                                                             
         MI,R3    7                 WORD DISPLACMENT                            
         LCI      6                 MOVE TO CORE                                
         LM,R6    TRAP91,R3                                                     
         STM,R6   TRAP90+4          FOR OUTPUT                                  
         LW,R6    TRAPIDM           GET REMAINING MESSAGE                       
         STW,R6   TRAP90+11         PLACE IN BUFFER                             
*                                                                               
         LI,R11   X'1FFFF'          ADDRESS MASK                                
         AND,R11  0,R1              GET ORIGINAL ADDRESS                        
         BAL,R8   HEXBCD            CONVERT TRAPPED ADDR TO EBCDIC              
         STW,R11  TRAP90+10         PUT LOW ORDER 4 BYTES IN                    
         LI,R11   X'FF'                                                         
         STS,R10  TRAP90+9          PUT IN TOP BYTE OF ADDR                     
         CI,R3    IPCTOS            1.IF ILLEGAL PARAMETER CAL                  
         BNE      ENDIF001            *** DETERMINED BY MESSAGE OFFSET          
         LW,R6    *PCBPOINT         2...IF DCB POINTED TO BY SAVED R10          
         LW,R9    -18,R6                *** IF CAL RETURN ADDR FROM PSD         
         AI,R9    -1                    *** MINUS 1 IS UNREADABLE ASSUME        
         BAL,R7   ADDRCHEK              *** NO DCB POINTED TO BY R10.           
         B        ENDIF002                                                      
         LW,R8    *R9                   *** IF ADDR IN SAVED REG R10 IS         
         LW,R9    M17                   *** NOT = TO ADDRESS IN RETURN          
         CS,R8    -16+10,R6             *** MINUS 1 THEN IT IS NOT AN           
         BE       ENDIF002              *** FPT ADDRESS. SHOULD BE DCB.         
         LW,R9    -16+10,R6                                                     
         BAL,R7   ADDRCHEK              *** IF ADDR IN R10 UNREADABLE           
         B        ENDIF002              *** ASSUME NO DCB                       
         LB,R8    *R9                                                           
         CI,R8    5                     *** IF BYTE 0 NOT = 5 OR 7 IT           
         BE       %+3                   *** IS NOT A DCB                        
         CI,R8    7                                                             
         BNE      ENDIF002                                                      
         LW,R8    *R9                   *** ASN FIELD MUST BE 1 OR 3            
         AI,R9    1                     *** OR IT IS NOT A DCR                  
         LW,R7    *R9                                                           
         AND,R8   XF                                                            
         CI,R8    1                                                             
         BE       %+3                                                           
         CI,R8    3                                                             
         BNE      ENDIF002                                                      
         PAGE                                                                   
         CI,R8    3                 3.....IF DCB ASSIGNED TO DEVICE             
         BNE      ELSE003                 *** ONLY IF ASN=3                     
         CI,R7    X'8000'                 *** THEN DEFINITELY IF DEVF=1         
         BANZ     FCN003                                                        
         AND,R7   M8                                                            
         LW,R8    R7                                                            
         LB,R7    TCBPOINT                                                      
         LB,R7    STIJID,R7                                                     
         LW,R7    SJI1,R7                                                       
         LW,R7    5,R7                                                          
         XW,R7    R8                                                            
         LB,R7    *R8,R7                                                        
         CI,R7    X'80'                   *** BUT ALSO IF OPLBL 2 ENTRY         
         BANZ     ELSE003                 *** HAS A ZERO IN BIT 0               
FCN003   AND,R7   M8                4.......PLACE YYNDD IN OUTPUT LINE          
         LD,R8    DCT16,R7                                                      
         SLD,R8   8                                                             
         AI,R9    X'40'                                                         
         SLD,R8   16                                                            
         AI,R9    X'4040'                                                       
         STW,R8   TRAP90+7                                                      
         STW,R9   TRAP90+8                                                      
         B        ENDIF003                                                      
         PAGE                                                                   
ELSE003  AND,R7   M7                3.....ELSE                                  
         AI,R9    4                                                             
         LCI      2                                                             
         LM,R8    *R9                                                           
         STM,R8   TRAP90+7                                                      
         LB,R7    RFT8,R7           4.......PLACE AREA NAME IN LINE             
         LH,R8    MDNAME,R7                                                     
         LI,R9    ', '                      *** PUT A COMMA AFTER AREA          
         STH,R9   R8                        *** NAME                            
         SCS,R8   8                                                             
         STW,R8   TRAP90+6                                                      
ENDIF003 RES      0                 3.....END IF                                
ENDIF002 RES      0                 2...END IF                                  
         LW,R11   -16+10,R6         2...PLACE ERROR CODE IN LINE                
         LB,R11   R11                                                           
         BAL,R8   HEXBCD                                                        
         LI,R6    1                                                             
         STH,R11  TRAP90+5,6                                                    
ENDIF001 RES      0                 1.ENDIF                                     
         LB,R3    TCBPOINT          TASK ID                                     
         LB,R3    STILMID,R3        LMID                                        
         LD,R8    LMINAME,R3        GET LOAD MODULE NAME                        
         LCI      2                                                             
         STM,R8   TRAP90+12         STORE IN TRAP MESSAGE                       
*                                                                               
         LI,R3    TRAP90+4          R3 WORD ADR OF MESSAGE                      
         LW,R0    R3                                                            
         SLS,R0   2                                                             
         AI,R0    1                 R0 NOW BYTE ADDR OF MSG                     
         B        0,R5              RETURN ON LINK                              
*                                                                               
ADDRCHEK RES      0                                                             
         BAL,R8   TMGRA                                                         
         LCF      R0                                                            
         BCS,4    0,R7              UNREADABLE                                  
         BCR,2    1,R7              READABLE                                    
         BCS,1    0,R7              UNREADABLE                                  
*                                                                               
TRAPMSGX DATA,1   0                 1                                           
         DATA,1   1                 2                                           
         DATA,1   0                 X                                           
         DATA,1   2                 4                                           
         DATA,1   0                 X                                           
         DATA,1   0                 X                                           
         DATA,1   0                 X                                           
         DATA,1   3                 8                                           
*                                                                               
*                                                                               
         TITLE    '** TRAPS - TRAP CRASH **'                                    
*                                                                               
* THIS CRASHES WITH THE RIGHT TRAP MESSAGE                                      
*                                                                               
TRAPCRSH RES      0                                                             
         DO       #CRASH                                                        
         LCI      0                                                             
         STM,R0   CRASHREG          SAVE ALL REGISTERS                          
*                                                                               
         LI,R11   X'1FFFF'                                                      
         AND,R11  0,R1              TRAPPED ADDR TO R11                         
*                                                                               
         BAL,R5   TRAPMSG           BUILD TRAP MESSAGE                          
*                                                                               
         LW,R3    CRSHXPSD                                                      
         STW,R3   TRAP90+3          PUT IN XPSD TO CRASH ROUTINE                
*                                                                               
         LCI      0                                                             
         LM,R0    CRASHREG                                                      
         LD,R0    TRAP90                                                        
         B        TRAP90+3                                                      
         ELSE                                                                   
         B        %                 LOOP                                        
         FIN                                                                    
         TITLE    '** TRAPS - HEX TO BCD CONVERSION SUBROUTINE **'              
*                                   SBR TO CHANGE HEX TO BCD                    
*                                      CALL IS  BAL,R8   HEXBCD                 
*                                   WHERE                                       
*                                      R11=VALUE TO CONVERT                     
*                                   EXITS R10,R11=VALUE IN BCD                  
*                                   USES R0, R6-R11                             
*                                                                               
HEXBCD   LI,R7    -28               SHIFT INDEX                                 
         LI,R6    0                 STORE INDEX                                 
         LW,R9    R11                                                           
HEXBCD1  LW,R0    R9                                                            
         SLS,R0   0,R7                                                          
         AND,R0   M4                MASK OUT CHAR.                              
         AI,R0    X'F0'                                                         
         CI,R0    X'FA'             CHANGE TO BCD                               
         BL       %+2                                                           
         AI,R0    -X'39'                                                        
         STB,R0   R10,R6            STORE IT                                    
         AI,R6    1                                                             
         AI,R7    4                                                             
         BLEZ     HEXBCD1           LOOP BACK                                   
         B        *R8               DONE                                        
         BOUND    8                                                             
TRAPIDM  TEXT     ' ID='                                                        
TRAP91   TEXTC    '!!MEM. PROT. ERR  AT  XXXXX'                                 
         TEXTC    '!!PRIVELEGE INST. AT  XXXXX'                                 
         TEXTC    '!!NONEXIST. ADD.  AT  XXXXX'                                 
         TEXTC    '!!NONEXIST. INST. AT  XXXXX'                                 
         TEXTC    '!!UNIMPLE. INST.  AT  XXXXX'                                 
         TEXTC    '!!STACK OVERFLOW  AT  XXXXX'                                 
         TEXTC    '!!ARITH.  FAULT  AT   XXXXX'                                 
         TEXTC    '!!WDOG TIMER RNOUT AT XXXXX'                                 
IPCTOS   EQU      %-TRAP91                                                      
         TEXTC    '!!ERRYY ON CAL      @ XXXXX'                                 
         TEXTC    '!!BREAK ERROR      AT XXXXX'                                 
         DO       #SIGMA9                                                       
         TEXTC    '!!MEM. PARITY ERR  AT XXXXX'                                 
         TEXTC    '!!INST EXCEPT TRAP AT XXXXX'                                 
         FIN                                                                    
         TITLE    '** TRAPS - TRAP-RETURN CAL PROCESSING **'                    
*                                                                               
*                                                                               
*                                                                               
TRTY     EQU      %                                                             
         LI,R0    -1                SET FOR RETURN TO TRAP LOC                  
         B        TRTN05            DO NORMAL TRAP RETURN                       
         TITLE    '** TRAPS - TRAP-EXIT CAL PROCESSING **'                      
*                                                                               
*                                                                               
*                                                                               
TEXIT    EQU      %                                                             
         LI,R1    -19               CLEAN AT LEAST 19 WORDS FROM USR ST         
         MSP,R1   *PCBPOINT         PSD,R0-R15,TRAP NUMBER                      
         PLW,R0   *PCBPOINT         IS THIS THE ONLY FILLER                     
         CI,R0    0                                                             
         BE       %+2               YES                                         
         PLW,R0   *PCBPOINT         NO - PULL ONE MORE                          
EXTEXIT  B        EXIT                                                          
         TITLE    '** TRAPS - TRAP-RETURN CAL PROCESSING **'                    
*                                                                               
*                                                                               
*                                                                               
TRTN     EQU      %                                                             
         LI,R0    0                 SET FOR RETURN TO TRAP LOC+1                
TRTN05   LI,R1    -1                CLEAN ONE WORD                              
         MSP,R1   *PCBPOINT         (CONTAINING TRAP NO) FROM TRAP STACK        
         LI,R1    -15               LET R1 = POINTER TO                         
         AW,R1    *PCBPOINT          REGISTER 0 STORAGE                         
         LI,R9    0                 GET NULL MASK          /SIG7-3960/*C01      
EXTRTN   B        TRTN10            GO TO EXIT                                  
         TITLE    '** TRAPS - JOB TRAP CAL PROCESSING **'                       
*                                                                               
*                                                                               
*                                                                               
JTRAP    EQU      %                                                             
         LB,R4    TCBPOINT          GET FWA OF JCB IN R3                        
         LB,R5    STIJID,R4                                                     
         LW,R3    SJI1,R5                                                       
         AI,R3    2                 SECONDARY TRAP ADD IN JCB+2                 
         BIFMAP   %+2               PRIMARY TRAP ADD IN JCB+3                   
         AI,R3    1                 ADJUST FOR PRIMARY                          
         LI,R4    1                 SET R3 TO INDICATE JTRAP                    
         STB,R4   R3                                                            
         B        TRAP71                                                        
         TITLE    '** TRAPS - TRAP CAL PROCESSING **'                           
*                                                                               
*                                                                               
*                                                                               
TRAP70   EQU      %                                                             
         LW,R3    PCBPOINT                                                      
         AI,R3    4                 SET TO LOC OF TRAP ADDRESS                  
TRAP71   STW,R0   R1                RI=FPT ADDRESS                              
         LI,R5    X'1FFFF'          GET MASK                                    
         LI,R4    0                                                             
         LS,R4    0,R1              R2=EITHER FGD/BCKG FWA,LWA                  
         BEZ      TRAP75            NO TRAP ADDRESS PRESENT                     
         LW,R9    R4                                                            
         BAL,R8   TMVADR            VALIDATE ADR IN R9                          
         B        EXTRAP7X          ERROR                                       
         STS,R4   0,R3              STORE TRAP ADDR                             
TRAP72   LW,R5    1,R1              GET CONTROL BITS                            
         SLS,R5   1                 POSITION ABORT BITS                         
         AND,R5   YFF               GET JUST ABORT BITS                         
         LI,R4    0                                                             
         STS,R4   0,R3              STORE ABORT BITS                            
         LW,R5    1,R1                                                          
         SLS,R5   9                 POSITION TRAP BITS                          
         AND,R5   YFF               GET JUST TRAP BITS                          
         LI,R4    -1                                                            
         STS,R4   0,R3              STORE TRAP BITS                             
         LB,R2    *R1               R2= FPT CODE                                
         CI,R2    X'14'             PROCESSING JTRAP CALL                       
         BNE      EXTRAP70          YES-AM,DM BITS ARE NOT PROCESSED            
         LB,R3    TCBPOINT          GET CAL STACK BASE                          
         LD,R3    STIRTSB,R3                                                    
         LW,R6    TCBPOINT          R6=TCB ADDRESS                              
         LW,R5    1,R1                                                          
         SLS,R5   12                GET PERMIT BITS FOR DM,AM TRAP              
         AND,R5   Y003                                                          
         STS,R4   -CAL1PUSH+16,R3   STORE IN PSD                                
         BIFSEC   %+2               SET ENTRY PSD FOR PRIMARY                   
         STS,R4   8,R6              STORE IN PSD IN TCB                         
*                                   NOTE THAT R8 GETS CLOBBERED IF NO TCB       
         LW,R5    1,R1                                                          
         SLS,R5   20                                                            
         AND,R5   Y003              GET IGNORE BITS FOR DM,AM TRAP              
         LI,R4    0                                                             
         STS,R4   -CAL1PUSH+16,R3   STORE IN PSD                                
         BIFSEC   %+2               SET ENTRY PSD FOR PRIMARY                   
         STS,R4   8,R6                                                          
EXTRAP70 B        CALEXIT           EXIT FROM CAL                               
TRAP75   RES      0                                                             
         LS,R4    0,R3              IS THERE A TRAP ADDR IN PCB                 
         BNEZ     TRAP72            YES, ALLOW CAL                              
         LW,R5    1,R1                                                          
         SLS,R5   1                 PSITION TRAP BITS                           
         AND,R5   Y00FF             ARE THERE ANY SET                           
         BEZ      TRAP72            NOT PROCESSING ANY TRAPS, SO OK             
EXTRAP7X B        TRAPX             ERROR, PROCESS,TRAPS,BUT NO ADR             
         OLAYEND                                                                
         END                                                                    
