; ###----------------------------------------------------------------### ; # file : exc010.u # ; # date : Mar 26 1996 # ; # descr. : functional test for mips # ; ###----------------------------------------------------------------### ; ###--------------------------------------------------------### ; # exceptions : # ; # - illegal instruction (when executing a mtc0) # ; ###--------------------------------------------------------### new_sr .equ 0x00000000 ; try to set system mode .org 0x00400000 .start init init: loadi r1 , new_sr ; init. r2 with the desired ;+value of sr ; ###--------------------------------------------------------### ; # move r1 into sr. This must generate an exception # ; # (privileged instruction) # ; ###--------------------------------------------------------### loadi r31,back_from_exception mtc0 r1, status ; EXCEPTION (privileged) nop j bad nop back_from_exception: loadi r31,good rfe ; EXCEPTION (privileged) nop j bad nop .org 0x004000d0 good: j good nop bad: j bad nop .end