source: trunk/Softwares/Test/Test_009/src/sys/crt0.s @ 98

Last change on this file since 98 was 98, checked in by rosiere, 16 years ago

1) Fix bug (read unit, RAT -> write in R0, SPR desallocation ...)
2) Change VHDL Execute_queue -> use Generic/Queue?
3) Complete document on VHDL generation
4) Add soc test

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1/*
2 * Test_009
3 *
4 * end_ko : infinite_loop
5 * end_ok : Write in R1 the stop address and stop an data
6 *          The store in the destination of an jump
7 * start  : Test l.add
8 */
9       
10        .file   "crt0.s"
11        /*
12        .section .vector
13        */
14        .section .text
15        .align  4       
16
17/* ---[ 0x0  : Print a error ]------------------------------------------- */
18
19        .org 0x0
20_end_ko        :       
21_infinite_loop :       
22        l.j     _infinite_loop
23        l.nop
24
25_end_ok :
26        l.movhi r1,     hi(_tty)
27        l.ori   r1, r1, lo(_tty)
28        l.sw    4(r1), r1 /* stop address */
29
30
31/* ---[ 0x100: RESET exception ]----------------------------------------- */
32        .org 0x100
33        .global _start
34_start:
35        /*
36             A (r1)     B (r2)     - D (r3 wait)CY OV (SR = r6, mask SR = r5)
37                                       (r4)                (r7)
38          1) 0x00000000 0x00000000 - 0x00000000 0  0
39         
40         */
41
42        /* Mask to read OV (SR[11]), CY (SR[10]) and F (SR[9]) */
43        l.movhi r5,     hi(0x000000e0)
44        l.ori   r5, r5, lo(0x000000e0)
45
46        /**********/
47        /* Test 1 */
48        /**********/
49        l.movhi r1,     hi(0x00000000) /* RA */
50        l.ori   r1, r1, lo(0x00000000)
51        l.movhi r2,     hi(0x00000000) /* RB */
52        l.ori   r2, r2, lo(0x00000000)
53        l.movhi r3,     hi(0x00000000) /* RD wait */
54        l.ori   r3, r3, lo(0x00000000)
55        l.movhi r6,     hi(0x00000000) /* SR wait */
56        l.ori   r6, r6, lo(0x00000000)
57       
58        l.add   r4, r1, r2
59
60        /* Test flag */
61        l.mfspr r7, r0, 17
62        l.and   r7, r7, r5
63
64        l.sfeq  r6, r7
65        l.bnf   _end_ko
66        l.nop
67
68        /* Test result */
69        l.sfeq  r3, r4
70        l.bnf   _end_ko
71        l.nop
72        l.j     _end_ok
73        l.nop
74
Note: See TracBrowser for help on using the repository browser.