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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [hwtests/] [xcptest/] [start.s] - Diff between revs 14 and 80

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

Rev 14 Rev 80
;
;
; start.s -- startup and support routines
; start.s -- startup and support routines
;
;
 
 
        .set    dmapaddr,0xC0000000     ; base of directly mapped addresses
        .set    dmapaddr,0xC0000000     ; base of directly mapped addresses
        .set    stacktop,0xC0400000     ; monitor stack is at top of memory
        .set    stacktop,0xC0400000     ; monitor stack is at top of memory
 
 
        .set    PSW,0                    ; reg # of PSW
        .set    PSW,0                    ; reg # of PSW
        .set    TLB_INDEX,1             ; reg # of TLB Index
        .set    TLB_INDEX,1             ; reg # of TLB Index
        .set    TLB_ENTRY_HI,2          ; reg # of TLB EntryHi
        .set    TLB_ENTRY_HI,2          ; reg # of TLB EntryHi
        .set    TLB_ENTRY_LO,3          ; reg # of TLB EntryLo
        .set    TLB_ENTRY_LO,3          ; reg # of TLB EntryLo
        .set    TLB_ENTRIES,32          ; number of TLB entries
        .set    TLB_ENTRIES,32          ; number of TLB entries
 
        .set    BAD_ADDRESS,4           ; reg # of bad address reg
 
 
;***************************************************************
;***************************************************************
 
 
        .import _ecode
        .import _ecode
        .import _edata
        .import _edata
        .import _ebss
        .import _ebss
 
 
        .import serinit
        .import serinit
        .import ser0in
        .import ser0in
        .import ser0out
        .import ser0out
 
 
        .import main
        .import main
        .import userMissTaken
        .import userMissTaken
 
 
        .export _bcode
        .export _bcode
        .export _bdata
        .export _bdata
        .export _bbss
        .export _bbss
 
 
        .export cin
        .export cin
        .export cout
        .export cout
 
 
        .export xtest1
        .export xtest1
        .export xtest1x
        .export xtest1x
        .export xtest2
        .export xtest2
        .export xtest2x
        .export xtest2x
        .export xtest3
        .export xtest3
        .export xtest3x
        .export xtest3x
        .export xtest4
        .export xtest4
        .export xtest4x
        .export xtest4x
        .export xtest5
        .export xtest5
        .export xtest5x
        .export xtest5x
        .export xtest6
        .export xtest6
        .export xtest6x
        .export xtest6x
        .export xtest7
        .export xtest7
        .export xtest7x
        .export xtest7x
        .export xtest8
        .export xtest8
        .export xtest8x
        .export xtest8x
        .export xtest9
        .export xtest9
        .export xtest9x
        .export xtest9x
        .export xtest10
        .export xtest10
        .export xtest10x
        .export xtest10x
        .export xtest11
        .export xtest11
        .export xtest11x
        .export xtest11x
        .export xtest12
        .export xtest12
        .export xtest12x
        .export xtest12x
        .export xtest13
        .export xtest13
        .export xtest13x
        .export xtest13x
        .export xtest14
        .export xtest14
        .export xtest14x
        .export xtest14x
        .export xtest15
        .export xtest15
        .export xtest15x
        .export xtest15x
        .export xtest16
        .export xtest16
        .export xtest16x
        .export xtest16x
        .export xtest17
        .export xtest17
        .export xtest17x
        .export xtest17x
        .export xtest18
        .export xtest18
        .export xtest18x
        .export xtest18x
        .export xtest19
        .export xtest19
        .export xtest19x
        .export xtest19x
        .export xtest20
        .export xtest20
        .export xtest20x
        .export xtest20x
        .export xtest21
        .export xtest21
        .export xtest21x
        .export xtest21x
        .export xtest22
        .export xtest22
        .export xtest22x
        .export xtest22x
        .export xtest23
        .export xtest23
        .export xtest23x
        .export xtest23x
        .export xtest24
        .export xtest24
        .export xtest24x
        .export xtest24x
        .export xtest25
        .export xtest25
        .export xtest25x
        .export xtest25x
        .export xtest26
        .export xtest26
        .export xtest26x
        .export xtest26x
        .export xtest27
        .export xtest27
        .export xtest27x
        .export xtest27x
        .export xtest28
        .export xtest28
        .export xtest28x
        .export xtest28x
        .export xtest29
        .export xtest29
        .export xtest29x
        .export xtest29x
        .export xtest30
        .export xtest30
        .export xtest30x
        .export xtest30x
        .export xtest31
        .export xtest31
        .export xtest31x
        .export xtest31x
        .export xtest32
        .export xtest32
        .export xtest32x
        .export xtest32x
        .export xtest33
        .export xtest33
        .export xtest33x
        .export xtest33x
        .export xtest34
        .export xtest34
        .export xtest34x
        .export xtest34x
        .export xtest35
        .export xtest35
        .export xtest35x
        .export xtest35x
        .export xtest36
        .export xtest36
        .export xtest36x
        .export xtest36x
        .export xtest37
        .export xtest37
        .export xtest37x
        .export xtest37x
 
 
        .export getTLB_HI
        .export getTLB_HI
        .export getTLB_LO
        .export getTLB_LO
        .export setTLB
        .export setTLB
 
 
;***************************************************************
;***************************************************************
 
 
        .code
        .code
_bcode:
_bcode:
 
 
        .data
        .data
_bdata:
_bdata:
 
 
        .bss
        .bss
_bbss:
_bbss:
 
 
;***************************************************************
;***************************************************************
 
 
        .code
        .code
        .align  4
        .align  4
 
 
reset:
reset:
        j       start
        j       start
 
 
interrupt:
interrupt:
        j       isr
        j       isr
 
 
userMiss:
userMiss:
        j       umsr
        j       umsr
 
 
;***************************************************************
;***************************************************************
 
 
        .code
        .code
        .align  4
        .align  4
 
 
cin:
cin:
        j       ser0in
        j       ser0in
 
 
cout:
cout:
        j       ser0out
        j       ser0out
 
 
;***************************************************************
;***************************************************************
 
 
        .code
        .code
        .align  4
        .align  4
 
 
start:
start:
        ; force CPU into a defined state
        ; force CPU into a defined state
        mvts    $0,PSW                   ; disable interrupts and user mode
        mvts    $0,PSW                   ; disable interrupts and user mode
 
 
        ; initialize TLB
        ; initialize TLB
        mvts    $0,TLB_ENTRY_LO          ; invalidate all TLB entries
        mvts    $0,TLB_ENTRY_LO          ; invalidate all TLB entries
        add     $8,$0,dmapaddr           ; by impossible virtual page number
        add     $8,$0,dmapaddr           ; by impossible virtual page number
        add     $9,$0,$0
        add     $9,$0,$0
        add     $10,$0,TLB_ENTRIES
        add     $10,$0,TLB_ENTRIES
tlbloop:
tlbloop:
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        mvts    $9,TLB_INDEX
        mvts    $9,TLB_INDEX
        tbwi
        tbwi
        add     $8,$8,0x1000            ; all entries must be different
        add     $8,$8,0x1000            ; all entries must be different
        add     $9,$9,1
        add     $9,$9,1
        bne     $9,$10,tlbloop
        bne     $9,$10,tlbloop
 
 
        ; copy data segment
        ; copy data segment
        add     $10,$0,_bdata            ; lowest dst addr to be written to
        add     $10,$0,_bdata            ; lowest dst addr to be written to
        add     $8,$0,_edata             ; one above the top dst addr
        add     $8,$0,_edata             ; one above the top dst addr
        sub     $9,$8,$10               ; $9 = size of data segment
        sub     $9,$8,$10               ; $9 = size of data segment
        add     $9,$9,_ecode            ; data is waiting right after code
        add     $9,$9,_ecode            ; data is waiting right after code
        j       cpytest
        j       cpytest
cpyloop:
cpyloop:
        ldw     $11,$9,0         ; src addr in $9
        ldw     $11,$9,0         ; src addr in $9
        stw     $11,$8,0         ; dst addr in $8
        stw     $11,$8,0         ; dst addr in $8
cpytest:
cpytest:
        sub     $8,$8,4                 ; downward
        sub     $8,$8,4                 ; downward
        sub     $9,$9,4
        sub     $9,$9,4
        bgeu    $8,$10,cpyloop
        bgeu    $8,$10,cpyloop
 
 
        ; clear bss segment
        ; clear bss segment
        add     $8,$0,_bbss              ; start with first word of bss
        add     $8,$0,_bbss              ; start with first word of bss
        add     $9,$0,_ebss              ; this is one above the top
        add     $9,$0,_ebss              ; this is one above the top
        j       clrtest
        j       clrtest
clrloop:
clrloop:
        stw     $0,$8,0                   ; dst addr in $8
        stw     $0,$8,0                   ; dst addr in $8
        add     $8,$8,4                 ; upward
        add     $8,$8,4                 ; upward
clrtest:
clrtest:
        bltu    $8,$9,clrloop
        bltu    $8,$9,clrloop
 
 
        ; now do some useful work
        ; now do some useful work
        add     $29,$0,stacktop          ; setup monitor stack
        add     $29,$0,stacktop          ; setup monitor stack
        jal     serinit                 ; init serial interface
        jal     serinit                 ; init serial interface
        jal     main                    ; enter command loop
        jal     main                    ; enter command loop
 
 
        ; main should never return
        ; main should never return
        j       start                   ; just to be sure...
        j       start                   ; just to be sure...
 
 
;***************************************************************
;***************************************************************
 
 
xtest1:
xtest1:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest1x:
xtest1x:
        trap
        trap
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest2:
xtest2:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest2x:
xtest2x:
        .word   0x1E << 26
        .word   0x1E << 26
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest3:
xtest3:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest3x:
xtest3x:
        div     $5,$7,$0
        div     $5,$7,$0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest4:
xtest4:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest4x:
xtest4x:
        div     $5,$7,0
        div     $5,$7,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest5:
xtest5:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest5x:
xtest5x:
        divu    $5,$7,$0
        divu    $5,$7,$0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest6:
xtest6:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest6x:
xtest6x:
        divu    $5,$7,0
        divu    $5,$7,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest7:
xtest7:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest7x:
xtest7x:
        rem     $5,$7,$0
        rem     $5,$7,$0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest8:
xtest8:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest8x:
xtest8x:
        rem     $5,$7,0
        rem     $5,$7,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest9:
xtest9:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest9x:
xtest9x:
        remu    $5,$7,$0
        remu    $5,$7,$0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest10:
xtest10:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest10x:
xtest10x:
        remu    $5,$7,0
        remu    $5,$7,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest11:
xtest11:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
;xtest11x:
;xtest11x:
        .set    xtest11x,0xFFFFFF10
        .set    xtest11x,0xFFFFFF10
        jr      $15
        jr      $15
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest12:
xtest12:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest12x:
xtest12x:
        ldw     $5,$15,0
        ldw     $5,$15,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest13:
xtest13:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest13x:
xtest13x:
        stw     $5,$15,0
        stw     $5,$15,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest14:
xtest14:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        add     $16,$0,xtest14v          ; switch to virtual addressing
        add     $16,$0,xtest14v          ; switch to virtual addressing
        add     $8,$0,11
        add     $8,$0,11
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        and     $8,$16,0x3FFFF000
        and     $8,$16,0x3FFFF000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        and     $8,$16,0x3FFFF000
        and     $8,$16,0x3FFFF000
        or      $8,$8,3
        or      $8,$8,3
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
        add     $8,$8,1
        add     $8,$8,1
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        mvfs    $8,TLB_ENTRY_HI
        mvfs    $8,TLB_ENTRY_HI
        add     $8,$8,0x1000
        add     $8,$8,0x1000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        mvfs    $8,TLB_ENTRY_LO
        mvfs    $8,TLB_ENTRY_LO
        add     $8,$8,0x1000
        add     $8,$8,0x1000
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        and     $16,$16,0x3FFFFFFF
        and     $16,$16,0x3FFFFFFF
        jr      $16
        jr      $16
xtest14v:
xtest14v:
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest14x:
xtest14x:
        rfx
        rfx
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest15:
xtest15:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        add     $16,$0,xtest15v          ; switch to virtual addressing
        add     $16,$0,xtest15v          ; switch to virtual addressing
        add     $8,$0,11
        add     $8,$0,11
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        and     $8,$16,0x3FFFF000
        and     $8,$16,0x3FFFF000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        and     $8,$16,0x3FFFF000
        and     $8,$16,0x3FFFF000
        or      $8,$8,3
        or      $8,$8,3
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
        add     $8,$8,1
        add     $8,$8,1
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        mvfs    $8,TLB_ENTRY_HI
        mvfs    $8,TLB_ENTRY_HI
        add     $8,$8,0x1000
        add     $8,$8,0x1000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        mvfs    $8,TLB_ENTRY_LO
        mvfs    $8,TLB_ENTRY_LO
        add     $8,$8,0x1000
        add     $8,$8,0x1000
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        and     $16,$16,0x3FFFFFFF
        and     $16,$16,0x3FFFFFFF
        jr      $16
        jr      $16
xtest15v:
xtest15v:
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest15x:
xtest15x:
        mvts    $0,PSW
        mvts    $0,PSW
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest16:
xtest16:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        add     $16,$0,xtest16v          ; switch to virtual addressing
        add     $16,$0,xtest16v          ; switch to virtual addressing
        add     $8,$0,11
        add     $8,$0,11
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        and     $8,$16,0x3FFFF000
        and     $8,$16,0x3FFFF000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        and     $8,$16,0x3FFFF000
        and     $8,$16,0x3FFFF000
        or      $8,$8,3
        or      $8,$8,3
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
        add     $8,$8,1
        add     $8,$8,1
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        mvfs    $8,TLB_ENTRY_HI
        mvfs    $8,TLB_ENTRY_HI
        add     $8,$8,0x1000
        add     $8,$8,0x1000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        mvfs    $8,TLB_ENTRY_LO
        mvfs    $8,TLB_ENTRY_LO
        add     $8,$8,0x1000
        add     $8,$8,0x1000
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        and     $16,$16,0x3FFFFFFF
        and     $16,$16,0x3FFFFFFF
        jr      $16
        jr      $16
xtest16v:
xtest16v:
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest16x:
xtest16x:
        tbs
        tbs
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest17:
xtest17:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        add     $16,$0,xtest17v          ; switch to virtual addressing
        add     $16,$0,xtest17v          ; switch to virtual addressing
        add     $8,$0,11
        add     $8,$0,11
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        and     $8,$16,0x3FFFF000
        and     $8,$16,0x3FFFF000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        and     $8,$16,0x3FFFF000
        and     $8,$16,0x3FFFF000
        or      $8,$8,3
        or      $8,$8,3
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
        add     $8,$8,1
        add     $8,$8,1
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        mvfs    $8,TLB_ENTRY_HI
        mvfs    $8,TLB_ENTRY_HI
        add     $8,$8,0x1000
        add     $8,$8,0x1000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        mvfs    $8,TLB_ENTRY_LO
        mvfs    $8,TLB_ENTRY_LO
        add     $8,$8,0x1000
        add     $8,$8,0x1000
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        and     $16,$16,0x3FFFFFFF
        and     $16,$16,0x3FFFFFFF
        jr      $16
        jr      $16
xtest17v:
xtest17v:
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
;xtest17x:
;xtest17x:
        .set    xtest17x,0xFFFFFF10
        .set    xtest17x,0xFFFFFF10
        jr      $15
        jr      $15
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest18:
xtest18:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        add     $16,$0,xtest18v          ; switch to virtual addressing
        add     $16,$0,xtest18v          ; switch to virtual addressing
        add     $8,$0,11
        add     $8,$0,11
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        and     $8,$16,0x3FFFF000
        and     $8,$16,0x3FFFF000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        and     $8,$16,0x3FFFF000
        and     $8,$16,0x3FFFF000
        or      $8,$8,3
        or      $8,$8,3
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
        add     $8,$8,1
        add     $8,$8,1
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        mvfs    $8,TLB_ENTRY_HI
        mvfs    $8,TLB_ENTRY_HI
        add     $8,$8,0x1000
        add     $8,$8,0x1000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        mvfs    $8,TLB_ENTRY_LO
        mvfs    $8,TLB_ENTRY_LO
        add     $8,$8,0x1000
        add     $8,$8,0x1000
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        and     $16,$16,0x3FFFFFFF
        and     $16,$16,0x3FFFFFFF
        jr      $16
        jr      $16
xtest18v:
xtest18v:
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest18x:
xtest18x:
        ldw     $5,$15,0
        ldw     $5,$15,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest19:
xtest19:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        add     $16,$0,xtest19v          ; switch to virtual addressing
        add     $16,$0,xtest19v          ; switch to virtual addressing
        add     $8,$0,11
        add     $8,$0,11
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        and     $8,$16,0x3FFFF000
        and     $8,$16,0x3FFFF000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        and     $8,$16,0x3FFFF000
        and     $8,$16,0x3FFFF000
        or      $8,$8,3
        or      $8,$8,3
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
        add     $8,$8,1
        add     $8,$8,1
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        mvfs    $8,TLB_ENTRY_HI
        mvfs    $8,TLB_ENTRY_HI
        add     $8,$8,0x1000
        add     $8,$8,0x1000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        mvfs    $8,TLB_ENTRY_LO
        mvfs    $8,TLB_ENTRY_LO
        add     $8,$8,0x1000
        add     $8,$8,0x1000
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        and     $16,$16,0x3FFFFFFF
        and     $16,$16,0x3FFFFFFF
        jr      $16
        jr      $16
xtest19v:
xtest19v:
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest19x:
xtest19x:
        stw     $5,$15,0
        stw     $5,$15,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest20:
xtest20:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
;xtest20x:
;xtest20x:
        .set    xtest20x,0x11111122
        .set    xtest20x,0x11111122
        jr      $17
        jr      $17
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest21:
xtest21:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
;xtest21x:
;xtest21x:
        .set    xtest21x,0x00000021
        .set    xtest21x,0x00000021
        jr      $16
        jr      $16
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest22:
xtest22:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest22x:
xtest22x:
        ldw     $5,$15,2
        ldw     $5,$15,2
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest23:
xtest23:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest23x:
xtest23x:
        ldw     $5,$15,1
        ldw     $5,$15,1
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest24:
xtest24:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest24x:
xtest24x:
        ldh     $5,$15,1
        ldh     $5,$15,1
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest25:
xtest25:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest25x:
xtest25x:
        stw     $5,$15,2
        stw     $5,$15,2
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest26:
xtest26:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest26x:
xtest26x:
        stw     $5,$15,1
        stw     $5,$15,1
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest27:
xtest27:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest27x:
xtest27x:
        sth     $5,$15,1
        sth     $5,$15,1
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest28:
xtest28:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
;xtest28x:
;xtest28x:
        .set    xtest28x,0x33333314
        .set    xtest28x,0x33333314
        jr      $3
        jr      $3
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest29:
xtest29:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest29x:
xtest29x:
        ldw     $5,$3,0
        ldw     $5,$3,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest30:
xtest30:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest30x:
xtest30x:
        stw     $5,$3,0
        stw     $5,$3,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest31:
xtest31:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
;xtest31x:
;xtest31x:
        .set    xtest31x,0xBBBBBB1C
        .set    xtest31x,0xBBBBBB1C
        jr      $11
        jr      $11
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest32:
xtest32:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest32x:
xtest32x:
        ldw     $5,$11,0
        ldw     $5,$11,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest33:
xtest33:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest33x:
xtest33x:
        stw     $5,$11,0
        stw     $5,$11,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest34:
xtest34:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        add     $8,$0,11         ; construct TLB entry
        add     $8,$0,11         ; construct TLB entry
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        add     $8,$0,0xBBBBBB1C
        add     $8,$0,0xBBBBBB1C
        and     $8,$8,0xFFFFF000
        and     $8,$8,0xFFFFF000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        add     $8,$0,0
        add     $8,$0,0
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
;xtest34x:
;xtest34x:
        .set    xtest34x,0xBBBBBB1C
        .set    xtest34x,0xBBBBBB1C
        jr      $11
        jr      $11
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest35:
xtest35:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        add     $8,$0,11         ; construct TLB entry
        add     $8,$0,11         ; construct TLB entry
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        add     $8,$0,0xBBBBBB1C
        add     $8,$0,0xBBBBBB1C
        and     $8,$8,0xFFFFF000
        and     $8,$8,0xFFFFF000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        add     $8,$0,0
        add     $8,$0,0
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest35x:
xtest35x:
        ldw     $5,$11,0
        ldw     $5,$11,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest36:
xtest36:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        add     $8,$0,11         ; construct TLB entry
        add     $8,$0,11         ; construct TLB entry
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        add     $8,$0,0xBBBBBB1C
        add     $8,$0,0xBBBBBB1C
        and     $8,$8,0xFFFFF000
        and     $8,$8,0xFFFFF000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        add     $8,$0,0
        add     $8,$0,0
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest36x:
xtest36x:
        stw     $5,$11,0
        stw     $5,$11,0
        j       halt
        j       halt
        .syn
        .syn
 
 
xtest37:
xtest37:
        mvts    $0,PSW
        mvts    $0,PSW
        add     $8,$0,returnState
        add     $8,$0,returnState
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $4,$8,0*4                ; pointer to interrupt context
        stw     $31,$8,1*4              ; return address
        stw     $31,$8,1*4              ; return address
        stw     $29,$8,2*4              ; stack pointer
        stw     $29,$8,2*4              ; stack pointer
        stw     $16,$8,3*4              ; local variables
        stw     $16,$8,3*4              ; local variables
        stw     $17,$8,4*4
        stw     $17,$8,4*4
        stw     $18,$8,5*4
        stw     $18,$8,5*4
        stw     $19,$8,6*4
        stw     $19,$8,6*4
        stw     $20,$8,7*4
        stw     $20,$8,7*4
        stw     $21,$8,8*4
        stw     $21,$8,8*4
        stw     $22,$8,9*4
        stw     $22,$8,9*4
        stw     $23,$8,10*4
        stw     $23,$8,10*4
        add     $8,$0,11         ; construct TLB entry
        add     $8,$0,11         ; construct TLB entry
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        add     $8,$0,0xBBBBBB1C
        add     $8,$0,0xBBBBBB1C
        and     $8,$8,0xFFFFF000
        and     $8,$8,0xFFFFF000
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        add     $8,$0,1
        add     $8,$0,1
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
        tbwi
        tbwi
        .nosyn
        .nosyn
        add     $28,$4,$0
        add     $28,$4,$0
        ldw     $8,$28,33*4             ; tlbIndex
        ldw     $8,$28,33*4             ; tlbIndex
        mvts    $8,TLB_INDEX
        mvts    $8,TLB_INDEX
        ldw     $8,$28,34*4             ; tlbWntryHi
        ldw     $8,$28,34*4             ; tlbWntryHi
        mvts    $8,TLB_ENTRY_HI
        mvts    $8,TLB_ENTRY_HI
        ldw     $8,$28,35*4             ; tlbEntryLo
        ldw     $8,$28,35*4             ; tlbEntryLo
        mvts    $8,TLB_ENTRY_LO
        mvts    $8,TLB_ENTRY_LO
 
        ldw     $8,$28,36*4             ; badAddress
 
        mvts    $8,BAD_ADDRESS
        ;ldw    $0,$28,0*4              ; registers
        ;ldw    $0,$28,0*4              ; registers
        ldw     $1,$28,1*4
        ldw     $1,$28,1*4
        ldw     $2,$28,2*4
        ldw     $2,$28,2*4
        ldw     $3,$28,3*4
        ldw     $3,$28,3*4
        ldw     $4,$28,4*4
        ldw     $4,$28,4*4
        ldw     $5,$28,5*4
        ldw     $5,$28,5*4
        ldw     $6,$28,6*4
        ldw     $6,$28,6*4
        ldw     $7,$28,7*4
        ldw     $7,$28,7*4
        ldw     $8,$28,8*4
        ldw     $8,$28,8*4
        ldw     $9,$28,9*4
        ldw     $9,$28,9*4
        ldw     $10,$28,10*4
        ldw     $10,$28,10*4
        ldw     $11,$28,11*4
        ldw     $11,$28,11*4
        ldw     $12,$28,12*4
        ldw     $12,$28,12*4
        ldw     $13,$28,13*4
        ldw     $13,$28,13*4
        ldw     $14,$28,14*4
        ldw     $14,$28,14*4
        ldw     $15,$28,15*4
        ldw     $15,$28,15*4
        ldw     $16,$28,16*4
        ldw     $16,$28,16*4
        ldw     $17,$28,17*4
        ldw     $17,$28,17*4
        ldw     $18,$28,18*4
        ldw     $18,$28,18*4
        ldw     $19,$28,19*4
        ldw     $19,$28,19*4
        ldw     $20,$28,20*4
        ldw     $20,$28,20*4
        ldw     $21,$28,21*4
        ldw     $21,$28,21*4
        ldw     $22,$28,22*4
        ldw     $22,$28,22*4
        ldw     $23,$28,23*4
        ldw     $23,$28,23*4
        ldw     $24,$28,24*4
        ldw     $24,$28,24*4
        ldw     $25,$28,25*4
        ldw     $25,$28,25*4
        ldw     $26,$28,26*4
        ldw     $26,$28,26*4
        ldw     $27,$28,27*4
        ldw     $27,$28,27*4
        ;ldw    $28,$28,28*4
        ;ldw    $28,$28,28*4
        ldw     $29,$28,29*4
        ldw     $29,$28,29*4
        ldw     $30,$28,30*4
        ldw     $30,$28,30*4
        ldw     $31,$28,31*4
        ldw     $31,$28,31*4
        ldw     $28,$28,32*4            ; psw
        ldw     $28,$28,32*4            ; psw
        mvts    $28,PSW
        mvts    $28,PSW
xtest37x:
xtest37x:
        stw     $5,$11,0
        stw     $5,$11,0
        j       halt
        j       halt
        .syn
        .syn
 
 
        ; last resort if the exception did not trigger
        ; last resort if the exception did not trigger
halt:
halt:
        j       halt
        j       halt
 
 
;***************************************************************
;***************************************************************
 
 
        ; Word getTLB_HI(int index)
        ; Word getTLB_HI(int index)
getTLB_HI:
getTLB_HI:
        mvts    $4,TLB_INDEX
        mvts    $4,TLB_INDEX
        tbri
        tbri
        mvfs    $2,TLB_ENTRY_HI
        mvfs    $2,TLB_ENTRY_HI
        jr      $31
        jr      $31
 
 
        ; Word getTLB_LO(int index)
        ; Word getTLB_LO(int index)
getTLB_LO:
getTLB_LO:
        mvts    $4,TLB_INDEX
        mvts    $4,TLB_INDEX
        tbri
        tbri
        mvfs    $2,TLB_ENTRY_LO
        mvfs    $2,TLB_ENTRY_LO
        jr      $31
        jr      $31
 
 
        ; void setTLB(int index, Word entryHi, Word entryLo)
        ; void setTLB(int index, Word entryHi, Word entryLo)
setTLB:
setTLB:
        mvts    $4,TLB_INDEX
        mvts    $4,TLB_INDEX
        mvts    $5,TLB_ENTRY_HI
        mvts    $5,TLB_ENTRY_HI
        mvts    $6,TLB_ENTRY_LO
        mvts    $6,TLB_ENTRY_LO
        tbwi
        tbwi
        jr      $31
        jr      $31
 
 
;***************************************************************
;***************************************************************
 
 
        ; general interrupt entry
        ; general interrupt entry
isr:
isr:
        .nosyn
        .nosyn
        ldhi    $28,userMissTaken       ; remember entry point
        ldhi    $28,userMissTaken       ; remember entry point
        or      $28,$28,userMissTaken
        or      $28,$28,userMissTaken
        stw     $0,$28,0
        stw     $0,$28,0
        j       common
        j       common
 
 
        ; TLB user miss entry
        ; TLB user miss entry
umsr:
umsr:
        .nosyn
        .nosyn
        ldhi    $28,userMissTaken       ; remember entry point
        ldhi    $28,userMissTaken       ; remember entry point
        or      $28,$28,userMissTaken
        or      $28,$28,userMissTaken
        stw     $28,$28,0
        stw     $28,$28,0
        j       common
        j       common
 
 
common:
common:
        ldhi    $28,returnState
        ldhi    $28,returnState
        or      $28,$28,returnState
        or      $28,$28,returnState
        ldw     $28,$28,0                ; pointer to interrupt context
        ldw     $28,$28,0                ; pointer to interrupt context
        stw     $0,$28,0*4                ; registers
        stw     $0,$28,0*4                ; registers
        stw     $1,$28,1*4
        stw     $1,$28,1*4
        stw     $2,$28,2*4
        stw     $2,$28,2*4
        stw     $3,$28,3*4
        stw     $3,$28,3*4
        stw     $4,$28,4*4
        stw     $4,$28,4*4
        stw     $5,$28,5*4
        stw     $5,$28,5*4
        stw     $6,$28,6*4
        stw     $6,$28,6*4
        stw     $7,$28,7*4
        stw     $7,$28,7*4
        stw     $8,$28,8*4
        stw     $8,$28,8*4
        stw     $9,$28,9*4
        stw     $9,$28,9*4
        stw     $10,$28,10*4
        stw     $10,$28,10*4
        stw     $11,$28,11*4
        stw     $11,$28,11*4
        stw     $12,$28,12*4
        stw     $12,$28,12*4
        stw     $13,$28,13*4
        stw     $13,$28,13*4
        stw     $14,$28,14*4
        stw     $14,$28,14*4
        stw     $15,$28,15*4
        stw     $15,$28,15*4
        stw     $16,$28,16*4
        stw     $16,$28,16*4
        stw     $17,$28,17*4
        stw     $17,$28,17*4
        stw     $18,$28,18*4
        stw     $18,$28,18*4
        stw     $19,$28,19*4
        stw     $19,$28,19*4
        stw     $20,$28,20*4
        stw     $20,$28,20*4
        stw     $21,$28,21*4
        stw     $21,$28,21*4
        stw     $22,$28,22*4
        stw     $22,$28,22*4
        stw     $23,$28,23*4
        stw     $23,$28,23*4
        stw     $24,$28,24*4
        stw     $24,$28,24*4
        stw     $25,$28,25*4
        stw     $25,$28,25*4
        stw     $26,$28,26*4
        stw     $26,$28,26*4
        stw     $27,$28,27*4
        stw     $27,$28,27*4
        stw     $28,$28,28*4
        stw     $28,$28,28*4
        stw     $29,$28,29*4
        stw     $29,$28,29*4
        stw     $30,$28,30*4
        stw     $30,$28,30*4
        stw     $31,$28,31*4
        stw     $31,$28,31*4
        mvfs    $8,PSW
        mvfs    $8,PSW
        stw     $8,$28,32*4             ; psw
        stw     $8,$28,32*4             ; psw
        mvfs    $8,TLB_INDEX
        mvfs    $8,TLB_INDEX
        stw     $8,$28,33*4             ; tlbIndex
        stw     $8,$28,33*4             ; tlbIndex
        mvfs    $8,TLB_ENTRY_HI
        mvfs    $8,TLB_ENTRY_HI
        stw     $8,$28,34*4             ; tlbEntryHi
        stw     $8,$28,34*4             ; tlbEntryHi
        mvfs    $8,TLB_ENTRY_LO
        mvfs    $8,TLB_ENTRY_LO
        stw     $8,$28,35*4             ; tlbEntryLo
        stw     $8,$28,35*4             ; tlbEntryLo
 
        mvfs    $8,BAD_ADDRESS
 
        stw     $8,$28,36*4             ; badAddress
        .syn
        .syn
        add     $8,$0,returnState
        add     $8,$0,returnState
        ldw     $4,$8,0*4                ; pointer to interrupt context
        ldw     $4,$8,0*4                ; pointer to interrupt context
        ldw     $31,$8,1*4              ; return address
        ldw     $31,$8,1*4              ; return address
        ldw     $29,$8,2*4              ; stack pointer
        ldw     $29,$8,2*4              ; stack pointer
        ldw     $16,$8,3*4              ; local variables
        ldw     $16,$8,3*4              ; local variables
        ldw     $17,$8,4*4
        ldw     $17,$8,4*4
        ldw     $18,$8,5*4
        ldw     $18,$8,5*4
        ldw     $19,$8,6*4
        ldw     $19,$8,6*4
        ldw     $20,$8,7*4
        ldw     $20,$8,7*4
        ldw     $21,$8,8*4
        ldw     $21,$8,8*4
        ldw     $22,$8,9*4
        ldw     $22,$8,9*4
        ldw     $23,$8,10*4
        ldw     $23,$8,10*4
        jr      $31
        jr      $31
 
 
        .bss
        .bss
        .align  4
        .align  4
 
 
        ; monitor state
        ; monitor state
        ; stored when leaving to execute a user program
        ; stored when leaving to execute a user program
        ; loaded when re-entering the monitor
        ; loaded when re-entering the monitor
returnState:
returnState:
        .word   0                ; pointer to interrupt context
        .word   0                ; pointer to interrupt context
        .word   0                ; $31 (return address)
        .word   0                ; $31 (return address)
        .word   0                ; $29 (stack pointer)
        .word   0                ; $29 (stack pointer)
        .word   0                ; $16 (local variable)
        .word   0                ; $16 (local variable)
        .word   0                ; $17 (local variable)
        .word   0                ; $17 (local variable)
        .word   0                ; $18 (local variable)
        .word   0                ; $18 (local variable)
        .word   0                ; $19 (local variable)
        .word   0                ; $19 (local variable)
        .word   0                ; $20 (local variable)
        .word   0                ; $20 (local variable)
        .word   0                ; $21 (local variable)
        .word   0                ; $21 (local variable)
        .word   0                ; $22 (local variable)
        .word   0                ; $22 (local variable)
        .word   0                ; $23 (local variable)
        .word   0                ; $23 (local variable)
 
 

powered by: WebSVN 2.1.0

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