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

Subversion Repositories openmsp430

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

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

Line No. Rev Author Line
1 134 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 INSTRUCTION                 */
25
/*---------------------------------------------------------------------------*/
26
/* Test the MOV instruction with all addressing modes                        */
27
/*                                                                           */
28
/* Author(s):                                                                */
29
/*             - Olivier Girard,    olgirard@gmail.com                       */
30
/*                                                                           */
31
/*---------------------------------------------------------------------------*/
32
/* $Rev: 19 $                                                                */
33
/* $LastChangedBy: olivier.girard $                                          */
34
/* $LastChangedDate: 2009-08-04 23:47:15 +0200 (Tue, 04 Aug 2009) $          */
35
/*===========================================================================*/
36
 
37
.set    DMEM_BASE, (__data_start     )
38
.set    DMEM_200,  (__data_start+0x00)
39
.set    DMEM_202,  (__data_start+0x02)
40
.set    DMEM_204,  (__data_start+0x04)
41
.set    DMEM_206,  (__data_start+0x06)
42
.set    DMEM_208,  (__data_start+0x08)
43
.set    DMEM_20A,  (__data_start+0x0A)
44
.set    DMEM_20C,  (__data_start+0x0C)
45
.set    DMEM_20E,  (__data_start+0x0E)
46
.set    DMEM_210,  (__data_start+0x10)
47
.set    DMEM_212,  (__data_start+0x12)
48
.set    DMEM_214,  (__data_start+0x14)
49
.set    DMEM_216,  (__data_start+0x16)
50
.set    DMEM_218,  (__data_start+0x18)
51
.set    DMEM_21A,  (__data_start+0x1A)
52
.set    DMEM_21C,  (__data_start+0x1C)
53
.set    DMEM_21E,  (__data_start+0x1E)
54
.set    DMEM_220,  (__data_start+0x20)
55
.set    DMEM_222,  (__data_start+0x22)
56
 
57
.global main
58
 
59
main:
60
        /* ---------------------- INITIALIZE MEMORY --------------------- */
61
 
62
        mov     #0x0000,    &DMEM_200
63
        mov     #0x1020,    &DMEM_202
64
        mov     #0x1122,    &DMEM_204
65
        mov     #0x3344,    &DMEM_206
66
        mov     #0x5566,    &DMEM_208
67
        mov     #0x7788,    &DMEM_20A
68
        mov     #0x99AA,    &DMEM_20C
69
        mov     #0xBBCC,    &DMEM_20E
70
        mov     #0xDDEE,    &DMEM_210
71
        mov     #0xFF21,    &DMEM_212
72
        mov     #0x1223,    &DMEM_214
73
        mov     #0x3445,    &DMEM_216
74
        mov     #0x5667,    &DMEM_218
75
        mov     #0x7889,    &DMEM_21A
76
        mov     #0x9AAB,    &DMEM_21C
77
        mov     #0xBCCD,    &DMEM_21E
78
        mov     #0xDEEF,    &DMEM_220
79
        mov     #0xF001,    &DMEM_222
80
 
81
        mov     #0x0001,    &DMEM_200
82
 
83
        /* ---------------------- AUTO-INCREMENT: R1 --------------------- */
84
        /*                                                                 */
85
        /* NOTE:         it increment by 2 even in byte mode               */
86
 
87
        mov     #DMEM_204,  r1
88
        mov     #0x0000,    r2
89
        mov     #0x0000,    r3
90
        mov     #0x0000,    r4
91
        mov     #0x0000,    r5
92
        mov     #0x0000,    r6
93
        mov     #0x0000,    r7
94
        mov     #0x0000,    r8
95
        mov     #0x0000,    r9
96
        mov     #0x0000,    r10
97
        mov     #0x0000,    r11
98
        mov     #0x0000,    r12
99
        mov     #0x0000,    r13
100
        mov     #0x0000,    r14
101
        mov     #0x0000,    r15
102
 
103
        mov     #0x1000,    &DMEM_200
104
        mov.b      @r1+,    &DMEM_202
105
        mov     #0x1001,    &DMEM_200
106
        mov.b      @r1+,    &DMEM_202
107
        mov     #0x1002,    &DMEM_200
108
        mov     #0x0000,    &DMEM_202
109
 
110
        /* ---------------------- AUTO-INCREMENT: R2 --------------------- */
111
 
112
        mov     #0x0000,    r1
113
        mov     #0x0004,    r2
114
        mov     #0x0000,    r3
115
        mov     #0x0000,    r4
116
        mov     #0x0000,    r5
117
        mov     #0x0000,    r6
118
        mov     #0x0000,    r7
119
        mov     #0x0000,    r8
120
        mov     #0x0000,    r9
121
        mov     #0x0000,    r10
122
        mov     #0x0000,    r11
123
        mov     #0x0000,    r12
124
        mov     #0x0000,    r13
125
        mov     #0x0000,    r14
126
        mov     #0x0000,    r15
127
 
128
        mov     #0x2000,    &DMEM_200
129
        mov.b      @r2+,    &DMEM_202
130
        mov     #0x2001,    &DMEM_200
131
        mov.b      @r2+,    &DMEM_202
132
        mov     #0x2002,    &DMEM_200
133
        mov     #0x0000,    &DMEM_202
134
 
135
        /* ---------------------- AUTO-INCREMENT: R3 --------------------- */
136
 
137
        mov     #0x0000,    r1
138
        mov     #0x0000,    r2
139
        mov     #DMEM_208,  r3
140
        mov     #0x0000,    r4
141
        mov     #0x0000,    r5
142
        mov     #0x0000,    r6
143
        mov     #0x0000,    r7
144
        mov     #0x0000,    r8
145
        mov     #0x0000,    r9
146
        mov     #0x0000,    r10
147
        mov     #0x0000,    r11
148
        mov     #0x0000,    r12
149
        mov     #0x0000,    r13
150
        mov     #0x0000,    r14
151
        mov     #0x0000,    r15
152
 
153
        mov     #0x3000,    &DMEM_200
154
        mov.b      @r3+,    &DMEM_202
155
        mov     #0x3001,    &DMEM_200
156
        mov.b      @r3+,    &DMEM_202
157
        mov     #0x3002,    &DMEM_200
158
        swpb       @r3+
159
        mov     #0x0000,    &DMEM_202
160
 
161
        /* ---------------------- AUTO-INCREMENT: R4 --------------------- */
162
 
163
        mov     #0x0000,    r1
164
        mov     #0x0000,    r2
165
        mov     #0x0000,    r3
166
        mov     #DMEM_20A,  r4
167
        mov     #0x0000,    r5
168
        mov     #0x0000,    r6
169
        mov     #0x0000,    r7
170
        mov     #0x0000,    r8
171
        mov     #0x0000,    r9
172
        mov     #0x0000,    r10
173
        mov     #0x0000,    r11
174
        mov     #0x0000,    r12
175
        mov     #0x0000,    r13
176
        mov     #0x0000,    r14
177
        mov     #0x0000,    r15
178
 
179
        mov     #0x4000,    &DMEM_200
180
        mov.b      @r4+,    &DMEM_202
181
        mov     #0x4001,    &DMEM_200
182
        mov.b      @r4+,    &DMEM_202
183
        mov     #0x4002,    &DMEM_200
184
        mov     #0x0000,    &DMEM_202
185
 
186
        /* ---------------------- AUTO-INCREMENT: R5 --------------------- */
187
 
188
        mov     #0x0000,    r1
189
        mov     #0x0000,    r2
190
        mov     #0x0000,    r3
191
        mov     #0x0000,    r4
192
        mov     #DMEM_20C,  r5
193
        mov     #0x0000,    r6
194
        mov     #0x0000,    r7
195
        mov     #0x0000,    r8
196
        mov     #0x0000,    r9
197
        mov     #0x0000,    r10
198
        mov     #0x0000,    r11
199
        mov     #0x0000,    r12
200
        mov     #0x0000,    r13
201
        mov     #0x0000,    r14
202
        mov     #0x0000,    r15
203
 
204
        mov     #0x5000,    &DMEM_200
205
        mov.b      @r5+,    &DMEM_202
206
        mov     #0x5001,    &DMEM_200
207
        mov.b      @r5+,    &DMEM_202
208
        mov     #0x5002,    &DMEM_200
209
        mov     #0x0000,    &DMEM_202
210
 
211
        /* ---------------------- AUTO-INCREMENT: R6 --------------------- */
212
 
213
        mov     #0x0000,    r1
214
        mov     #0x0000,    r2
215
        mov     #0x0000,    r3
216
        mov     #0x0000,    r4
217
        mov     #0x0000,    r5
218
        mov     #DMEM_20E,  r6
219
        mov     #0x0000,    r7
220
        mov     #0x0000,    r8
221
        mov     #0x0000,    r9
222
        mov     #0x0000,    r10
223
        mov     #0x0000,    r11
224
        mov     #0x0000,    r12
225
        mov     #0x0000,    r13
226
        mov     #0x0000,    r14
227
        mov     #0x0000,    r15
228
 
229
        mov     #0x6000,    &DMEM_200
230
        mov.b      @r6+,    &DMEM_202
231
        mov     #0x6001,    &DMEM_200
232
        mov.b      @r6+,    &DMEM_202
233
        mov     #0x6002,    &DMEM_200
234
        mov     #0x0000,    &DMEM_202
235
 
236
        /* ---------------------- AUTO-INCREMENT: R7 --------------------- */
237
 
238
        mov     #0x0000,    r1
239
        mov     #0x0000,    r2
240
        mov     #0x0000,    r3
241
        mov     #0x0000,    r4
242
        mov     #0x0000,    r5
243
        mov     #0x0000,    r6
244
        mov     #DMEM_210,  r7
245
        mov     #0x0000,    r8
246
        mov     #0x0000,    r9
247
        mov     #0x0000,    r10
248
        mov     #0x0000,    r11
249
        mov     #0x0000,    r12
250
        mov     #0x0000,    r13
251
        mov     #0x0000,    r14
252
        mov     #0x0000,    r15
253
 
254
        mov     #0x7000,    &DMEM_200
255
        mov.b      @r7+,    &DMEM_202
256
        mov     #0x7001,    &DMEM_200
257
        mov.b      @r7+,    &DMEM_202
258
        mov     #0x7002,    &DMEM_200
259
        mov     #0x0000,    &DMEM_202
260
 
261
        /* ---------------------- AUTO-INCREMENT: R8 --------------------- */
262
 
263
        mov     #0x0000,    r1
264
        mov     #0x0000,    r2
265
        mov     #0x0000,    r3
266
        mov     #0x0000,    r4
267
        mov     #0x0000,    r5
268
        mov     #0x0000,    r6
269
        mov     #0x0000,    r7
270
        mov     #DMEM_212,  r8
271
        mov     #0x0000,    r9
272
        mov     #0x0000,    r10
273
        mov     #0x0000,    r11
274
        mov     #0x0000,    r12
275
        mov     #0x0000,    r13
276
        mov     #0x0000,    r14
277
        mov     #0x0000,    r15
278
 
279
        mov     #0x8000,    &DMEM_200
280
        mov.b      @r8+,    &DMEM_202
281
        mov     #0x8001,    &DMEM_200
282
        mov.b      @r8+,    &DMEM_202
283
        mov     #0x8002,    &DMEM_200
284
        mov     #0x0000,    &DMEM_202
285
 
286
        /* ---------------------- AUTO-INCREMENT: R9 --------------------- */
287
 
288
        mov     #0x0000,    r1
289
        mov     #0x0000,    r2
290
        mov     #0x0000,    r3
291
        mov     #0x0000,    r4
292
        mov     #0x0000,    r5
293
        mov     #0x0000,    r6
294
        mov     #0x0000,    r7
295
        mov     #0x0000,    r8
296
        mov     #DMEM_214,  r9
297
        mov     #0x0000,    r10
298
        mov     #0x0000,    r11
299
        mov     #0x0000,    r12
300
        mov     #0x0000,    r13
301
        mov     #0x0000,    r14
302
        mov     #0x0000,    r15
303
 
304
        mov     #0x9000,    &DMEM_200
305
        mov.b       @r9+,   &DMEM_202
306
        mov     #0x9001,    &DMEM_200
307
        mov.b       @r9+,   &DMEM_202
308
        mov     #0x9002,    &DMEM_200
309
        mov     #0x0000,    &DMEM_202
310
 
311
        /* ---------------------- AUTO-INCREMENT: R10 --------------------- */
312
 
313
        mov     #0x0000,    r1
314
        mov     #0x0000,    r2
315
        mov     #0x0000,    r3
316
        mov     #0x0000,    r4
317
        mov     #0x0000,    r5
318
        mov     #0x0000,    r6
319
        mov     #0x0000,    r7
320
        mov     #0x0000,    r8
321
        mov     #0x0000,    r9
322
        mov     #DMEM_216,  r10
323
        mov     #0x0000,    r11
324
        mov     #0x0000,    r12
325
        mov     #0x0000,    r13
326
        mov     #0x0000,    r14
327
        mov     #0x0000,    r15
328
 
329
        mov     #0xA000,    &DMEM_200
330
        mov.b     @r10+,    &DMEM_202
331
        mov     #0xA001,    &DMEM_200
332
        mov.b     @r10+,    &DMEM_202
333
        mov     #0xA002,    &DMEM_200
334
        mov     #0x0000,    &DMEM_202
335
 
336
        /* ---------------------- AUTO-INCREMENT: R11 --------------------- */
337
 
338
        mov     #0x0000,    r1
339
        mov     #0x0000,    r2
340
        mov     #0x0000,    r3
341
        mov     #0x0000,    r4
342
        mov     #0x0000,    r5
343
        mov     #0x0000,    r6
344
        mov     #0x0000,    r7
345
        mov     #0x0000,    r8
346
        mov     #0x0000,    r9
347
        mov     #0x0000,    r10
348
        mov     #DMEM_218,  r11
349
        mov     #0x0000,    r12
350
        mov     #0x0000,    r13
351
        mov     #0x0000,    r14
352
        mov     #0x0000,    r15
353
 
354
        mov     #0xB000,    &DMEM_200
355
        mov.b     @r11+,    &DMEM_202
356
        mov     #0xB001,    &DMEM_200
357
        mov.b     @r11+,    &DMEM_202
358
        mov     #0xB002,    &DMEM_200
359
        mov     #0x0000,    &DMEM_202
360
 
361
        /* ---------------------- AUTO-INCREMENT: R12 --------------------- */
362
 
363
        mov     #0x0000,    r1
364
        mov     #0x0000,    r2
365
        mov     #0x0000,    r3
366
        mov     #0x0000,    r4
367
        mov     #0x0000,    r5
368
        mov     #0x0000,    r6
369
        mov     #0x0000,    r7
370
        mov     #0x0000,    r8
371
        mov     #0x0000,    r9
372
        mov     #0x0000,    r10
373
        mov     #0x0000,    r11
374
        mov     #DMEM_21A,  r12
375
        mov     #0x0000,    r13
376
        mov     #0x0000,    r14
377
        mov     #0x0000,    r15
378
 
379
        mov     #0xC000,    &DMEM_200
380
        mov.b     @r12+,    &DMEM_202
381
        mov     #0xC001,    &DMEM_200
382
        mov.b     @r12+,    &DMEM_202
383
        mov     #0xC002,    &DMEM_200
384
        mov     #0x0000,    &DMEM_202
385
 
386
        /* ---------------------- AUTO-INCREMENT: R13 --------------------- */
387
 
388
        mov     #0x0000,    r1
389
        mov     #0x0000,    r2
390
        mov     #0x0000,    r3
391
        mov     #0x0000,    r4
392
        mov     #0x0000,    r5
393
        mov     #0x0000,    r6
394
        mov     #0x0000,    r7
395
        mov     #0x0000,    r8
396
        mov     #0x0000,    r9
397
        mov     #0x0000,    r10
398
        mov     #0x0000,    r11
399
        mov     #0x0000,    r12
400
        mov     #DMEM_21C,  r13
401
        mov     #0x0000,    r14
402
        mov     #0x0000,    r15
403
 
404
        mov     #0xD000,    &DMEM_200
405
        mov.b     @r13+,    &DMEM_202
406
        mov     #0xD001,    &DMEM_200
407
        mov.b     @r13+,    &DMEM_202
408
        mov     #0xD002,    &DMEM_200
409
        mov     #0x0000,    &DMEM_202
410
 
411
        /* ---------------------- AUTO-INCREMENT: R14 --------------------- */
412
 
413
        mov     #0x0000,    r1
414
        mov     #0x0000,    r2
415
        mov     #0x0000,    r3
416
        mov     #0x0000,    r4
417
        mov     #0x0000,    r5
418
        mov     #0x0000,    r6
419
        mov     #0x0000,    r7
420
        mov     #0x0000,    r8
421
        mov     #0x0000,    r9
422
        mov     #0x0000,    r10
423
        mov     #0x0000,    r11
424
        mov     #0x0000,    r12
425
        mov     #0x0000,    r13
426
        mov     #DMEM_21E,  r14
427
        mov     #0x0000,    r15
428
 
429
        mov     #0xE000,    &DMEM_200
430
        mov.b     @r14+,    &DMEM_202
431
        mov     #0xE001,    &DMEM_200
432
        mov.b     @r14+,    &DMEM_202
433
        mov     #0xE002,    &DMEM_200
434
        mov     #0x0000,    &DMEM_202
435
 
436
        /* ---------------------- AUTO-INCREMENT: R15 --------------------- */
437
 
438
        mov     #0x0000,    r1
439
        mov     #0x0000,    r2
440
        mov     #0x0000,    r3
441
        mov     #0x0000,    r4
442
        mov     #0x0000,    r5
443
        mov     #0x0000,    r6
444
        mov     #0x0000,    r7
445
        mov     #0x0000,    r8
446
        mov     #0x0000,    r9
447
        mov     #0x0000,    r10
448
        mov     #0x0000,    r11
449
        mov     #0x0000,    r12
450
        mov     #0x0000,    r13
451
        mov     #0x0000,    r14
452
        mov     #DMEM_220,  r15
453
 
454
        mov     #0xF000,    &DMEM_200
455
        mov.b     @r15+,    &DMEM_202
456
        mov     #0xF001,    &DMEM_200
457
        mov.b     @r15+,    &DMEM_202
458
        mov     #0xF002,    &DMEM_200
459
        mov     #0x0000,    &DMEM_202
460
 
461
        /* ----------------------         END OF TEST        --------------- */
462
end_of_test:
463
        nop
464
        br #0xffff
465
 
466
 
467
        /* ----------------------         INTERRUPT VECTORS  --------------- */
468
 
469
.section .vectors, "a"
470
.word end_of_test  ; Interrupt  0 (lowest priority)    
471
.word end_of_test  ; Interrupt  1                      
472
.word end_of_test  ; Interrupt  2                      
473
.word end_of_test  ; Interrupt  3                      
474
.word end_of_test  ; Interrupt  4                      
475
.word end_of_test  ; Interrupt  5                      
476
.word end_of_test  ; Interrupt  6                      
477
.word end_of_test  ; Interrupt  7                      
478
.word end_of_test  ; Interrupt  8                      
479
.word end_of_test  ; Interrupt  9                      
480
.word end_of_test  ; Interrupt 10                      Watchdog timer
481
.word end_of_test  ; Interrupt 11                      
482
.word end_of_test  ; Interrupt 12                      
483
.word end_of_test  ; Interrupt 13                      
484
.word end_of_test  ; Interrupt 14                      NMI
485
.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.