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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src/] [two-op_add_rom-rd.s43] - Blame information for rev 18

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
/*                     ADD:   DATA READ ACCESS FROM ROM                      */
25
/*---------------------------------------------------------------------------*/
26
/* Test the ADD instruction with all addressing modes making a read access   */
27
/* to the ROM.                                                               */
28 18 olivier.gi
/*                                                                           */
29
/* Author(s):                                                                */
30
/*             - Olivier Girard,    olgirard@gmail.com                       */
31
/*                                                                           */
32
/*---------------------------------------------------------------------------*/
33
/* $Rev: 17 $                                                                */
34
/* $LastChangedBy: olivier.girard $                                          */
35
/* $LastChangedDate: 2009-08-04 23:15:39 +0200 (Tue, 04 Aug 2009) $          */
36 2 olivier.gi
/*===========================================================================*/
37
 
38
 
39
.global main
40
 
41
main:
42
        /* ---------------------- TEST WHEN SOURCE IS @Rn ------------------ */
43
.set   aRn_EDE,  (__data_start+0x0012)
44
.set   aRn_TONY, 0x0214
45
 
46
 
47
        mov   #data_aRn_0x1111, r4
48
        mov            #0x6666, r5
49
        add                @r4, r5         ;# Add @r4+r5 (0x1111+0x6666=0x7777)
50
 
51
        mov   #data_aRn_0x000a, r4
52
        add                @r4, r0
53
        nop
54
        nop
55
        nop
56
        mov            #0x1234, r4         ;# Make sure the jump is taken
57
test_aRn_PC:
58
 
59
        mov            #0x5432, &0x0210
60
        mov            #0x0200, r6
61
        mov   #data_aRn_0x1234, r7
62
        add                @r7, 16(r6)     ;# Write 0x1234+0x5432=0x6666 to memory @0x0210
63
 
64
        mov            #0x8e1c, &0x0212
65
        mov   #data_aRn_0x5f12, r7
66
        add                @r7, aRn_EDE    ;# Write 0x5f12+0x8e1c=0xed2e to memory @0x0212
67
 
68
        mov            #0x1541, &0x0214
69
        mov   #data_aRn_0x3112, r8
70
        add                @r8, &aRn_TONY  ;# Write 0x3112+0x1541=0x4653 to memory @0x0214
71
 
72
        mov            #0x1000, r15
73
 
74
 
75
 
76
        /* ---------------------- TEST WHEN SOURCE IS @Rn+ ----------------- */
77
.set   aRni_EDE,  (__data_start+0x0012)
78
.set   aRni_TONY, 0x0214
79
 
80
        mov   #data_aRni_0x2222, r4
81
        mov             #0x8888, r5
82
        add                @r4+, r5        ;# Add @r4+r5 (0x2222+0x8888=0xaaaa)
83
        add                @r4+, r5        ;# Add @r4+r5 (0x3333+0xaaaa=0xdddd)
84
 
85
        mov             #0xaaaa, r7
86
        mov   #data_aRni_0x000a, r6
87
        add                @r6+, r0
88
        nop
89
        nop
90
        nop
91
        mov             #0x1234, r7        ;# Make sure the jump is taken
92
test_aRni_PC1:
93
        add                @r6+, r0
94
        nop
95
        nop
96
        nop
97
        nop
98
        nop
99
        mov             #0x1234, r7        ;# Make sure the jump is taken
100
test_aRni_PC2:
101
 
102
        mov             #0x5432, &0x0210
103
        mov             #0x0200, r8
104
        mov   #data_aRni_0x1234, r10
105
        add               @r10+, 16(r8)    ;# Write 0x1234+0x5432=0x6666 to memory @0x0210
106
        add               @r10+, 16(r8)    ;# Write 0x2345+0x6666=0x89AB to memory @0x0210
107
 
108
        mov             #0x8e1c, &0x0212
109
        mov   #data_aRni_0x5f12, r8
110
        add                @r8+, aRni_EDE   ;# Write 0x5f12+0x8e1c=0xed2e to memory @0x0212
111
        add                @r8+, aRni_EDE   ;# Write 0x6345+0xed2e=0x5073 to memory @0x0212
112
 
113
        mov             #0x1541, &0x0214
114
        mov   #data_aRni_0x3112, r9
115
        add                @r9+, &aRni_TONY ;# Write 0x3112+0x1541=0x4653 to memory @0x0214
116
        add                @r9+, &aRni_TONY ;# Write 0x1123+0x4653=0x5776 to memory @0x0214
117
 
118
        mov             #0x2000, r15
119
 
120
 
121
        /* ---------------------- TEST WHEN SOURCE IS x(Rn) ---------------- */
122
.set   xRn_EDE,  (__data_start+0x0020)
123
.set   xRn_TONY, 0x0208
124
 
125
        mov            #0x1234, r5
126
        mov   #data_xRn_0x8347, r4
127
        add             16(r4), r5         ;# Write 0x8347+0x1234=0x957b to R5
128
 
129
        mov   #data_xRn_0x000a, r4
130
        mov            #0x1234, r6
131
        add              8(r4), r0
132
        nop
133
        nop
134
        nop
135
        nop
136
        mov            #0x0000, r6         ;# Make sure the jump is taken
137
test_xRn_PC:
138
 
139
        mov            #0x1535, &0x0214
140
        mov   #data_xRn_0x4241, r7
141
        mov            #0x0202, r8
142
        add             16(r7), 18(r8)     ;# Write 0x4241+0x1535=0x5776 to memory @0x214
143
 
144
        mov            #0x2143, &0x0220
145
        mov   #data_xRn_0x7238, r7
146
        add              4(r7), xRn_EDE    ;# Write 0x7238+0x2143=0x937b to memory @0x220
147
 
148
        mov            #0x1432, &0x0208
149
        mov   #data_xRn_0x98b2, r4
150
        add             22(r4), &xRn_TONY  ;# Write 0x0x98b2+0x1432=0xace4 to memory @0x208
151
 
152
        mov            #0x3000, r15
153
 
154
 
155
        /* ---------------------- TEST WHEN SOURCE IS 'EDE' ---------------- */
156
.set   EDE_EDE,  (__data_start+0x0016)
157
.set   EDE_TONY, 0x0212
158
 
159
 
160
        mov              #0x4321, r4
161
        add      data_EDE_0xc3d6, r4          ;# Write 0xc3d6+0x4321=0x06f7 to R4
162
 
163
        mov              #0x3456, r6
164
        add      data_EDE_0x000a, r0
165
        nop
166
        nop
167
        nop
168
        nop
169
        mov              #0x0000, r6          ;# Make sure the jump is taken
170
test_EDE_PC:
171
 
172
        mov              #0x0202, r8
173
        mov              #0x1234, &0x0214
174
        mov              #0x0000, &0x0208
175
        add      data_EDE_0xf712, 18(r8)      ;# Write 0xf712+0x1234=0x0946 to memory @0x214
176
 
177
        mov              #0x058a, &0x0216
178
        mov              #0x1234, &0x0208
179
        add      data_EDE_0xb3a9, EDE_EDE     ;# Write 0xb3a9+0x058a=0xb933 to memory @0x216
180
 
181
        mov              #0xA738, &0x0212
182
        mov              #0x1234, &0x020A
183
        add      data_EDE_0x837a, &EDE_TONY   ;# Write 0x837A+0xA738=0x2ab2 to memory @0x212
184
 
185
        mov              #0x4000, r15
186
 
187
 
188
 
189
        /* ---------------------- TEST WHEN SOURCE IS '&EDE' --------------- */
190
.set   aEDE_EDE,  (__data_start+0x0018)
191
.set   aEDE_TONY, 0x0202
192
 
193
        mov                #0x4321, r4
194
        add      &data_aEDE_0x23d4, r4          ;# Write 0x23d4+0x4321=0x66f5 to R4
195
 
196
        mov                #0x3456, r6
197
        add      &data_aEDE_0x000a, r0
198
        nop
199
        nop
200
        nop
201
        nop
202
        mov                #0x0000, r6          ;# Make sure the jump is taken
203
test_aEDE_PC:
204
 
205
        mov                #0x0202, r7
206
        mov                #0x3ab5, &0x0214
207
        mov                #0x1234, &0x0206
208
        add      &data_aEDE_0x481c, 18(r7)      ;# Write 0x481c+0x3ab5=0x82d1 to memory @0x214
209
 
210
        mov                #0x6e2f, &0x0218
211
        mov                #0x1234, &0x0208
212
        add      &data_aEDE_0x5c1f, aEDE_EDE    ;# Write 0x5c1f+0x6e2f=0xca4e to memory @0x218
213
 
214
        mov                #0x51ca, &0x0202
215
        mov                #0x1234, &0x020A
216
        add      &data_aEDE_0xc16e, &aEDE_TONY  ;# Write 0xc16e+0x51ca=0x1338 to memory @0x202
217
 
218
        mov                #0x5000, r15
219
 
220
 
221
 
222
end_of_test:
223
        nop
224
        br #0xffff
225
 
226
 
227
        /* ----------------------            DATA TABLE      --------------- */
228
data_aRn_0x1111:
229
        .word 0x1111
230
data_aRn_0x000a:
231
        .word 0x000a
232
data_aRn_0x1234:
233
        .word 0x1234
234
data_aRn_0x5f12:
235
        .word 0x5f12
236
data_aRn_0x3112:
237
        .word 0x3112
238
 
239
data_aRni_0x2222:
240
        .word 0x2222
241
        .word 0x3333
242
data_aRni_0x000a:
243
        .word 0x000a
244
        .word 0x000e
245
data_aRni_0x1234:
246
        .word 0x1234
247
        .word 0x2345
248
data_aRni_0x5f12:
249
        .word 0x5f12
250
        .word 0x6345
251
data_aRni_0x3112:
252
        .word 0x3112
253
        .word 0x1123
254
 
255
data_xRn_0x8347:
256
        .word 0x0000
257
        .word 0x0000
258
        .word 0x0000
259
        .word 0x0000
260
        .word 0x0000
261
        .word 0x0000
262
        .word 0x0000
263
        .word 0x0000
264
        .word 0x8347
265
data_xRn_0x000a:
266
        .word 0x0000
267
        .word 0x0000
268
        .word 0x0000
269
        .word 0x0000
270
        .word 0x000a
271
data_xRn_0x4241:
272
        .word 0x0000
273
        .word 0x0000
274
        .word 0x0000
275
        .word 0x0000
276
        .word 0x0000
277
        .word 0x0000
278
        .word 0x0000
279
        .word 0x0000
280
        .word 0x4241
281
data_xRn_0x7238:
282
        .word 0x0000
283
        .word 0x0000
284
        .word 0x7238
285
data_xRn_0x98b2:
286
        .word 0x0000
287
        .word 0x0000
288
        .word 0x0000
289
        .word 0x0000
290
        .word 0x0000
291
        .word 0x0000
292
        .word 0x0000
293
        .word 0x0000
294
        .word 0x0000
295
        .word 0x0000
296
        .word 0x0000
297
        .word 0x98b2
298
 
299
data_EDE_0xc3d6:
300
        .word 0xc3d6
301
data_EDE_0x000a:
302
        .word 0x000a
303
data_EDE_0xf712:
304
        .word 0xf712
305
data_EDE_0xb3a9:
306
        .word 0xb3a9
307
data_EDE_0x837a:
308
        .word 0x837a
309
 
310
data_aEDE_0x23d4:
311
        .word 0x23d4
312
data_aEDE_0x000a:
313
        .word 0x000a
314
data_aEDE_0x481c:
315
        .word 0x481c
316
data_aEDE_0x5c1f:
317
        .word 0x5c1f
318
data_aEDE_0xc16e:
319
        .word 0xc16e
320
 
321
 
322
 
323
        /* ----------------------         INTERRUPT VECTORS  --------------- */
324
 
325
.section .vectors, "a"
326
.word end_of_test  ; Interrupt  0 (lowest priority)    
327
.word end_of_test  ; Interrupt  1                      
328
.word end_of_test  ; Interrupt  2                      
329
.word end_of_test  ; Interrupt  3                      
330
.word end_of_test  ; Interrupt  4                      
331
.word end_of_test  ; Interrupt  5                      
332
.word end_of_test  ; Interrupt  6                      
333
.word end_of_test  ; Interrupt  7                      
334
.word end_of_test  ; Interrupt  8                      
335
.word end_of_test  ; Interrupt  9                      
336
.word end_of_test  ; Interrupt 10                      Watchdog timer
337
.word end_of_test  ; Interrupt 11                      
338
.word end_of_test  ; Interrupt 12                      
339
.word end_of_test  ; Interrupt 13                      
340
.word end_of_test  ; Interrupt 14                      NMI
341
.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.