source: trunk/softs/tests_cc_vcache/test_breakpoint_delayslot/test.S @ 1024

Last change on this file since 1024 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: 1.2 KB
Line 
1/*
2 * breakpoint test: check that a breakpoint in a delay slot is properly handled
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        j       exit
24        break
25        nop
26        /* we should not get there, */
27        EXIT(2)
28        .globl exit
29exit:
30        move    a0, v0
31        PRINTX
32        PUTCHAR(' ')
33        move    a0, v1
34        PRINTX
35        PUTCHAR('\n')
36        /* we should get there */
37        EXIT(0)
38
39        .globl excep
40excep:
41        .set noreorder
42        PRINT(statusstr)
43        mfc0    a0, COP0_STATUS
44        PRINTX
45
46        PRINT(causestr)
47        mfc0    a0, COP0_CAUSE
48        PRINTX
49
50        PRINT(pcstr)
51        mfc0    a0, COP0_EXPC
52        PRINTX
53
54        PRINT(badvastr)
55        mfc0    a0, COP_0_BADVADDR
56        PRINTX
57        PUTCHAR('\n')
58        la      a0, exit
59        mtc0    a0, COP0_EXPC
60        li      v0, MAGIC1
61        li      v1, MAGIC2
62        li      a3, 1
63        eret
64        nop
65
66#we should not end there
67        EXIT(1)
68
69        .rodata:
70statusstr: .ascii "status \0"
71causestr: .ascii " cause \0"
72pcstr: .ascii " pc \0"
73badvastr: .ascii " badva \0"
74startstr: .ascii "start\n\0"
75usrstr: .ascii "usrmode\n\0"
76
77        .org EXCEP_ADDRESS - BOOT_ADDRESS
78        .globl evect
79evect:
80        j       excep
81        nop
82        .data
83        .word MAGIC1
84testval:
85        .word MAGIC2
Note: See TracBrowser for help on using the repository browser.