source: trunk/softs/tests_cc_vcache/test_exceptions/test.S @ 520

Last change on this file since 520 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: 867 bytes
Line 
1/*
2 * Check that the exeption vector is called on exception.
3 * We use a load to an unaligned address to trigger the 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
15        PRINT(startstr)
16
17        li      a0, 1
18        lw      a0, 0(a0) /* fault */
19
20        /* we shouldn't get there */
21        EXIT(1)
22
23        .globl excep
24excep:
25        .set noreorder
26        PRINT(statusstr)
27        mfc0    a0, COP0_STATUS
28        PRINTX
29
30        PRINT(causestr)
31        mfc0    a0, COP0_CAUSE
32        PRINTX
33
34        PRINT(pcstr)
35        mfc0    a0, COP0_EXPC
36        PRINTX
37
38        PRINT(badvastr)
39        mfc0    a0, COP_0_BADVADDR
40        PRINTX
41
42        li      a0, '\n'
43        sb      a0, 0(k0)
44
45        EXIT(0)
46
47        .rodata:
48statusstr: .ascii "status \0"
49causestr: .ascii " cause \0"
50pcstr: .ascii " pc \0"
51badvastr: .ascii " badva \0"
52startstr: .ascii "start\n\0"
53
54        .org EXCEP_ADDRESS - BOOT_ADDRESS
55        .globl evect
56evect:
57        j       excep
58        nop
59        .data
60myvar:  .word 0
Note: See TracBrowser for help on using the repository browser.