source: trunk/softs/tests_cc_vcache/test_ao/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: 946 bytes
Line 
1/*
2 * arithmetic overflow test: check that a add can generates an exception
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        la      a0, 0x7fffffff
21        li      a1, 0x02
22        add     a0, a0, a1
23        EXIT(2)
24
25        .globl excep
26excep:
27        .set noreorder
28        PRINT(statusstr)
29        mfc0    a0, COP0_STATUS
30        PRINTX
31
32        PRINT(causestr)
33        mfc0    a0, COP0_CAUSE
34        PRINTX
35
36        PRINT(pcstr)
37        mfc0    a0, COP0_EXPC
38        PRINTX
39
40        PRINT(badvastr)
41        mfc0    a0, COP_0_BADVADDR
42        PRINTX
43        PUTCHAR('\n')
44#we should end there
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"
53usrstr: .ascii "usrmode\n\0"
54
55        .org EXCEP_ADDRESS - BOOT_ADDRESS
56        .globl evect
57evect:
58        j       excep
59        nop
60        .data
61        .word MAGIC1
62testval:
63        .word MAGIC2
Note: See TracBrowser for help on using the repository browser.