| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 
 | 
;  ###----------------------------------------------------------------###
;  # file	: exc015.u						#
;  # date	: Mar 26 1996						#
;  # descr.	: functional test for mips				#
;  ###----------------------------------------------------------------###
	;  ###--------------------------------------------------------###
	;  #   exceptions :						#
	;  #     - overflow (when adding positive numbers)		#
	;  ###--------------------------------------------------------###
data		.equ	0x7FFFFFFF; a big positive data
imd_data	.equ	0x6234
		.org	0x00400000
		.start	init
init:
		loadi	r10, data		; big positive data in r10
		loadi	r11, data		; same data in r11
	;  ###--------------------------------------------------------###
	;  #   addition generating an overflow				#
	;  ###--------------------------------------------------------###
		addi	r10, r10, imd_data	; EXCEPTION (overflow)
	;  ###--------------------------------------------------------###
	;  #   after returning from exception check that r10 has not	#
	;  # been altered						#
	;  ###--------------------------------------------------------###
back_from_exception:
	        beq	r10, r11, good
		nop
		j	bad
		nop
		.org	0x004000d0
good:		j	good
		nop
bad:		j	bad
		nop
		.end
 |