source: trunk/Softwares/Test/Test_011/src/sys/crt0.s @ 100

Last change on this file since 100 was 100, checked in by rosiere, 15 years ago

1) Bug fix (Operation, Instruction)
2) Modif Return Address Stack
3) Add Soft Test
4) Add Soc Test

  • Property svn:keywords set to Id
File size: 5.2 KB
Line 
1/*
2 * Test_011
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.addi
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 (I)  - D (r3 wait)CY OV (SR = r6, mask SR = r5)
37                                       (r4)                (r7)
38          1) 0x00000000 0x0000 - 0x00000000 0  0
39          2) 0x14011959 0x1959 - 0x140132b2 0  0
40          3) 0xebfee6a7 0xe6a7 - 0xebfecd4e 1  0
41          4) 0xebfee6a7 0x1959 - 0xebff0000 0  0
42          5) 0x14011959 0xe6a7 - 0x14010000 1  0
43          6) 0x87654321 0xabcd - 0x8764eeee 1  0
44          7) 0x7fffffff 0x5432 - 0x80005431 0  1
45          */
46
47        /* Mask to read OV (SR[11]), CY (SR[10]) and not F (SR[9]) */
48        l.movhi r5,     hi(0x00000c00)
49        l.ori   r5, r5, lo(0x00000c00)
50       
51        /**********/
52        /* Test 1 */
53        /**********/
54        l.movhi r1,     hi(0x00000000) /* RA */
55        l.ori   r1, r1, lo(0x00000000)
56        l.movhi r3,     hi(0x00000000) /* RD wait */
57        l.ori   r3, r3, lo(0x00000000)
58        l.movhi r6,     hi(0x00000000) /* SR wait */
59        l.ori   r6, r6, lo(0x00000000)
60       
61        l.addi  r4, r1, 0x0000
62
63        /* Test flag */
64        l.mfspr r7, r0, 17
65        l.and   r7, r7, r5
66
67        l.sfeq  r6, r7
68        l.bnf   _end_ko
69        l.nop
70
71        /* Test result */
72        l.sfeq  r3, r4
73        l.bnf   _end_ko
74        l.nop
75
76        /**********/
77        /* Test 2 */
78        /**********/
79        l.movhi r1,     hi(0x14011959) /* RA */
80        l.ori   r1, r1, lo(0x14011959)
81        l.movhi r3,     hi(0x140132b2) /* RD wait */
82        l.ori   r3, r3, lo(0x140132b2)
83        l.movhi r6,     hi(0x00000000) /* SR wait */
84        l.ori   r6, r6, lo(0x00000000)
85       
86        l.addi  r4, r1, 0x1959
87
88        /* Test flag */
89        l.mfspr r7, r0, 17
90        l.and   r7, r7, r5
91
92        l.sfeq  r6, r7
93        l.bnf   _end_ko
94        l.nop
95
96        /* Test result */
97        l.sfeq  r3, r4
98        l.bnf   _end_ko
99        l.nop
100
101        /**********/
102        /* Test 3 */
103        /**********/
104        l.movhi r1,     hi(0xebfee6a7) /* RA */
105        l.ori   r1, r1, lo(0xebfee6a7)
106        l.movhi r3,     hi(0xebfecd4e) /* RD wait */
107        l.ori   r3, r3, lo(0xebfecd4e)
108        l.movhi r6,     hi(0x00000400) /* SR wait */
109        l.ori   r6, r6, lo(0x00000400)
110       
111        l.addi  r4, r1, 0xe6a7
112
113        /* Test flag */
114        l.mfspr r7, r0, 17
115        l.and   r7, r7, r5
116
117        l.sfeq  r6, r7
118        l.bnf   _end_ko
119        l.nop
120
121        /* Test result */
122        l.sfeq  r3, r4
123        l.bnf   _end_ko
124        l.nop
125
126        /**********/
127        /* Test 4 */
128        /**********/
129        l.movhi r1,     hi(0xebfee6a7) /* RA */
130        l.ori   r1, r1, lo(0xebfee6a7)
131        l.movhi r3,     hi(0xebff0000) /* RD wait */
132        l.ori   r3, r3, lo(0xebff0000)
133        l.movhi r6,     hi(0x00000000) /* SR wait */
134        l.ori   r6, r6, lo(0x00000000)
135       
136        l.addi  r4, r1, 0x1959
137
138        /* Test flag */
139        l.mfspr r7, r0, 17
140        l.and   r7, r7, r5
141
142        l.sfeq  r6, r7
143        l.bnf   _end_ko
144        l.nop
145
146        /* Test result */
147        l.sfeq  r3, r4
148        l.bnf   _end_ko
149        l.nop
150
151        /**********/
152        /* Test 5 */
153        /**********/
154        l.movhi r1,     hi(0x14011959) /* RA */
155        l.ori   r1, r1, lo(0x14011959)
156        l.movhi r3,     hi(0x14010000) /* RD wait */
157        l.ori   r3, r3, lo(0x14010000)
158        l.movhi r6,     hi(0x00000400) /* SR wait */
159        l.ori   r6, r6, lo(0x00000400)
160       
161        l.addi  r4, r1, 0xe6a7
162
163        /* Test flag */
164        l.mfspr r7, r0, 17
165        l.and   r7, r7, r5
166
167        l.sfeq  r6, r7
168        l.bnf   _end_ko
169        l.nop
170
171        /* Test result */
172        l.sfeq  r3, r4
173        l.bnf   _end_ko
174        l.nop
175
176        /**********/
177        /* Test 6 */
178        /**********/
179        l.movhi r1,     hi(0x87654321) /* RA */
180        l.ori   r1, r1, lo(0x87654321)
181        l.movhi r3,     hi(0x8764eeee) /* RD wait */
182        l.ori   r3, r3, lo(0x8764eeee)
183        l.movhi r6,     hi(0x00000400) /* SR wait */
184        l.ori   r6, r6, lo(0x00000400)
185       
186        l.addi  r4, r1, 0xabcd
187
188        /* Test flag */
189        l.mfspr r7, r0, 17
190        l.and   r7, r7, r5
191
192        l.sfeq  r6, r7
193        l.bnf   _end_ko
194        l.nop
195
196        /* Test result */
197        l.sfeq  r3, r4
198        l.bnf   _end_ko
199        l.nop
200
201        /**********/
202        /* Test 7 */
203        /**********/
204        l.movhi r1,     hi(0x7fffffff) /* RA */
205        l.ori   r1, r1, lo(0x7fffffff)
206        l.movhi r3,     hi(0x80005431) /* RD wait */
207        l.ori   r3, r3, lo(0x80005431)
208        l.movhi r6,     hi(0x00000800) /* SR wait */
209        l.ori   r6, r6, lo(0x00000800)
210       
211        l.addi  r4, r1, 0x5432
212
213        /* Test flag */
214        l.mfspr r7, r0, 17
215        l.and   r7, r7, r5
216
217        l.sfeq  r6, r7
218        l.bnf   _end_ko
219        l.nop
220
221        /* Test result */
222        l.sfeq  r3, r4
223        l.bnf   _end_ko
224        l.nop
225
226        /**********/
227        /* End */
228        /**********/
229
230        l.j     _end_ok
231        l.nop
Note: See TracBrowser for help on using the repository browser.