Last change
on this file since 900 was
520,
checked in by bouyer, 11 years ago
|
Re-add the tests; reverting previous which was done at the wrong level (sorry)
|
File size:
959 bytes
|
Line | |
---|
1 | /* |
---|
2 | * reserved instruction exception test: check that a reserved instruction |
---|
3 | * generates an exception. |
---|
4 | */ |
---|
5 | #include <registers.h> |
---|
6 | #include <misc.h> |
---|
7 | |
---|
8 | .text |
---|
9 | .globl _start |
---|
10 | _start: |
---|
11 | .set noreorder |
---|
12 | la k0, TTY_BASE |
---|
13 | la k1, EXIT_BASE |
---|
14 | la sp, 0x00400000 - 16 |
---|
15 | |
---|
16 | PRINT(startstr) |
---|
17 | |
---|
18 | /* reset cop0 status (keep BEV) */ |
---|
19 | lui a0, 0x0040; |
---|
20 | mtc0 a0, COP0_STATUS |
---|
21 | nop |
---|
22 | nop |
---|
23 | nop |
---|
24 | .word 0x60000000 |
---|
25 | EXIT(2) |
---|
26 | |
---|
27 | .globl excep |
---|
28 | excep: |
---|
29 | .set noreorder |
---|
30 | PRINT(statusstr) |
---|
31 | mfc0 a0, COP0_STATUS |
---|
32 | PRINTX |
---|
33 | |
---|
34 | PRINT(causestr) |
---|
35 | mfc0 a0, COP0_CAUSE |
---|
36 | PRINTX |
---|
37 | |
---|
38 | PRINT(pcstr) |
---|
39 | mfc0 a0, COP0_EXPC |
---|
40 | PRINTX |
---|
41 | |
---|
42 | PRINT(badvastr) |
---|
43 | mfc0 a0, COP_0_BADVADDR |
---|
44 | PRINTX |
---|
45 | PUTCHAR('\n') |
---|
46 | #we should end there |
---|
47 | EXIT(0) |
---|
48 | |
---|
49 | .rodata: |
---|
50 | statusstr: .ascii "status \0" |
---|
51 | causestr: .ascii " cause \0" |
---|
52 | pcstr: .ascii " pc \0" |
---|
53 | badvastr: .ascii " badva \0" |
---|
54 | startstr: .ascii "start\n\0" |
---|
55 | usrstr: .ascii "usrmode\n\0" |
---|
56 | |
---|
57 | .org EXCEP_ADDRESS - BOOT_ADDRESS |
---|
58 | .globl evect |
---|
59 | evect: |
---|
60 | j excep |
---|
61 | nop |
---|
62 | .data |
---|
63 | .word MAGIC1 |
---|
64 | testval: |
---|
65 | .word MAGIC2 |
---|
Note: See
TracBrowser
for help on using the repository browser.