1 | /* |
---|
2 | * Test_041 |
---|
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.srl |
---|
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) |
---|
40 | (r4) |
---|
41 | 1) 0xdeadbeef 0x00000000 - 0xdeadbeef |
---|
42 | 2) 0xdeadbeef 0x00000008 - 0x00deadbe |
---|
43 | 3) 0xdeadbeef 0x00000010 - 0x0000dead |
---|
44 | 4) 0xdeadbeef 0x00000018 - 0x000000de |
---|
45 | 5) 0xdeadbeef 0x0000001f - 0x00000001 |
---|
46 | 6) 0xdeadbeef 0x00000024 - 0x0deadbee |
---|
47 | 7) 0x12345678 0x00000000 - 0x12345678 |
---|
48 | 8) 0x12345678 0x00000008 - 0x00123456 |
---|
49 | 9) 0x12345678 0x00000010 - 0x00001234 |
---|
50 | 10) 0x12345678 0x00000018 - 0x00000012 |
---|
51 | 11) 0x12345678 0x0000001f - 0x00000000 |
---|
52 | 12) 0x12345678 0x00000024 - 0x01234567 |
---|
53 | */ |
---|
54 | |
---|
55 | /***********/ |
---|
56 | /* Test 1 */ |
---|
57 | /***********/ |
---|
58 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
59 | l.ori r1, r1, lo(0xdeadbeef) |
---|
60 | l.movhi r2, hi(0x00000000) /* RA */ |
---|
61 | l.ori r2, r2, lo(0x00000000) |
---|
62 | l.movhi r3, hi(0xdeadbeef) /* RD wait */ |
---|
63 | l.ori r3, r3, lo(0xdeadbeef) |
---|
64 | |
---|
65 | l.srl r4, r1, r2 |
---|
66 | |
---|
67 | /* Test result */ |
---|
68 | l.sfeq r3, r4 |
---|
69 | l.bnf _end_ko |
---|
70 | l.nop |
---|
71 | |
---|
72 | /***********/ |
---|
73 | /* Test 2 */ |
---|
74 | /***********/ |
---|
75 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
76 | l.ori r1, r1, lo(0xdeadbeef) |
---|
77 | l.movhi r2, hi(0x00000008) /* RA */ |
---|
78 | l.ori r2, r2, lo(0x00000008) |
---|
79 | l.movhi r3, hi(0x00deadbe) /* RD wait */ |
---|
80 | l.ori r3, r3, lo(0x00deadbe) |
---|
81 | |
---|
82 | l.srl r4, r1, r2 |
---|
83 | |
---|
84 | /* Test result */ |
---|
85 | l.sfeq r3, r4 |
---|
86 | l.bnf _end_ko |
---|
87 | l.nop |
---|
88 | |
---|
89 | /***********/ |
---|
90 | /* Test 3 */ |
---|
91 | /***********/ |
---|
92 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
93 | l.ori r1, r1, lo(0xdeadbeef) |
---|
94 | l.movhi r2, hi(0x00000010) /* RB */ |
---|
95 | l.ori r2, r2, lo(0x00000010) |
---|
96 | l.movhi r3, hi(0x0000dead) /* RD wait */ |
---|
97 | l.ori r3, r3, lo(0x0000dead) |
---|
98 | |
---|
99 | l.srl r4, r1, r2 |
---|
100 | |
---|
101 | /* Test result */ |
---|
102 | l.sfeq r3, r4 |
---|
103 | l.bnf _end_ko |
---|
104 | l.nop |
---|
105 | |
---|
106 | /***********/ |
---|
107 | /* Test 4 */ |
---|
108 | /***********/ |
---|
109 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
110 | l.ori r1, r1, lo(0xdeadbeef) |
---|
111 | l.movhi r2, hi(0x00000018) /* RB */ |
---|
112 | l.ori r2, r2, lo(0x00000018) |
---|
113 | l.movhi r3, hi(0x000000de) /* RD wait */ |
---|
114 | l.ori r3, r3, lo(0x000000de) |
---|
115 | |
---|
116 | l.srl r4, r1, r2 |
---|
117 | |
---|
118 | /* Test result */ |
---|
119 | l.sfeq r3, r4 |
---|
120 | l.bnf _end_ko |
---|
121 | l.nop |
---|
122 | |
---|
123 | /***********/ |
---|
124 | /* Test 5 */ |
---|
125 | /***********/ |
---|
126 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
127 | l.ori r1, r1, lo(0xdeadbeef) |
---|
128 | l.movhi r2, hi(0x0000001f) /* RB */ |
---|
129 | l.ori r2, r2, lo(0x0000001f) |
---|
130 | l.movhi r3, hi(0x00000001) /* RD wait */ |
---|
131 | l.ori r3, r3, lo(0x00000001) |
---|
132 | |
---|
133 | l.srl r4, r1, r2 |
---|
134 | |
---|
135 | /* Test result */ |
---|
136 | l.sfeq r3, r4 |
---|
137 | l.bnf _end_ko |
---|
138 | l.nop |
---|
139 | |
---|
140 | /***********/ |
---|
141 | /* Test 6 */ |
---|
142 | /***********/ |
---|
143 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
144 | l.ori r1, r1, lo(0xdeadbeef) |
---|
145 | l.movhi r2, hi(0x00000024) /* RB */ |
---|
146 | l.ori r2, r2, lo(0x00000024) |
---|
147 | l.movhi r3, hi(0x0deadbee) /* RD wait */ |
---|
148 | l.ori r3, r3, lo(0x0deadbee) |
---|
149 | |
---|
150 | l.srl r4, r1, r2 |
---|
151 | |
---|
152 | /* Test result */ |
---|
153 | l.sfeq r3, r4 |
---|
154 | l.bnf _end_ko |
---|
155 | l.nop |
---|
156 | |
---|
157 | /***********/ |
---|
158 | /* Test 7 */ |
---|
159 | /***********/ |
---|
160 | l.movhi r1, hi(0x12345678) /* RA */ |
---|
161 | l.ori r1, r1, lo(0x12345678) |
---|
162 | l.movhi r2, hi(0x00000000) /* RB */ |
---|
163 | l.ori r2, r2, lo(0x00000000) |
---|
164 | l.movhi r3, hi(0x12345678) /* RD wait */ |
---|
165 | l.ori r3, r3, lo(0x12345678) |
---|
166 | |
---|
167 | l.srl r4, r1, r2 |
---|
168 | |
---|
169 | /* Test result */ |
---|
170 | l.sfeq r3, r4 |
---|
171 | l.bnf _end_ko |
---|
172 | l.nop |
---|
173 | |
---|
174 | /***********/ |
---|
175 | /* Test 8 */ |
---|
176 | /***********/ |
---|
177 | l.movhi r1, hi(0x12345678) /* RA */ |
---|
178 | l.ori r1, r1, lo(0x12345678) |
---|
179 | l.movhi r2, hi(0x00000008) /* RB */ |
---|
180 | l.ori r2, r2, lo(0x00000008) |
---|
181 | l.movhi r3, hi(0x00123456) /* RD wait */ |
---|
182 | l.ori r3, r3, lo(0x00123456) |
---|
183 | |
---|
184 | l.srl r4, r1, r2 |
---|
185 | |
---|
186 | /* Test result */ |
---|
187 | l.sfeq r3, r4 |
---|
188 | l.bnf _end_ko |
---|
189 | l.nop |
---|
190 | |
---|
191 | /***********/ |
---|
192 | /* Test 9 */ |
---|
193 | /***********/ |
---|
194 | l.movhi r1, hi(0x12345678) /* RA */ |
---|
195 | l.ori r1, r1, lo(0x12345678) |
---|
196 | l.movhi r2, hi(0x00000010) /* RB */ |
---|
197 | l.ori r2, r2, lo(0x00000010) |
---|
198 | l.movhi r3, hi(0x00001234) /* RD wait */ |
---|
199 | l.ori r3, r3, lo(0x00001234) |
---|
200 | |
---|
201 | l.srl r4, r1, r2 |
---|
202 | |
---|
203 | /* Test result */ |
---|
204 | l.sfeq r3, r4 |
---|
205 | l.bnf _end_ko |
---|
206 | l.nop |
---|
207 | |
---|
208 | /***********/ |
---|
209 | /* Test 10 */ |
---|
210 | /***********/ |
---|
211 | l.movhi r1, hi(0x12345678) /* RA */ |
---|
212 | l.ori r1, r1, lo(0x12345678) |
---|
213 | l.movhi r2, hi(0x00000018) /* RB */ |
---|
214 | l.ori r2, r2, lo(0x00000018) |
---|
215 | l.movhi r3, hi(0x00000012) /* RD wait */ |
---|
216 | l.ori r3, r3, lo(0x00000012) |
---|
217 | |
---|
218 | l.srl r4, r1, r2 |
---|
219 | |
---|
220 | /* Test result */ |
---|
221 | l.sfeq r3, r4 |
---|
222 | l.bnf _end_ko |
---|
223 | l.nop |
---|
224 | |
---|
225 | /***********/ |
---|
226 | /* Test 11 */ |
---|
227 | /***********/ |
---|
228 | l.movhi r1, hi(0x12345678) /* RA */ |
---|
229 | l.ori r1, r1, lo(0x12345678) |
---|
230 | l.movhi r2, hi(0x0000001f) /* RB */ |
---|
231 | l.ori r2, r2, lo(0x0000001f) |
---|
232 | l.movhi r3, hi(0x00000000) /* RD wait */ |
---|
233 | l.ori r3, r3, lo(0x00000000) |
---|
234 | |
---|
235 | l.srl r4, r1, r2 |
---|
236 | |
---|
237 | /* Test result */ |
---|
238 | l.sfeq r3, r4 |
---|
239 | l.bnf _end_ko |
---|
240 | l.nop |
---|
241 | |
---|
242 | /***********/ |
---|
243 | /* Test 12 */ |
---|
244 | /***********/ |
---|
245 | l.movhi r1, hi(0x12345678) /* RA */ |
---|
246 | l.ori r1, r1, lo(0x12345678) |
---|
247 | l.movhi r2, hi(0x00000024) /* RB */ |
---|
248 | l.ori r2, r2, lo(0x00000024) |
---|
249 | l.movhi r3, hi(0x01234567) /* RD wait */ |
---|
250 | l.ori r3, r3, lo(0x01234567) |
---|
251 | |
---|
252 | l.srl r4, r1, r2 |
---|
253 | |
---|
254 | /* Test result */ |
---|
255 | l.sfeq r3, r4 |
---|
256 | l.bnf _end_ko |
---|
257 | l.nop |
---|
258 | |
---|
259 | |
---|
260 | /**********/ |
---|
261 | /* End */ |
---|
262 | /**********/ |
---|
263 | |
---|
264 | l.j _end_ok |
---|
265 | l.nop |
---|