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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src/] [sing-op_push.s43] - Blame information for rev 78

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
/*                 SINGLE-OPERAND ARITHMETIC: PUSH  INSTRUCTION              */
25
/*---------------------------------------------------------------------------*/
26
/* Test the PUSH  instruction.                                               */
27 18 olivier.gi
/*                                                                           */
28
/* Author(s):                                                                */
29
/*             - Olivier Girard,    olgirard@gmail.com                       */
30
/*                                                                           */
31
/*---------------------------------------------------------------------------*/
32 19 olivier.gi
/* $Rev: 19 $                                                                */
33
/* $LastChangedBy: olivier.girard $                                          */
34
/* $LastChangedDate: 2009-08-04 23:47:15 +0200 (Tue, 04 Aug 2009) $          */
35 2 olivier.gi
/*===========================================================================*/
36
 
37
 
38
.global main
39
 
40
main:
41
        /* -------------- TEST INSTRUCTION IN WORD MODE ------------------- */
42
 
43
        # Initialization
44
        #------------------------
45
 
46
        mov     #0x0050, r4        ;# Initialize RAM
47
        mov     #0x0200, r5
48
clear_mem_loop:
49
        clr    0(r5)
50
        incd     r5
51
        dec      r4
52
        jnz     clear_mem_loop
53
 
54
 
55
        mov     #0x0252, r1        ;# Initialize stack pointer
56
 
57
 
58
        mov     #0x1000, r15
59
 
60
 
61
        # Addressing mode: Rn
62
        #------------------------
63
 
64
        mov     #0x7524, r4
65
        mov     #0x5555, &0x0300
66
        push          r4           ;# PUSH (r4=0x7524  =>  @=0x0250)
67
 
68
        mov     #0x1cb6, r6
69
        mov     #0x5555, &0x0300
70
        push          r6           ;# PUSH (r6=0x1cb6  =>  @=0x024E)
71
 
72
        mov     #0x2000, r15
73
 
74
 
75
        # Addressing mode: @Rn
76
        #------------------------
77
 
78
        mov     #0x0212, r4
79
        mov     #0x1234, &0x0212
80
        mov     #0x5555, &0x0300
81
        push        @r4           ;# PUSH (0x1234  =>  @=0x024C)
82
 
83
        mov     #0x0214, r6
84
        mov     #0x5678, &0x0214
85
        mov     #0x5555, &0x0300
86
        push        @r6           ;# PUSH (0x5678  =>  @=0x024A)
87
 
88
        mov     #0x3000, r15
89
 
90
 
91
        # Addressing mode: @Rn+
92
        #------------------------
93
 
94
        mov     #0x0216, r4
95
        mov     #0x9abc, &0x0216
96
        mov     #0x5555, &0x0300
97
        push       @r4+           ;# PUSH (0x9abc  =>  @=0x0248)
98
 
99
        mov     #0xdef0, &0x0218
100
        mov     #0x5555, &0x0300
101
        push       @r4+           ;# PUSH (0xdef0  =>  @=0x0246)
102
 
103
        mov     #0x4000, r15
104
 
105
 
106
        # Addressing mode: X(Rn)
107
        #------------------------
108
 
109
        mov     #0x0200, r4
110
        mov     #0x0fed, &0x021A
111
        mov     #0x5555, &0x0300
112
        push      26(r4)           ;# PUSH (0x0fed  =>  @=0x0244)
113
 
114
        mov     #0xcba9, &0x021C
115
        mov     #0x5555, &0x0300
116
        push      28(r4)           ;# PUSH (0xcba9  =>  @=0x0242)
117
 
118
        mov     #0x5000, r15
119
 
120
 
121
        # Addressing mode: EDE
122
        #------------------------
123
.set   EDE_21E,  (__data_start+0x001E)
124
.set   EDE_220,  (__data_start+0x0020)
125
 
126
        mov     #0x0200, r4
127
        mov     #0x8765, &0x021E
128
        mov     #0x5555, &0x0300
129
        push    EDE_21E            ;# PUSH (0x8765  =>  @=0x0240)
130
 
131
        mov     #0x4321, &0x0220
132
        mov     #0x5555, &0x0300
133
        push    EDE_220            ;# PUSH (0x4321  =>  @=0x023E)
134
 
135
        mov     #0x6000, r15
136
 
137
 
138
        # Addressing mode: &EDE
139
        #------------------------
140
.set   aEDE_222,  0x0222
141
.set   aEDE_224,  0x0224
142
 
143
        mov     #0x0200, r4
144
        mov     #0x1f2e, &0x0222
145
        mov     #0x5555, &0x0300
146
        push  &aEDE_222            ;# PUSH (0x1f2e  =>  @=0x023C)
147
 
148
        mov     #0x3d4c, &0x0224
149
        mov     #0x5555, &0x0300
150
        push  &aEDE_224            ;# PUSH (0x3d4c  =>  @=0x023A)
151
 
152
        mov     #0x7000, r15
153
 
154
 
155
        # Addressing mode: #N
156
        #------------------------
157
 
158
        mov     #0x5555, &0x0300
159
        push    #0x71c8            ;# PUSH (0x71c8  =>  @=0x0238)
160
 
161
        mov     #0x5555, &0x0300
162
        push    #0x178c            ;# PUSH (0x178c  =>  @=0x0236)
163
 
164
        mov     #0x7001, r15
165
 
166
 
167
        /* -------------- TEST INSTRUCTION IN BYTE MODE ------------------- */
168
 
169
        # Initialization
170
        #------------------------
171
 
172
        mov     #0x0252, r1        ;# Initialize stack pointer
173
 
174
        mov     #0x8000, r15
175
 
176
 
177
        # Addressing mode: Rn
178
        #------------------------
179
 
180
        mov     #0x1fe2, r4
181
        mov     #0x5555, &0x0300
182
        push.b        r4           ;# PUSH (r4=0xe2  =>  @=0x0250)
183
 
184
        mov     #0x3dc4, r6
185
        mov     #0x5555, &0x0300
186
        push.b        r6           ;# PUSH (r6=0xc4  =>  @=0x024E)
187
 
188
        mov     #0x9000, r15
189
 
190
 
191
        # Addressing mode: @Rn
192
        #------------------------
193
 
194
        mov     #0x0212, r4
195
        mov     #0x5ba6, &0x0212
196
        mov     #0x5555, &0x0300
197
        push.b      @r4           ;# PUSH (0xa6    =>  @=0x024C)
198
 
199
        mov     #0x0215, r6
200
        mov     #0x7988, &0x0214
201
        mov     #0x5555, &0x0300
202
        push.b      @r6           ;# PUSH (0x79    =>  @=0x024A)
203
 
204
        mov     #0xA000, r15
205
 
206
 
207
        # Addressing mode: @Rn+
208
        #------------------------
209
 
210
        mov     #0x0216, r4
211
        mov     #0x976a, &0x0216
212
        mov     #0x5555, &0x0300
213
        push.b     @r4+           ;# PUSH (0x6a  =>  @=0x0248)
214
 
215
        mov     #0x5555, &0x0300
216
        push.b     @r4+           ;# PUSH (0x97  =>  @=0x0246)
217
 
218
        mov     #0xB000, r15
219
 
220
 
221
        # Addressing mode: X(Rn)
222
        #------------------------
223
 
224
        mov     #0x0200, r4
225
        mov     #0xb54c, &0x021A
226
        mov     #0x5555, &0x0300
227
        push.b    26(r4)           ;# PUSH (0x4c  =>  @=0x0244)
228
 
229
        mov     #0xc32d, &0x021C
230
        mov     #0x5555, &0x0300
231
        push.b    29(r4)           ;# PUSH (0xc3  =>  @=0x0242)
232
 
233
        mov     #0xC000, r15
234
 
235
 
236
        # Addressing mode: EDE
237
        #------------------------
238
.set   EDE_B_21E,  (__data_start+0x001E)
239
.set   EDE_B_221,  (__data_start+0x0021)
240
 
241
        mov     #0x0200, r4
242
        mov     #0xd10e, &0x021E
243
        mov     #0x5555, &0x0300
244
        push.b  EDE_B_21E          ;# PUSH (0x0e  =>  @=0x0240)
245
 
246
        mov     #0xfed0, &0x0220
247
        mov     #0x5555, &0x0300
248
        push.b  EDE_B_221          ;# PUSH (0xfe  =>  @=0x023E)
249
 
250
        mov     #0xD000, r15
251
 
252
 
253
        # Addressing mode: &EDE
254
        #------------------------
255
.set   aEDE_B_222,  0x0222
256
.set   aEDE_B_225,  0x0225
257
 
258
        mov     #0x0200, r4
259
        mov     #0x1bc2, &0x0222
260
        mov     #0x5555, &0x0300
261
        push.b &aEDE_B_222         ;# PUSH (0xc2  =>  @=0x023C)
262
 
263
        mov     #0x3ba4, &0x0224
264
        mov     #0x5555, &0x0300
265
        push.b &aEDE_B_225         ;# PUSH (0x3b  =>  @=0x023A)
266
 
267
        mov     #0xE000, r15
268
 
269
 
270
        # Addressing mode: #N
271
        #------------------------
272
 
273
        mov     #0x5555, &0x0300
274
        push.b  #0x82d9            ;# PUSH (0xd9  =>  @=0x0238)
275
 
276
        mov     #0x5555, &0x0300
277
        push.b  #0x288d            ;# PUSH (0x8d  =>  @=0x0236)
278
 
279
        mov     #0xF000, r15
280
 
281
 
282
        /* ----------------------         END OF TEST        --------------- */
283
end_of_test:
284
        nop
285
        br #0xffff
286
 
287
 
288
 
289
        /* ----------------------         INTERRUPT VECTORS  --------------- */
290
 
291
.section .vectors, "a"
292
.word end_of_test  ; Interrupt  0 (lowest priority)    
293
.word end_of_test  ; Interrupt  1                      
294
.word end_of_test  ; Interrupt  2                      
295
.word end_of_test  ; Interrupt  3                      
296
.word end_of_test  ; Interrupt  4                      
297
.word end_of_test  ; Interrupt  5                      
298
.word end_of_test  ; Interrupt  6                      
299
.word end_of_test  ; Interrupt  7                      
300
.word end_of_test  ; Interrupt  8                      
301
.word end_of_test  ; Interrupt  9                      
302
.word end_of_test  ; Interrupt 10                      Watchdog timer
303
.word end_of_test  ; Interrupt 11                      
304
.word end_of_test  ; Interrupt 12                      
305
.word end_of_test  ; Interrupt 13                      
306
.word end_of_test  ; Interrupt 14                      NMI
307
.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.