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 200

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