OpenCores

Subversion Repositories openmsp430

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

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

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

powered by: WebSVN 2.1.0

© copyright 1999-2014 OpenCores.org, equivalent to ORSoC AB, all rights reserved. OpenCores®, registered trademark.