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

Subversion Repositories openmsp430

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

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: MOV.B INSTRUCTION               */
25
/*---------------------------------------------------------------------------*/
26
/* Test the MOV.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: 141 $                                                                */
33
/* $LastChangedBy: olivier.girard $                                          */
34
/* $LastChangedDate: 2012-05-05 23:22:06 +0200 (Sat, 05 May 2012) $          */
35 2 olivier.gi
/*===========================================================================*/
36
 
37 141 olivier.gi
.include "pmem_defs.asm"
38 111 olivier.gi
 
39 2 olivier.gi
.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 111 olivier.gi
.set   Rn_EDEL,  DMEM_214
62
.set   Rn_EDEH,  DMEM_217
63
.set   Rn_TONYL, DMEM_218
64
.set   Rn_TONYH, DMEM_21B
65 2 olivier.gi
 
66
        mov.b        r5, r4        ;# Overwrite r4 with 0x0055
67
 
68 111 olivier.gi
        mov   #DMEM_200, r5
69
        mov     #0xaaaa, &DMEM_210
70 2 olivier.gi
        mov     #0x1234, r6
71
        mov.b        r6, 16(r5)    ;# Write 0x34 to memory @0x0210
72 111 olivier.gi
        mov     #0x5555, &DMEM_212
73 2 olivier.gi
        mov     #0x5678, r6
74
        mov.b        r6, 19(r5)    ;# Write 0x78 to memory @0x0213
75
 
76 111 olivier.gi
        mov     #0x1111, &DMEM_214
77 2 olivier.gi
        mov     #0xabcd, r7
78 141 olivier.gi
        mov.b        r7, Rn_EDEL+PMEM_LENGTH   ;# Write 0xcd to memory @0x0214
79 111 olivier.gi
        mov     #0x9999, &DMEM_216
80 2 olivier.gi
        mov     #0xef12, r7
81 141 olivier.gi
        mov.b        r7, Rn_EDEH+PMEM_LENGTH   ;# Write 0x12 to memory @0x0217
82 2 olivier.gi
 
83 111 olivier.gi
        mov     #0x7777, &DMEM_218
84 2 olivier.gi
        mov     #0x1f2e, r8
85
        mov.b        r8, &Rn_TONYL ;# Write 0x2e to memory @0x0218
86 111 olivier.gi
        mov     #0x3333, &DMEM_21A
87 2 olivier.gi
        mov     #0x3d4c, r8
88
        mov.b        r8, &Rn_TONYH ;# Write 0x4c to memory @0x021B
89
 
90
        mov     #0x2000, r15
91
 
92
 
93
        /* ---------------------- TEST WHEN SOURCE IS @Rn ------------------ */
94 111 olivier.gi
.set   aRn_EDE_218,  DMEM_218
95
.set   aRn_EDE_21B,  DMEM_21B
96
.set   aRn_EDE_21C,  DMEM_21C
97
.set   aRn_EDE_21F,  DMEM_21F
98 2 olivier.gi
 
99 111 olivier.gi
.set   aRn_TONY_220, DMEM_220
100
.set   aRn_TONY_223, DMEM_223
101
.set   aRn_TONY_224, DMEM_224
102
.set   aRn_TONY_227, DMEM_227
103 2 olivier.gi
 
104
 
105 111 olivier.gi
        mov     #0x2233, &DMEM_210
106
        mov   #DMEM_210, r4
107 2 olivier.gi
        mov     #0xffff, r5
108
        mov.b       @r4, r5         ;# r5 takes @0x0210 value: 0x0033
109 111 olivier.gi
        mov     #0x4455, &DMEM_212
110
        mov   #DMEM_213, r4
111 2 olivier.gi
        mov     #0xffff, r6
112
        mov.b       @r4, r6         ;# r6 takes @0x0213 value: 0x0044
113
 
114 111 olivier.gi
        mov     #0x1122, &DMEM_200
115
        mov     #0x3344, &DMEM_202
116
        mov     #0x5566, &DMEM_204
117
        mov     #0x7788, &DMEM_206
118
        mov   #DMEM_200, r7
119
        mov     #0xaaaa, &DMEM_210
120
        mov     #0x5555, &DMEM_212
121
        mov     #0x5a5a, &DMEM_214
122
        mov     #0xa5a5, &DMEM_216
123 2 olivier.gi
 
124 111 olivier.gi
        mov   #DMEM_200, r8
125 2 olivier.gi
        mov.b       @r8, 16(r7)      ;# Move memory @0x200 (0x22) to memory @0x210
126 111 olivier.gi
        mov   #DMEM_202, r8
127 2 olivier.gi
        mov.b       @r8, 19(r7)      ;# Move memory @0x202 (0x44) to memory @0x213
128 111 olivier.gi
        mov   #DMEM_205, r8
129 2 olivier.gi
        mov.b       @r8, 20(r7)      ;# Move memory @0x205 (0x55) to memory @0x214
130 111 olivier.gi
        mov   #DMEM_207, r8
131 2 olivier.gi
        mov.b       @r8, 23(r7)      ;# Move memory @0x207 (0x77) to memory @0x217
132
 
133 111 olivier.gi
        mov     #0x99aa, &DMEM_200
134
        mov     #0xbbcc, &DMEM_202
135
        mov     #0xddee, &DMEM_204
136
        mov     #0xff11, &DMEM_206
137
        mov     #0x1111, &DMEM_218
138
        mov     #0xeeee, &DMEM_21A
139
        mov     #0x1e1e, &DMEM_21C
140
        mov     #0xe1e1, &DMEM_21E
141 2 olivier.gi
 
142 111 olivier.gi
        mov   #DMEM_200, r8
143 141 olivier.gi
        mov.b       @r8, aRn_EDE_218+PMEM_LENGTH ;# Move memory @0x200 (0xaa) to memory @0x218
144 111 olivier.gi
        mov   #DMEM_202, r8
145 141 olivier.gi
        mov.b       @r8, aRn_EDE_21B+PMEM_LENGTH ;# Move memory @0x202 (0xcc) to memory @0x21B
146 111 olivier.gi
        mov   #DMEM_205, r8
147 141 olivier.gi
        mov.b       @r8, aRn_EDE_21C+PMEM_LENGTH ;# Move memory @0x205 (0xdd) to memory @0x21C
148 111 olivier.gi
        mov   #DMEM_207, r8
149 141 olivier.gi
        mov.b       @r8, aRn_EDE_21F+PMEM_LENGTH ;# Move memory @0x207 (0xff) to memory @0x21F
150 2 olivier.gi
 
151 111 olivier.gi
        mov     #0x2233, &DMEM_200
152
        mov     #0x4455, &DMEM_202
153
        mov     #0x6677, &DMEM_204
154
        mov     #0x8899, &DMEM_206
155
        mov     #0x2222, &DMEM_220
156
        mov     #0xdddd, &DMEM_222
157
        mov     #0x2d2d, &DMEM_224
158
        mov     #0xd2d2, &DMEM_226
159 2 olivier.gi
 
160 111 olivier.gi
        mov   #DMEM_200, r8
161 2 olivier.gi
        mov.b       @r8, &aRn_TONY_220 ;# Move memory @0x200 (0x33) to memory @0x220
162 111 olivier.gi
        mov   #DMEM_202, r8
163 2 olivier.gi
        mov.b       @r8, &aRn_TONY_223 ;# Move memory @0x202 (0x55) to memory @0x223
164 111 olivier.gi
        mov   #DMEM_205, r8
165 2 olivier.gi
        mov.b       @r8, &aRn_TONY_224 ;# Move memory @0x205 (0x66) to memory @0x224
166 111 olivier.gi
        mov   #DMEM_207, r8
167 2 olivier.gi
        mov.b       @r8, &aRn_TONY_227 ;# Move memory @0x207 (0x88) to memory @0x227
168
 
169 111 olivier.gi
        mov     #0x3000, r15
170 2 olivier.gi
 
171
 
172
        /* ---------------------- TEST WHEN SOURCE IS @Rn+ ----------------- */
173 111 olivier.gi
.set   aRni_EDE_218,  DMEM_218
174
.set   aRni_EDE_21B,  DMEM_21B
175
.set   aRni_EDE_21C,  DMEM_21C
176
.set   aRni_EDE_21F,  DMEM_21F
177 2 olivier.gi
 
178 111 olivier.gi
.set   aRni_TONY_220, DMEM_220
179
.set   aRni_TONY_223, DMEM_223
180
.set   aRni_TONY_224, DMEM_224
181
.set   aRni_TONY_227, DMEM_227
182 2 olivier.gi
 
183
 
184 111 olivier.gi
        mov     #0x2233, &DMEM_210
185
        mov   #DMEM_210, r4
186 2 olivier.gi
        mov     #0xffff, r5
187
        mov.b      @r4+, r5         ;# r5 takes @0x0210 value: 0x0033
188 111 olivier.gi
        mov     #0x4455, &DMEM_212
189
        mov   #DMEM_213, r6
190 2 olivier.gi
        mov     #0xffff, r7
191
        mov.b      @r6+, r7         ;# r7 takes @0x0213 value: 0x0044
192
 
193 111 olivier.gi
        mov     #0x1122, &DMEM_200
194
        mov     #0x3344, &DMEM_202
195
        mov     #0x5566, &DMEM_204
196
        mov     #0x7788, &DMEM_206
197
        mov   #DMEM_200, r8
198
        mov     #0xaaaa, &DMEM_210
199
        mov     #0x5555, &DMEM_212
200
        mov     #0x5a5a, &DMEM_214
201
        mov     #0xa5a5, &DMEM_216
202 2 olivier.gi
 
203 111 olivier.gi
        mov   #DMEM_200, r9
204 2 olivier.gi
        mov.b      @r9+, 16(r8)      ;# Move memory @0x200 (0x22) to memory @0x210
205
        mov.b      @r9+, r10
206
        mov.b      @r9+, 19(r8)      ;# Move memory @0x202 (0x44) to memory @0x213
207
        mov        @r9+, r10
208
        mov.b      @r9+, 20(r8)      ;# Move memory @0x205 (0x55) to memory @0x214
209
        mov.b      @r9+, r10
210
        mov.b      @r9+, 23(r8)      ;# Move memory @0x207 (0x77) to memory @0x217
211
 
212 111 olivier.gi
        mov     #0x99aa, &DMEM_200
213
        mov     #0xbbcc, &DMEM_202
214
        mov     #0xddee, &DMEM_204
215
        mov     #0xff11, &DMEM_206
216
        mov     #0x1111, &DMEM_218
217
        mov     #0xeeee, &DMEM_21A
218
        mov     #0x1e1e, &DMEM_21C
219
        mov     #0xe1e1, &DMEM_21E
220 2 olivier.gi
 
221 111 olivier.gi
        mov   #DMEM_200, r10
222 141 olivier.gi
        mov.b     @r10+, aRni_EDE_218+PMEM_LENGTH ;# Move memory @0x200 (0xaa) to memory @0x218
223 2 olivier.gi
        mov.b     @r10+, r11
224 141 olivier.gi
        mov.b     @r10+, aRni_EDE_21B+PMEM_LENGTH ;# Move memory @0x202 (0xcc) to memory @0x21B
225 2 olivier.gi
        mov       @r10+, r11
226 141 olivier.gi
        mov.b     @r10+, aRni_EDE_21C+PMEM_LENGTH ;# Move memory @0x205 (0xdd) to memory @0x21C
227 2 olivier.gi
        mov.b     @r10+, r11
228 141 olivier.gi
        mov.b     @r10+, aRni_EDE_21F+PMEM_LENGTH ;# Move memory @0x207 (0xff) to memory @0x21F
229 2 olivier.gi
 
230 111 olivier.gi
        mov     #0x2233, &DMEM_200
231
        mov     #0x4455, &DMEM_202
232
        mov     #0x6677, &DMEM_204
233
        mov     #0x8899, &DMEM_206
234
        mov     #0x2222, &DMEM_220
235
        mov     #0xdddd, &DMEM_222
236
        mov     #0x2d2d, &DMEM_224
237
        mov     #0xd2d2, &DMEM_226
238 2 olivier.gi
 
239 111 olivier.gi
        mov   #DMEM_200, r11
240 2 olivier.gi
        mov.b     @r11+, &aRni_TONY_220 ;# Move memory @0x200 (0x33) to memory @0x220
241
        mov.b     @r11+, r12
242
        mov.b     @r11+, &aRni_TONY_223 ;# Move memory @0x202 (0x55) to memory @0x223
243
        mov       @r11+, r12
244
        mov.b     @r11+, &aRni_TONY_224 ;# Move memory @0x205 (0x66) to memory @0x224
245
        mov.b     @r11+, r12
246
        mov.b     @r11+, &aRni_TONY_227 ;# Move memory @0x207 (0x88) to memory @0x227
247
 
248 111 olivier.gi
        mov     #0x4000, r15
249 2 olivier.gi
 
250
 
251
        /* ---------------------- TEST WHEN SOURCE IS #N ------------------- */
252 111 olivier.gi
.set   N_EDE_218,  DMEM_218
253
.set   N_EDE_21B,  DMEM_21B
254
.set   N_EDE_21C,  DMEM_21C
255
.set   N_EDE_21F,  DMEM_21F
256 2 olivier.gi
 
257 111 olivier.gi
.set   N_TONY_220, DMEM_220
258
.set   N_TONY_223, DMEM_223
259
.set   N_TONY_224, DMEM_224
260
.set   N_TONY_227, DMEM_227
261 2 olivier.gi
 
262
 
263
        mov     #0xffff, r4
264
        mov.b   #0x1234, r4         ;# r4 takes 0x0034 value
265
 
266 111 olivier.gi
        mov   #DMEM_200, r5
267
        mov     #0xaaaa, &DMEM_210
268
        mov     #0x5555, &DMEM_212
269
        mov     #0x5a5a, &DMEM_214
270
        mov     #0xa5a5, &DMEM_216
271 2 olivier.gi
        mov.b   #0x1122, 16(r5)     ;# Move value 0x22 to memory @0x210
272
        mov.b   #0x3344, 19(r5)     ;# Move value 0x44 to memory @0x213
273
        mov.b   #0x5566, 20(r5)     ;# Move value 0x66 to memory @0x214
274
        mov.b   #0x7788, 23(r5)     ;# Move value 0x88 to memory @0x217
275
 
276
 
277 111 olivier.gi
        mov     #0x1111, &DMEM_218
278
        mov     #0xeeee, &DMEM_21A
279
        mov     #0x1e1e, &DMEM_21C
280
        mov     #0xe1e1, &DMEM_21E
281 141 olivier.gi
        mov.b   #0x99aa, N_EDE_218+PMEM_LENGTH  ;# Move value 0xaa to memory @0x218
282
        mov.b   #0xbbcc, N_EDE_21B+PMEM_LENGTH  ;# Move value 0xcc to memory @0x21B
283
        mov.b   #0xddee, N_EDE_21C+PMEM_LENGTH  ;# Move value 0xee to memory @0x21C
284
        mov.b   #0xff11, N_EDE_21F+PMEM_LENGTH  ;# Move value 0x11 to memory @0x21F
285 2 olivier.gi
 
286 111 olivier.gi
        mov     #0xaaaa, &DMEM_220
287
        mov     #0xeeee, &DMEM_222
288
        mov     #0xaeae, &DMEM_224
289
        mov     #0xeaea, &DMEM_226
290 2 olivier.gi
        mov.b   #0x2233, &N_TONY_220 ;# Move value 0x33 to memory @0x220
291
        mov.b   #0x4455, &N_TONY_223 ;# Move value 0x55 to memory @0x223
292
        mov.b   #0x6677, &N_TONY_224 ;# Move value 0x77 to memory @0x224
293
        mov.b   #0x8899, &N_TONY_227 ;# Move value 0x99 to memory @0x227
294
 
295
        mov      #0x5000, r15
296
 
297
 
298
        /* ---------------------- TEST WHEN SOURCE IS x(Rn) ---------------- */
299 111 olivier.gi
.set   xRn_EDE_218,  DMEM_218
300
.set   xRn_EDE_21B,  DMEM_21B
301
.set   xRn_EDE_21C,  DMEM_21C
302
.set   xRn_EDE_21F,  DMEM_21F
303 2 olivier.gi
 
304 111 olivier.gi
.set   xRn_TONY_220, DMEM_220
305
.set   xRn_TONY_223, DMEM_223
306
.set   xRn_TONY_224, DMEM_224
307
.set   xRn_TONY_227, DMEM_227
308 2 olivier.gi
 
309
 
310 111 olivier.gi
        mov     #0x2233, &DMEM_210
311
        mov   #DMEM_200, r4
312 2 olivier.gi
        mov     #0xffff, r5
313
        mov.b    16(r4), r5         ;# r5 takes @0x0210 value: 0x0033
314 111 olivier.gi
        mov     #0x4455, &DMEM_212
315 2 olivier.gi
        mov     #0xffff, r6
316
        mov.b    19(r4), r6         ;# r6 takes @0x0213 value: 0x0044
317
 
318 111 olivier.gi
        mov     #0x1122, &DMEM_202
319
        mov     #0x3344, &DMEM_204
320
        mov     #0x5566, &DMEM_206
321
        mov     #0x7788, &DMEM_208
322
        mov   #DMEM_200, r7
323
        mov     #0xaaaa, &DMEM_210
324
        mov     #0x5555, &DMEM_212
325
        mov     #0x5a5a, &DMEM_214
326
        mov     #0xa5a5, &DMEM_216
327 2 olivier.gi
 
328 111 olivier.gi
        mov   #DMEM_200, r8
329 2 olivier.gi
        mov.b     2(r8), 16(r7)      ;# Move memory @0x202 (0x22) to memory @0x210
330
        mov.b     4(r8), 19(r7)      ;# Move memory @0x204 (0x44) to memory @0x213
331
        mov.b     7(r8), 20(r7)      ;# Move memory @0x207 (0x55) to memory @0x214
332
        mov.b     9(r8), 23(r7)      ;# Move memory @0x209 (0x77) to memory @0x217
333
 
334 111 olivier.gi
        mov     #0x99aa, &DMEM_202
335
        mov     #0xbbcc, &DMEM_204
336
        mov     #0xddee, &DMEM_206
337
        mov     #0xff11, &DMEM_208
338
        mov     #0x1111, &DMEM_218
339
        mov     #0xeeee, &DMEM_21A
340
        mov     #0x1e1e, &DMEM_21C
341
        mov     #0xe1e1, &DMEM_21E
342 2 olivier.gi
 
343 111 olivier.gi
        mov   #DMEM_200, r8
344 141 olivier.gi
        mov.b     2(r8), xRn_EDE_218+PMEM_LENGTH ;# Move memory @0x202 (0xaa) to memory @0x218
345
        mov.b     4(r8), xRn_EDE_21B+PMEM_LENGTH ;# Move memory @0x204 (0xcc) to memory @0x21B
346
        mov.b     7(r8), xRn_EDE_21C+PMEM_LENGTH ;# Move memory @0x207 (0xdd) to memory @0x21C
347
        mov.b     9(r8), xRn_EDE_21F+PMEM_LENGTH ;# Move memory @0x209 (0xff) to memory @0x21F
348 2 olivier.gi
 
349 111 olivier.gi
        mov     #0x2233, &DMEM_202
350
        mov     #0x4455, &DMEM_204
351
        mov     #0x6677, &DMEM_206
352
        mov     #0x8899, &DMEM_208
353
        mov     #0x2222, &DMEM_220
354
        mov     #0xdddd, &DMEM_222
355
        mov     #0x2d2d, &DMEM_224
356
        mov     #0xd2d2, &DMEM_226
357 2 olivier.gi
 
358 111 olivier.gi
        mov   #DMEM_200, r8
359 2 olivier.gi
        mov.b     2(r8), &xRn_TONY_220 ;# Move memory @0x202 (0x33) to memory @0x220
360
        mov.b     4(r8), &xRn_TONY_223 ;# Move memory @0x204 (0x55) to memory @0x223
361
        mov.b     7(r8), &xRn_TONY_224 ;# Move memory @0x207 (0x66) to memory @0x224
362
        mov.b     9(r8), &xRn_TONY_227 ;# Move memory @0x209 (0x88) to memory @0x227
363
 
364 111 olivier.gi
        mov     #0x6000, r15
365 2 olivier.gi
 
366
 
367
        /* ---------------------- TEST WHEN SOURCE IS 'EDE' ---------------- */
368 111 olivier.gi
.set   EDE_EDE_202,  DMEM_202
369
.set   EDE_EDE_204,  DMEM_204
370
.set   EDE_EDE_207,  DMEM_207
371
.set   EDE_EDE_209,  DMEM_209
372
.set   EDE_EDE_210,  DMEM_210
373
.set   EDE_EDE_213,  DMEM_213
374
.set   EDE_EDE_218,  DMEM_218
375
.set   EDE_EDE_21B,  DMEM_21B
376
.set   EDE_EDE_21C,  DMEM_21C
377
.set   EDE_EDE_21F,  DMEM_21F
378 2 olivier.gi
 
379 111 olivier.gi
.set   EDE_TONY_220, DMEM_220
380
.set   EDE_TONY_223, DMEM_223
381
.set   EDE_TONY_224, DMEM_224
382
.set   EDE_TONY_227, DMEM_227
383 2 olivier.gi
 
384
 
385 111 olivier.gi
        mov       #0x2233, &DMEM_210
386 2 olivier.gi
        mov       #0xffff, r5
387 141 olivier.gi
        mov.b EDE_EDE_210+PMEM_LENGTH, r5         ;# r5 takes @0x0210 value: 0x0033
388 111 olivier.gi
        mov       #0x4455, &DMEM_212
389 2 olivier.gi
        mov       #0xffff, r6
390 141 olivier.gi
        mov.b EDE_EDE_213+PMEM_LENGTH, r6         ;# r6 takes @0x0213 value: 0x0044
391 2 olivier.gi
 
392 111 olivier.gi
        mov       #0x1122, &DMEM_202
393
        mov       #0x3344, &DMEM_204
394
        mov       #0x5566, &DMEM_206
395
        mov       #0x7788, &DMEM_208
396
        mov     #DMEM_200, r7
397
        mov       #0xaaaa, &DMEM_210
398
        mov       #0x5555, &DMEM_212
399
        mov       #0x5a5a, &DMEM_214
400
        mov       #0xa5a5, &DMEM_216
401 2 olivier.gi
 
402 141 olivier.gi
        mov.b EDE_EDE_202+PMEM_LENGTH, 16(r7)      ;# Move memory @0x202 (0x22) to memory @0x210
403
        mov.b EDE_EDE_204+PMEM_LENGTH, 19(r7)      ;# Move memory @0x204 (0x44) to memory @0x213
404
        mov.b EDE_EDE_207+PMEM_LENGTH, 20(r7)      ;# Move memory @0x207 (0x55) to memory @0x214
405
        mov.b EDE_EDE_209+PMEM_LENGTH, 23(r7)      ;# Move memory @0x209 (0x77) to memory @0x217
406 2 olivier.gi
 
407 111 olivier.gi
        mov       #0x99aa, &DMEM_202
408
        mov       #0xbbcc, &DMEM_204
409
        mov       #0xddee, &DMEM_206
410
        mov       #0xff11, &DMEM_208
411
        mov       #0x1111, &DMEM_218
412
        mov       #0xeeee, &DMEM_21A
413
        mov       #0x1e1e, &DMEM_21C
414
        mov       #0xe1e1, &DMEM_21E
415 2 olivier.gi
 
416 141 olivier.gi
        mov.b EDE_EDE_202+PMEM_LENGTH, EDE_EDE_218+PMEM_LENGTH ;# Move memory @0x202 (0xaa) to memory @0x218
417
        mov.b EDE_EDE_204+PMEM_LENGTH, EDE_EDE_21B+PMEM_LENGTH ;# Move memory @0x204 (0xcc) to memory @0x21B
418
        mov.b EDE_EDE_207+PMEM_LENGTH, EDE_EDE_21C+PMEM_LENGTH ;# Move memory @0x207 (0xdd) to memory @0x21C
419
        mov.b EDE_EDE_209+PMEM_LENGTH, EDE_EDE_21F+PMEM_LENGTH ;# Move memory @0x209 (0xff) to memory @0x21F
420 2 olivier.gi
 
421 111 olivier.gi
        mov       #0x2233, &DMEM_202
422
        mov       #0x4455, &DMEM_204
423
        mov       #0x6677, &DMEM_206
424
        mov       #0x8899, &DMEM_208
425
        mov       #0x2222, &DMEM_220
426
        mov       #0xdddd, &DMEM_222
427
        mov       #0x2d2d, &DMEM_224
428
        mov       #0xd2d2, &DMEM_226
429 2 olivier.gi
 
430 141 olivier.gi
        mov.b EDE_EDE_202+PMEM_LENGTH, &EDE_TONY_220 ;# Move memory @0x202 (0x33) to memory @0x220
431
        mov.b EDE_EDE_204+PMEM_LENGTH, &EDE_TONY_223 ;# Move memory @0x204 (0x55) to memory @0x223
432
        mov.b EDE_EDE_207+PMEM_LENGTH, &EDE_TONY_224 ;# Move memory @0x207 (0x66) to memory @0x224
433
        mov.b EDE_EDE_209+PMEM_LENGTH, &EDE_TONY_227 ;# Move memory @0x209 (0x88) to memory @0x227
434 2 olivier.gi
 
435
        mov      #0x7000, r15
436
 
437
 
438
 
439
        /* ---------------------- TEST WHEN SOURCE IS '&EDE' --------------- */
440 111 olivier.gi
.set   aEDE_EDE_218,  DMEM_218
441
.set   aEDE_EDE_21B,  DMEM_21B
442
.set   aEDE_EDE_21C,  DMEM_21C
443
.set   aEDE_EDE_21F,  DMEM_21F
444 2 olivier.gi
 
445 111 olivier.gi
.set   aEDE_TONY_220, DMEM_220
446
.set   aEDE_TONY_223, DMEM_223
447
.set   aEDE_TONY_224, DMEM_224
448
.set   aEDE_TONY_227, DMEM_227
449 2 olivier.gi
 
450
 
451 111 olivier.gi
        mov       #0x2233, &DMEM_210
452 2 olivier.gi
        mov       #0xffff, r5
453 111 olivier.gi
        mov.b   &DMEM_210, r5         ;# r5 takes @0x0210 value: 0x0033
454
        mov       #0x4455, &DMEM_212
455 2 olivier.gi
        mov       #0xffff, r6
456 111 olivier.gi
        mov.b   &DMEM_213, r6         ;# r6 takes @0x0213 value: 0x0044
457 2 olivier.gi
 
458 111 olivier.gi
        mov       #0x1122, &DMEM_202
459
        mov       #0x3344, &DMEM_204
460
        mov       #0x5566, &DMEM_206
461
        mov       #0x7788, &DMEM_208
462
        mov     #DMEM_200, r7
463
        mov       #0xaaaa, &DMEM_210
464
        mov       #0x5555, &DMEM_212
465
        mov       #0x5a5a, &DMEM_214
466
        mov       #0xa5a5, &DMEM_216
467 2 olivier.gi
 
468 111 olivier.gi
        mov.b   &DMEM_202, 16(r7)      ;# Move memory @0x202 (0x22) to memory @0x210
469
        mov.b   &DMEM_204, 19(r7)      ;# Move memory @0x204 (0x44) to memory @0x213
470
        mov.b   &DMEM_207, 20(r7)      ;# Move memory @0x207 (0x55) to memory @0x214
471
        mov.b   &DMEM_209, 23(r7)      ;# Move memory @0x209 (0x77) to memory @0x217
472 2 olivier.gi
 
473 111 olivier.gi
        mov       #0x99aa, &DMEM_202
474
        mov       #0xbbcc, &DMEM_204
475
        mov       #0xddee, &DMEM_206
476
        mov       #0xff11, &DMEM_208
477
        mov       #0x1111, &DMEM_218
478
        mov       #0xeeee, &DMEM_21A
479
        mov       #0x1e1e, &DMEM_21C
480
        mov       #0xe1e1, &DMEM_21E
481 2 olivier.gi
 
482 141 olivier.gi
        mov.b   &DMEM_202, aEDE_EDE_218+PMEM_LENGTH ;# Move memory @0x202 (0xaa) to memory @0x218
483
        mov.b   &DMEM_204, aEDE_EDE_21B+PMEM_LENGTH ;# Move memory @0x204 (0xcc) to memory @0x21B
484
        mov.b   &DMEM_207, aEDE_EDE_21C+PMEM_LENGTH ;# Move memory @0x207 (0xdd) to memory @0x21C
485
        mov.b   &DMEM_209, aEDE_EDE_21F+PMEM_LENGTH ;# Move memory @0x209 (0xff) to memory @0x21F
486 2 olivier.gi
 
487 111 olivier.gi
        mov       #0x2233, &DMEM_202
488
        mov       #0x4455, &DMEM_204
489
        mov       #0x6677, &DMEM_206
490
        mov       #0x8899, &DMEM_208
491
        mov       #0x2222, &DMEM_220
492
        mov       #0xdddd, &DMEM_222
493
        mov       #0x2d2d, &DMEM_224
494
        mov       #0xd2d2, &DMEM_226
495 2 olivier.gi
 
496 111 olivier.gi
        mov.b   &DMEM_202, &aEDE_TONY_220 ;# Move memory @0x202 (0x33) to memory @0x220
497
        mov.b   &DMEM_204, &aEDE_TONY_223 ;# Move memory @0x204 (0x55) to memory @0x223
498
        mov.b   &DMEM_207, &aEDE_TONY_224 ;# Move memory @0x207 (0x66) to memory @0x224
499
        mov.b   &DMEM_209, &aEDE_TONY_227 ;# Move memory @0x209 (0x88) to memory @0x227
500 2 olivier.gi
 
501 111 olivier.gi
        mov       #0x8000, r15
502 2 olivier.gi
 
503
 
504
        /* ---------------------- TEST WHEN SOURCE IS CONSTANT ------------- */
505 111 olivier.gi
.set   CONSTL_EDE0,   DMEM_230
506
.set   CONSTL_EDE1,   DMEM_232
507
.set   CONSTL_EDE2,   DMEM_234
508
.set   CONSTL_EDE4,   DMEM_236
509
.set   CONSTL_EDE8,   DMEM_238
510
.set   CONSTL_EDEm1,  DMEM_23A
511
.set   CONSTH_EDE0,   DMEM_23D
512
.set   CONSTH_EDE1,   DMEM_23F
513
.set   CONSTH_EDE2,   DMEM_241
514
.set   CONSTH_EDE4,   DMEM_243
515
.set   CONSTH_EDE8,   DMEM_245
516
.set   CONSTH_EDEm1,  DMEM_247
517 2 olivier.gi
 
518 111 olivier.gi
.set   CONSTL_TONY0,  DMEM_250
519
.set   CONSTL_TONY1,  DMEM_252
520
.set   CONSTL_TONY2,  DMEM_254
521
.set   CONSTL_TONY4,  DMEM_256
522
.set   CONSTL_TONY8,  DMEM_258
523
.set   CONSTL_TONYm1, DMEM_25A
524
.set   CONSTH_TONY0,  DMEM_25D
525
.set   CONSTH_TONY1,  DMEM_25F
526
.set   CONSTH_TONY2,  DMEM_261
527
.set   CONSTH_TONY4,  DMEM_263
528
.set   CONSTH_TONY8,  DMEM_265
529
.set   CONSTH_TONYm1, DMEM_267
530 2 olivier.gi
 
531
 
532
        mov      #0x4444, r4              ;# Initialize registers
533
        mov      #0x5555, r5
534
        mov      #0x6666, r6
535
        mov      #0x7777, r7
536
        mov      #0x8888, r8
537
        mov      #0x9999, r9
538
 
539
        mov.b    #0x0000, r4              ;# Write +0 to R4
540
        mov.b    #0x0001, r5              ;# Write +1 to R5
541
        mov.b    #0x0002, r6              ;# Write +2 to R6
542
        mov.b    #0x0004, r7              ;# Write +4 to R7
543
        mov.b    #0x0008, r8              ;# Write +8 to R8
544
        mov.b    #0xffff, r9              ;# Write -1 to R9
545
 
546 111 olivier.gi
        mov      #0x4444, &DMEM_210       ;# Initialize Memory
547
        mov      #0x5555, &DMEM_212
548
        mov      #0x6666, &DMEM_214
549
        mov      #0x7777, &DMEM_216
550
        mov      #0x3535, &DMEM_218
551
        mov      #0x9999, &DMEM_21A
552
        mov      #0xaaaa, &DMEM_21C
553
        mov      #0xbbbb, &DMEM_21E
554
        mov      #0xcccc, &DMEM_220
555
        mov      #0xdddd, &DMEM_222
556
        mov      #0xeeee, &DMEM_224
557
        mov      #0x3333, &DMEM_226
558 2 olivier.gi
 
559 111 olivier.gi
        mov    #DMEM_202, r10
560 2 olivier.gi
        mov      #0x1234, r11
561
        mov.b    #0x0000, 14(r10)         ;# Move +0 to memory @0x210
562
        mov.b    #0x0001, 16(r10)         ;# Move +1 to memory @0x212
563
        mov.b    #0x0002, 18(r10)         ;# Move +2 to memory @0x214
564
        mov.b    #0x0004, 20(r10)         ;# Move +4 to memory @0x216
565
        mov.b    #0x0008, 22(r10)         ;# Move +8 to memory @0x218
566
        mov.b    #0xffff, 24(r10)         ;# Move -1 to memory @0x21A
567
        mov.b    #0x0000, 27(r10)         ;# Move +0 to memory @0x21D
568
        mov.b    #0x0001, 29(r10)         ;# Move +1 to memory @0x21F
569
        mov.b    #0x0002, 31(r10)         ;# Move +2 to memory @0x221
570
        mov.b    #0x0004, 33(r10)         ;# Move +4 to memory @0x223
571
        mov.b    #0x0008, 35(r10)         ;# Move +8 to memory @0x225
572
        mov.b    #0xffff, 37(r10)         ;# Move -1 to memory @0x227
573
 
574 111 olivier.gi
        mov      #0x4444, &DMEM_230       ;# Initialize Memory
575
        mov      #0x5555, &DMEM_232
576
        mov      #0x6666, &DMEM_234
577
        mov      #0x7777, &DMEM_236
578
        mov      #0x3535, &DMEM_238
579
        mov      #0x9999, &DMEM_23A
580
        mov      #0xaaaa, &DMEM_23C
581
        mov      #0xbbbb, &DMEM_23E
582
        mov      #0xcccc, &DMEM_240
583
        mov      #0xdddd, &DMEM_242
584
        mov      #0xeeee, &DMEM_244
585
        mov      #0x3333, &DMEM_246
586 2 olivier.gi
 
587 141 olivier.gi
        mov.b    #0x0000, CONSTL_EDE0+PMEM_LENGTH     ;# Move +0 to memory @0x230
588
        mov.b    #0x0001, CONSTL_EDE1+PMEM_LENGTH     ;# Move +1 to memory @0x232
589
        mov.b    #0x0002, CONSTL_EDE2+PMEM_LENGTH     ;# Move +2 to memory @0x234
590
        mov.b    #0x0004, CONSTL_EDE4+PMEM_LENGTH     ;# Move +4 to memory @0x236
591
        mov.b    #0x0008, CONSTL_EDE8+PMEM_LENGTH     ;# Move +8 to memory @0x238
592
        mov.b    #0xffff, CONSTL_EDEm1+PMEM_LENGTH    ;# Move -1 to memory @0x23A
593
        mov.b    #0x0000, CONSTH_EDE0+PMEM_LENGTH     ;# Move +0 to memory @0x23D
594
        mov.b    #0x0001, CONSTH_EDE1+PMEM_LENGTH     ;# Move +1 to memory @0x23F
595
        mov.b    #0x0002, CONSTH_EDE2+PMEM_LENGTH     ;# Move +2 to memory @0x241
596
        mov.b    #0x0004, CONSTH_EDE4+PMEM_LENGTH     ;# Move +4 to memory @0x243
597
        mov.b    #0x0008, CONSTH_EDE8+PMEM_LENGTH     ;# Move +8 to memory @0x245
598
        mov.b    #0xffff, CONSTH_EDEm1+PMEM_LENGTH    ;# Move -1 to memory @0x247
599 2 olivier.gi
 
600
 
601
        #
602
        # NOTE: The following section would not fit in the smallest ROM
603
        #       configuration. Therefore, it is executed at the end of
604
        #       the "two-op_mov.s43" pattern.
605
        #
606
 
607 111 olivier.gi
#       mov      #0x4444, &DMEM_250         ;# Initialize Memory
608
#       mov      #0x5555, &DMEM_252
609
#       mov      #0x6666, &DMEM_254
610
#       mov      #0x7777, &DMEM_256
611
#       mov      #0x3535, &DMEM_258
612
#       mov      #0x9999, &DMEM_25A
613
#       mov      #0xaaaa, &DMEM_25C
614
#       mov      #0xbbbb, &DMEM_25E
615
#       mov      #0xcccc, &DMEM_260
616
#       mov      #0xdddd, &DMEM_262
617
#       mov      #0xeeee, &DMEM_264
618
#       mov      #0x3333, &DMEM_266
619 2 olivier.gi
 
620
#       mov.b    #0x0000, &CONSTL_TONY0    ;# Move +0 to memory @0x250
621
#       mov.b    #0x0001, &CONSTL_TONY1    ;# Move +1 to memory @0x252
622
#       mov.b    #0x0002, &CONSTL_TONY2    ;# Move +2 to memory @0x254
623
#       mov.b    #0x0004, &CONSTL_TONY4    ;# Move +4 to memory @0x256
624
#       mov.b    #0x0008, &CONSTL_TONY8    ;# Move +8 to memory @0x258
625
#       mov.b    #0xffff, &CONSTL_TONYm1   ;# Move -1 to memory @0x25A
626
#       mov.b    #0x0000, &CONSTH_TONY0    ;# Move +0 to memory @0x25D
627
#       mov.b    #0x0001, &CONSTH_TONY1    ;# Move +1 to memory @0x25F
628
#       mov.b    #0x0002, &CONSTH_TONY2    ;# Move +2 to memory @0x261
629
#       mov.b    #0x0004, &CONSTH_TONY4    ;# Move +4 to memory @0x263
630
#       mov.b    #0x0008, &CONSTH_TONY8    ;# Move +8 to memory @0x265
631
#       mov.b    #0xffff, &CONSTH_TONYm1   ;# Move -1 to memory @0x267
632
 
633
        mov      #0x9000, r15
634
 
635
 
636
        /* ----------------------         END OF TEST        --------------- */
637
end_of_test:
638
        nop
639
        br #0xffff
640
 
641
 
642
 
643
        /* ----------------------         INTERRUPT VECTORS  --------------- */
644
 
645
.section .vectors, "a"
646
.word end_of_test  ; Interrupt  0 (lowest priority)    
647
.word end_of_test  ; Interrupt  1                      
648
.word end_of_test  ; Interrupt  2                      
649
.word end_of_test  ; Interrupt  3                      
650
.word end_of_test  ; Interrupt  4                      
651
.word end_of_test  ; Interrupt  5                      
652
.word end_of_test  ; Interrupt  6                      
653
.word end_of_test  ; Interrupt  7                      
654
.word end_of_test  ; Interrupt  8                      
655
.word end_of_test  ; Interrupt  9                      
656
.word end_of_test  ; Interrupt 10                      Watchdog timer
657
.word end_of_test  ; Interrupt 11                      
658
.word end_of_test  ; Interrupt 12                      
659
.word end_of_test  ; Interrupt 13                      
660
.word end_of_test  ; Interrupt 14                      NMI
661
.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.