File: mftlo_00.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 (67 lines) | stat: -rw-r--r-- 1,664 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67

;  ###----------------------------------------------------------------###
;  # file	: mftlo_00.s						#
;  # date	: Mar 26 1996						#
;  # descr.	: functional test for mips				#
;  ###----------------------------------------------------------------###

	;  ###--------------------------------------------------------###
	;  #   exceptions :						#
	;  #     - break                                		#
	;  ###--------------------------------------------------------###

value   	.equ	0x12344444
ill_codop	.equ	0x28
mask		.equ	0x3C

		.org	0x80000080
		.start	it_handler

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

it_handler:

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

		;addiu	r28, r0, mask
		;mfc0	r29, cause
		;nop
		;and	r29, r29, r28
		;addiu	r28, r0, ill_codop
		;bne	r28, r29, not_good

		loadi	r28, value
		mtlo	r28 
		nop
                mflo	r29
		nop
		bne	r28, r29, not_good

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

	;  ###--------------------------------------------------------###
	;  #   restore return address before returning (from EXCEPTION)	#
	;  # to the user program (address must be saved by the user	#
	;  # prior to the EXCEPTION in epc)				#
	;  ###--------------------------------------------------------###

restore_return_adr:
		mfc0    r31, epc
		nop
                addiu    r31, r31, 8
                jr      r31
		rfe

not_good:
		mfc0    r31, epc
		nop
                addiu    r31, r31, 4
                jr      r31
		rfe

		.end