; ###----------------------------------------------------------------### ; # file : exc011.u # ; # date : Mar 26 1996 # ; # descr. : functional test for mips # ; ###----------------------------------------------------------------### ; ###--------------------------------------------------------### ; # exceptions : # ; # - data address miss alignment (when loading a half-word) # ; ###--------------------------------------------------------### adr .equ 0x40000050 ; miss aligned word address data .equ 0x9043ad6b ; data .org 0x00400000 .start init init: loadi r31, back_from_exception loadi r1 , adr ; half word's address loadi r2 , data ; init. r2 with a data loadi r3 , data ; init. r3 with the same value ; ###--------------------------------------------------------### ; # load a half-word at a miss aligned address (data address # ; # alignment exception) # ; ###--------------------------------------------------------### lh r2 , 1 (r1 ) ; EXCEPTION (alignement) ; ###--------------------------------------------------------### ; # check that the load has faild and the content of the # ; # register has not been altered # ; ###--------------------------------------------------------### back_from_exception: ; check that the lh has failed beq r2 ,r3, good ; jump to good if OK nop j bad nop .org 0x004000d0 good: j good nop bad: j bad nop .end