OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [libgloss/] [hp74x/] [iva_table.s] - Diff between revs 158 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 158 Rev 816
/****************************************************************************
/****************************************************************************
 
 
                THIS SOFTWARE IS NOT COPYRIGHTED
                THIS SOFTWARE IS NOT COPYRIGHTED
 
 
   HP offers the following for use in the public domain.  HP makes no
   HP offers the following for use in the public domain.  HP makes no
   warranty with regard to the software or it's performance and the
   warranty with regard to the software or it's performance and the
   user accepts the software "AS IS" with all faults.
   user accepts the software "AS IS" with all faults.
 
 
   HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
   HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
   TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
   TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
 
****************************************************************************/
****************************************************************************/
 
 
        .space  $TEXT$
        .space  $TEXT$
        .subspa $CODE$,access=0x2c
        .subspa $CODE$,access=0x2c
 
 
#include        "diagnose.h"
#include        "diagnose.h"
#if 0
#if 0
#include        "iva_table.h"
#include        "iva_table.h"
#endif
#endif
 
 
R_gr0           .equ     0
R_gr0           .equ     0
R_gr1           .equ     4
R_gr1           .equ     4
R_gr2           .equ     8
R_gr2           .equ     8
R_gr3           .equ    12
R_gr3           .equ    12
R_gr4           .equ    16
R_gr4           .equ    16
R_gr5           .equ    20
R_gr5           .equ    20
R_gr6           .equ    24
R_gr6           .equ    24
R_gr7           .equ    28
R_gr7           .equ    28
R_gr8           .equ    32
R_gr8           .equ    32
R_gr9           .equ    36
R_gr9           .equ    36
R_gr10          .equ    40
R_gr10          .equ    40
R_gr11          .equ    44
R_gr11          .equ    44
R_gr12          .equ    48
R_gr12          .equ    48
R_gr13          .equ    52
R_gr13          .equ    52
R_gr14          .equ    56
R_gr14          .equ    56
R_gr15          .equ    60
R_gr15          .equ    60
R_gr16          .equ    64
R_gr16          .equ    64
R_gr17          .equ    68
R_gr17          .equ    68
R_gr18          .equ    72
R_gr18          .equ    72
R_gr19          .equ    76
R_gr19          .equ    76
R_gr20          .equ    80
R_gr20          .equ    80
R_gr21          .equ    84
R_gr21          .equ    84
R_gr22          .equ    88
R_gr22          .equ    88
R_gr23          .equ    92
R_gr23          .equ    92
R_gr24          .equ    96
R_gr24          .equ    96
R_gr25          .equ    100
R_gr25          .equ    100
R_gr26          .equ    104
R_gr26          .equ    104
R_gr27          .equ    108
R_gr27          .equ    108
R_gr28          .equ    112
R_gr28          .equ    112
R_gr29          .equ    116
R_gr29          .equ    116
R_gr30          .equ    120
R_gr30          .equ    120
R_gr31          .equ    124
R_gr31          .equ    124
R_rctr          .equ    160
R_rctr          .equ    160
R_cpu0          .equ    164
R_cpu0          .equ    164
R_pidr1         .equ    168
R_pidr1         .equ    168
R_pidr2         .equ    172
R_pidr2         .equ    172
R_ccr           .equ    176
R_ccr           .equ    176
R_sar           .equ    180
R_sar           .equ    180
R_pidr3         .equ    184
R_pidr3         .equ    184
R_pidr4         .equ    188
R_pidr4         .equ    188
R_iva           .equ    192
R_iva           .equ    192
R_eiem          .equ    196
R_eiem          .equ    196
 
 
R_itmr          .equ    200
R_itmr          .equ    200
R_pcsqH         .equ    204
R_pcsqH         .equ    204
R_pcoqH         .equ    208
R_pcoqH         .equ    208
R_iir           .equ    212
R_iir           .equ    212
R_pcsqT         .equ    216
R_pcsqT         .equ    216
R_pcoqT         .equ    220
R_pcoqT         .equ    220
R_isr           .equ    224
R_isr           .equ    224
R_ior           .equ    228
R_ior           .equ    228
R_ipsw          .equ    232
R_ipsw          .equ    232
R_eirr          .equ    236
R_eirr          .equ    236
R_tr0           .equ    240
R_tr0           .equ    240
R_tr1           .equ    244
R_tr1           .equ    244
R_tr2           .equ    248
R_tr2           .equ    248
R_tr3           .equ    252
R_tr3           .equ    252
R_tr4           .equ    256
R_tr4           .equ    256
R_tr5           .equ    260
R_tr5           .equ    260
R_tr6           .equ    264
R_tr6           .equ    264
R_tr7           .equ    268
R_tr7           .equ    268
 
 
R_SIZE          .equ    300
R_SIZE          .equ    300
 
 
        .import putc,code
        .import putc,code
        .import puts,code
        .import puts,code
        .import putnum,code
        .import putnum,code
        .import put_led,code
        .import put_led,code
        .import save_regs,code
        .import save_regs,code
        .import STUB_RESTORE,code
        .import STUB_RESTORE,code
        .import RegBlk,data
        .import RegBlk,data
        .export iva_table,data
        .export iva_table,data
        .IMPORT led_putnum,code
        .IMPORT led_putnum,code
        .IMPORT delay,code
        .IMPORT delay,code
        .IMPORT putnum,code
        .IMPORT putnum,code
        .IMPORT outbyte,code
        .IMPORT outbyte,code
        .IMPORT print,code
        .IMPORT print,code
 
 
        .align  2048
        .align  2048
iva_table
iva_table
        .blockz 32      ; entry 0 is reserved
        .blockz 32      ; entry 0 is reserved
 
 
        .align  32
        .align  32
hpmc
hpmc
        nop
        nop
        b,n     hpmc_handler
        b,n     hpmc_handler
        nop
        nop
        .word   0
        .word   0
        .word   0
        .word   0
        .word   0
        .word   0
        .word   hpmc_handler
        .word   hpmc_handler
        .word   0
        .word   0
 
 
        .align  32
        .align  32
power_fail
power_fail
;       PrintString     Str02,0x2
;       PrintString     Str02,0x2
        ldi     1,%r26
        ldi     1,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
recovery
recovery
;;      PrintString     Str03,0x3
;;      PrintString     Str03,0x3
        ldi     2,%r26
        ldi     2,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
                ldi     3,%r1
                ldi     3,%r1
        b,n     handle_rcc
        b,n     handle_rcc
        nop
        nop
 
 
        .align  32
        .align  32
external
external
;       PrintString     Str04,0x4
;       PrintString     Str04,0x4
        ldi     3,%r26
        ldi     3,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
lpmc
lpmc
;       PrintString     Str05,0x5
;       PrintString     Str05,0x5
        ldi     4,%r26
        ldi     4,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
itlb_miss
itlb_miss
;       PrintString     Str06,0x6
;       PrintString     Str06,0x6
        ldi     5,%r26
        ldi     5,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
imem_protection
imem_protection
;       PrintString     Str07,0x7
;       PrintString     Str07,0x7
        ldi     6,%r26
        ldi     6,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
illegal_inst
illegal_inst
;       PrintString     Str08,0x8
;       PrintString     Str08,0x8
        ldi     7,%r26
        ldi     7,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
break
break
        b,n     break_handler
        b,n     break_handler
        nop
        nop
 
 
        .align  32
        .align  32
privileged_op
privileged_op
;       PrintString     Str0a,0xa
;       PrintString     Str0a,0xa
        ldi     8,%r26
        ldi     8,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
privileged_reg
privileged_reg
;       PrintString     Str0b,0xb
;       PrintString     Str0b,0xb
        ldi     9,%r26
        ldi     9,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
overflow
overflow
;       PrintString     Str0c,0xc
;       PrintString     Str0c,0xc
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
conditional
conditional
;       PrintString     Str0d,0xd
;       PrintString     Str0d,0xd
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
assist_excep
assist_excep
;       PrintString     Str0e,0xe
;       PrintString     Str0e,0xe
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
dtlb_miss
dtlb_miss
;       PrintString     Str0f,0xf
;       PrintString     Str0f,0xf
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
na_itlb
na_itlb
;       PrintString     Str10,0x10
;       PrintString     Str10,0x10
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
na_dtlb
na_dtlb
;       PrintString     Str11,0x11
;       PrintString     Str11,0x11
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
dmem_protection
dmem_protection
;       PrintString     Str12,0x12
;       PrintString     Str12,0x12
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
dmem_break
dmem_break
;       PrintString     Str13,0x13
;       PrintString     Str13,0x13
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
tlb_dirty
tlb_dirty
;       PrintString     Str14,0x14
;       PrintString     Str14,0x14
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
page_ref
page_ref
;       PrintString     Str15,0x15
;       PrintString     Str15,0x15
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
assist_emul
assist_emul
;       PrintString     Str16,0x16
;       PrintString     Str16,0x16
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
high_priv
high_priv
;       PrintString     Str17,0x17
;       PrintString     Str17,0x17
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
low_priv
low_priv
;       PrintString     Str18,0x18
;       PrintString     Str18,0x18
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
        .align  32
        .align  32
branch_taken
branch_taken
;       PrintString     Str19,0x19
;       PrintString     Str19,0x19
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
/*
/*
 * foobar -- debug procedure calling between C and assembler
 * foobar -- debug procedure calling between C and assembler
 */
 */
        .EXPORT foobar,ENTRY,ARGW0=GR,RTNVAL=GR
        .EXPORT foobar,ENTRY,ARGW0=GR,RTNVAL=GR
foobar
foobar
        .PROC
        .PROC
        .CALLINFO CALLER,FRAME=128,SAVE_RP
        .CALLINFO CALLER,FRAME=128,SAVE_RP
        .ENTRY
        .ENTRY
 
 
        stw     %r2,-20(0,%r30)                 ; stash the return pointer
        stw     %r2,-20(0,%r30)                 ; stash the return pointer
        ldo     128(%r30),%r30                  ; push up the stack pointer
        ldo     128(%r30),%r30                  ; push up the stack pointer
 
 
        ldi     8, %r26
        ldi     8, %r26
        bl,n    led_putnum,%r2
        bl,n    led_putnum,%r2
        nop
        nop
        ldil    L'900000,%r26
        ldil    L'900000,%r26
        ldo     R'900000(%r26),%r26
        ldo     R'900000(%r26),%r26
        bl,n    delay,%r2
        bl,n    delay,%r2
        nop
        nop
        ldi     8, %r26
        ldi     8, %r26
        bl,n    led_putnum,%r2
        bl,n    led_putnum,%r2
        nop
        nop
        ldil    L'900000,%r26
        ldil    L'900000,%r26
        ldo     R'900000(%r26),%r26
        ldo     R'900000(%r26),%r26
        bl,n    delay,%r2
        bl,n    delay,%r2
        nop
        nop
;;      copy    %r26,%r26
;;      copy    %r26,%r26
;;      bl,n    putnum,%r2
;;      bl,n    putnum,%r2
        nop
        nop
 
 
        ldw     -148(0,%r30),%r2                ; retrieve the return pointer
        ldw     -148(0,%r30),%r2                ; retrieve the return pointer
        ldo     -128(%r30),%r30                 ; reset the stack pointer
        ldo     -128(%r30),%r30                 ; reset the stack pointer
        bv,n    0(%r2)
        bv,n    0(%r2)
        nop
        nop
 
 
        .EXIT
        .EXIT
        .PROCEND
        .PROCEND
 
 
/*
/*
 * setup_vectors -- add vectors for GDB to the vector table.
 * setup_vectors -- add vectors for GDB to the vector table.
 *      %r3 - current vector table
 *      %r3 - current vector table
 *      %r4 - new vector table
 *      %r4 - new vector table
 */
 */
        .EXPORT setup_vectors,ENTRY,ARGW0=GR,RTNVAL=GR
        .EXPORT setup_vectors,ENTRY,ARGW0=GR,RTNVAL=GR
setup_vectors
setup_vectors
        .PROC
        .PROC
        .CALLINFO CALLER,FRAME=128,SAVE_RP
        .CALLINFO CALLER,FRAME=128,SAVE_RP
        .ENTRY
        .ENTRY
        stw     %r2,-20(0,%r30)                 ; stash the return pointer
        stw     %r2,-20(0,%r30)                 ; stash the return pointer
        ldo     128(%r30),%r30                  ; push up the stack pointer
        ldo     128(%r30),%r30                  ; push up the stack pointer
 
 
        mfctl   %iva,%r3
        mfctl   %iva,%r3
 
 
        ldil    L%iva_table,%r4                 ; Get the new vector table
        ldil    L%iva_table,%r4                 ; Get the new vector table
        ldo     R%iva_table(%r4),%r4            ; address
        ldo     R%iva_table(%r4),%r4            ; address
 
 
        ldil    L%break_handler,%r5             ; Get the breakpoint
        ldil    L%break_handler,%r5             ; Get the breakpoint
        ldo     R%break_handler(%r5),%r5        ; handler vector
        ldo     R%break_handler(%r5),%r5        ; handler vector
 
 
        ldil    L%break_default,%r6             ; Get the default handler
        ldil    L%break_default,%r6             ; Get the default handler
        ldo     R%break_default(%r6),%r6        ; vector
        ldo     R%break_default(%r6),%r6        ; vector
 
 
        stw     %r6,4(%r4)                      ; ad the default vector
        stw     %r6,4(%r4)                      ; ad the default vector
        stw     %r5,36(%r4)                     ; add the break vector
        stw     %r5,36(%r4)                     ; add the break vector
 
 
        mtctl   %r4,%iva
        mtctl   %r4,%iva
 
 
        ldw     -148(0,%r30),%r2                ; retrieve the return pointer
        ldw     -148(0,%r30),%r2                ; retrieve the return pointer
        ldo     -128(%r30),%r30                 ; reset the stack pointer
        ldo     -128(%r30),%r30                 ; reset the stack pointer
        bv,n    0(%r2)
        bv,n    0(%r2)
        nop
        nop
 
 
        .EXIT
        .EXIT
        .PROCEND
        .PROCEND
 
 
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
hpmc_handler
hpmc_handler
        bl,n    save_state,%r25
        bl,n    save_state,%r25
        nop
        nop
        bl      print_intr,%rp
        bl      print_intr,%rp
        ldi     Str01-Str01,%arg0
        ldi     Str01-Str01,%arg0
        bl      print_state,%rp
        bl      print_state,%rp
        nop
        nop
        ldil    L%0xf0000000,%r1
        ldil    L%0xf0000000,%r1
        ldw     (%r1),%r1               ; read from ROM to reset HPMC
        ldw     (%r1),%r1               ; read from ROM to reset HPMC
 
 
        mfcpu_c 0,%r1
        mfcpu_c 0,%r1
        mfcpu_c 0,%r1
        mfcpu_c 0,%r1
        depi    0,CPU_DIAG_0_PREV_HPMC_PREP_BIT,1,%r1   ; clear Prev HPMC bit
        depi    0,CPU_DIAG_0_PREV_HPMC_PREP_BIT,1,%r1   ; clear Prev HPMC bit
 
 
#ifdef PCXL
#ifdef PCXL
        depi    0,CPU_DIAG_0_L2DHPMC_BIT,1,%r1
        depi    0,CPU_DIAG_0_L2DHPMC_BIT,1,%r1
        depi    0,CPU_DIAG_0_L2IHPMC_BIT,1,%r1
        depi    0,CPU_DIAG_0_L2IHPMC_BIT,1,%r1
        depi    0,CPU_DIAG_0_L1IHPMC_BIT,1,%r1
        depi    0,CPU_DIAG_0_L1IHPMC_BIT,1,%r1
        depi    0,CPU_DIAG_0_L2PARERR_BIT,4,%r1
        depi    0,CPU_DIAG_0_L2PARERR_BIT,4,%r1
#else   /* PCXT */
#else   /* PCXT */
        depi    0,CPU_DIAG_0_DHPMC_BIT,1,%r1            ; don't clear DHPMC
        depi    0,CPU_DIAG_0_DHPMC_BIT,1,%r1            ; don't clear DHPMC
        depi    0,CPU_DIAG_0_ILPMC_BIT,1,%r1             ; don't clear ILPMC
        depi    0,CPU_DIAG_0_ILPMC_BIT,1,%r1             ; don't clear ILPMC
        depi    0,CPU_DIAG_0_HTOC_BIT,1,%r1              ; don't clear HTOC
        depi    0,CPU_DIAG_0_HTOC_BIT,1,%r1              ; don't clear HTOC
#endif
#endif
 
 
        mtcpu   %r1,0
        mtcpu   %r1,0
        mtcpu   %r1,0
        mtcpu   %r1,0
 
 
        b,n     restore_to_STUB
        b,n     restore_to_STUB
        ldi     0x1,%r1
        ldi     0x1,%r1
 
 
/*
/*
 * break_handler -- this is the main entry point for an exception
 * break_handler -- this is the main entry point for an exception
 */
 */
        .ALIGN  2048
        .ALIGN  2048
break_handler
break_handler
 
 
        mfctl   %iir,%r1                        ; r1 = break instruction
        mfctl   %iir,%r1                        ; r1 = break instruction
        extru   %r1,18,13,%r8
        extru   %r1,18,13,%r8
        ldo     -i13BREAK(%r8),%r8              ; if im13 field doesn't match
        ldo     -i13BREAK(%r8),%r8              ; if im13 field doesn't match
        comb,<>,n %r8,%r0,break_default         ;   go to default operation
        comb,<>,n %r8,%r0,break_default         ;   go to default operation
        extru   %r1,31,5,%r8
        extru   %r1,31,5,%r8
        ldi     0x9,%r1                         ; set exception index
        ldi     0x9,%r1                         ; set exception index
        comib,=,n i5BP,%r8,break_breakpoint
        comib,=,n i5BP,%r8,break_breakpoint
        comib,=,n i5PSW,%r8,break_psw
        comib,=,n i5PSW,%r8,break_psw
        comib,=,n i5REG,%r8,break_reg_init
        comib,=,n i5REG,%r8,break_reg_init
        comib,=,n i5INLINE,%r8,break_breakpoint
        comib,=,n i5INLINE,%r8,break_breakpoint
        ; fall through to break_default
        ; fall through to break_default
 
 
break_default
break_default
;       PrintString     Str09,0x9
;       PrintString     Str09,0x9
        ldi     32,%r26
        ldi     32,%r26
        bl,n    putnum,%r2
        bl,n    putnum,%r2
        nop
        nop
 
 
break_reg_init
break_reg_init
        bl      setup_vectors,%r25
        bl      setup_vectors,%r25
        nop
        nop
        bl      save_regs,%r25
        bl      save_regs,%r25
        nop
        nop
        ; fall through to advance past break instruction
        ; fall through to advance past break instruction
 
 
break_psw
break_psw
        b,n     recover
        b,n     recover
 
 
break_breakpoint
break_breakpoint
        b,n     STUB_RESTORE
        b,n     STUB_RESTORE
 
 
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
 
 
handle_rcc
handle_rcc
        mfctl   %ipsw,%r1
        mfctl   %ipsw,%r1
        bb,>=,n %r1,10,do_restore       ; check nullify bit
        bb,>=,n %r1,10,do_restore       ; check nullify bit
        dep     %r0,10,1,%r1
        dep     %r0,10,1,%r1
        mtctl   %r1,%ipsw               ; clear nullify bit
        mtctl   %r1,%ipsw               ; clear nullify bit
 
 
        ;; was the AdvancePCOQ .macro
        ;; was the AdvancePCOQ .macro
        mtctl   %r0,%pcoq               ; throw away iiaoq head pointer, tail->head
        mtctl   %r0,%pcoq               ; throw away iiaoq head pointer, tail->head
        mfctl   %pcoq,%r1               ; get tail pointer
        mfctl   %pcoq,%r1               ; get tail pointer
        mtctl   %r1,%pcoq               ; insert tail pointer
        mtctl   %r1,%pcoq               ; insert tail pointer
        ldo     4(%r1),%r1              ; advance tail pointer
        ldo     4(%r1),%r1              ; advance tail pointer
        mtctl   %r1,%pcoq               ; insert new tail pointer, former tail->head
        mtctl   %r1,%pcoq               ; insert new tail pointer, former tail->head
 
 
do_restore
do_restore
        b,n     STUB_RESTORE
        b,n     STUB_RESTORE
        nop
        nop
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
 
 
print_intr
print_intr
; %dp may be messed up, so do self-relocating to reach Save_area
; %dp may be messed up, so do self-relocating to reach Save_area
        blr     %r0,%r1
        blr     %r0,%r1
        addil   L%Str01-pr_intr_0,%r1
        addil   L%Str01-pr_intr_0,%r1
 
 
pr_intr_0
pr_intr_0
        ldo     R%Str01-pr_intr_0(%r1),%r1      ; r1 points to Save_area
        ldo     R%Str01-pr_intr_0(%r1),%r1      ; r1 points to Save_area
        b       puts                            ; print string--return through rp
        b       puts                            ; print string--return through rp
        add     %r1,%arg0,%arg0
        add     %r1,%arg0,%arg0
 
 
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
 
 
halt
halt
; %dp may be messed up, so do self-relocating to reach Save_area
; %dp may be messed up, so do self-relocating to reach Save_area
        blr     %r0,%r1
        blr     %r0,%r1
        addil   L%HaltStr-halt_0,%r1
        addil   L%HaltStr-halt_0,%r1
 
 
halt_0
halt_0
        bl      puts,%rp                        ; print halt message
        bl      puts,%rp                        ; print halt message
        ldo     R%HaltStr-halt_0(%r1),%arg0
        ldo     R%HaltStr-halt_0(%r1),%arg0
 
 
        nop
        nop
        b,n     .                               ; loop forever
        b,n     .                               ; loop forever
        nop
        nop
 
 
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
 
 
recover
recover
        ;; was the AdvancePCOQ .macro
        ;; was the AdvancePCOQ .macro
        mtctl   %r0,%pcoq                       ; throw away iiaoq head pointer, tail->head
        mtctl   %r0,%pcoq                       ; throw away iiaoq head pointer, tail->head
        mfctl   %pcoq,%r1                       ; get tail pointer
        mfctl   %pcoq,%r1                       ; get tail pointer
        mtctl   %r1,%pcoq                       ; insert tail pointer
        mtctl   %r1,%pcoq                       ; insert tail pointer
        ldo     4(%r1),%r1                      ; advance tail pointer
        ldo     4(%r1),%r1                      ; advance tail pointer
        mtctl   %r1,%pcoq                       ; insert new tail pointer, former tail->head
        mtctl   %r1,%pcoq                       ; insert new tail pointer, former tail->head
 
 
        rfir
        rfir
 
 
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
 
 
save_state      ; %r25 is return pointer
save_state      ; %r25 is return pointer
; %dp may be messed up, so do self-relocating to reach Save_area
; %dp may be messed up, so do self-relocating to reach Save_area
        blr     %r0,%r1
        blr     %r0,%r1
        addil   L%Save_area-sa_st_0,%r1
        addil   L%Save_area-sa_st_0,%r1
 
 
sa_st_0
sa_st_0
        ldo     R%Save_area-sa_st_0(%r1),%r1    ; r1 points to Save_area
        ldo     R%Save_area-sa_st_0(%r1),%r1    ; r1 points to Save_area
 
 
; save general registers
; save general registers
        stw     %r0,R_gr0(%r1)
        stw     %r0,R_gr0(%r1)
                                ; don't save %r1 until restored
                                ; don't save %r1 until restored
        stw     %r2,R_gr2(%r1)
        stw     %r2,R_gr2(%r1)
        stw     %r3,R_gr3(%r1)
        stw     %r3,R_gr3(%r1)
        stw     %r4,R_gr4(%r1)
        stw     %r4,R_gr4(%r1)
        stw     %r5,R_gr5(%r1)
        stw     %r5,R_gr5(%r1)
        stw     %r6,R_gr6(%r1)
        stw     %r6,R_gr6(%r1)
        stw     %r7,R_gr7(%r1)
        stw     %r7,R_gr7(%r1)
                                ; don't save %r8, %r9 until restored
                                ; don't save %r8, %r9 until restored
        stw     %r10,R_gr10(%r1)
        stw     %r10,R_gr10(%r1)
        stw     %r11,R_gr11(%r1)
        stw     %r11,R_gr11(%r1)
        stw     %r12,R_gr12(%r1)
        stw     %r12,R_gr12(%r1)
        stw     %r13,R_gr13(%r1)
        stw     %r13,R_gr13(%r1)
        stw     %r14,R_gr14(%r1)
        stw     %r14,R_gr14(%r1)
        stw     %r15,R_gr15(%r1)
        stw     %r15,R_gr15(%r1)
                                ; don't save %r16, %r17 until restored
                                ; don't save %r16, %r17 until restored
        stw     %r18,R_gr18(%r1)
        stw     %r18,R_gr18(%r1)
        stw     %r19,R_gr19(%r1)
        stw     %r19,R_gr19(%r1)
        stw     %r20,R_gr20(%r1)
        stw     %r20,R_gr20(%r1)
        stw     %r21,R_gr21(%r1)
        stw     %r21,R_gr21(%r1)
        stw     %r22,R_gr22(%r1)
        stw     %r22,R_gr22(%r1)
        stw     %r23,R_gr23(%r1)
        stw     %r23,R_gr23(%r1)
                                ; don't save %r24, %r25 until restored
                                ; don't save %r24, %r25 until restored
        stw     %r26,R_gr26(%r1)
        stw     %r26,R_gr26(%r1)
        stw     %r27,R_gr27(%r1)
        stw     %r27,R_gr27(%r1)
        stw     %r28,R_gr28(%r1)
        stw     %r28,R_gr28(%r1)
        stw     %r29,R_gr29(%r1)
        stw     %r29,R_gr29(%r1)
        copy    %r25,%rp        ; copy return pointer to %rp
        copy    %r25,%rp        ; copy return pointer to %rp
        stw     %r30,R_gr30(%r1)
        stw     %r30,R_gr30(%r1)
        copy    %r1,%r19        ; save Save_area pointer in %r19
        copy    %r1,%r19        ; save Save_area pointer in %r19
        stw     %r31,R_gr31(%r1)
        stw     %r31,R_gr31(%r1)
        shdw_gr                 ; restore %r1 and %r25 (et al.) from shadow regs
        shdw_gr                 ; restore %r1 and %r25 (et al.) from shadow regs
        shdw_gr
        shdw_gr
        stw     %r1,R_gr1(%r19) ; save %r1
        stw     %r1,R_gr1(%r19) ; save %r1
        stw     %r8,R_gr8(%r19)
        stw     %r8,R_gr8(%r19)
        stw     %r9,R_gr9(%r19)
        stw     %r9,R_gr9(%r19)
        stw     %r16,R_gr16(%r19)
        stw     %r16,R_gr16(%r19)
        stw     %r17,R_gr17(%r19)
        stw     %r17,R_gr17(%r19)
        stw     %r24,R_gr24(%r19)
        stw     %r24,R_gr24(%r19)
 
 
; save control registers
; save control registers
        mfctl   %rctr,%r1
        mfctl   %rctr,%r1
        stw     %r1,R_rctr(%r19)
        stw     %r1,R_rctr(%r19)
        mfctl   %pidr1,%r1
        mfctl   %pidr1,%r1
        stw     %r1,R_pidr1(%r19)
        stw     %r1,R_pidr1(%r19)
        mfctl   %pidr2,%r1
        mfctl   %pidr2,%r1
        stw     %r1,R_pidr2(%r19)
        stw     %r1,R_pidr2(%r19)
        mfctl   %ccr,%r1
        mfctl   %ccr,%r1
        stw     %r1,R_ccr(%r19)
        stw     %r1,R_ccr(%r19)
        mfctl   %sar,%r1
        mfctl   %sar,%r1
        stw     %r1,R_sar(%r19)
        stw     %r1,R_sar(%r19)
        mfctl   %pidr3,%r1
        mfctl   %pidr3,%r1
        stw     %r1,R_pidr3(%r19)
        stw     %r1,R_pidr3(%r19)
        mfctl   %pidr4,%r1
        mfctl   %pidr4,%r1
        stw     %r1,R_pidr4(%r19)
        stw     %r1,R_pidr4(%r19)
        mfctl   %iva,%r1
        mfctl   %iva,%r1
        stw     %r1,R_iva(%r19)
        stw     %r1,R_iva(%r19)
        mfctl   %eiem,%r1
        mfctl   %eiem,%r1
        stw     %r1,R_eiem(%r19)
        stw     %r1,R_eiem(%r19)
        mfctl   %itmr,%r1
        mfctl   %itmr,%r1
        stw     %r1,R_itmr(%r19)
        stw     %r1,R_itmr(%r19)
        mfctl   %pcsq,%r1
        mfctl   %pcsq,%r1
        mtctl   %r1,%pcsq
        mtctl   %r1,%pcsq
        stw     %r1,R_pcsqH(%r19)
        stw     %r1,R_pcsqH(%r19)
        mfctl   %pcsq,%r1
        mfctl   %pcsq,%r1
        mtctl   %r1,%pcsq
        mtctl   %r1,%pcsq
        stw     %r1,R_pcsqT(%r19)
        stw     %r1,R_pcsqT(%r19)
        mfctl   %pcoq,%r1
        mfctl   %pcoq,%r1
        mtctl   %r1,%pcoq
        mtctl   %r1,%pcoq
        stw     %r1,R_pcoqH(%r19)
        stw     %r1,R_pcoqH(%r19)
        mfctl   %pcoq,%r1
        mfctl   %pcoq,%r1
        mtctl   %r1,%pcoq
        mtctl   %r1,%pcoq
        stw     %r1,R_pcoqT(%r19)
        stw     %r1,R_pcoqT(%r19)
        mfctl   %iir,%r1
        mfctl   %iir,%r1
        stw     %r1,R_iir(%r19)
        stw     %r1,R_iir(%r19)
        mfctl   %isr,%r1
        mfctl   %isr,%r1
        stw     %r1,R_isr(%r19)
        stw     %r1,R_isr(%r19)
        mfctl   %ior,%r1
        mfctl   %ior,%r1
        stw     %r1,R_ior(%r19)
        stw     %r1,R_ior(%r19)
        mfctl   %ipsw,%r1
        mfctl   %ipsw,%r1
        stw     %r1,R_ipsw(%r19)
        stw     %r1,R_ipsw(%r19)
        mfctl   %eirr,%r1
        mfctl   %eirr,%r1
        stw     %r1,R_eirr(%r19)
        stw     %r1,R_eirr(%r19)
        mfctl   %tr0,%r1
        mfctl   %tr0,%r1
        stw     %r1,R_tr0(%r19)
        stw     %r1,R_tr0(%r19)
        mfctl   %tr1,%r1
        mfctl   %tr1,%r1
        stw     %r1,R_tr1(%r19)
        stw     %r1,R_tr1(%r19)
        mfctl   %tr2,%r1
        mfctl   %tr2,%r1
        stw     %r1,R_tr2(%r19)
        stw     %r1,R_tr2(%r19)
        mfctl   %tr3,%r1
        mfctl   %tr3,%r1
        stw     %r1,R_tr3(%r19)
        stw     %r1,R_tr3(%r19)
        mfctl   %tr4,%r1
        mfctl   %tr4,%r1
        stw     %r1,R_tr4(%r19)
        stw     %r1,R_tr4(%r19)
        mfctl   %tr5,%r1
        mfctl   %tr5,%r1
        stw     %r1,R_tr5(%r19)
        stw     %r1,R_tr5(%r19)
        mfctl   %tr6,%r1
        mfctl   %tr6,%r1
        stw     %r1,R_tr6(%r19)
        stw     %r1,R_tr6(%r19)
        mfctl   %tr7,%r1
        mfctl   %tr7,%r1
        stw     %r1,R_tr7(%r19)
        stw     %r1,R_tr7(%r19)
 
 
; save diagnose registers
; save diagnose registers
        mfcpu_c 0,%r1
        mfcpu_c 0,%r1
        mfcpu_c 0,%r1
        mfcpu_c 0,%r1
        stw     %r1,R_cpu0(%r19)
        stw     %r1,R_cpu0(%r19)
 
 
#ifdef  PRINT_SPACE
#ifdef  PRINT_SPACE
        stw     %r25,R_gr25(%r19)
        stw     %r25,R_gr25(%r19)
 
 
; save space registers
; save space registers
        mfsp    %sr0,%r1
        mfsp    %sr0,%r1
        stw     %r1,R_sr0(%r19)
        stw     %r1,R_sr0(%r19)
        mfsp    %sr1,%r1
        mfsp    %sr1,%r1
        stw     %r1,R_sr1(%r19)
        stw     %r1,R_sr1(%r19)
        mfsp    %sr2,%r1
        mfsp    %sr2,%r1
        stw     %r1,R_sr2(%r19)
        stw     %r1,R_sr2(%r19)
        mfsp    %sr3,%r1
        mfsp    %sr3,%r1
        stw     %r1,R_sr3(%r19)
        stw     %r1,R_sr3(%r19)
        mfsp    %sr4,%r1
        mfsp    %sr4,%r1
        stw     %r1,R_sr4(%r19)
        stw     %r1,R_sr4(%r19)
        mfsp    %sr5,%r1
        mfsp    %sr5,%r1
        stw     %r1,R_sr5(%r19)
        stw     %r1,R_sr5(%r19)
        mfsp    %sr6,%r1
        mfsp    %sr6,%r1
        stw     %r1,R_sr6(%r19)
        stw     %r1,R_sr6(%r19)
        mfsp    %sr7,%r1
        mfsp    %sr7,%r1
        bv      (%rp)
        bv      (%rp)
        stw     %r1,R_sr7(%r19)
        stw     %r1,R_sr7(%r19)
#else
#else
        bv      (%rp)
        bv      (%rp)
        stw     %r25,R_gr25(%r19)
        stw     %r25,R_gr25(%r19)
#endif
#endif
 
 
 
 
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
 
 
restore_to_STUB         ; doesn't return--goes to STUB_RESTORE
restore_to_STUB         ; doesn't return--goes to STUB_RESTORE
                        ; Note--STUB_RESTORE executes rfir,
                        ; Note--STUB_RESTORE executes rfir,
                        ;       so we don't need to
                        ;       so we don't need to
        copy    %r1,%r8 ; save exception index
        copy    %r1,%r8 ; save exception index
; %dp may be messed up, so do self-relocating to reach Save_area
; %dp may be messed up, so do self-relocating to reach Save_area
        bl      re_st_0,%r1
        bl      re_st_0,%r1
        addil   L%Save_area-re_st_0,%r1
        addil   L%Save_area-re_st_0,%r1
 
 
re_st_0
re_st_0
        ldo     R%Save_area-re_st_0(%r1),%r1    ; r1 points to Save_area
        ldo     R%Save_area-re_st_0(%r1),%r1    ; r1 points to Save_area
 
 
; restore general registers
; restore general registers
        ldw     R_gr2(%r1),%r2
        ldw     R_gr2(%r1),%r2
        ldw     R_gr3(%r1),%r3
        ldw     R_gr3(%r1),%r3
        ldw     R_gr4(%r1),%r4
        ldw     R_gr4(%r1),%r4
        ldw     R_gr5(%r1),%r5
        ldw     R_gr5(%r1),%r5
        ldw     R_gr6(%r1),%r6
        ldw     R_gr6(%r1),%r6
        ldw     R_gr7(%r1),%r7
        ldw     R_gr7(%r1),%r7
;       ldw     R_gr8(%r1),%r8         don't smash the exception index
;       ldw     R_gr8(%r1),%r8         don't smash the exception index
        ldw     R_gr9(%r1),%r9
        ldw     R_gr9(%r1),%r9
        ldw     R_gr10(%r1),%r10
        ldw     R_gr10(%r1),%r10
        ldw     R_gr11(%r1),%r11
        ldw     R_gr11(%r1),%r11
        ldw     R_gr12(%r1),%r12
        ldw     R_gr12(%r1),%r12
        ldw     R_gr13(%r1),%r13
        ldw     R_gr13(%r1),%r13
        ldw     R_gr14(%r1),%r14
        ldw     R_gr14(%r1),%r14
        ldw     R_gr15(%r1),%r15
        ldw     R_gr15(%r1),%r15
        ldw     R_gr16(%r1),%r16
        ldw     R_gr16(%r1),%r16
        ldw     R_gr17(%r1),%r17
        ldw     R_gr17(%r1),%r17
        ldw     R_gr18(%r1),%r18
        ldw     R_gr18(%r1),%r18
        ldw     R_gr19(%r1),%r19
        ldw     R_gr19(%r1),%r19
        ldw     R_gr20(%r1),%r20
        ldw     R_gr20(%r1),%r20
        ldw     R_gr21(%r1),%r21
        ldw     R_gr21(%r1),%r21
        ldw     R_gr22(%r1),%r22
        ldw     R_gr22(%r1),%r22
        ldw     R_gr23(%r1),%r23
        ldw     R_gr23(%r1),%r23
        ldw     R_gr24(%r1),%r24
        ldw     R_gr24(%r1),%r24
        ldw     R_gr25(%r1),%r25
        ldw     R_gr25(%r1),%r25
        ldw     R_gr26(%r1),%r26
        ldw     R_gr26(%r1),%r26
        ldw     R_gr27(%r1),%r27
        ldw     R_gr27(%r1),%r27
        ldw     R_gr28(%r1),%r28
        ldw     R_gr28(%r1),%r28
        ldw     R_gr29(%r1),%r29
        ldw     R_gr29(%r1),%r29
        ldw     R_gr30(%r1),%r30
        ldw     R_gr30(%r1),%r30
        ldw     R_gr31(%r1),%r31
        ldw     R_gr31(%r1),%r31
        ldw     R_gr1(%r1),%r1
        ldw     R_gr1(%r1),%r1
        b       STUB_RESTORE
        b       STUB_RESTORE
        copy    %r8,%r1                 ; restore the exception index
        copy    %r8,%r1                 ; restore the exception index
 
 
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
 
 
#define HoldPtr         %r10
#define HoldPtr         %r10
#define SavePtr         %r11
#define SavePtr         %r11
#define StrPtr          %r12
#define StrPtr          %r12
#define Count           %r13
#define Count           %r13
 
 
#define Hold_Hold       0*4      /* First word of hold area */
#define Hold_Hold       0*4      /* First word of hold area */
#define Hold_Save       1*4     /* Second word of hold area */
#define Hold_Save       1*4     /* Second word of hold area */
#define Hold_Str        2*4     /* Third word of hold area */
#define Hold_Str        2*4     /* Third word of hold area */
#define Hold_Count      3*4     /* Fourth word of hold area */
#define Hold_Count      3*4     /* Fourth word of hold area */
#define Hold_rp         4*4     /* Fifth word of hold area */
#define Hold_rp         4*4     /* Fifth word of hold area */
 
 
print_state
print_state
; %dp may be messed up, so do self-relocating to reach Save_area
; %dp may be messed up, so do self-relocating to reach Save_area
        blr     %r0,%mrp
        blr     %r0,%mrp
        addil   L%Hold_area-pr_st_0,%mrp
        addil   L%Hold_area-pr_st_0,%mrp
 
 
pr_st_0
pr_st_0
        ldo     R%Hold_area-pr_st_0(%r1),%r1    ; r1 points to Hold_area
        ldo     R%Hold_area-pr_st_0(%r1),%r1    ; r1 points to Hold_area
 
 
; save working registers
; save working registers
 
 
        stw     HoldPtr,Hold_Hold(%r1)
        stw     HoldPtr,Hold_Hold(%r1)
        copy    %r1,HoldPtr                     ; HoldPtr = &Hold_area
        copy    %r1,HoldPtr                     ; HoldPtr = &Hold_area
        stw     SavePtr,Hold_Save(HoldPtr)
        stw     SavePtr,Hold_Save(HoldPtr)
        ldo     Save_area-Hold_area(HoldPtr),SavePtr    ; SavePtr = &Save_area
        ldo     Save_area-Hold_area(HoldPtr),SavePtr    ; SavePtr = &Save_area
        stw     StrPtr,Hold_Str(HoldPtr)
        stw     StrPtr,Hold_Str(HoldPtr)
        addil   L%PrintLabels-pr_st_0,%mrp
        addil   L%PrintLabels-pr_st_0,%mrp
        stw     Count,Hold_Count(HoldPtr)
        stw     Count,Hold_Count(HoldPtr)
        ldo     R%PrintLabels-pr_st_0(%r1),StrPtr
        ldo     R%PrintLabels-pr_st_0(%r1),StrPtr
        stw     %rp,Hold_rp(HoldPtr)
        stw     %rp,Hold_rp(HoldPtr)
 
 
 
 
#ifdef  PRINT_SPACE
#ifdef  PRINT_SPACE
        ldi     68,Count
        ldi     68,Count
#else
#else
        ldo     R_gr0(SavePtr),SavePtr
        ldo     R_gr0(SavePtr),SavePtr
        ldi     60,Count
        ldi     60,Count
#endif
#endif
 
 
; print register values
; print register values
 
 
print_loop
print_loop
        bl      puts,%rp                ; print label
        bl      puts,%rp                ; print label
        ldo     1(StrPtr),%arg0         ; advance past length byte
        ldo     1(StrPtr),%arg0         ; advance past length byte
        bl      putnum,%rp              ; print register value
        bl      putnum,%rp              ; print register value
        ldwm    4(SavePtr),%arg0
        ldwm    4(SavePtr),%arg0
        ldbs,ma 1(StrPtr),%r1
        ldbs,ma 1(StrPtr),%r1
        addib,> -1,Count,print_loop
        addib,> -1,Count,print_loop
        add     %r1,StrPtr,StrPtr
        add     %r1,StrPtr,StrPtr
 
 
; skip to next line
; skip to next line
        bl      puts,%rp                ; print label
        bl      puts,%rp                ; print label
        ldo     1(StrPtr),%arg0         ; advance past length byte
        ldo     1(StrPtr),%arg0         ; advance past length byte
 
 
; restore working registers
; restore working registers
 
 
        ldw     Hold_rp(HoldPtr),%rp
        ldw     Hold_rp(HoldPtr),%rp
        ldw     Hold_Count(HoldPtr),Count
        ldw     Hold_Count(HoldPtr),Count
        ldw     Hold_Str(HoldPtr),StrPtr
        ldw     Hold_Str(HoldPtr),StrPtr
        ldw     Hold_Save(HoldPtr),SavePtr
        ldw     Hold_Save(HoldPtr),SavePtr
        bv      (%rp)
        bv      (%rp)
        ldw     Hold_Hold(HoldPtr),HoldPtr
        ldw     Hold_Hold(HoldPtr),HoldPtr
 
 
#undef  SavePtr
#undef  SavePtr
#undef  HoldPtr
#undef  HoldPtr
#undef  StrPtr
#undef  StrPtr
#undef  Count
#undef  Count
 
 
#undef  Hold_Save
#undef  Hold_Save
#undef  Hold_Scr
#undef  Hold_Scr
#undef  Hold_Str
#undef  Hold_Str
#undef  Hold_Count
#undef  Hold_Count
#undef  Hold_rp
#undef  Hold_rp
 
 
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
 
 
        .space  $PRIVATE$
        .space  $PRIVATE$
        .subspa $DATA$,align=4,access=0x1f
        .subspa $DATA$,align=4,access=0x1f
 
 
/* Used to save machine registers before printing */
/* Used to save machine registers before printing */
Save_area
Save_area
        .block          R_SIZE          ; Used to store registers
        .block          R_SIZE          ; Used to store registers
 
 
/* Used to hold callee-save registers */
/* Used to hold callee-save registers */
Hold_area
Hold_area
        .block          8*4             ; 8 words to store temp. registers
        .block          8*4             ; 8 words to store temp. registers
 
 
HaltStr
HaltStr
        .stringz        "\r\nHalted\r\n"
        .stringz        "\r\nHalted\r\n"
 
 
RebootStr
RebootStr
        .stringz        "\r\nRebooting . . .\r\n"
        .stringz        "\r\nRebooting . . .\r\n"
 
 
Str01
Str01
        .stringz        "\r\nHPMC\r\n"
        .stringz        "\r\nHPMC\r\n"
 
 
Str02
Str02
        .stringz        "\r\nPower Fail\r\n"
        .stringz        "\r\nPower Fail\r\n"
 
 
Str03
Str03
        .stringz        "\r\nRecovery Counter Trap\r\n"
        .stringz        "\r\nRecovery Counter Trap\r\n"
 
 
Str04
Str04
        .stringz        "\r\nExternal Interrupt\r\n"
        .stringz        "\r\nExternal Interrupt\r\n"
 
 
Str05
Str05
        .stringz        "\r\nLPMC\r\n"
        .stringz        "\r\nLPMC\r\n"
 
 
Str06
Str06
        .stringz        "\r\nITLB Miss\r\n"
        .stringz        "\r\nITLB Miss\r\n"
 
 
Str07
Str07
        .stringz        "\r\nInstruction Memory Protection Trap\r\n"
        .stringz        "\r\nInstruction Memory Protection Trap\r\n"
 
 
Str08
Str08
        .stringz        "\r\nIllegal Instruction\r\n"
        .stringz        "\r\nIllegal Instruction\r\n"
 
 
Str09
Str09
        .stringz        "\r\nBreak Trap\r\n"
        .stringz        "\r\nBreak Trap\r\n"
 
 
Str0a
Str0a
        .stringz        "\r\nPrivileged Operation\r\n"
        .stringz        "\r\nPrivileged Operation\r\n"
 
 
Str0b
Str0b
        .stringz        "\r\nPrivileged Register\r\n"
        .stringz        "\r\nPrivileged Register\r\n"
 
 
Str0c
Str0c
        .stringz        "\r\nOverflow Trap\r\n"
        .stringz        "\r\nOverflow Trap\r\n"
 
 
Str0d
Str0d
        .stringz        "\r\nConditional Trap\r\n"
        .stringz        "\r\nConditional Trap\r\n"
 
 
Str0e
Str0e
        .stringz        "\r\nAssist Exception\r\n"
        .stringz        "\r\nAssist Exception\r\n"
 
 
Str0f
Str0f
        .stringz        "\r\nData TLB Miss\r\n"
        .stringz        "\r\nData TLB Miss\r\n"
 
 
Str10
Str10
        .stringz        "\r\nNon-access ITLB Miss\r\n"
        .stringz        "\r\nNon-access ITLB Miss\r\n"
 
 
Str11
Str11
        .stringz        "\r\nNon-access DTLB Miss\r\n"
        .stringz        "\r\nNon-access DTLB Miss\r\n"
 
 
Str12
Str12
        .stringz        "\r\nData Memory Protection Trap\r\n"
        .stringz        "\r\nData Memory Protection Trap\r\n"
 
 
Str13
Str13
        .stringz        "\r\nData Memory Break\r\n"
        .stringz        "\r\nData Memory Break\r\n"
 
 
Str14
Str14
        .stringz        "\r\nTLB Dirty Bit Trap\r\n"
        .stringz        "\r\nTLB Dirty Bit Trap\r\n"
 
 
Str15
Str15
        .stringz        "\r\nPage Reference Trap\r\n"
        .stringz        "\r\nPage Reference Trap\r\n"
 
 
Str16
Str16
        .stringz        "\r\nAssist Emulation Trap\r\n"
        .stringz        "\r\nAssist Emulation Trap\r\n"
 
 
Str17
Str17
        .stringz        "\r\nHigher-privilege Trap\r\n"
        .stringz        "\r\nHigher-privilege Trap\r\n"
 
 
Str18
Str18
        .stringz        "\r\nLower-privilege Trap\r\n"
        .stringz        "\r\nLower-privilege Trap\r\n"
 
 
Str19
Str19
        .stringz        "\r\nTaken Branch Trap\r\n"
        .stringz        "\r\nTaken Branch Trap\r\n"
 
 
Str20
Str20
        .stringz        "\r\nHere I am!\r\n"
        .stringz        "\r\nHere I am!\r\n"
 
 
PrintLabels
PrintLabels
#ifdef  PRINT_SPACE
#ifdef  PRINT_SPACE
        .byte           10
        .byte           10
        .stringz        "sr 0 = 0x"
        .stringz        "sr 0 = 0x"
        .byte           13
        .byte           13
        .stringz        "sr 1 = 0x"
        .stringz        "sr 1 = 0x"
        .byte           13
        .byte           13
        .stringz        "sr 2 = 0x"
        .stringz        "sr 2 = 0x"
        .byte           13
        .byte           13
        .stringz        "   sr 3 = 0x"
        .stringz        "   sr 3 = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\nsr 4 = 0x"
        .stringz        "\r\nsr 4 = 0x"
        .byte           13
        .byte           13
        .stringz        "   sr 5 = 0x"
        .stringz        "   sr 5 = 0x"
        .byte           13
        .byte           13
        .stringz        "   sr 6 = 0x"
        .stringz        "   sr 6 = 0x"
        .byte           13
        .byte           13
        .stringz        "   sr 7 = 0x"
        .stringz        "   sr 7 = 0x"
        .byte           13
        .byte           13
        .stringz        "\r\n\ngr 0 = 0x"
        .stringz        "\r\n\ngr 0 = 0x"
#else
#else
        .byte           10
        .byte           10
        .stringz        "gr 0 = 0x"
        .stringz        "gr 0 = 0x"
#endif
#endif
 
 
        .byte           13
        .byte           13
        .stringz        "   gr 1 = 0x"
        .stringz        "   gr 1 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr 2 = 0x"
        .stringz        "   gr 2 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr 3 = 0x"
        .stringz        "   gr 3 = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\ngr 4 = 0x"
        .stringz        "\r\ngr 4 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr 5 = 0x"
        .stringz        "   gr 5 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr 6 = 0x"
        .stringz        "   gr 6 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr 7 = 0x"
        .stringz        "   gr 7 = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\ngr 8 = 0x"
        .stringz        "\r\ngr 8 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr 9 = 0x"
        .stringz        "   gr 9 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr10 = 0x"
        .stringz        "   gr10 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr11 = 0x"
        .stringz        "   gr11 = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\ngr12 = 0x"
        .stringz        "\r\ngr12 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr13 = 0x"
        .stringz        "   gr13 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr14 = 0x"
        .stringz        "   gr14 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr15 = 0x"
        .stringz        "   gr15 = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\ngr16 = 0x"
        .stringz        "\r\ngr16 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr17 = 0x"
        .stringz        "   gr17 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr18 = 0x"
        .stringz        "   gr18 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr19 = 0x"
        .stringz        "   gr19 = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\ngr20 = 0x"
        .stringz        "\r\ngr20 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr21 = 0x"
        .stringz        "   gr21 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr22 = 0x"
        .stringz        "   gr22 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr23 = 0x"
        .stringz        "   gr23 = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\ngr24 = 0x"
        .stringz        "\r\ngr24 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr25 = 0x"
        .stringz        "   gr25 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr26 = 0x"
        .stringz        "   gr26 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr27 = 0x"
        .stringz        "   gr27 = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\ngr28 = 0x"
        .stringz        "\r\ngr28 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr29 = 0x"
        .stringz        "   gr29 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr30 = 0x"
        .stringz        "   gr30 = 0x"
        .byte           13
        .byte           13
        .stringz        "   gr31 = 0x"
        .stringz        "   gr31 = 0x"
        .byte           13
        .byte           13
        .stringz        "\r\n\nrctr = 0x"
        .stringz        "\r\n\nrctr = 0x"
        .byte           53
        .byte           53
        .stringz        "                                           cpu0 = 0x"
        .stringz        "                                           cpu0 = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\npid1 = 0x"
        .stringz        "\r\npid1 = 0x"
        .byte           13
        .byte           13
        .stringz        "   pid2 = 0x"
        .stringz        "   pid2 = 0x"
        .byte           13
        .byte           13
        .stringz        "    ccr = 0x"
        .stringz        "    ccr = 0x"
        .byte           13
        .byte           13
        .stringz        "    sar = 0x"
        .stringz        "    sar = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\npid3 = 0x"
        .stringz        "\r\npid3 = 0x"
        .byte           13
        .byte           13
        .stringz        "   pid4 = 0x"
        .stringz        "   pid4 = 0x"
        .byte           13
        .byte           13
        .stringz        "    iva = 0x"
        .stringz        "    iva = 0x"
        .byte           13
        .byte           13
        .stringz        "   eiem = 0x"
        .stringz        "   eiem = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\nitmr = 0x"
        .stringz        "\r\nitmr = 0x"
        .byte           13
        .byte           13
        .stringz        "   iasq = 0x"
        .stringz        "   iasq = 0x"
        .byte           13
        .byte           13
        .stringz        "   iaoq = 0x"
        .stringz        "   iaoq = 0x"
        .byte           13
        .byte           13
        .stringz        "    iir = 0x"
        .stringz        "    iir = 0x"
        .byte           32
        .byte           32
        .stringz        "\r\n                    iasq = 0x"
        .stringz        "\r\n                    iasq = 0x"
        .byte           13
        .byte           13
        .stringz        "   iaoq = 0x"
        .stringz        "   iaoq = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\n isr = 0x"
        .stringz        "\r\n isr = 0x"
        .byte           13
        .byte           13
        .stringz        "    ior = 0x"
        .stringz        "    ior = 0x"
        .byte           13
        .byte           13
        .stringz        "   ipsw = 0x"
        .stringz        "   ipsw = 0x"
        .byte           13
        .byte           13
        .stringz        "   eirr = 0x"
        .stringz        "   eirr = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\ncr24 = 0x"
        .stringz        "\r\ncr24 = 0x"
        .byte           13
        .byte           13
        .stringz        "   cr25 = 0x"
        .stringz        "   cr25 = 0x"
        .byte           13
        .byte           13
        .stringz        "   cr26 = 0x"
        .stringz        "   cr26 = 0x"
        .byte           13
        .byte           13
        .stringz        "   cr27 = 0x"
        .stringz        "   cr27 = 0x"
        .byte           12
        .byte           12
        .stringz        "\r\ncr28 = 0x"
        .stringz        "\r\ncr28 = 0x"
        .byte           13
        .byte           13
        .stringz        "   cr29 = 0x"
        .stringz        "   cr29 = 0x"
        .byte           13
        .byte           13
        .stringz        "   cr30 = 0x"
        .stringz        "   cr30 = 0x"
        .byte           13
        .byte           13
        .stringz        "   cr31 = 0x"
        .stringz        "   cr31 = 0x"
        .byte           4
        .byte           4
        .stringz        "\r\n\n"
        .stringz        "\r\n\n"
 
 
        .end
        .end
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.