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