File: exc024.e

package info (click to toggle)
alliance 5.0-20120515-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 70,180 kB
  • sloc: ansic: 350,295; vhdl: 34,227; yacc: 27,122; sh: 12,416; cpp: 9,478; makefile: 7,055; lex: 3,684
file content (53 lines) | stat: -rw-r--r-- 1,428 bytes parent folder | download | duplicates (4)
1
2
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
47
48
49
50
51
52
53
;  ###----------------------------------------------------------------###
;  # file	: exc024.s						#
;  # date	: Mar 26 1996						#
;  # descr.	: functional test for mips				#
;  ###----------------------------------------------------------------###

	;  ###--------------------------------------------------------###
	;  #   exceptions :						#
	;  #     - instruction bus error  	               		#
	;  ###--------------------------------------------------------###

xcode_mask	.equ	0x3C			; exc mask
xcode_ibe	.equ    0x18    		; instruction bus error

		.org	0x80000080
		.start	it_handler

	;  ###--------------------------------------------------------###
	;  #   interrupt and exception handler				#
	;  ###--------------------------------------------------------###

it_handler:

		sw	r29, 0 (r30)
		sw	r28, 4 (r30)

		mfc0	r29,cause 
		nop
		addiu	r28,r0,xcode_mask
		and	r29, r29, r28		; instruction bus error ?
                addiu   r27,r0,xcode_ibe
		bne	r29,r27, other_causes
		nop

		lw	r29, 0 (r30)
		lw	r28, 4 (r30)

restore_return_adr:
		j	return
		nop

other_causes:	j	other_causes
		nop

	;  ###--------------------------------------------------------###
	;  #   return to the interrupted program			#
	;  ###--------------------------------------------------------###
                .org    0x800000d0
return:
		rfe
                jr      r31

		.end