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 162

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