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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src/] [sing-op_push_rom-rd.s43] - Blame information for rev 19

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
/*                     PUSH:   DATA READ ACCESS FROM ROM                     */
25
/*---------------------------------------------------------------------------*/
26
/* Test the PUSH 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: 19 $                                                                */
34
/* $LastChangedBy: olivier.girard $                                          */
35
/* $LastChangedDate: 2009-08-04 23:47:15 +0200 (Tue, 04 Aug 2009) $          */
36 2 olivier.gi
/*===========================================================================*/
37
 
38
 
39
.global main
40
 
41
main:
42
        /* -------------- TEST INSTRUCTION IN WORD MODE ------------------- */
43
 
44
        # Initialization
45
        #------------------------
46
 
47
        mov     #0x0020, r4        ;# Initialize RAM
48
        mov     #0x0230, r5
49
clear_mem_loop:
50
        clr    0(r5)
51
        incd     r5
52
        dec      r4
53
        jnz     clear_mem_loop
54
 
55
 
56
        mov     #0x0252, r1        ;# Initialize stack pointer
57
 
58
 
59
        mov     #0x1000, r15
60
 
61
 
62
        # Addressing mode: @Rn
63
        #------------------------
64
 
65
        mov     #data_aRn_0x1234, r4
66
        push                     @r4           ;# PUSH (0x1234  =>  @=0x0250)
67
 
68
        mov     #data_aRn_0x5678, r6
69
        push                     @r6           ;# PUSH (0x5678  =>  @=0x024E)
70
 
71
        mov              #0x2000, r15
72
 
73
 
74
        # Addressing mode: @Rn+
75
        #------------------------
76
 
77
        mov     #data_aRni_0x9abc, r4
78
        push                      @r4+         ;# PUSH (0x9abc  =>  @=0x024C)
79
        push                      @r4+         ;# PUSH (0xdef0  =>  @=0x024A)
80
 
81
        mov     #0x3000, r15
82
 
83
 
84
        # Addressing mode: X(Rn)
85
        #------------------------
86
 
87
        mov     #data_xRn_0x0fed, r4
88
        push                   26(r4)          ;# PUSH (0x0fed  =>  @=0x0248)
89
        push                   28(r4)          ;# PUSH (0xcba9  =>  @=0x0246)
90
 
91
        mov     #0x4000, r15
92
 
93
 
94
        # Addressing mode: EDE
95
        #------------------------
96
.set   EDE_21E,  (__data_start+0x001E)
97
.set   EDE_220,  (__data_start+0x0020)
98
 
99
        push    data_EDE_0x8765                ;# PUSH (0x8765  =>  @=0x0244)
100
        push    data_EDE_0x4321                ;# PUSH (0x4321  =>  @=0x0242)
101
 
102
        mov     #0x5000, r15
103
 
104
 
105
        # Addressing mode: &EDE
106
        #------------------------
107
.set   aEDE_222,  0x0222
108
.set   aEDE_224,  0x0224
109
 
110
        push  &data_aEDE_0x1f2e                ;# PUSH (0x1f2e  =>  @=0x0240)
111
        push  &data_aEDE_0x3d4c                ;# PUSH (0x3d4c  =>  @=0x023E)
112
 
113
        mov     #0x6000, r15
114
 
115
 
116
 
117
        /* ----------------------         END OF TEST        --------------- */
118
end_of_test:
119
        nop
120
        br #0xffff
121
 
122
 
123
        /* ----------------------            DATA TABLE      --------------- */
124
data_aRn_0x1234:
125
        .word 0x1234
126
data_aRn_0x5678:
127
        .word 0x5678
128
 
129
data_aRni_0x9abc:
130
        .word 0x9abc
131
        .word 0xdef0
132
 
133
data_xRn_0x0fed:
134
        .word 0x0000
135
        .word 0x0000
136
        .word 0x0000
137
        .word 0x0000
138
        .word 0x0000
139
        .word 0x0000
140
        .word 0x0000
141
        .word 0x0000
142
        .word 0x0000
143
        .word 0x0000
144
        .word 0x0000
145
        .word 0x0000
146
        .word 0x0000
147
        .word 0x0fed
148
        .word 0xcba9
149
 
150
data_EDE_0x8765:
151
        .word 0x8765
152
data_EDE_0x4321:
153
        .word 0x4321
154
 
155
data_aEDE_0x1f2e:
156
        .word 0x1f2e
157
data_aEDE_0x3d4c:
158
        .word 0x3d4c
159
 
160
 
161
        /* ----------------------         INTERRUPT VECTORS  --------------- */
162
 
163
.section .vectors, "a"
164
.word end_of_test  ; Interrupt  0 (lowest priority)    
165
.word end_of_test  ; Interrupt  1                      
166
.word end_of_test  ; Interrupt  2                      
167
.word end_of_test  ; Interrupt  3                      
168
.word end_of_test  ; Interrupt  4                      
169
.word end_of_test  ; Interrupt  5                      
170
.word end_of_test  ; Interrupt  6                      
171
.word end_of_test  ; Interrupt  7                      
172
.word end_of_test  ; Interrupt  8                      
173
.word end_of_test  ; Interrupt  9                      
174
.word end_of_test  ; Interrupt 10                      Watchdog timer
175
.word end_of_test  ; Interrupt 11                      
176
.word end_of_test  ; Interrupt 12                      
177
.word end_of_test  ; Interrupt 13                      
178
.word end_of_test  ; Interrupt 14                      NMI
179
.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.