source: trunk/softs/tests_ccvcache_v4/test_fpe_delayslot/test.S @ 232

Last change on this file since 232 was 232, checked in by alain, 12 years ago

Introducing the elementary tests for a TSAR mono-cluster
mono-processor platform with MMU using the vci_cc_vcache_v4
such as the "tsarv4_mono_mmu".
(assemby level tests written by Manuel Bouyer)

File size: 1.3 KB
Line 
1/*
2 * trap test: check that a trap in a delay slot is
3 * properly handled
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), enable cop1 */
19        lui     a0, 0x2040;
20        mtc0    a0, COP0_STATUS
21
22        la      a0, div1
23        lwc1    $f2, 0(a0)
24        la      a0, div2
25        lwc1    $f0, 0(a0)
26        j exit
27        div.s   $f0, $f0, $f2
28        /* we should not get there, */
29        EXIT(2)
30        .globl exit
31exit:
32        move    a0, v0
33        PRINTX
34        PUTCHAR(' ')
35        move    a0, v1
36        PRINTX
37        PUTCHAR('\n')
38        /* we should get there */
39        EXIT(0)
40
41        .globl excep
42excep:
43        .set noreorder
44        PRINT(statusstr)
45        mfc0    a0, COP0_STATUS
46        PRINTX
47
48        PRINT(causestr)
49        mfc0    a0, COP0_CAUSE
50        PRINTX
51
52        PRINT(pcstr)
53        mfc0    a0, COP0_EXPC
54        PRINTX
55
56        PRINT(badvastr)
57        mfc0    a0, COP_0_BADVADDR
58        PRINTX
59        PUTCHAR('\n')
60        la      a0, exit
61        mtc0    a0, COP0_EXPC
62        li      v0, MAGIC1
63        li      v1, MAGIC2
64        li      a3, 1
65        eret
66        nop
67
68#we should not end there
69        EXIT(1)
70
71        .rodata:
72statusstr: .ascii "status \0"
73causestr: .ascii " cause \0"
74pcstr: .ascii " pc \0"
75badvastr: .ascii " badva \0"
76startstr: .ascii "start\n\0"
77usrstr: .ascii "usrmode\n\0"
78
79        .org EXCEP_ADDRESS - BOOT_ADDRESS
80        .globl evect
81evect:
82        j       excep
83        nop
84        .data
85        .word MAGIC1
86testval:
87        .word MAGIC2
88div1:
89        .float  10.0
90        .globl div2
91div2:
92        .float  0.0
Note: See TracBrowser for help on using the repository browser.