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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src/] [sing-op_rrc.s43] - Blame information for rev 76

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
/*                 SINGLE-OPERAND ARITHMETIC: RRC[.B] INSTRUCTION            */
25
/*---------------------------------------------------------------------------*/
26
/* Test the RRC[.B] instruction.                                             */
27 18 olivier.gi
/*                                                                           */
28
/* Author(s):                                                                */
29
/*             - Olivier Girard,    olgirard@gmail.com                       */
30
/*                                                                           */
31
/*---------------------------------------------------------------------------*/
32 19 olivier.gi
/* $Rev: 19 $                                                                */
33
/* $LastChangedBy: olivier.girard $                                          */
34
/* $LastChangedDate: 2009-08-04 23:47:15 +0200 (Tue, 04 Aug 2009) $          */
35 2 olivier.gi
/*===========================================================================*/
36
 
37
 
38
.global main
39
 
40
main:
41
        /* -------------- TEST INSTRUCTION IN WORD MODE ------------------- */
42
 
43
 
44
        # Addressing mode: Rn
45
        #------------------------
46
 
47
        mov     #0x0000, r2        ;# Test 1
48
        mov     #0x3332, r4
49
        rrc          r4            ;# RRC ({C=0, r4=0x3332}  => {r4=0x1999, C=0})
50
        mov          r2, r5
51
 
52
        mov     #0x0000, r2        ;# Test 2
53
        mov     #0x3333, r6
54
        rrc          r6            ;# RRC ({C=0, r6=0x3333}  => {r6=0x1999, C=1})
55
        mov          r2, r7
56
 
57
        mov     #0x0001, r2        ;# Test 3
58
        mov     #0x3332, r8
59
        rrc          r8            ;# RRC ({C=1, r9=0x3332}  => {r9=0x9999, C=0})
60
        mov          r2, r9
61
 
62
        mov     #0x0001, r2        ;# Test 4
63
        mov     #0x3333, r10
64
        rrc         r10            ;# RRC ({C=1, r10=0x3333} => {r10=0x9999, C=1})
65
        mov          r2, r11
66
 
67
        mov     #0x1000, r15
68
 
69
 
70
        # Addressing mode: @Rn
71
        #------------------------
72
 
73
        mov     #0x0000, r2        ;# Test 1
74
        mov     #0x3332, &0x0200
75
        mov     #0x0200, r4
76
        mov     #0xaaaa, &0x0202
77
        rrc         @r4            ;# RRC ({C=0, mem00=0x3332}  => {mem00=0x1999, C=0})
78
        mov          r2, r5
79
 
80
        mov     #0x0000, r2        ;# Test 2
81
        mov     #0x3333, &0x0202
82
        mov     #0x0202, r6
83
        mov     #0xaaaa, &0x0204
84
        rrc         @r6            ;# RRC ({C=0, mem01=0x3333}  => {mem01=0x1999, C=1})
85
        mov          r2, r7
86
 
87
        mov     #0x0001, r2        ;# Test 3
88
        mov     #0x3332, &0x0204
89
        mov     #0x0204, r8
90
        mov     #0xaaaa, &0x0206
91
        rrc         @r8            ;# RRC ({C=1, mem02=0x3332}  => {mem02=0x9999, C=0})
92
        mov          r2, r9
93
 
94
        mov     #0x0001, r2        ;# Test 4
95
        mov     #0x3333, &0x0206
96
        mov     #0x0206, r10
97
        mov     #0xaaaa, &0x0208
98
        rrc        @r10            ;# RRC ({C=1, mem03=0x3333}  => {mem03=0x9999, C=1})
99
        mov          r2, r11
100
 
101
        mov     #0x2000, r15
102
 
103
 
104
        # Addressing mode: @Rn+
105
        #------------------------
106
 
107
        mov     #0x0000, r2        ;# Test 1
108
        mov     #0x3332, &0x0208
109
        mov     #0x0208, r4
110
        mov     #0xaaaa, &0x020A
111
        rrc        @r4+            ;# RRC ({C=0, mem04=0x3332}  => {mem04=0x1999, C=0})
112
        mov          r2, r5
113
 
114
        mov     #0x0000, r2        ;# Test 2
115
        mov     #0x3333, &0x020A
116
        mov     #0x020A, r6
117
        mov     #0xaaaa, &0x020C
118
        rrc        @r6+            ;# RRC ({C=0, mem05=0x3333}  => {mem05=0x1999, C=1})
119
        mov          r2, r7
120
 
121
        mov     #0x0001, r2        ;# Test 3
122
        mov     #0x3332, &0x020C
123
        mov     #0x020C, r8
124
        mov     #0xaaaa, &0x020E
125
        rrc        @r8+            ;# RRC ({C=1, mem06=0x3332}  => {mem06=0x9999, C=0})
126
        mov          r2, r9
127
 
128
        mov     #0x0001, r2        ;# Test 4
129
        mov     #0x3333, &0x020E
130
        mov     #0x020E, r10
131
        mov     #0xaaaa, &0x0210
132
        rrc       @r10+            ;# RRC ({C=1, mem07=0x3333}  => {mem07=0x9999, C=1})
133
        mov          r2, r11
134
 
135
        mov     #0x3000, r15
136
 
137
 
138
        # Addressing mode: X(Rn)
139
        #------------------------
140
 
141
        mov     #0x0000, r2        ;# Test 1
142
        mov     #0x3332, &0x0210
143
        mov     #0x0200, r4
144
        mov     #0xaaaa, &0x0212
145
        rrc       16(r4)            ;# RRC ({C=0, mem08=0x3332}  => {mem08=0x1999, C=0})
146
        mov          r2, r5
147
 
148
        mov     #0x0000, r2        ;# Test 2
149
        mov     #0x3333, &0x0212
150
        mov     #0x0200, r6
151
        mov     #0xaaaa, &0x0214
152
        rrc       18(r6)            ;# RRC ({C=0, mem09=0x3333}  => {mem09=0x1999, C=1})
153
        mov          r2, r7
154
 
155
        mov     #0x0001, r2        ;# Test 3
156
        mov     #0x3332, &0x0214
157
        mov     #0x0200, r8
158
        mov     #0xaaaa, &0x0216
159
        rrc       20(r8)            ;# RRC ({C=1, mem0a=0x3332}  => {mem0a=0x9999, C=0})
160
        mov          r2, r9
161
 
162
        mov     #0x0001, r2        ;# Test 4
163
        mov     #0x3333, &0x0216
164
        mov     #0x0200, r10
165
        mov     #0xaaaa, &0x0218
166
        rrc      22(r10)            ;# RRC ({C=1, mem0b=0x3333}  => {mem0b=0x9999, C=1})
167
        mov          r2, r11
168
 
169
        mov     #0x4000, r15
170
 
171
 
172
        # Addressing mode: EDE
173
        #------------------------
174
.set   EDE_218,  (__data_start+0x0018)
175
.set   EDE_21A,  (__data_start+0x001A)
176
.set   EDE_21C,  (__data_start+0x001C)
177
.set   EDE_21E,  (__data_start+0x001E)
178
 
179
        mov     #0x0000, r2        ;# Test 1
180
        mov     #0x3332, &0x0218
181
        mov     #0xaaaa, &0x021A
182
        rrc     EDE_218            ;# RRC ({C=0, mem0c=0x3332}  => {mem0c=0x1999, C=0})
183
        mov          r2, r5
184
 
185
        mov     #0x0000, r2        ;# Test 2
186
        mov     #0x3333, &0x021A
187
        mov     #0xaaaa, &0x021C
188
        rrc     EDE_21A            ;# RRC ({C=0, mem0d=0x3333}  => {mem0d=0x1999, C=1})
189
        mov          r2, r7
190
 
191
        mov     #0x0001, r2        ;# Test 3
192
        mov     #0x3332, &0x021C
193
        mov     #0xaaaa, &0x021E
194
        rrc     EDE_21C            ;# RRC ({C=1, mem0e=0x3332}  => {mem0e=0x9999, C=0})
195
        mov          r2, r9
196
 
197
        mov     #0x0001, r2        ;# Test 4
198
        mov     #0x3333, &0x021E
199
        mov     #0xaaaa, &0x0220
200
        rrc     EDE_21E            ;# RRC ({C=1, mem0f=0x3333}  => {mem0f=0x9999, C=1})
201
        mov          r2, r11
202
 
203
        mov     #0x5000, r15
204
 
205
 
206
        # Addressing mode: &EDE
207
        #------------------------
208
.set   aEDE_220,  0x0220
209
.set   aEDE_222,  0x0222
210
.set   aEDE_224,  0x0224
211
.set   aEDE_226,  0x0226
212
 
213
        mov     #0x0000, r2        ;# Test 1
214
        mov     #0x3332, &0x0220
215
        mov     #0xaaaa, &0x0222
216
        rrc   &aEDE_220            ;# RRC ({C=0, mem10=0x3332}  => {mem10=0x1999, C=0})
217
        mov          r2, r5
218
 
219
        mov     #0x0000, r2        ;# Test 2
220
        mov     #0x3333, &0x0222
221
        mov     #0xaaaa, &0x0224
222
        rrc   &aEDE_222            ;# RRC ({C=0, mem11=0x3333}  => {mem11=0x1999, C=1})
223
        mov          r2, r7
224
 
225
        mov     #0x0001, r2        ;# Test 3
226
        mov     #0x3332, &0x0224
227
        mov     #0xaaaa, &0x0226
228
        rrc   &aEDE_224            ;# RRC ({C=1, mem12=0x3332}  => {mem12=0x9999, C=0})
229
        mov          r2, r9
230
 
231
        mov     #0x0001, r2        ;# Test 4
232
        mov     #0x3333, &0x0226
233
        mov     #0xaaaa, &0x0228
234
        rrc   &aEDE_226            ;# RRC ({C=1, mem13=0x3333}  => {mem13=0x9999, C=1})
235
        mov          r2, r11
236
 
237
        mov     #0x6000, r15
238
 
239
 
240
        /* ----------------------- CLEAR MEMORY --------------------------- */
241
        mov     #0x0015, r4
242
        mov     #0x0200, r5
243
clear_mem_loop:
244
        clr    0(r5)
245
        incd     r5
246
        dec      r4
247
        jnz     clear_mem_loop
248
 
249
        mov     #0x7000, r15
250
 
251
 
252
        /* -------------- TEST INSTRUCTION IN BYTE MODE ------------------- */
253
 
254
        # Addressing mode: Rn
255
        #------------------------
256
 
257
        mov     #0x0000, r2    ;# Test 1
258
        mov     #0xff32, r4
259
        rrc.b        r4        ;# RRC.B ({C=0, r4=0x32}  => {r4=0x19, C=0})
260
        mov          r2, r5
261
 
262
        mov     #0x0000, r2    ;# Test 2
263
        mov     #0xff33, r6
264
        rrc.b        r6        ;# RRC.B ({C=0, r6=0x33}  => {r6=0x19, C=1})
265
        mov          r2, r7
266
 
267
        mov     #0x0001, r2    ;# Test 3
268
        mov     #0xf032, r8
269
        rrc.b        r8        ;# RRC.B ({C=1, r9=0x32}  => {r9=0x99, C=0})
270
        mov          r2, r9
271
 
272
        mov     #0x0001, r2    ;# Test 4
273
        mov     #0xf033, r10
274
        rrc.b       r10        ;# RRC.B ({C=1, r10=0x33} => {r10=0x99, C=1})
275
        mov          r2, r11
276
 
277
        mov     #0x8000, r15
278
 
279
 
280
        # Addressing mode: @Rn (Low Byte)
281
        #---------------------------------
282
 
283
        mov     #0x0000, r2        ;# Test 1: Low Byte
284
        mov     #0x2532, &0x0200
285
        mov     #0x0200, r4
286
        mov     #0xaaaa, &0x0202
287
        rrc.b       @r4            ;# RRC.B ({C=0, mem00=0x2532}  => {mem00=0x2519, C=0})
288
        mov          r2, r5
289
 
290
        mov     #0x0000, r2        ;# Test 2: Low Byte
291
        mov     #0x2533, &0x0202
292
        mov     #0x0202, r6
293
        mov     #0xaaaa, &0x0204
294
        rrc.b       @r6            ;# RRC.B ({C=0, mem01=0x2533}  => {mem01=0x2519, C=1})
295
        mov          r2, r7
296
 
297
        mov     #0x0001, r2        ;# Test 3: Low Byte
298
        mov     #0x2532, &0x0204
299
        mov     #0x0204, r8
300
        mov     #0xaaaa, &0x0206
301
        rrc.b       @r8            ;# RRC.B ({C=1, mem02=0x2532}  => {mem02=0x2599, C=0})
302
        mov          r2, r9
303
 
304
        mov     #0x0001, r2        ;# Test 4: Low Byte
305
        mov     #0x2533, &0x0206
306
        mov     #0x0206, r10
307
        mov     #0xaaaa, &0x0208
308
        rrc.b      @r10            ;# RRC.B ({C=1, mem03=0x2533}  => {mem03=0x2599, C=1})
309
        mov          r2, r11
310
 
311
        mov     #0x9000, r15
312
 
313
        # Addressing mode: @Rn (High Byte)
314
        #---------------------------------
315
 
316
        mov     #0x0000, r2        ;# Test 1: High Byte
317
        mov     #0x3225, &0x0208
318
        mov     #0x0209, r4
319
        mov     #0xaaaa, &0x020A
320
        rrc.b       @r4            ;# RRC.B ({C=0, mem04=0x3225}  => {mem04=0x1925, C=0})
321
        mov          r2, r6
322
 
323
        mov     #0x0000, r2        ;# Test 2: High Byte
324
        mov     #0x3325, &0x020A
325
        mov     #0x020B, r6
326
        mov     #0xaaaa, &0x020C
327
        rrc.b       @r6            ;# RRC.B ({C=0, mem05=0x3325}  => {mem05=0x1925, C=1})
328
        mov          r2, r8
329
 
330
        mov     #0x0001, r2        ;# Test 3: High Byte
331
        mov     #0x3225, &0x020C
332
        mov     #0x020D, r8
333
        mov     #0xaaaa, &0x020E
334
        rrc.b       @r8            ;# RRC.B ({C=1, mem06=0x3225}  => {mem06=0x9925, C=0})
335
        mov          r2, r10
336
 
337
        mov     #0x0001, r2        ;# Test 4: High Byte
338
        mov     #0x3325, &0x020E
339
        mov     #0x020F, r10
340
        mov     #0xaaaa, &0x0210
341
        rrc.b      @r10            ;# RRC.B ({C=1, mem07=0x3325}  => {mem07=0x9925, C=1})
342
        mov          r2, r11
343
 
344
        mov     #0x9001, r15
345
 
346
 
347
        # Addressing mode: @Rn+ (Low Byte)
348
        #---------------------------------
349
 
350
        mov     #0x0000, r2        ;# Test 1: Low Byte
351
        mov     #0x2532, &0x0210
352
        mov     #0x0210, r4
353
        mov     #0xaaaa, &0x0212
354
        rrc.b      @r4+            ;# RRC.B ({C=0, mem08=0x2532}  => {mem08=0x2519, C=0})
355
        mov          r2, r5
356
 
357
        mov     #0x0000, r2        ;# Test 2: Low Byte
358
        mov     #0x2533, &0x0212
359
        mov     #0x0212, r6
360
        mov     #0xaaaa, &0x0214
361
        rrc.b      @r6+            ;# RRC.B ({C=0, mem09=0x2533}  => {mem09=0x2519, C=1})
362
        mov          r2, r7
363
 
364
        mov     #0x0001, r2        ;# Test 3: Low Byte
365
        mov     #0x2532, &0x0214
366
        mov     #0x0214, r8
367
        mov     #0xaaaa, &0x0216
368
        rrc.b      @r8+            ;# RRC.B ({C=1, mem0a=0x2532}  => {mem0a=0x2599, C=0})
369
        mov          r2, r9
370
 
371
        mov     #0x0001, r2        ;# Test 4: Low Byte
372
        mov     #0x2533, &0x0216
373
        mov     #0x0216, r10
374
        mov     #0xaaaa, &0x0218
375
        rrc.b     @r10+            ;# RRC.B ({C=1, mem0b=0x2533}  => {mem0b=0x2599, C=1})
376
        mov          r2, r11
377
 
378
        mov     #0xA000, r15
379
 
380
        # Addressing mode: @Rn+ (High Byte)
381
        #-----------------------------------
382
 
383
        mov     #0x0000, r2        ;# Test 1: High Byte
384
        mov     #0x3225, &0x0218
385
        mov     #0x0219, r4
386
        mov     #0xaaaa, &0x021A
387
        rrc.b      @r4+            ;# RRC.B ({C=0, mem0c=0x3225}  => {mem0c=0x1925, C=0})
388
        mov          r2, r6
389
 
390
        mov     #0x0000, r2        ;# Test 2: High Byte
391
        mov     #0x3325, &0x021A
392
        mov     #0x021B, r6
393
        mov     #0xaaaa, &0x021C
394
        rrc.b      @r6+            ;# RRC.B ({C=0, mem0d=0x3325}  => {mem0d=0x1925, C=1})
395
        mov          r2, r8
396
 
397
        mov     #0x0001, r2        ;# Test 3: High Byte
398
        mov     #0x3225, &0x021C
399
        mov     #0x021D, r8
400
        mov     #0xaaaa, &0x021E
401
        rrc.b      @r8+            ;# RRC.B ({C=1, mem0e=0x3225}  => {mem0e=0x9925, C=0})
402
        mov          r2, r10
403
 
404
        mov     #0x0001, r2        ;# Test 4: High Byte
405
        mov     #0x3325, &0x021E
406
        mov     #0x021F, r10
407
        mov     #0xaaaa, &0x0220
408
        rrc.b     @r10+            ;# RRC.B ({C=1, mem0f=0x3325}  => {mem0f=0x9925, C=1})
409
        mov          r2, r11
410
 
411
        mov     #0xA001, r15
412
 
413
 
414
        # Addressing mode: X(Rn) (Low Byte)
415
        #-----------------------------------
416
 
417
        mov     #0x0000, r2        ;# Test 1
418
        mov     #0x2532, &0x0220
419
        mov     #0x0200, r4
420
        mov     #0xaaaa, &0x0222
421
        rrc.b     32(r4)           ;# RRC ({C=0, mem10=0x2532}  => {mem10=0x2519, C=0})
422
        mov          r2, r5
423
 
424
        mov     #0x0000, r2        ;# Test 2
425
        mov     #0x2533, &0x0222
426
        mov     #0x0200, r6
427
        mov     #0xaaaa, &0x0224
428
        rrc.b     34(r6)           ;# RRC ({C=0, mem11=0x2533}  => {mem11=0x2519, C=1})
429
        mov          r2, r7
430
 
431
        mov     #0x0001, r2        ;# Test 3
432
        mov     #0x2532, &0x0224
433
        mov     #0x0200, r8
434
        mov     #0xaaaa, &0x0226
435
        rrc.b     36(r8)           ;# RRC ({C=1, mem12=0x2532}  => {mem12=0x2599, C=0})
436
        mov          r2, r9
437
 
438
        mov     #0x0001, r2        ;# Test 4
439
        mov     #0x2533, &0x0226
440
        mov     #0x0200, r10
441
        mov     #0xaaaa, &0x0228
442
        rrc.b    38(r10)           ;# RRC ({C=1, mem13=0x2533}  => {mem13=0x2599, C=1})
443
        mov          r2, r11
444
 
445
        mov     #0xB000, r15
446
 
447
        # Addressing mode: X(Rn) (High Byte)
448
        #------------------------------------
449
 
450
        mov     #0x0000, r2        ;# Test 1
451
        mov     #0x3225, &0x0228
452
        mov     #0x0200, r4
453
        mov     #0xaaaa, &0x022A
454
        rrc.b     41(r4)           ;# RRC ({C=0, mem14=0x3225}  => {mem14=0x1925, C=0})
455
        mov          r2, r5
456
 
457
        mov     #0x0000, r2        ;# Test 2
458
        mov     #0x3325, &0x022A
459
        mov     #0x0200, r6
460
        mov     #0xaaaa, &0x022C
461
        rrc.b     43(r6)           ;# RRC ({C=0, mem15=0x3325}  => {mem15=0x1925, C=1})
462
        mov          r2, r7
463
 
464
        mov     #0x0001, r2        ;# Test 3
465
        mov     #0x3225, &0x022C
466
        mov     #0x0200, r8
467
        mov     #0xaaaa, &0x022E
468
        rrc.b     45(r8)           ;# RRC ({C=1, mem16=0x3225}  => {mem16=0x9925, C=0})
469
        mov          r2, r9
470
 
471
        mov     #0x0001, r2        ;# Test 4
472
        mov     #0x3325, &0x022E
473
        mov     #0x0200, r10
474
        mov     #0xaaaa, &0x0230
475
        rrc.b    47(r10)           ;# RRC ({C=1, mem17=0x3325}  => {mem17=0x9925, C=1})
476
        mov          r2, r11
477
 
478
        mov     #0xB001, r15
479
 
480
 
481
        # Addressing mode: EDE (Low Byte)
482
        #---------------------------------
483
.set   EDE_230,  (__data_start+0x0030)
484
.set   EDE_232,  (__data_start+0x0032)
485
.set   EDE_234,  (__data_start+0x0034)
486
.set   EDE_236,  (__data_start+0x0036)
487
 
488
        mov     #0x0000, r2        ;# Test 1
489
        mov     #0x2532, &0x0230
490
        mov     #0xaaaa, &0x0232
491
        rrc.b   EDE_230            ;# RRC ({C=0, mem18=0x2532}  => {mem18=0x2519, C=0})
492
        mov          r2, r5
493
 
494
        mov     #0x0000, r2        ;# Test 2
495
        mov     #0x2533, &0x0232
496
        mov     #0xaaaa, &0x0234
497
        rrc.b   EDE_232            ;# RRC ({C=0, mem19=0x2533}  => {mem19=0x2519, C=1})
498
        mov          r2, r7
499
 
500
        mov     #0x0001, r2        ;# Test 3
501
        mov     #0x2532, &0x0234
502
        mov     #0xaaaa, &0x0236
503
        rrc.b   EDE_234            ;# RRC ({C=1, mem1a=0x2532}  => {mem1a=0x2599, C=0})
504
        mov          r2, r9
505
 
506
        mov     #0x0001, r2        ;# Test 4
507
        mov     #0x2533, &0x0236
508
        mov     #0xaaaa, &0x0238
509
        rrc.b   EDE_236            ;# RRC ({C=1, mem1b=0x2533}  => {mem1b=0x2599, C=1})
510
        mov          r2, r11
511
 
512
        mov     #0xC000, r15
513
 
514
        # Addressing mode: EDE (High Byte)
515
        #----------------------------------
516
.set   EDE_239,  (__data_start+0x0039)
517
.set   EDE_23B,  (__data_start+0x003B)
518
.set   EDE_23D,  (__data_start+0x003D)
519
.set   EDE_23F,  (__data_start+0x003F)
520
 
521
        mov     #0x0000, r2        ;# Test 1
522
        mov     #0x3225, &0x0238
523
        mov     #0xaaaa, &0x023A
524
        rrc.b   EDE_239            ;# RRC ({C=0, mem1c=0x3225}  => {mem1c=0x1925, C=0})
525
        mov          r2, r5
526
 
527
        mov     #0x0000, r2        ;# Test 2
528
        mov     #0x3325, &0x023A
529
        mov     #0xaaaa, &0x023C
530
        rrc.b   EDE_23B            ;# RRC ({C=0, mem1d=0x3325}  => {mem1d=0x1925, C=1})
531
        mov          r2, r7
532
 
533
        mov     #0x0001, r2        ;# Test 3
534
        mov     #0x3225, &0x023C
535
        mov     #0xaaaa, &0x023E
536
        rrc.b   EDE_23D            ;# RRC ({C=1, mem1e=0x3225}  => {mem1e=0x9925, C=0})
537
        mov          r2, r9
538
 
539
        mov     #0x0001, r2        ;# Test 4
540
        mov     #0x3325, &0x023E
541
        mov     #0xaaaa, &0x0240
542
        rrc.b   EDE_23F            ;# RRC ({C=1, mem1f=0x3325}  => {mem1f=0x9925, C=1})
543
        mov          r2, r11
544
 
545
        mov     #0xC001, r15
546
 
547
 
548
        # Addressing mode: &EDE (Low Byte)
549
        #----------------------------------
550
.set   aEDE_240,  0x0240
551
.set   aEDE_242,  0x0242
552
.set   aEDE_244,  0x0244
553
.set   aEDE_246,  0x0246
554
 
555
        mov     #0x0000, r2        ;# Test 1
556
        mov     #0x2532, &0x0240
557
        mov     #0xaaaa, &0x0242
558
        rrc.b &aEDE_240            ;# RRC ({C=0, mem20=0x2532}  => {mem20=0x2519, C=0})
559
        mov          r2, r5
560
 
561
        mov     #0x0000, r2        ;# Test 2
562
        mov     #0x2533, &0x0242
563
        mov     #0xaaaa, &0x0244
564
        rrc.b &aEDE_242            ;# RRC ({C=0, mem21=0x2533}  => {mem21=0x2519, C=1})
565
        mov          r2, r7
566
 
567
        mov     #0x0001, r2        ;# Test 3
568
        mov     #0x2532, &0x0244
569
        mov     #0xaaaa, &0x0246
570
        rrc.b &aEDE_244            ;# RRC ({C=1, mem22=0x2532}  => {mem22=0x2599, C=0})
571
        mov          r2, r9
572
 
573
        mov     #0x0001, r2        ;# Test 4
574
        mov     #0x2533, &0x0246
575
        mov     #0xaaaa, &0x0248
576
        rrc.b &aEDE_246            ;# RRC ({C=1, mem23=0x2533}  => {mem23=0x2599, C=1})
577
        mov          r2, r11
578
 
579
        mov     #0xD000, r15
580
 
581
        # Addressing mode: &EDE (High Byte)
582
        #-----------------------------------
583
.set   aEDE_249,  0x0249
584
.set   aEDE_24B,  0x024B
585
.set   aEDE_24D,  0x024D
586
.set   aEDE_24F,  0x024F
587
 
588
        mov     #0x0000, r2        ;# Test 1
589
        mov     #0x3225, &0x0248
590
        mov     #0xaaaa, &0x024A
591
        rrc.b &aEDE_249            ;# RRC ({C=0, mem24=0x3225}  => {mem24=0x1925, C=0})
592
        mov          r2, r5
593
 
594
        mov     #0x0000, r2        ;# Test 2
595
        mov     #0x3325, &0x024A
596
        mov     #0xaaaa, &0x024C
597
        rrc.b &aEDE_24B            ;# RRC ({C=0, mem25=0x3325}  => {mem25=0x1925, C=1})
598
        mov          r2, r7
599
 
600
        mov     #0x0001, r2        ;# Test 3
601
        mov     #0x3225, &0x024C
602
        mov     #0xaaaa, &0x024E
603
        rrc.b &aEDE_24D            ;# RRC ({C=1, mem26=0x3225}  => {mem26=0x9925, C=0})
604
        mov          r2, r9
605
 
606
        mov     #0x0001, r2        ;# Test 4
607
        mov     #0x3325, &0x024E
608
        mov     #0xaaaa, &0x0250
609
        rrc.b &aEDE_24F            ;# RRC ({C=1, mem27=0x3325}  => {mem27=0x9925, C=1})
610
        mov          r2, r11
611
 
612
        mov     #0xD001, r15
613
 
614
 
615
 
616
        /* ----------------------         END OF TEST        --------------- */
617
end_of_test:
618
        nop
619
        br #0xffff
620
 
621
 
622
 
623
        /* ----------------------         INTERRUPT VECTORS  --------------- */
624
 
625
.section .vectors, "a"
626
.word end_of_test  ; Interrupt  0 (lowest priority)    
627
.word end_of_test  ; Interrupt  1                      
628
.word end_of_test  ; Interrupt  2                      
629
.word end_of_test  ; Interrupt  3                      
630
.word end_of_test  ; Interrupt  4                      
631
.word end_of_test  ; Interrupt  5                      
632
.word end_of_test  ; Interrupt  6                      
633
.word end_of_test  ; Interrupt  7                      
634
.word end_of_test  ; Interrupt  8                      
635
.word end_of_test  ; Interrupt  9                      
636
.word end_of_test  ; Interrupt 10                      Watchdog timer
637
.word end_of_test  ; Interrupt 11                      
638
.word end_of_test  ; Interrupt 12                      
639
.word end_of_test  ; Interrupt 13                      
640
.word end_of_test  ; Interrupt 14                      NMI
641
.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.