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 219

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