OpenCores
URL https://opencores.org/ocsvn/openmsp430/openmsp430/trunk

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src/] [two-op_add-b.s43] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.