1 |
2 |
olivier.gi |
/*===========================================================================*/
|
2 |
|
|
/* Copyright (C) 2001 Authors */
|
3 |
|
|
/* */
|
4 |
|
|
/* This source file may be used and distributed without restriction provided */
|
5 |
|
|
/* that this copyright statement is not removed from the file and that any */
|
6 |
|
|
/* derivative work contains the original copyright notice and the associated */
|
7 |
|
|
/* disclaimer. */
|
8 |
|
|
/* */
|
9 |
|
|
/* This source file is free software; you can redistribute it and/or modify */
|
10 |
|
|
/* it under the terms of the GNU Lesser General Public License as published */
|
11 |
|
|
/* by the Free Software Foundation; either version 2.1 of the License, or */
|
12 |
|
|
/* (at your option) any later version. */
|
13 |
|
|
/* */
|
14 |
|
|
/* This source is distributed in the hope that it will be useful, but WITHOUT*/
|
15 |
|
|
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
|
16 |
|
|
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
|
17 |
|
|
/* License for more details. */
|
18 |
|
|
/* */
|
19 |
|
|
/* You should have received a copy of the GNU Lesser General Public License */
|
20 |
|
|
/* along with this source; if not, write to the Free Software Foundation, */
|
21 |
|
|
/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
22 |
|
|
/* */
|
23 |
|
|
/*===========================================================================*/
|
24 |
|
|
/* TWO-OPERAND ARITHMETIC: ADD.B INSTRUCTION */
|
25 |
|
|
/*---------------------------------------------------------------------------*/
|
26 |
|
|
/* Test the ADD.B instruction with all addressing modes */
|
27 |
18 |
olivier.gi |
/* */
|
28 |
|
|
/* Author(s): */
|
29 |
|
|
/* - Olivier Girard, olgirard@gmail.com */
|
30 |
|
|
/* */
|
31 |
|
|
/*---------------------------------------------------------------------------*/
|
32 |
19 |
olivier.gi |
/* $Rev: 19 $ */
|
33 |
|
|
/* $LastChangedBy: olivier.girard $ */
|
34 |
|
|
/* $LastChangedDate: 2009-08-04 23:47:15 +0200 (Tue, 04 Aug 2009) $ */
|
35 |
2 |
olivier.gi |
/*===========================================================================*/
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
.global main
|
39 |
|
|
|
40 |
|
|
main:
|
41 |
|
|
/* ---------------------- INITIALIZE REGISTERS --------------------- */
|
42 |
|
|
mov #0x2222, r2
|
43 |
|
|
mov #0x3333, r3
|
44 |
|
|
mov #0x4444, r4
|
45 |
|
|
mov #0x5555, r5
|
46 |
|
|
mov #0x6666, r6
|
47 |
|
|
mov #0x7777, r7
|
48 |
|
|
mov #0x8888, r8
|
49 |
|
|
mov #0x9999, r9
|
50 |
|
|
mov #0xaaaa, r10
|
51 |
|
|
mov #0xbbbb, r11
|
52 |
|
|
mov #0xcccc, r12
|
53 |
|
|
mov #0xdddd, r13
|
54 |
|
|
mov #0xeeee, r14
|
55 |
|
|
|
56 |
|
|
mov #0x1000, r15
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
/* ---------------------- TEST WHEN SOURCE IS Rn ------------------- */
|
60 |
|
|
.set Rn_EDEL, (__data_start+0x0014)
|
61 |
|
|
.set Rn_EDEH, (__data_start+0x0017)
|
62 |
|
|
.set Rn_TONYL, 0x0218
|
63 |
|
|
.set Rn_TONYH, 0x021B
|
64 |
|
|
|
65 |
|
|
mov #0x4455, r4
|
66 |
|
|
mov #0x6677, r5
|
67 |
|
|
add.b r5, r4 ;# Write 0x55+0x77=0x00cc to r4
|
68 |
|
|
|
69 |
|
|
mov #0x0200, r5
|
70 |
|
|
mov #0xaabb, &0x210
|
71 |
|
|
mov #0x1234, r6
|
72 |
|
|
add.b r6, 16(r5) ;# Write 0xbb+0x34=0xef to memory @0x0210
|
73 |
|
|
mov #0x5566, &0x212
|
74 |
|
|
mov #0x5678, r6
|
75 |
|
|
add.b r6, 19(r5) ;# Write 0x55+0x78=0xcd to memory @0x0213
|
76 |
|
|
|
77 |
|
|
mov #0x1122, &0x214
|
78 |
|
|
mov #0xabcd, r7
|
79 |
|
|
add.b r7, Rn_EDEL ;# Write 0x22+0xcd=0xef to memory @0x0214
|
80 |
|
|
mov #0x99aa, &0x216
|
81 |
|
|
mov #0xef12, r7
|
82 |
|
|
add.b r7, Rn_EDEH ;# Write 0x99+0x12=0xab to memory @0x0217
|
83 |
|
|
|
84 |
|
|
mov #0x7788, &0x218
|
85 |
|
|
mov #0x1f2e, r8
|
86 |
|
|
add.b r8, &Rn_TONYL ;# Write 0x88+0x2e=0xb6 to memory @0x0218
|
87 |
|
|
mov #0x3344, &0x21A
|
88 |
|
|
mov #0x3d4c, r8
|
89 |
|
|
add.b r8, &Rn_TONYH ;# Write 0x33+0x4c=0x7f to memory @0x021B
|
90 |
|
|
|
91 |
|
|
mov #0x2000, r15
|
92 |
|
|
|
93 |
|
|
|
94 |
|
|
/* ---------------------- TEST WHEN SOURCE IS @Rn ------------------ */
|
95 |
|
|
.set aRn_EDE_218, (__data_start+0x0018)
|
96 |
|
|
.set aRn_EDE_21B, (__data_start+0x001B)
|
97 |
|
|
.set aRn_EDE_21C, (__data_start+0x001C)
|
98 |
|
|
.set aRn_EDE_21F, (__data_start+0x001F)
|
99 |
|
|
|
100 |
|
|
.set aRn_TONY_220, 0x0220
|
101 |
|
|
.set aRn_TONY_223, 0x0223
|
102 |
|
|
.set aRn_TONY_224, 0x0224
|
103 |
|
|
.set aRn_TONY_227, 0x0227
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
mov #0x2233, &0x0210
|
107 |
|
|
mov #0x0210, r4
|
108 |
|
|
mov #0xeeff, r5
|
109 |
|
|
add.b @r4, r5 ;# Write 0x33+0xff=0x32 to r5
|
110 |
|
|
mov #0x4455, &0x0212
|
111 |
|
|
mov #0x0213, r4
|
112 |
|
|
mov #0xccdd, r6
|
113 |
|
|
add.b @r4, r6 ;# Write 0x44+0xdd=0x21 to r6
|
114 |
|
|
|
115 |
|
|
mov #0x1122, &0x0200
|
116 |
|
|
mov #0x3344, &0x0202
|
117 |
|
|
mov #0x5566, &0x0204
|
118 |
|
|
mov #0x7788, &0x0206
|
119 |
|
|
mov #0x0200, r7
|
120 |
|
|
mov #0x55aa, &0x0210
|
121 |
|
|
mov #0x66bb, &0x0212
|
122 |
|
|
mov #0x56ab, &0x0214
|
123 |
|
|
mov #0x65ba, &0x0216
|
124 |
|
|
|
125 |
|
|
mov #0x0200, r8
|
126 |
|
|
add.b @r8, 16(r7) ;# Write 0x22+0xaa=0xcc to memory @0x210
|
127 |
|
|
mov #0x0202, r8
|
128 |
|
|
add.b @r8, 19(r7) ;# Write 0x44+0x66=0xaa to memory @0x213
|
129 |
|
|
mov #0x0205, r8
|
130 |
|
|
add.b @r8, 20(r7) ;# Write 0x55+0xab=0x00 to memory @0x214
|
131 |
|
|
mov #0x0207, r8
|
132 |
|
|
add.b @r8, 23(r7) ;# Write 0x77+0x65=0xdc to memory @0x217
|
133 |
|
|
|
134 |
|
|
mov #0x99aa, &0x0200
|
135 |
|
|
mov #0xbbcc, &0x0202
|
136 |
|
|
mov #0xddee, &0x0204
|
137 |
|
|
mov #0xff11, &0x0206
|
138 |
|
|
mov #0x11ee, &0x0218
|
139 |
|
|
mov #0x22dd, &0x021A
|
140 |
|
|
mov #0x1de2, &0x021C
|
141 |
|
|
mov #0xd12e, &0x021E
|
142 |
|
|
|
143 |
|
|
mov #0x0200, r8
|
144 |
|
|
add.b @r8, aRn_EDE_218 ;# Write 0xaa+0xee=0x98 to memory @0x218
|
145 |
|
|
mov #0x0202, r8
|
146 |
|
|
add.b @r8, aRn_EDE_21B ;# Write 0xcc+0x22=0xee to memory @0x21B
|
147 |
|
|
mov #0x0205, r8
|
148 |
|
|
add.b @r8, aRn_EDE_21C ;# Write 0xdd+0xe2=0xbf to memory @0x21C
|
149 |
|
|
mov #0x0207, r8
|
150 |
|
|
add.b @r8, aRn_EDE_21F ;# Write 0xff+0xd1=0xd0 to memory @0x21F
|
151 |
|
|
|
152 |
|
|
mov #0x2233, &0x0200
|
153 |
|
|
mov #0x4455, &0x0202
|
154 |
|
|
mov #0x6677, &0x0204
|
155 |
|
|
mov #0x8899, &0x0206
|
156 |
|
|
|
157 |
|
|
mov #0x22dd, &0x0220
|
158 |
|
|
mov #0x33cc, &0x0222
|
159 |
|
|
mov #0x2cd3, &0x0224
|
160 |
|
|
mov #0xc23d, &0x0226
|
161 |
|
|
|
162 |
|
|
mov #0x0200, r8
|
163 |
|
|
add.b @r8, &aRn_TONY_220 ;# Write 0x33+0xdd=0x10 to memory @0x220
|
164 |
|
|
mov #0x0202, r8
|
165 |
|
|
add.b @r8, &aRn_TONY_223 ;# Write 0x55+0x33=0x88 to memory @0x223
|
166 |
|
|
mov #0x0205, r8
|
167 |
|
|
add.b @r8, &aRn_TONY_224 ;# Write 0x66+0xd3=0x39 to memory @0x224
|
168 |
|
|
mov #0x0207, r8
|
169 |
|
|
add.b @r8, &aRn_TONY_227 ;# Write 0x88+0xc2=0x4a to memory @0x227
|
170 |
|
|
|
171 |
|
|
mov #0x3000, r15
|
172 |
|
|
|
173 |
|
|
|
174 |
|
|
/* ---------------------- TEST WHEN SOURCE IS @Rn+ ----------------- */
|
175 |
|
|
.set aRni_EDE_218, (__data_start+0x0018)
|
176 |
|
|
.set aRni_EDE_21B, (__data_start+0x001B)
|
177 |
|
|
.set aRni_EDE_21C, (__data_start+0x001C)
|
178 |
|
|
.set aRni_EDE_21F, (__data_start+0x001F)
|
179 |
|
|
|
180 |
|
|
.set aRni_TONY_220, 0x0220
|
181 |
|
|
.set aRni_TONY_223, 0x0223
|
182 |
|
|
.set aRni_TONY_224, 0x0224
|
183 |
|
|
.set aRni_TONY_227, 0x0227
|
184 |
|
|
|
185 |
|
|
|
186 |
|
|
mov #0x2233, &0x0210
|
187 |
|
|
mov #0x0210, r4
|
188 |
|
|
mov #0xf11f, r5
|
189 |
|
|
add.b @r4+, r5 ;# Write 0x33+0x1f=0x52 to r5
|
190 |
|
|
mov #0x4455, &0x0212
|
191 |
|
|
mov #0x0213, r6
|
192 |
|
|
mov #0x1ff1, r7
|
193 |
|
|
add.b @r6+, r7 ;# Write 0x44+0xf1=0x35 to r7
|
194 |
|
|
|
195 |
|
|
mov #0x1122, &0x0200
|
196 |
|
|
mov #0x3344, &0x0202
|
197 |
|
|
mov #0x5566, &0x0204
|
198 |
|
|
mov #0x7788, &0x0206
|
199 |
|
|
mov #0x0200, r8
|
200 |
|
|
mov #0xaabb, &0x0210
|
201 |
|
|
mov #0x5566, &0x0212
|
202 |
|
|
mov #0x5a6b, &0x0214
|
203 |
|
|
mov #0xa5b6, &0x0216
|
204 |
|
|
|
205 |
|
|
mov #0x0200, r9
|
206 |
|
|
add.b @r9+, 16(r8) ;# Write 0x22+0xbb=0xdd to memory @0x210
|
207 |
|
|
mov.b @r9+, r10
|
208 |
|
|
add.b @r9+, 19(r8) ;# Write 0x44+0x55=0x99 to memory @0x213
|
209 |
|
|
mov @r9+, r10
|
210 |
|
|
add.b @r9+, 20(r8) ;# Write 0x55+0x6b=0xc0 to memory @0x214
|
211 |
|
|
mov.b @r9+, r10
|
212 |
|
|
add.b @r9+, 23(r8) ;# Write 0x77+0xa5=0x1c to memory @0x217
|
213 |
|
|
|
214 |
|
|
mov #0x99aa, &0x0200
|
215 |
|
|
mov #0xbbcc, &0x0202
|
216 |
|
|
mov #0xddee, &0x0204
|
217 |
|
|
mov #0xff11, &0x0206
|
218 |
|
|
mov #0x1122, &0x0218
|
219 |
|
|
mov #0xeeff, &0x021A
|
220 |
|
|
mov #0x1e2f, &0x021C
|
221 |
|
|
mov #0xe1f2, &0x021E
|
222 |
|
|
|
223 |
|
|
mov #0x0200, r10
|
224 |
|
|
add.b @r10+, aRni_EDE_218 ;# Write 0xaa+0x22=0xcc to memory @0x218
|
225 |
|
|
mov.b @r10+, r11
|
226 |
|
|
add.b @r10+, aRni_EDE_21B ;# Write 0xcc+0xee=0xba to memory @0x21B
|
227 |
|
|
mov @r10+, r11
|
228 |
|
|
add.b @r10+, aRni_EDE_21C ;# Write 0xdd+0x2f=0x0c to memory @0x21C
|
229 |
|
|
mov.b @r10+, r11
|
230 |
|
|
add.b @r10+, aRni_EDE_21F ;# Write 0xff+0xe1=0xe0 to memory @0x21F
|
231 |
|
|
|
232 |
|
|
mov #0x2233, &0x0200
|
233 |
|
|
mov #0x4455, &0x0202
|
234 |
|
|
mov #0x6677, &0x0204
|
235 |
|
|
mov #0x8899, &0x0206
|
236 |
|
|
|
237 |
|
|
mov #0x5566, &0x0220
|
238 |
|
|
mov #0xccdd, &0x0222
|
239 |
|
|
mov #0x5c6d, &0x0224
|
240 |
|
|
mov #0xc5d6, &0x0226
|
241 |
|
|
|
242 |
|
|
mov #0x0200, r11
|
243 |
|
|
add.b @r11+, &aRni_TONY_220 ;# Write 0x33+0x66=0x99 to memory @0x220
|
244 |
|
|
mov.b @r11+, r12
|
245 |
|
|
add.b @r11+, &aRni_TONY_223 ;# Write 0x55+0xcc=0x21 to memory @0x223
|
246 |
|
|
mov @r11+, r12
|
247 |
|
|
add.b @r11+, &aRni_TONY_224 ;# Write 0x66+0x6d=0xd3 to memory @0x224
|
248 |
|
|
mov.b @r11+, r12
|
249 |
|
|
add.b @r11+, &aRni_TONY_227 ;# Write 0x88+0xc5=0x4d to memory @0x227
|
250 |
|
|
|
251 |
|
|
mov #0x4000, r15
|
252 |
|
|
|
253 |
|
|
|
254 |
|
|
/* ---------------------- TEST WHEN SOURCE IS #N ------------------- */
|
255 |
|
|
.set N_EDE_218, (__data_start+0x0018)
|
256 |
|
|
.set N_EDE_21B, (__data_start+0x001B)
|
257 |
|
|
.set N_EDE_21C, (__data_start+0x001C)
|
258 |
|
|
.set N_EDE_21F, (__data_start+0x001F)
|
259 |
|
|
|
260 |
|
|
.set N_TONY_220, 0x0220
|
261 |
|
|
.set N_TONY_223, 0x0223
|
262 |
|
|
.set N_TONY_224, 0x0224
|
263 |
|
|
.set N_TONY_227, 0x0227
|
264 |
|
|
|
265 |
|
|
|
266 |
|
|
mov #0xac56, r4
|
267 |
|
|
add.b #0x1234, r4 ;# Write 0x56+0x34=0x8a to r4
|
268 |
|
|
|
269 |
|
|
mov #0x0200, r5
|
270 |
|
|
mov #0xaa99, &0x0210
|
271 |
|
|
mov #0x5544, &0x0212
|
272 |
|
|
mov #0xa954, &0x0214
|
273 |
|
|
mov #0x495a, &0x0216
|
274 |
|
|
add.b #0x1122, 16(r5) ;# Write 0x22+0x99=0xbb to memory @0x210
|
275 |
|
|
add.b #0x3344, 19(r5) ;# Write 0x44+0x55=0x99 to memory @0x213
|
276 |
|
|
add.b #0x5566, 20(r5) ;# Write 0x66+0x54=0xba to memory @0x214
|
277 |
|
|
add.b #0x7788, 23(r5) ;# Write 0x88+0x49=0xd1 to memory @0x217
|
278 |
|
|
|
279 |
|
|
mov #0x1122, &0x0218
|
280 |
|
|
mov #0xeecc, &0x021A
|
281 |
|
|
mov #0x1e2c, &0x021C
|
282 |
|
|
mov #0xe1c2, &0x021E
|
283 |
|
|
add.b #0x99aa, N_EDE_218 ;# Write 0xaa+0x22=0xcc to memory @0x218
|
284 |
|
|
add.b #0xbbcc, N_EDE_21B ;# Write 0xcc+0xee=0xba to memory @0x21B
|
285 |
|
|
add.b #0xddee, N_EDE_21C ;# Write 0xee+0x2c=0x1a to memory @0x21C
|
286 |
|
|
add.b #0xff11, N_EDE_21F ;# Write 0x11+0xe1=0xf2 to memory @0x21F
|
287 |
|
|
|
288 |
|
|
mov #0xaa88, &0x0220
|
289 |
|
|
mov #0x22ee, &0x0222
|
290 |
|
|
mov #0xa28e, &0x0224
|
291 |
|
|
mov #0x2ae8, &0x0226
|
292 |
|
|
|
293 |
|
|
add.b #0x2233, &N_TONY_220 ;# Write 0x33+0x88=0xbb to memory @0x220
|
294 |
|
|
add.b #0x4455, &N_TONY_223 ;# Write 0x55+0x22=0x77 to memory @0x223
|
295 |
|
|
add.b #0x6677, &N_TONY_224 ;# Write 0x77+0x8e=0x05 to memory @0x224
|
296 |
|
|
add.b #0x8899, &N_TONY_227 ;# Write 0x99+0x2a=0xc3 to memory @0x227
|
297 |
|
|
|
298 |
|
|
mov #0x5000, r15
|
299 |
|
|
|
300 |
|
|
|
301 |
|
|
/* ---------------------- TEST WHEN SOURCE IS x(Rn) ---------------- */
|
302 |
|
|
.set xRn_EDE_218, (__data_start+0x0018)
|
303 |
|
|
.set xRn_EDE_21B, (__data_start+0x001B)
|
304 |
|
|
.set xRn_EDE_21C, (__data_start+0x001C)
|
305 |
|
|
.set xRn_EDE_21F, (__data_start+0x001F)
|
306 |
|
|
|
307 |
|
|
.set xRn_TONY_220, 0x0220
|
308 |
|
|
.set xRn_TONY_223, 0x0223
|
309 |
|
|
.set xRn_TONY_224, 0x0224
|
310 |
|
|
.set xRn_TONY_227, 0x0227
|
311 |
|
|
|
312 |
|
|
|
313 |
|
|
mov #0x2233, &0x0210
|
314 |
|
|
mov #0x0200, r4
|
315 |
|
|
mov #0xba98, r5
|
316 |
|
|
add.b 16(r4), r5 ;# Write 0x33+0x98=0xcb to r5
|
317 |
|
|
mov #0x4455, &0x0212
|
318 |
|
|
mov #0x7654, r6
|
319 |
|
|
add.b 19(r4), r6 ;# Write 0x44+0x54=0x98 to r6
|
320 |
|
|
|
321 |
|
|
mov #0x1122, &0x0202
|
322 |
|
|
mov #0x3344, &0x0204
|
323 |
|
|
mov #0x5566, &0x0206
|
324 |
|
|
mov #0x7788, &0x0208
|
325 |
|
|
mov #0x0200, r7
|
326 |
|
|
mov #0xaa11, &0x0210
|
327 |
|
|
mov #0x2255, &0x0212
|
328 |
|
|
mov #0xa215, &0x0214
|
329 |
|
|
mov #0x2a51, &0x0216
|
330 |
|
|
|
331 |
|
|
mov #0x0200, r8
|
332 |
|
|
add.b 2(r8), 16(r7) ;# Write 0x22+0x11=0x33 to memory @0x210
|
333 |
|
|
add.b 4(r8), 19(r7) ;# Write 0x44+0x22=0x66 to memory @0x213
|
334 |
|
|
add.b 7(r8), 20(r7) ;# Write 0x55+0x15=0x6a to memory @0x214
|
335 |
|
|
add.b 9(r8), 23(r7) ;# Write 0x77+0x2a=0xa1 to memory @0x217
|
336 |
|
|
|
337 |
|
|
mov #0x99aa, &0x0202
|
338 |
|
|
mov #0xbbcc, &0x0204
|
339 |
|
|
mov #0xddee, &0x0206
|
340 |
|
|
mov #0xff11, &0x0208
|
341 |
|
|
mov #0x3344, &0x0218
|
342 |
|
|
mov #0x77cc, &0x021A
|
343 |
|
|
mov #0x374c, &0x021C
|
344 |
|
|
mov #0x73c4, &0x021E
|
345 |
|
|
|
346 |
|
|
mov #0x0200, r8
|
347 |
|
|
add.b 2(r8), xRn_EDE_218 ;# Write 0xaa+0x44=0xee to memory @0x218
|
348 |
|
|
add.b 4(r8), xRn_EDE_21B ;# Write 0xcc+0x77=0x43 to memory @0x21B
|
349 |
|
|
add.b 7(r8), xRn_EDE_21C ;# Write 0xdd+0x4c=0x29 to memory @0x21C
|
350 |
|
|
add.b 9(r8), xRn_EDE_21F ;# Write 0xff+0x73=0x72 to memory @0x21F
|
351 |
|
|
|
352 |
|
|
mov #0x2233, &0x0202
|
353 |
|
|
mov #0x4455, &0x0204
|
354 |
|
|
mov #0x6677, &0x0206
|
355 |
|
|
mov #0x8899, &0x0208
|
356 |
|
|
|
357 |
|
|
mov #0x0011, &0x0220
|
358 |
|
|
mov #0xddcc, &0x0222
|
359 |
|
|
mov #0x0d1c, &0x0224
|
360 |
|
|
mov #0xd0c1, &0x0226
|
361 |
|
|
|
362 |
|
|
mov #0x0200, r8
|
363 |
|
|
add.b 2(r8), &xRn_TONY_220 ;# Write 0x33+0x11=0x44 to memory @0x220
|
364 |
|
|
add.b 4(r8), &xRn_TONY_223 ;# Write 0x55+0xdd=0x32 to memory @0x223
|
365 |
|
|
add.b 7(r8), &xRn_TONY_224 ;# Write 0x66+0x1c=0x82 to memory @0x224
|
366 |
|
|
add.b 9(r8), &xRn_TONY_227 ;# Write 0x88+0xd0=0x58 to memory @0x227
|
367 |
|
|
|
368 |
|
|
mov #0x6000, r15
|
369 |
|
|
|
370 |
|
|
|
371 |
|
|
/* ---------------------- TEST WHEN SOURCE IS 'EDE' ---------------- */
|
372 |
|
|
.set EDE_EDE_202, (__data_start+0x0002)
|
373 |
|
|
.set EDE_EDE_204, (__data_start+0x0004)
|
374 |
|
|
.set EDE_EDE_207, (__data_start+0x0007)
|
375 |
|
|
.set EDE_EDE_209, (__data_start+0x0009)
|
376 |
|
|
.set EDE_EDE_210, (__data_start+0x0010)
|
377 |
|
|
.set EDE_EDE_213, (__data_start+0x0013)
|
378 |
|
|
.set EDE_EDE_218, (__data_start+0x0018)
|
379 |
|
|
.set EDE_EDE_21B, (__data_start+0x001B)
|
380 |
|
|
.set EDE_EDE_21C, (__data_start+0x001C)
|
381 |
|
|
.set EDE_EDE_21F, (__data_start+0x001F)
|
382 |
|
|
|
383 |
|
|
.set EDE_TONY_220, 0x0220
|
384 |
|
|
.set EDE_TONY_223, 0x0223
|
385 |
|
|
.set EDE_TONY_224, 0x0224
|
386 |
|
|
.set EDE_TONY_227, 0x0227
|
387 |
|
|
|
388 |
|
|
|
389 |
|
|
mov #0x2233, &0x0210
|
390 |
|
|
mov #0xcb43, r5
|
391 |
|
|
add.b EDE_EDE_210, r5 ;# Write 0x33+0x43=0x76 to r5
|
392 |
|
|
mov #0x4455, &0x0212
|
393 |
|
|
mov #0x32a5, r6
|
394 |
|
|
add.b EDE_EDE_213, r6 ;# Write 0x44+0xa5=0xe9 to r6
|
395 |
|
|
|
396 |
|
|
mov #0x1122, &0x0202
|
397 |
|
|
mov #0x3344, &0x0204
|
398 |
|
|
mov #0x5566, &0x0206
|
399 |
|
|
mov #0x7788, &0x0208
|
400 |
|
|
mov #0x0200, r7
|
401 |
|
|
mov #0xaabb, &0x0210
|
402 |
|
|
mov #0x6655, &0x0212
|
403 |
|
|
mov #0xa6b5, &0x0214
|
404 |
|
|
mov #0x6a5b, &0x0216
|
405 |
|
|
|
406 |
|
|
add.b EDE_EDE_202, 16(r7) ;# Write 0x22+0xbb=0xdd to memory @0x210
|
407 |
|
|
add.b EDE_EDE_204, 19(r7) ;# Write 0x44+0x66=0xaa to memory @0x213
|
408 |
|
|
add.b EDE_EDE_207, 20(r7) ;# Write 0x55+0xb5=0x0a to memory @0x214
|
409 |
|
|
add.b EDE_EDE_209, 23(r7) ;# Write 0x77+0x6a=0xe1 to memory @0x217
|
410 |
|
|
|
411 |
|
|
mov #0x99aa, &0x0202
|
412 |
|
|
mov #0xbbcc, &0x0204
|
413 |
|
|
mov #0xddee, &0x0206
|
414 |
|
|
mov #0xff11, &0x0208
|
415 |
|
|
mov #0x1122, &0x0218
|
416 |
|
|
mov #0xeeff, &0x021A
|
417 |
|
|
mov #0x1e2f, &0x021C
|
418 |
|
|
mov #0xe1f2, &0x021E
|
419 |
|
|
|
420 |
|
|
add.b EDE_EDE_202, EDE_EDE_218 ;# Write 0xaa+0x22=0xcc to memory @0x218
|
421 |
|
|
add.b EDE_EDE_204, EDE_EDE_21B ;# Write 0xcc+0xee=0xba to memory @0x21B
|
422 |
|
|
add.b EDE_EDE_207, EDE_EDE_21C ;# Write 0xdd+0x2f=0x0c to memory @0x21C
|
423 |
|
|
add.b EDE_EDE_209, EDE_EDE_21F ;# Write 0xff+0xe1=0xe0 to memory @0x21F
|
424 |
|
|
|
425 |
|
|
mov #0x2233, &0x0202
|
426 |
|
|
mov #0x4455, &0x0204
|
427 |
|
|
mov #0x6677, &0x0206
|
428 |
|
|
mov #0x8899, &0x0208
|
429 |
|
|
|
430 |
|
|
mov #0x1107, &0x0220
|
431 |
|
|
mov #0xccdd, &0x0222
|
432 |
|
|
mov #0x2c3d, &0x0224
|
433 |
|
|
mov #0xc2d3, &0x0226
|
434 |
|
|
|
435 |
|
|
add.b EDE_EDE_202, &EDE_TONY_220 ;# Write 0x33+0x07=0x3a to memory @0x220
|
436 |
|
|
add.b EDE_EDE_204, &EDE_TONY_223 ;# Write 0x55+0xcc=0x21 to memory @0x223
|
437 |
|
|
add.b EDE_EDE_207, &EDE_TONY_224 ;# Write 0x66+0x3d=0xa3 to memory @0x224
|
438 |
|
|
add.b EDE_EDE_209, &EDE_TONY_227 ;# Write 0x88+0xc2=0x4a to memory @0x227
|
439 |
|
|
|
440 |
|
|
mov #0x7000, r15
|
441 |
|
|
|
442 |
|
|
|
443 |
|
|
/* ---------------------- TEST WHEN SOURCE IS '&EDE' --------------- */
|
444 |
|
|
.set aEDE_EDE_218, (__data_start+0x0018)
|
445 |
|
|
.set aEDE_EDE_21B, (__data_start+0x001B)
|
446 |
|
|
.set aEDE_EDE_21C, (__data_start+0x001C)
|
447 |
|
|
.set aEDE_EDE_21F, (__data_start+0x001F)
|
448 |
|
|
|
449 |
|
|
.set aEDE_TONY_220, 0x0220
|
450 |
|
|
.set aEDE_TONY_223, 0x0223
|
451 |
|
|
.set aEDE_TONY_224, 0x0224
|
452 |
|
|
.set aEDE_TONY_227, 0x0227
|
453 |
|
|
|
454 |
|
|
|
455 |
|
|
mov #0x2233, &0x0210
|
456 |
|
|
mov #0x6677, r5
|
457 |
|
|
add.b &0x0210, r5 ;# Write 0x33+0x77=0xaa to r5
|
458 |
|
|
mov #0x4455, &0x0212
|
459 |
|
|
mov #0x8899, r6
|
460 |
|
|
add.b &0x0213, r6 ;# Write 0x44+0x99=0xdd to r6
|
461 |
|
|
|
462 |
|
|
mov #0x1122, &0x0202
|
463 |
|
|
mov #0x3344, &0x0204
|
464 |
|
|
mov #0x5566, &0x0206
|
465 |
|
|
mov #0x7788, &0x0208
|
466 |
|
|
mov #0x0200, r7
|
467 |
|
|
mov #0xaabb, &0x0210
|
468 |
|
|
mov #0xccdd, &0x0212
|
469 |
|
|
mov #0xacbd, &0x0214
|
470 |
|
|
mov #0xcadb, &0x0216
|
471 |
|
|
|
472 |
|
|
add.b &0x0202, 16(r7) ;# Write 0x22+0xbb=0xdd to memory @0x210
|
473 |
|
|
add.b &0x0204, 19(r7) ;# Write 0x44+0xcc=0x10 to memory @0x213
|
474 |
|
|
add.b &0x0207, 20(r7) ;# Write 0x55+0xbd=0x12 to memory @0x214
|
475 |
|
|
add.b &0x0209, 23(r7) ;# Write 0x77+0xca=0x41 to memory @0x217
|
476 |
|
|
|
477 |
|
|
mov #0x99aa, &0x0202
|
478 |
|
|
mov #0xbbcc, &0x0204
|
479 |
|
|
mov #0xddee, &0x0206
|
480 |
|
|
mov #0xff11, &0x0208
|
481 |
|
|
mov #0x1122, &0x0218
|
482 |
|
|
mov #0x6677, &0x021A
|
483 |
|
|
mov #0x1627, &0x021C
|
484 |
|
|
mov #0x6172, &0x021E
|
485 |
|
|
|
486 |
|
|
add.b &0x0202, aEDE_EDE_218 ;# Write 0xaa+0x22=0xcc to memory @0x218
|
487 |
|
|
add.b &0x0204, aEDE_EDE_21B ;# Write 0xcc+0x66=0x32 to memory @0x21B
|
488 |
|
|
add.b &0x0207, aEDE_EDE_21C ;# Write 0xdd+0x27=0x04 to memory @0x21C
|
489 |
|
|
add.b &0x0209, aEDE_EDE_21F ;# Write 0xff+0x61=0x60 to memory @0x21F
|
490 |
|
|
|
491 |
|
|
mov #0x2233, &0x0202
|
492 |
|
|
mov #0x4455, &0x0204
|
493 |
|
|
mov #0x6677, &0x0206
|
494 |
|
|
mov #0x8899, &0x0208
|
495 |
|
|
mov #0xaabb, &0x0220
|
496 |
|
|
mov #0xddee, &0x0222
|
497 |
|
|
mov #0xadbe, &0x0224
|
498 |
|
|
mov #0xdaeb, &0x0226
|
499 |
|
|
|
500 |
|
|
add.b &0x0202, &aEDE_TONY_220 ;# Write 0x33+0xbb=0xee to memory @0x220
|
501 |
|
|
add.b &0x0204, &aEDE_TONY_223 ;# Write 0x55+0xdd=0x32 to memory @0x223
|
502 |
|
|
add.b &0x0207, &aEDE_TONY_224 ;# Write 0x66+0xbe=0x24 to memory @0x224
|
503 |
|
|
add.b &0x0209, &aEDE_TONY_227 ;# Write 0x88+0xda=0x62 to memory @0x227
|
504 |
|
|
|
505 |
|
|
mov #0x8000, r15
|
506 |
|
|
|
507 |
|
|
|
508 |
|
|
/* ---------------------- TEST WHEN SOURCE IS CONSTANT ------------- */
|
509 |
|
|
.set CONSTL_EDE0, (__data_start+0x0030)
|
510 |
|
|
.set CONSTL_EDE1, (__data_start+0x0032)
|
511 |
|
|
.set CONSTL_EDE2, (__data_start+0x0034)
|
512 |
|
|
.set CONSTL_EDE4, (__data_start+0x0036)
|
513 |
|
|
.set CONSTL_EDE8, (__data_start+0x0038)
|
514 |
|
|
.set CONSTL_EDEm1, (__data_start+0x003A)
|
515 |
|
|
.set CONSTH_EDE0, (__data_start+0x003D)
|
516 |
|
|
.set CONSTH_EDE1, (__data_start+0x003F)
|
517 |
|
|
.set CONSTH_EDE2, (__data_start+0x0041)
|
518 |
|
|
.set CONSTH_EDE4, (__data_start+0x0043)
|
519 |
|
|
.set CONSTH_EDE8, (__data_start+0x0045)
|
520 |
|
|
.set CONSTH_EDEm1, (__data_start+0x0047)
|
521 |
|
|
|
522 |
|
|
.set CONSTL_TONY0, 0x0250
|
523 |
|
|
.set CONSTL_TONY1, 0x0252
|
524 |
|
|
.set CONSTL_TONY2, 0x0254
|
525 |
|
|
.set CONSTL_TONY4, 0x0256
|
526 |
|
|
.set CONSTL_TONY8, 0x0258
|
527 |
|
|
.set CONSTL_TONYm1, 0x025A
|
528 |
|
|
.set CONSTH_TONY0, 0x025D
|
529 |
|
|
.set CONSTH_TONY1, 0x025F
|
530 |
|
|
.set CONSTH_TONY2, 0x0261
|
531 |
|
|
.set CONSTH_TONY4, 0x0263
|
532 |
|
|
.set CONSTH_TONY8, 0x0265
|
533 |
|
|
.set CONSTH_TONYm1, 0x0267
|
534 |
|
|
|
535 |
|
|
|
536 |
|
|
mov #0xaa44, r4 ;# Initialize registers
|
537 |
|
|
mov #0xaa55, r5
|
538 |
|
|
mov #0xaa66, r6
|
539 |
|
|
mov #0xaa77, r7
|
540 |
|
|
mov #0xaa88, r8
|
541 |
|
|
mov #0xaa99, r9
|
542 |
|
|
|
543 |
|
|
add.b #0x0000, r4 ;# Write 0x44+0 to R4
|
544 |
|
|
add.b #0x0001, r5 ;# Write 0x55+1 to R5
|
545 |
|
|
add.b #0x0002, r6 ;# Write 0x66+2 to R6
|
546 |
|
|
add.b #0x0004, r7 ;# Write 0x77+4 to R7
|
547 |
|
|
add.b #0x0008, r8 ;# Write 0x88+8 to R8
|
548 |
|
|
add.b #0xffff, r9 ;# Write 0x99-1 to R9
|
549 |
|
|
|
550 |
|
|
mov #0xaa44, &0x0210 ;# Initialize Memory
|
551 |
|
|
mov #0xaa55, &0x0212
|
552 |
|
|
mov #0xaa66, &0x0214
|
553 |
|
|
mov #0xaa77, &0x0216
|
554 |
|
|
mov #0xaa35, &0x0218
|
555 |
|
|
mov #0xaa99, &0x021A
|
556 |
|
|
mov #0xaa55, &0x021C
|
557 |
|
|
mov #0xbb55, &0x021E
|
558 |
|
|
mov #0xcc55, &0x0220
|
559 |
|
|
mov #0xdd55, &0x0222
|
560 |
|
|
mov #0xee55, &0x0224
|
561 |
|
|
mov #0x3355, &0x0226
|
562 |
|
|
|
563 |
|
|
mov #0x0202, r10
|
564 |
|
|
mov #0x1234, r11
|
565 |
|
|
add.b #0x0000, 14(r10) ;# Move +0 to memory @0x210
|
566 |
|
|
add.b #0x0001, 16(r10) ;# Move +1 to memory @0x212
|
567 |
|
|
add.b #0x0002, 18(r10) ;# Move +2 to memory @0x214
|
568 |
|
|
add.b #0x0004, 20(r10) ;# Move +4 to memory @0x216
|
569 |
|
|
add.b #0x0008, 22(r10) ;# Move +8 to memory @0x218
|
570 |
|
|
add.b #0xffff, 24(r10) ;# Move -1 to memory @0x21A
|
571 |
|
|
add.b #0x0000, 27(r10) ;# Move +0 to memory @0x21D
|
572 |
|
|
add.b #0x0001, 29(r10) ;# Move +1 to memory @0x21F
|
573 |
|
|
add.b #0x0002, 31(r10) ;# Move +2 to memory @0x221
|
574 |
|
|
add.b #0x0004, 33(r10) ;# Move +4 to memory @0x223
|
575 |
|
|
add.b #0x0008, 35(r10) ;# Move +8 to memory @0x225
|
576 |
|
|
add.b #0xffff, 37(r10) ;# Move -1 to memory @0x227
|
577 |
|
|
|
578 |
|
|
mov #0xaa44, &0x0230 ;# Initialize Memory
|
579 |
|
|
mov #0xaa55, &0x0232
|
580 |
|
|
mov #0xaa66, &0x0234
|
581 |
|
|
mov #0xaa77, &0x0236
|
582 |
|
|
mov #0xaa35, &0x0238
|
583 |
|
|
mov #0xaa99, &0x023A
|
584 |
|
|
mov #0xaa55, &0x023C
|
585 |
|
|
mov #0xbb55, &0x023E
|
586 |
|
|
mov #0xcc55, &0x0240
|
587 |
|
|
mov #0xdd55, &0x0242
|
588 |
|
|
mov #0xee55, &0x0244
|
589 |
|
|
mov #0x3355, &0x0246
|
590 |
|
|
|
591 |
|
|
add.b #0x0000, CONSTL_EDE0 ;# Move +0 to memory @0x230
|
592 |
|
|
add.b #0x0001, CONSTL_EDE1 ;# Move +1 to memory @0x232
|
593 |
|
|
add.b #0x0002, CONSTL_EDE2 ;# Move +2 to memory @0x234
|
594 |
|
|
add.b #0x0004, CONSTL_EDE4 ;# Move +4 to memory @0x236
|
595 |
|
|
add.b #0x0008, CONSTL_EDE8 ;# Move +8 to memory @0x238
|
596 |
|
|
add.b #0xffff, CONSTL_EDEm1 ;# Move -1 to memory @0x23A
|
597 |
|
|
add.b #0x0000, CONSTH_EDE0 ;# Move +0 to memory @0x23D
|
598 |
|
|
add.b #0x0001, CONSTH_EDE1 ;# Move +1 to memory @0x23F
|
599 |
|
|
add.b #0x0002, CONSTH_EDE2 ;# Move +2 to memory @0x241
|
600 |
|
|
add.b #0x0004, CONSTH_EDE4 ;# Move +4 to memory @0x243
|
601 |
|
|
add.b #0x0008, CONSTH_EDE8 ;# Move +8 to memory @0x245
|
602 |
|
|
add.b #0xffff, CONSTH_EDEm1 ;# Move -1 to memory @0x247
|
603 |
|
|
|
604 |
|
|
|
605 |
|
|
#
|
606 |
|
|
# NOTE: The following section would not fit in the smallest ROM
|
607 |
|
|
# configuration. Therefore, it is executed at the end of
|
608 |
|
|
# the "two-op_add.s43" pattern.
|
609 |
|
|
#
|
610 |
|
|
|
611 |
|
|
# mov #0xaa44, &0x0250 ;# Initialize Memory
|
612 |
|
|
# mov #0xaa55, &0x0252
|
613 |
|
|
# mov #0xaa66, &0x0254
|
614 |
|
|
# mov #0xaa77, &0x0256
|
615 |
|
|
# mov #0xaa35, &0x0258
|
616 |
|
|
# mov #0xaa99, &0x025A
|
617 |
|
|
# mov #0xaa55, &0x025C
|
618 |
|
|
# mov #0xbb55, &0x025E
|
619 |
|
|
# mov #0xcc55, &0x0260
|
620 |
|
|
# mov #0xdd55, &0x0262
|
621 |
|
|
# mov #0xee55, &0x0264
|
622 |
|
|
# mov #0x3355, &0x0266
|
623 |
|
|
|
624 |
|
|
# add.b #0x0000, &CONSTL_TONY0 ;# Move +0 to memory @0x250
|
625 |
|
|
# add.b #0x0001, &CONSTL_TONY1 ;# Move +1 to memory @0x252
|
626 |
|
|
# add.b #0x0002, &CONSTL_TONY2 ;# Move +2 to memory @0x254
|
627 |
|
|
# add.b #0x0004, &CONSTL_TONY4 ;# Move +4 to memory @0x256
|
628 |
|
|
# add.b #0x0008, &CONSTL_TONY8 ;# Move +8 to memory @0x258
|
629 |
|
|
# add.b #0xffff, &CONSTL_TONYm1 ;# Move -1 to memory @0x25A
|
630 |
|
|
# add.b #0x0000, &CONSTH_TONY0 ;# Move +0 to memory @0x25D
|
631 |
|
|
# add.b #0x0001, &CONSTH_TONY1 ;# Move +1 to memory @0x25F
|
632 |
|
|
# add.b #0x0002, &CONSTH_TONY2 ;# Move +2 to memory @0x261
|
633 |
|
|
# add.b #0x0004, &CONSTH_TONY4 ;# Move +4 to memory @0x263
|
634 |
|
|
# add.b #0x0008, &CONSTH_TONY8 ;# Move +8 to memory @0x265
|
635 |
|
|
# add.b #0xffff, &CONSTH_TONYm1 ;# Move -1 to memory @0x267
|
636 |
|
|
|
637 |
|
|
mov #0x9000, r15
|
638 |
|
|
|
639 |
|
|
|
640 |
|
|
/* ---------------------- END OF TEST --------------- */
|
641 |
|
|
end_of_test:
|
642 |
|
|
nop
|
643 |
|
|
br #0xffff
|
644 |
|
|
|
645 |
|
|
|
646 |
|
|
/* ---------------------- INTERRUPT VECTORS --------------- */
|
647 |
|
|
|
648 |
|
|
.section .vectors, "a"
|
649 |
|
|
.word end_of_test ; Interrupt 0 (lowest priority)
|
650 |
|
|
.word end_of_test ; Interrupt 1
|
651 |
|
|
.word end_of_test ; Interrupt 2
|
652 |
|
|
.word end_of_test ; Interrupt 3
|
653 |
|
|
.word end_of_test ; Interrupt 4
|
654 |
|
|
.word end_of_test ; Interrupt 5
|
655 |
|
|
.word end_of_test ; Interrupt 6
|
656 |
|
|
.word end_of_test ; Interrupt 7
|
657 |
|
|
.word end_of_test ; Interrupt 8
|
658 |
|
|
.word end_of_test ; Interrupt 9
|
659 |
|
|
.word end_of_test ; Interrupt 10 Watchdog timer
|
660 |
|
|
.word end_of_test ; Interrupt 11
|
661 |
|
|
.word end_of_test ; Interrupt 12
|
662 |
|
|
.word end_of_test ; Interrupt 13
|
663 |
|
|
.word end_of_test ; Interrupt 14 NMI
|
664 |
|
|
.word main ; Interrupt 15 (highest priority) RESET
|