source: trunk/Softwares/Test/Test_045/src/sys/crt0.s @ 102

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

Previous commit with new files :P

  • Property svn:keywords set to Id
File size: 5.8 KB
Line 
1/*
2 * Test_045
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.sub
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        l.movhi r1,     hi(_tty)
22        l.ori   r1, r1, lo(_tty)
23        l.sw    4(r1), r1 /* stop address */
24_infinite_loop :       
25        l.j     _infinite_loop
26        l.nop
27
28_end_ok :
29        l.movhi r1,     hi(_tty)
30        l.ori   r1, r1, lo(_tty)
31        l.sw    4(r1), r0 /* stop address */
32
33
34/* ---[ 0x100: RESET exception ]----------------------------------------- */
35        .org 0x100
36        .global _start
37_start:
38        /*
39             A (r1)     B (r2)     - D (r3 wait)CY OV (SR = r6, mask SR = r5)
40                                       (r4)                (r7)
41          1) 0x00000000 0x00000000 - 0x00000000 0  0
42          2) 0x12344321 0x00000001 - 0x12344320 0  0
43          3) 0x12345678 0xffffffff - 0x12345679 0  0
44          4) 0x70000000 0x90000000 - 0xe0000000 0  0
45          5) 0x80001000 0x80000000 - 0x00001000 0  0
46          6) 0x00000001 0x7fffffff - 0x80000002 0  1
47          7) 0x12345678 0x12345678 - 0x00000000 0  0
48          */
49
50
51       
52        /* Mask to read OV (SR[11]), CY (SR[10]) and not F (SR[9]) */
53        l.movhi r5,     hi(0x00000c00)
54        l.ori   r5, r5, lo(0x00000c00)
55       
56        /**********/
57        /* Test 1 */
58        /**********/
59        l.movhi r1,     hi(0x00000000) /* RA */
60        l.ori   r1, r1, lo(0x00000000)
61        l.movhi r2,     hi(0x00000000) /* RB */
62        l.ori   r2, r2, lo(0x00000000)
63        l.movhi r3,     hi(0x00000000) /* RD wait */
64        l.ori   r3, r3, lo(0x00000000)
65        l.movhi r6,     hi(0x00000000) /* SR wait */
66        l.ori   r6, r6, lo(0x00000000)
67       
68        l.sub   r4, r1, r2
69
70        /* Test flag */
71        l.mfspr r7, r0, 17
72        l.and   r7, r7, r5
73
74        l.sfeq  r6, r7
75        l.bnf   _end_ko
76        l.nop
77
78        /* Test result */
79        l.sfeq  r3, r4
80        l.bnf   _end_ko
81        l.nop
82
83        /**********/
84        /* Test 2 */
85        /**********/
86        l.movhi r1,     hi(0x12344321) /* RA */
87        l.ori   r1, r1, lo(0x12344321)
88        l.movhi r2,     hi(0x00000001) /* RB */
89        l.ori   r2, r2, lo(0x00000001)
90        l.movhi r3,     hi(0x12344320) /* RD wait */
91        l.ori   r3, r3, lo(0x12344320)
92        l.movhi r6,     hi(0x00000000) /* SR wait */
93        l.ori   r6, r6, lo(0x00000000)
94       
95        l.sub   r4, r1, r2
96
97        /* Test flag */
98        l.mfspr r7, r0, 17
99        l.and   r7, r7, r5
100
101        l.sfeq  r6, r7
102        l.bnf   _end_ko
103        l.nop
104
105        /* Test result */
106        l.sfeq  r3, r4
107        l.bnf   _end_ko
108        l.nop
109
110        /**********/
111        /* Test 3 */
112        /**********/
113        l.movhi r1,     hi(0x12345678) /* RA */
114        l.ori   r1, r1, lo(0x12345678)
115        l.movhi r2,     hi(0xffffffff) /* RB */
116        l.ori   r2, r2, lo(0xffffffff)
117        l.movhi r3,     hi(0x12345679) /* RD wait */
118        l.ori   r3, r3, lo(0x12345679)
119        l.movhi r6,     hi(0x00000000) /* SR wait */
120        l.ori   r6, r6, lo(0x00000000)
121       
122        l.sub   r4, r1, r2
123
124        /* Test flag */
125        l.mfspr r7, r0, 17
126        l.and   r7, r7, r5
127
128        l.sfeq  r6, r7
129        l.bnf   _end_ko
130        l.nop
131
132        /* Test result */
133        l.sfeq  r3, r4
134        l.bnf   _end_ko
135        l.nop
136
137        /**********/
138        /* Test 4 */
139        /**********/
140        l.movhi r1,     hi(0x70000000) /* RA */
141        l.ori   r1, r1, lo(0x70000000)
142        l.movhi r2,     hi(0x90000000) /* RB */
143        l.ori   r2, r2, lo(0x90000000)
144        l.movhi r3,     hi(0xe0000000) /* RD wait */
145        l.ori   r3, r3, lo(0xe0000000)
146        l.movhi r6,     hi(0x00000800) /* SR wait */
147        l.ori   r6, r6, lo(0x00000800)
148       
149        l.sub   r4, r1, r2
150
151        /* Test flag */
152        l.mfspr r7, r0, 17
153        l.and   r7, r7, r5
154
155        l.sfeq  r6, r7
156        l.bnf   _end_ko
157        l.nop
158
159        /* Test result */
160        l.sfeq  r3, r4
161        l.bnf   _end_ko
162        l.nop
163
164        /**********/
165        /* Test 5 */
166        /**********/
167        l.movhi r1,     hi(0x80001000) /* RA */
168        l.ori   r1, r1, lo(0x80001000)
169        l.movhi r2,     hi(0x80000000) /* RB */
170        l.ori   r2, r2, lo(0x80000000)
171        l.movhi r3,     hi(0x00001000) /* RD wait */
172        l.ori   r3, r3, lo(0x00001000)
173        l.movhi r6,     hi(0x00000800) /* SR wait */
174        l.ori   r6, r6, lo(0x00000800)
175       
176        l.sub   r4, r1, r2
177
178        /* Test flag */
179        l.mfspr r7, r0, 17
180        l.and   r7, r7, r5
181
182        l.sfeq  r6, r7
183        l.bnf   _end_ko
184        l.nop
185
186        /* Test result */
187        l.sfeq  r3, r4
188        l.bnf   _end_ko
189        l.nop
190       
191        /**********/
192        /* Test 6 */
193        /**********/
194        l.movhi r1,     hi(0x00000001) /* RA */
195        l.ori   r1, r1, lo(0x00000001)
196        l.movhi r2,     hi(0x7fffffff) /* RB */
197        l.ori   r2, r2, lo(0x7fffffff)
198        l.movhi r3,     hi(0x80000002) /* RD wait */
199        l.ori   r3, r3, lo(0x80000002)
200        l.movhi r6,     hi(0x00000000) /* SR wait */
201        l.ori   r6, r6, lo(0x00000000)
202       
203        l.sub   r4, r1, r2
204
205        /* Test flag */
206        l.mfspr r7, r0, 17
207        l.and   r7, r7, r5
208
209        l.sfeq  r6, r7
210        l.bnf   _end_ko
211        l.nop
212
213        /* Test result */
214        l.sfeq  r3, r4
215        l.bnf   _end_ko
216        l.nop
217
218        /**********/
219        /* Test 7 */
220        /**********/
221        l.movhi r1,     hi(0x12345678) /* RA */
222        l.ori   r1, r1, lo(0x12345678)
223        l.movhi r2,     hi(0x12345678) /* RB */
224        l.ori   r2, r2, lo(0x12345678)
225        l.movhi r3,     hi(0x00000000) /* RD wait */
226        l.ori   r3, r3, lo(0x00000000)
227        l.movhi r6,     hi(0x00000000) /* SR wait */
228        l.ori   r6, r6, lo(0x00000000)
229       
230        l.sub   r4, r1, r2
231
232        /* Test flag */
233        l.mfspr r7, r0, 17
234        l.and   r7, r7, r5
235
236        l.sfeq  r6, r7
237        l.bnf   _end_ko
238        l.nop
239
240        /* Test result */
241        l.sfeq  r3, r4
242        l.bnf   _end_ko
243        l.nop
244       
245        /**********/
246        /* End */
247        /**********/
248
249        l.j     _end_ok
250        l.nop
Note: See TracBrowser for help on using the repository browser.