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

Subversion Repositories openmsp430

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

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 INSTRUCTION                   */
25
/*---------------------------------------------------------------------------*/
26
/* Test the ADD 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 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 111 olivier.gi
.set   Rn_EDE,  DMEM_212
62
.set   Rn_TONY, DMEM_214
63 2 olivier.gi
 
64
        mov     #0x4444, r4
65
        mov     #0x5555, r5
66
        add          r4, r5        ;# Add r4+r5 (0x4444+0x5555=0x9999)
67
 
68
        mov     #0x000a, r4
69
        add          r4, r0
70
        nop
71
        nop
72
        nop
73
        mov     #0x1234, r4        ;# Make sure the jump is taken
74
test_Rn_PC:
75
 
76 111 olivier.gi
        mov     #0x2222, &DMEM_210
77
        mov   #DMEM_200, r6
78 2 olivier.gi
        mov     #0x3333, r7
79
        add          r7, 16(r6)    ;# Write 0x2222+0x3333=0x5555 to memory @0x0210
80
 
81 111 olivier.gi
        mov     #0x4444, &DMEM_212
82 2 olivier.gi
        mov     #0x5678, r7
83 141 olivier.gi
        add          r7, Rn_EDE+PMEM_LENGTH    ;# Write 0x4444+0x5678=0x9abc to memory @0x0212
84 2 olivier.gi
 
85 111 olivier.gi
        mov     #0x5555, &DMEM_214
86 2 olivier.gi
        mov     #0x1234, r8
87
        add          r8, &Rn_TONY  ;# Write 0x5555+0x1234=0x6789 to memory @0x0214
88
 
89
        mov     #0x2000, r15
90
 
91
 
92
        /* ---------------------- TEST WHEN SOURCE IS @Rn ------------------ */
93 111 olivier.gi
.set   aRn_EDE,  DMEM_212
94
.set   aRn_TONY, DMEM_214
95 2 olivier.gi
 
96 111 olivier.gi
        mov   #DMEM_200, r4
97
        mov     #0x1111, &DMEM_200
98 2 olivier.gi
        mov     #0x6666, r5
99
        add         @r4, r5        ;# Add @r4+r5 (0x1111+0x6666=0x7777)
100
 
101 111 olivier.gi
        mov   #DMEM_200, r4
102
        mov     #0x000a, &DMEM_200
103 2 olivier.gi
        add         @r4, r0
104
        nop
105
        nop
106
        nop
107
        mov     #0x1234, r4        ;# Make sure the jump is taken
108
test_aRn_PC:
109
 
110 111 olivier.gi
        mov     #0x1234, &DMEM_20E
111
        mov     #0x5432, &DMEM_210
112
        mov   #DMEM_200, r6
113
        mov   #DMEM_20E, r7
114 2 olivier.gi
        add         @r7, 16(r6)    ;# Write 0x1234+0x5432=0x6666 to memory @0x0210
115
 
116 111 olivier.gi
        mov     #0x5f12, &DMEM_200
117
        mov     #0x8e1c, &DMEM_212
118
        mov   #DMEM_200, r7
119 141 olivier.gi
        add         @r7, aRn_EDE+PMEM_LENGTH    ;# Write 0x5f12+0x8e1c=0xed2e to memory @0x0212
120 2 olivier.gi
 
121 111 olivier.gi
        mov     #0x3112, &DMEM_202
122
        mov     #0x1541, &DMEM_214
123
        mov   #DMEM_202, r8
124 2 olivier.gi
        add         @r8, &aRn_TONY  ;# Write 0x3112+0x1541=0x4653 to memory @0x0214
125
 
126
        mov     #0x3000, r15
127
 
128
 
129
 
130
        /* ---------------------- TEST WHEN SOURCE IS @Rn+ ----------------- */
131 111 olivier.gi
.set   aRni_EDE,  DMEM_212
132
.set   aRni_TONY, DMEM_214
133 2 olivier.gi
 
134 111 olivier.gi
        mov   #DMEM_200, r4
135
        mov     #0x2222, &DMEM_200
136 2 olivier.gi
        mov     #0x8888, r5
137
        add        @r4+, r5         ;# Add @r4+r5 (0x2222+0x8888=0xaaaa)
138
 
139 111 olivier.gi
        mov   #DMEM_204, r6
140
        mov     #0x000a, &DMEM_204
141 2 olivier.gi
        add        @r6+, r0
142
        nop
143
        nop
144
        nop
145
        mov     #0x1234, r6         ;# Make sure the jump is taken
146
test_aRni_PC:
147
 
148 111 olivier.gi
        mov     #0x1234, &DMEM_20E
149
        mov     #0x5432, &DMEM_210
150
        mov   #DMEM_200, r8
151
        mov   #DMEM_20E, r7
152 2 olivier.gi
        add        @r7+, 16(r8)     ;# Write 0x1234+0x5432=0x6666 to memory @0x0210
153
 
154 111 olivier.gi
        mov     #0x5f12, &DMEM_206
155
        mov     #0x8e1c, &DMEM_212
156
        mov   #DMEM_206, r8
157 141 olivier.gi
        add        @r8+, aRni_EDE+PMEM_LENGTH   ;# Write 0x5f12+0x8e1c=0xed2e to memory @0x0212
158 2 olivier.gi
 
159 111 olivier.gi
        mov     #0x3112, &DMEM_202
160
        mov     #0x1541, &DMEM_214
161
        mov   #DMEM_202, r9
162 2 olivier.gi
        add        @r9+, &aRni_TONY ;# Write 0x3112+0x1541=0x4653 to memory @0x0214
163
 
164
        mov      #0x4000, r15
165
 
166
 
167
 
168
        /* ---------------------- TEST WHEN SOURCE IS #N ------------------- */
169 111 olivier.gi
.set   N_EDE,  DMEM_210
170
.set   N_TONY, DMEM_206
171 2 olivier.gi
 
172
        mov      #0x3210, r4
173
        add      #0x1234, r4         ;# Write 0x3210+0x1234=0x4444 to R4
174
 
175
        mov      #0x0000, r5
176
        add      #0x000a, r0
177
        nop
178
        nop
179
        nop
180
        mov      #0x1234, r5         ;# Make sure the jump is taken
181
test_N_PC:
182
 
183 111 olivier.gi
        mov      #0x5432, &DMEM_230
184
        mov    #DMEM_200, r6
185 2 olivier.gi
        add      #0x5a5a, 48(r6)     ;# Write 0x5432+0x5a5a=0xae8c to memory @0x0230
186
 
187 111 olivier.gi
        mov      #0x4325, &DMEM_210
188 141 olivier.gi
        add      #0x1a2b, N_EDE+PMEM_LENGTH      ;# Write 0x4325+0x1a2b=0x5d50 to memory @0x0210
189 2 olivier.gi
 
190 111 olivier.gi
        mov      #0x3254, &DMEM_206
191 2 olivier.gi
        add      #0x3c4d, &N_TONY    ;# Write 0x3254+0x3c4d=0x6ea1 to memory @0x0206
192
 
193
        mov      #0x5000, r15
194
 
195
 
196
        /* ---------------------- TEST WHEN SOURCE IS x(Rn) ---------------- */
197 111 olivier.gi
.set   xRn_EDE,  DMEM_220
198
.set   xRn_TONY, DMEM_208
199 2 olivier.gi
 
200 111 olivier.gi
        mov      #0x8347, &DMEM_210
201 2 olivier.gi
        mov      #0x1234, r5
202 111 olivier.gi
        mov    #DMEM_200, r4
203 2 olivier.gi
        add       16(r4), r5         ;# Write 0x8347+0x1234=0x957b to R5
204
 
205 111 olivier.gi
        mov      #0x000a, &DMEM_208
206
        mov    #DMEM_200, r4
207 2 olivier.gi
        mov      #0x1234, r6
208
        add        8(r4), r0
209
        nop
210
        nop
211
        nop
212
        nop
213
        mov      #0x0000, r6         ;# Make sure the jump is taken
214
test_xRn_PC:
215
 
216 111 olivier.gi
        mov      #0x4241, &DMEM_210
217
        mov      #0x1535, &DMEM_214
218
        mov    #DMEM_200, r7
219
        mov    #DMEM_202, r8
220 2 olivier.gi
        add       16(r7), 18(r8)     ;# Write 0x4241+0x1535=0x5776 to memory @0x214
221
 
222 111 olivier.gi
        mov      #0x7238, &DMEM_204
223
        mov      #0x2143, &DMEM_220
224
        mov    #DMEM_200, r7
225 141 olivier.gi
        add        4(r7), xRn_EDE+PMEM_LENGTH    ;# Write 0x7238+0x2143=0x937b to memory @0x220
226 2 olivier.gi
 
227 111 olivier.gi
        mov      #0x98b2, &DMEM_216
228
        mov      #0x1432, &DMEM_208
229
        mov    #DMEM_200, r7
230 2 olivier.gi
        add       22(r4), &xRn_TONY  ;# Write 0x0x98b2+0x1432=0xace4 to memory @0x208
231
 
232
        mov      #0x6000, r15
233
 
234
 
235
        /* ---------------------- TEST WHEN SOURCE IS 'EDE' ---------------- */
236 111 olivier.gi
.set   EDE_EDE,  DMEM_216
237
.set   EDE_TONY, DMEM_212
238 2 olivier.gi
 
239 111 olivier.gi
.set   EDE_200,  DMEM_200
240
.set   EDE_202,  DMEM_202
241
.set   EDE_204,  DMEM_204
242
.set   EDE_206,  DMEM_206
243
.set   EDE_208,  DMEM_208
244 2 olivier.gi
 
245 111 olivier.gi
        mov      #0xc3d6, &DMEM_200
246
        mov      #0x1234, &DMEM_204
247 2 olivier.gi
        mov      #0x4321, r4
248 141 olivier.gi
        add      EDE_200+PMEM_LENGTH, r4          ;# Write 0xc3d6+0x4321=0x06f7 to R4
249 2 olivier.gi
 
250 111 olivier.gi
        mov      #0x000a, &DMEM_202
251
        mov      #0x1234, &DMEM_204
252 2 olivier.gi
        mov      #0x3456, r6
253 141 olivier.gi
        add      EDE_202+PMEM_LENGTH, r0
254 2 olivier.gi
        nop
255
        nop
256
        nop
257
        nop
258
        mov      #0x0000, r6          ;# Make sure the jump is taken
259
test_EDE_PC:
260
 
261 111 olivier.gi
        mov    #DMEM_202, r8
262
        mov      #0xf712, &DMEM_204
263
        mov      #0x1234, &DMEM_214
264
        mov      #0x0000, &DMEM_208
265 141 olivier.gi
        add      EDE_204+PMEM_LENGTH, 18(r8)      ;# Write 0xf712+0x1234=0x0946 to memory @0x214
266 2 olivier.gi
 
267 111 olivier.gi
        mov      #0xb3a9, &DMEM_206
268
        mov      #0x058a, &DMEM_216
269
        mov      #0x1234, &DMEM_208
270 141 olivier.gi
        add      EDE_206+PMEM_LENGTH, EDE_EDE+PMEM_LENGTH     ;# Write 0xb3a9+0x058a=0xb933 to memory @0x216
271 2 olivier.gi
 
272 111 olivier.gi
        mov      #0x837A, &DMEM_208
273
        mov      #0xA738, &DMEM_212
274
        mov      #0x1234, &DMEM_20A
275 141 olivier.gi
        add      EDE_208+PMEM_LENGTH, &EDE_TONY   ;# Write 0x837A+0xA738=0x2ab2 to memory @0x212
276 2 olivier.gi
 
277
        mov      #0x7000, r15
278
 
279
 
280
 
281
        /* ---------------------- TEST WHEN SOURCE IS '&EDE' --------------- */
282 111 olivier.gi
.set   aEDE_EDE,  DMEM_218
283
.set   aEDE_TONY, DMEM_202
284 2 olivier.gi
 
285 111 olivier.gi
        mov      #0x23d4, &DMEM_200
286
        mov      #0x1234, &DMEM_202
287 2 olivier.gi
        mov      #0x4321, r4
288 111 olivier.gi
        add    &DMEM_200, r4          ;# Write 0x23d4+0x4321=0x66f5 to R4
289 2 olivier.gi
 
290 111 olivier.gi
        mov      #0x000a, &DMEM_202
291
        mov      #0x1234, &DMEM_204
292 2 olivier.gi
        mov      #0x3456, r6
293 111 olivier.gi
        add    &DMEM_202, r0
294 2 olivier.gi
        nop
295
        nop
296
        nop
297
        nop
298
        mov      #0x0000, r6          ;# Make sure the jump is taken
299
test_aEDE_PC:
300
 
301 111 olivier.gi
        mov    #DMEM_202, r7
302
        mov      #0x481c, &DMEM_204
303
        mov      #0x3ab5, &DMEM_214
304
        mov      #0x1234, &DMEM_206
305
        add    &DMEM_204, 18(r7)      ;# Write 0x481c+0x3ab5=0x82d1 to memory @0x214
306 2 olivier.gi
 
307 111 olivier.gi
        mov      #0x5c1f, &DMEM_206
308
        mov      #0x6e2f, &DMEM_218
309
        mov      #0x1234, &DMEM_208
310 141 olivier.gi
        add    &DMEM_206, aEDE_EDE+PMEM_LENGTH    ;# Write 0x5c1f+0x6e2f=0xca4e to memory @0x218
311 2 olivier.gi
 
312 111 olivier.gi
        mov      #0xc16e, &DMEM_208
313
        mov      #0x51ca, &DMEM_202
314
        mov      #0x1234, &DMEM_20A
315
        add    &DMEM_208, &aEDE_TONY  ;# Write 0xc16e+0x51ca=0x1338 to memory @0x202
316 2 olivier.gi
 
317
        mov      #0x8000, r15
318
 
319
 
320
        /* ---------------------- TEST WHEN SOURCE IS CONSTANT ------------- */
321 111 olivier.gi
.set   CONST_EDE0,   DMEM_220
322
.set   CONST_EDE1,   DMEM_222
323
.set   CONST_EDE2,   DMEM_224
324
.set   CONST_EDE4,   DMEM_226
325
.set   CONST_EDE8,   DMEM_228
326
.set   CONST_EDEm1,  DMEM_22A
327 2 olivier.gi
 
328 111 olivier.gi
.set   CONST_TONY0,  DMEM_230
329
.set   CONST_TONY1,  DMEM_232
330
.set   CONST_TONY2,  DMEM_234
331
.set   CONST_TONY4,  DMEM_236
332
.set   CONST_TONY8,  DMEM_238
333
.set   CONST_TONYm1, DMEM_23A
334 2 olivier.gi
 
335
 
336
        mov      #0x4444, r4              ;# Initialize registers
337
        mov      #0x5555, r5
338
        mov      #0x6666, r6
339
        mov      #0x7777, r7
340
        mov      #0x8888, r8
341
        mov      #0x9999, r9
342
        add      #0x0000, r4              ;# Write 0x4444+0 to R4
343
        add      #0x0001, r5              ;# Write 0x5555+1 to R5
344
        add      #0x0002, r6              ;# Write 0x6666+2 to R6
345
        add      #0x0004, r7              ;# Write 0x7777+4 to R7
346
        add      #0x0008, r8              ;# Write 0x8888+8 to R8
347
        add      #0xffff, r9              ;# Write 0x9999-1 to R9
348
 
349
        mov      #0x1234, r11
350
        add      #0x0004, r0
351
        clr      r11
352
        clr      r11
353
        jmp      end_const_r0
354
        clr      r11
355
        clr      r11
356
end_const_r0:
357
 
358 111 olivier.gi
        mov    #DMEM_202, r10
359
        mov      #0x4444, &DMEM_210       ;# Initialize Memory
360
        mov      #0x5555, &DMEM_212
361
        mov      #0x6666, &DMEM_214
362
        mov      #0x7777, &DMEM_216
363
        mov      #0x8888, &DMEM_218
364
        mov      #0x9999, &DMEM_21A
365 2 olivier.gi
        add      #0x0000, 14(r10)         ;# Move 0x4444+0 to memory @0x210
366
        add      #0x0001, 16(r10)         ;# Move 0x5555+1 to memory @0x212
367
        add      #0x0002, 18(r10)         ;# Move 0x6666+2 to memory @0x214
368
        add      #0x0004, 20(r10)         ;# Move 0x7777+4 to memory @0x216
369
        add      #0x0008, 22(r10)         ;# Move 0x8888+8 to memory @0x218
370
        add      #0xffff, 24(r10)         ;# Move 0x9999-1 to memory @0x21A
371
 
372
 
373 111 olivier.gi
        mov      #0x4444, &DMEM_220       ;# Initialize Memory
374
        mov      #0x5555, &DMEM_222
375
        mov      #0x6666, &DMEM_224
376
        mov      #0x7777, &DMEM_226
377
        mov      #0x8888, &DMEM_228
378
        mov      #0x9999, &DMEM_22A
379 141 olivier.gi
        add      #0x0000, CONST_EDE0+PMEM_LENGTH      ;# Move 0x4444+0 to memory @0x220
380
        add      #0x0001, CONST_EDE1+PMEM_LENGTH      ;# Move 0x5555+1 to memory @0x222
381
        add      #0x0002, CONST_EDE2+PMEM_LENGTH      ;# Move 0x6666+2 to memory @0x224
382
        add      #0x0004, CONST_EDE4+PMEM_LENGTH      ;# Move 0x7777+4 to memory @0x226
383
        add      #0x0008, CONST_EDE8+PMEM_LENGTH      ;# Move 0x8888+8 to memory @0x228
384
        add      #0xffff, CONST_EDEm1+PMEM_LENGTH     ;# Move 0x9999-1 to memory @0x22A
385 2 olivier.gi
 
386 111 olivier.gi
        mov      #0x4444, &DMEM_230       ;# Initialize Memory
387
        mov      #0x5555, &DMEM_232
388
        mov      #0x6666, &DMEM_234
389
        mov      #0x7777, &DMEM_236
390
        mov      #0x8888, &DMEM_238
391
        mov      #0x9999, &DMEM_23A
392 2 olivier.gi
        add      #0x0000, &CONST_TONY0    ;# Move 0x4444+0 to memory @0x230
393
        add      #0x0001, &CONST_TONY1    ;# Move 0x5555+1 to memory @0x232
394
        add      #0x0002, &CONST_TONY2    ;# Move 0x6666+2 to memory @0x234
395
        add      #0x0004, &CONST_TONY4    ;# Move 0x7777+4 to memory @0x236
396
        add      #0x0008, &CONST_TONY8    ;# Move 0x8888+8 to memory @0x238
397
        add      #0xffff, &CONST_TONYm1   ;# Move 0x9999-1 to memory @0x23A
398
 
399
        mov      #0x9000, r15
400
 
401
 
402
        /* ------------------------------ TEST FLAGS ---------------------- */
403
 
404
        mov     #0x0000, r2        ;# V=0, N=0, Z=0, C=0
405
        mov     #0x0444, r4        ;#
406
        mov     #0x0555, r5        ;#
407
        add          r4, r5        ;# Add r4+r5 (0x0444+0x0555=0x0999)
408
        mov     #0xA000, r15
409
 
410
        mov     #0x0000, r2        ;# V=0, N=0, Z=0, C=1
411
        mov     #0x0011, r4        ;#
412
        mov     #0xfff0, r5        ;#
413
        add          r4, r5        ;# Add r4+r5 (0xfff0+0x0011=0x0001)
414
        mov     #0xA001, r15
415
 
416
        mov     #0x0000, r2        ;# V=0, N=0, Z=1, C=0
417
        mov     #0x0000, r4        ;#
418
        mov     #0x0000, r5        ;#
419
        add          r4, r5        ;# Add r4+r5 (0x0000+0x0000=0x0000)
420
        mov     #0xA002, r15
421
 
422
        mov     #0x0000, r2        ;# V=0, N=1, Z=0, C=0
423
        mov     #0xff00, r4        ;#
424
        mov     #0x0010, r5        ;#
425
        add          r4, r5        ;# Add r4+r5 (0xff00+0x0010=0xff10)
426
        mov     #0xA003, r15
427
 
428
        mov     #0x0000, r2        ;# V=1, N=1, Z=0, C=0
429
        mov     #0x7fff, r4        ;#
430
        mov     #0x0010, r5        ;#
431
        add          r4, r5        ;# Add r4+r5 (0x7fff+0x0010=0x800f)
432
        mov     #0xA004, r15
433
 
434
        mov     #0x0000, r2        ;# V=1, N=0, Z=0, C=1
435
        mov     #0xff00, r4        ;#
436
        mov     #0x8000, r5        ;#
437
        add          r4, r5        ;# Add r4+r5 (0xff00+0x8000=0x7f00)
438
        mov     #0xA005, r15
439
 
440
        /* ---------------- TEST WHEN SOURCE IS CONSTANT IN BYTE MODE ------ */
441
        #
442
        # NOTE: The following section would not fit in the smallest ROM
443
        #       configuration for the "two-op_add-b.s43" pattern.
444
        #       It is therefore executed here.
445
        #
446 111 olivier.gi
.set   CONSTL_TONY0,  DMEM_250
447
.set   CONSTL_TONY1,  DMEM_252
448
.set   CONSTL_TONY2,  DMEM_254
449
.set   CONSTL_TONY4,  DMEM_256
450
.set   CONSTL_TONY8,  DMEM_258
451
.set   CONSTL_TONYm1, DMEM_25A
452
.set   CONSTH_TONY0,  DMEM_25D
453
.set   CONSTH_TONY1,  DMEM_25F
454
.set   CONSTH_TONY2,  DMEM_261
455
.set   CONSTH_TONY4,  DMEM_263
456
.set   CONSTH_TONY8,  DMEM_265
457
.set   CONSTH_TONYm1, DMEM_267
458 2 olivier.gi
 
459 111 olivier.gi
        mov      #0xaa44, &DMEM_250        ;# Initialize Memory
460
        mov      #0xaa55, &DMEM_252
461
        mov      #0xaa66, &DMEM_254
462
        mov      #0xaa77, &DMEM_256
463
        mov      #0xaa35, &DMEM_258
464
        mov      #0xaa99, &DMEM_25A
465
        mov      #0xaa55, &DMEM_25C
466
        mov      #0xbb55, &DMEM_25E
467
        mov      #0xcc55, &DMEM_260
468
        mov      #0xdd55, &DMEM_262
469
        mov      #0xee55, &DMEM_264
470
        mov      #0x3355, &DMEM_266
471 2 olivier.gi
 
472
        add.b    #0x0000, &CONSTL_TONY0    ;# Move +0 to memory @0x250
473
        add.b    #0x0001, &CONSTL_TONY1    ;# Move +1 to memory @0x252
474
        add.b    #0x0002, &CONSTL_TONY2    ;# Move +2 to memory @0x254
475
        add.b    #0x0004, &CONSTL_TONY4    ;# Move +4 to memory @0x256
476
        add.b    #0x0008, &CONSTL_TONY8    ;# Move +8 to memory @0x258
477
        add.b    #0xffff, &CONSTL_TONYm1   ;# Move -1 to memory @0x25A
478
        add.b    #0x0000, &CONSTH_TONY0    ;# Move +0 to memory @0x25D
479
        add.b    #0x0001, &CONSTH_TONY1    ;# Move +1 to memory @0x25F
480
        add.b    #0x0002, &CONSTH_TONY2    ;# Move +2 to memory @0x261
481
        add.b    #0x0004, &CONSTH_TONY4    ;# Move +4 to memory @0x263
482
        add.b    #0x0008, &CONSTH_TONY8    ;# Move +8 to memory @0x265
483
        add.b    #0xffff, &CONSTH_TONYm1   ;# Move -1 to memory @0x267
484
 
485
        mov      #0xB000, r15
486
 
487
 
488
        /* ------------------ TEST FLAGS IN BYTE MODE --------------------- */
489
 
490
        mov     #0x0000, r2        ;# V=0, N=0, Z=0, C=0
491
        mov     #0xaa04, r4        ;#
492
        mov     #0x6605, r5        ;#
493
        add.b        r4, r5        ;# Add r4+r5 (0xaa04+0x6605=0x0009)
494
        mov     #0xC000, r15
495
 
496
        mov     #0x0000, r2        ;# V=0, N=0, Z=0, C=1
497
        mov     #0xaa11, r4        ;#
498
        mov     #0x66f0, r5        ;#
499
        add.b        r4, r5        ;# Add r4+r5 (0x0011+0x00f0=0x0001)
500
        mov     #0xC001, r15
501
 
502
        mov     #0x0000, r2        ;# V=0, N=0, Z=1, C=0
503
        mov     #0xaa00, r4        ;#
504
        mov     #0x6600, r5        ;#
505
        add.b        r4, r5        ;# Add r4+r5 (0x0000+0x0000=0x0000)
506
        mov     #0xC002, r15
507
 
508
        mov     #0x0000, r2        ;# V=0, N=1, Z=0, C=0
509
        mov     #0xaaf0, r4        ;#
510
        mov     #0x6603, r5        ;#
511
        add.b        r4, r5        ;# Add r4+r5 (0x00f0+0x0003=0x00f3)
512
        mov     #0xC003, r15
513
 
514
        mov     #0x0000, r2        ;# V=1, N=1, Z=0, C=0
515
        mov     #0x007f, r4        ;#
516
        mov     #0x0010, r5        ;#
517
        add.b        r4, r5        ;# Add r4+r5 (0x007f+0x0010=0x008f)
518
        mov     #0xC004, r15
519
 
520
        mov     #0x0000, r2        ;# V=1, N=0, Z=0, C=1
521
        mov     #0x00ff, r4        ;#
522
        mov     #0x0080, r5        ;#
523
        add.b        r4, r5        ;# Add r4+r5 (0x00ff+0x0080=0x007f)
524
        mov     #0xC005, r15
525
 
526
 
527
 
528
        /* ----------------------         END OF TEST        --------------- */
529
        mov      #0xD000, r15
530
end_of_test:
531
        nop
532
        br #0xffff
533
 
534
 
535
        /* ----------------------         INTERRUPT VECTORS  --------------- */
536
 
537
.section .vectors, "a"
538
.word end_of_test  ; Interrupt  0 (lowest priority)    
539
.word end_of_test  ; Interrupt  1                      
540
.word end_of_test  ; Interrupt  2                      
541
.word end_of_test  ; Interrupt  3                      
542
.word end_of_test  ; Interrupt  4                      
543
.word end_of_test  ; Interrupt  5                      
544
.word end_of_test  ; Interrupt  6                      
545
.word end_of_test  ; Interrupt  7                      
546
.word end_of_test  ; Interrupt  8                      
547
.word end_of_test  ; Interrupt  9                      
548
.word end_of_test  ; Interrupt 10                      Watchdog timer
549
.word end_of_test  ; Interrupt 11                      
550
.word end_of_test  ; Interrupt 12                      
551
.word end_of_test  ; Interrupt 13                      
552
.word end_of_test  ; Interrupt 14                      NMI
553
.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.