source: trunk/softs/tests_ccvcache_v4/test_excep_cop1/test.S @ 344

Last change on this file since 344 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.0 KB
Line 
1/*
2 * trap test: check that we get a trap on FPU access though [ls][dw]c1
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), enable cop1 */
18        lui     a0, 0x0040;
19        mtc0    a0, COP0_STATUS
20
21        la      a0, div1;
22        lwc1    $f0, 0(a0)
23        PRINTX
24        PUTCHAR('\n')
25        EXIT(2)
26
27        .globl excep
28excep:
29        .set noreorder
30        PRINT(statusstr)
31        mfc0    a0, COP0_STATUS
32        PRINTX
33
34        PRINT(causestr)
35        mfc0    a0, COP0_CAUSE
36        PRINTX
37
38        PRINT(pcstr)
39        mfc0    a0, COP0_EXPC
40        PRINTX
41
42        PRINT(badvastr)
43        mfc0    a0, COP_0_BADVADDR
44        PRINTX
45        PUTCHAR('\n')
46#we should end there
47        EXIT(0)
48
49        .rodata:
50statusstr: .ascii "status \0"
51causestr: .ascii " cause \0"
52pcstr: .ascii " pc \0"
53badvastr: .ascii " badva \0"
54startstr: .ascii "start\n\0"
55usrstr: .ascii "usrmode\n\0"
56
57        .org EXCEP_ADDRESS - BOOT_ADDRESS
58        .globl evect
59evect:
60        j       excep
61        nop
62        .data
63        .word MAGIC1
64testval:
65        .word MAGIC2
66        .globl div1
67div1:
68        .float  10.0
69        .globl div2
70div2:
71        .float  0.0
Note: See TracBrowser for help on using the repository browser.