source: trunk/Softwares/Test/Test_010/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.7 KB
Line 
1/*
2 * Test_010
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.addc
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          2) 0x14011959 0x25071959 - 0x390832b2 0  0
40          3) 0xebfee6a7 0xdaf8e6a7 - 0xc6f7cd4e 1  0
41          4) 0xebfee6a7 0x25071959 - 0x11060001 1  0
42          5) 0x14011959 0xdaf8e6a7 - 0xeefa0001 0  0
43          6) 0x87654321 0xabcdef01 - 0x33333222 1  1
44          7) 0x789abcde 0x08765432 - 0x81111111 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 r2,     hi(0x00000000) /* RB */
57        l.ori   r2, r2, lo(0x00000000)
58        l.movhi r3,     hi(0x00000000) /* RD wait */
59        l.ori   r3, r3, lo(0x00000000)
60        l.movhi r6,     hi(0x00000000) /* SR wait */
61        l.ori   r6, r6, lo(0x00000000)
62       
63        l.addc   r4, r1, r2
64
65        /* Test flag */
66        l.mfspr r7, r0, 17
67        l.and   r7, r7, r5
68
69        l.sfeq  r6, r7
70        l.bnf   _end_ko
71        l.nop
72
73        /* Test result */
74        l.sfeq  r3, r4
75        l.bnf   _end_ko
76        l.nop
77
78        /**********/
79        /* Test 2 */
80        /**********/
81        l.movhi r1,     hi(0x14011959) /* RA */
82        l.ori   r1, r1, lo(0x14011959)
83        l.movhi r2,     hi(0x25071959) /* RB */
84        l.ori   r2, r2, lo(0x25071959)
85        l.movhi r3,     hi(0x390832b2) /* RD wait */
86        l.ori   r3, r3, lo(0x390832b2)
87        l.movhi r6,     hi(0x00000000) /* SR wait */
88        l.ori   r6, r6, lo(0x00000000)
89       
90        l.addc   r4, r1, r2
91
92        /* Test flag */
93        l.mfspr r7, r0, 17
94        l.and   r7, r7, r5
95
96        l.sfeq  r6, r7
97        l.bnf   _end_ko
98        l.nop
99
100        /* Test result */
101        l.sfeq  r3, r4
102        l.bnf   _end_ko
103        l.nop
104
105        /**********/
106        /* Test 3 */
107        /**********/
108        l.movhi r1,     hi(0xebfee6a7) /* RA */
109        l.ori   r1, r1, lo(0xebfee6a7)
110        l.movhi r2,     hi(0xdaf8e6a7) /* RB */
111        l.ori   r2, r2, lo(0xdaf8e6a7)
112        l.movhi r3,     hi(0xc6f7cd4e) /* RD wait */
113        l.ori   r3, r3, lo(0xc6f7cd4e)
114        l.movhi r6,     hi(0x00000400) /* SR wait */
115        l.ori   r6, r6, lo(0x00000400)
116       
117        l.addc   r4, r1, r2
118
119        /* Test flag */
120        l.mfspr r7, r0, 17
121        l.and   r7, r7, r5
122
123        l.sfeq  r6, r7
124        l.bnf   _end_ko
125        l.nop
126
127        /* Test result */
128        l.sfeq  r3, r4
129        l.bnf   _end_ko
130        l.nop
131
132        /**********/
133        /* Test 4 */
134        /**********/
135        l.movhi r1,     hi(0xebfee6a7) /* RA */
136        l.ori   r1, r1, lo(0xebfee6a7)
137        l.movhi r2,     hi(0x25071959) /* RB */
138        l.ori   r2, r2, lo(0x25071959)
139        l.movhi r3,     hi(0x11060001) /* RD wait */
140        l.ori   r3, r3, lo(0x11060001)
141        l.movhi r6,     hi(0x00000400) /* SR wait */
142        l.ori   r6, r6, lo(0x00000400)
143       
144        l.addc   r4, r1, r2
145
146        /* Test flag */
147        l.mfspr r7, r0, 17
148        l.and   r7, r7, r5
149
150        l.sfeq  r6, r7
151        l.bnf   _end_ko
152        l.nop
153
154        /* Test result */
155        l.sfeq  r3, r4
156        l.bnf   _end_ko
157        l.nop
158
159        /**********/
160        /* Test 5 */
161        /**********/
162        l.movhi r1,     hi(0x14011959) /* RA */
163        l.ori   r1, r1, lo(0x14011959)
164        l.movhi r2,     hi(0xdaf8e6a7) /* RB */
165        l.ori   r2, r2, lo(0xdaf8e6a7)
166        l.movhi r3,     hi(0xeefa0001) /* RD wait */
167        l.ori   r3, r3, lo(0xeefa0001)
168        l.movhi r6,     hi(0x00000000) /* SR wait */
169        l.ori   r6, r6, lo(0x00000000)
170       
171        l.addc   r4, r1, r2
172
173        /* Test flag */
174        l.mfspr r7, r0, 17
175        l.and   r7, r7, r5
176
177        l.sfeq  r6, r7
178        l.bnf   _end_ko
179        l.nop
180
181        /* Test result */
182        l.sfeq  r3, r4
183        l.bnf   _end_ko
184        l.nop
185
186        /**********/
187        /* Test 6 */
188        /**********/
189        l.movhi r1,     hi(0x87654321) /* RA */
190        l.ori   r1, r1, lo(0x87654321)
191        l.movhi r2,     hi(0xabcdef01) /* RB */
192        l.ori   r2, r2, lo(0xabcdef01)
193        l.movhi r3,     hi(0x33333222) /* RD wait */
194        l.ori   r3, r3, lo(0x33333222)
195        l.movhi r6,     hi(0x00000c00) /* SR wait */
196        l.ori   r6, r6, lo(0x00000c00)
197       
198        l.addc   r4, r1, r2
199
200        /* Test flag */
201        l.mfspr r7, r0, 17
202        l.and   r7, r7, r5
203
204        l.sfeq  r6, r7
205        l.bnf   _end_ko
206        l.nop
207
208        /* Test result */
209        l.sfeq  r3, r4
210        l.bnf   _end_ko
211        l.nop
212
213        /**********/
214        /* Test 7 */
215        /**********/
216        l.movhi r1,     hi(0x789abcde) /* RA */
217        l.ori   r1, r1, lo(0x789abcde)
218        l.movhi r2,     hi(0x08765432) /* RB */
219        l.ori   r2, r2, lo(0x08765432)
220        l.movhi r3,     hi(0x81111111) /* RD wait */
221        l.ori   r3, r3, lo(0x81111111)
222        l.movhi r6,     hi(0x00000800) /* SR wait */
223        l.ori   r6, r6, lo(0x00000800)
224       
225        l.addc   r4, r1, r2
226
227        /* Test flag */
228        l.mfspr r7, r0, 17
229        l.and   r7, r7, r5
230
231        l.sfeq  r6, r7
232        l.bnf   _end_ko
233        l.nop
234
235        /* Test result */
236        l.sfeq  r3, r4
237        l.bnf   _end_ko
238        l.nop
239       
240        /**********/
241        /* End */
242        /**********/
243
244        l.j     _end_ok
245        l.nop
Note: See TracBrowser for help on using the repository browser.