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

Subversion Repositories openmsp430

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

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