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

Subversion Repositories openmsp430

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

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
/*                     CALL:   DATA READ ACCESS FROM ROM                     */
25
/*---------------------------------------------------------------------------*/
26
/* Test the CALL 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: 111 $                                                                */
34
/* $LastChangedBy: olivier.girard $                                          */
35
/* $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $          */
36 2 olivier.gi
/*===========================================================================*/
37
 
38 111 olivier.gi
.set    DMEM_BASE, (__data_start     )
39
.set    DMEM_200,  (__data_start+0x00)
40
.set    DMEM_212,  (__data_start+0x12)
41
.set    DMEM_216,  (__data_start+0x16)
42
.set    DMEM_21A,  (__data_start+0x1A)
43
.set    DMEM_21E,  (__data_start+0x1E)
44
.set    DMEM_220,  (__data_start+0x20)
45
.set    DMEM_250,  (__data_start+0x50)
46
.set    DMEM_252,  (__data_start+0x52)
47
.set    DMEM_300,  (__data_start+0x100)
48
 
49 2 olivier.gi
.global main
50
 
51
main:
52
        # Initialization
53
        #------------------------
54
 
55 111 olivier.gi
        mov   #DMEM_252, r1        ;# Initialize stack pointer
56 2 olivier.gi
        mov     #0x0000, r5        ;# Initialize R5
57
 
58
 
59
        mov     #0x1000, r15
60
 
61
 
62
        # Addressing mode: @Rn
63
        #------------------------
64
 
65
        mov    #data_aRn_call, r4
66
        mov           #0x0000, r5
67
        call                  @r4           ;# CALL TEST_ROUTINE_aRN
68
 
69
        mov     #0x2000, r15
70
 
71
 
72
        # Addressing mode: @Rn+
73
        #------------------------
74
 
75
        mov    #data_aRni_call, r4
76
        mov            #0x0000, r5
77
        call                   @r4+         ;# CALL TEST_ROUTINE_aRNi
78
 
79
        mov     #0x3000, r15
80
 
81
 
82
        # Addressing mode: X(Rn)
83
        #------------------------
84
 
85
        mov    #data_xRn_call, r4
86
        mov           #0x0000, r5
87
        call                26(r4)          ;# CALL TEST_ROUTINE_xRN
88
 
89
        mov     #0x4000, r15
90
 
91
 
92
        # Addressing mode: EDE
93
        #------------------------
94 111 olivier.gi
.set   EDE_21E,  DMEM_21E
95 2 olivier.gi
 
96
        mov     #0x0000, r5
97
        call    data_EDE_call               ;# CALL TEST_ROUTINE_EDE
98
 
99
        mov     #0x5000, r15
100
 
101
 
102
        # Addressing mode: &EDE
103
        #------------------------
104 111 olivier.gi
.set   aEDE_220,  DMEM_220
105 2 olivier.gi
 
106
        mov     #0x0000, r5
107
        call  &data_aEDE_call               ;# CALL TEST_ROUTINE_aEDE
108
 
109
        mov     #0x6000, r15
110
 
111
 
112
        /* ----------------------         END OF TEST        --------------- */
113
end_of_test:
114
        nop
115
        br #0xffff
116
 
117
 
118
 
119
        /* ----------------------         TEST FUNCTIONS     --------------- */
120
 
121
TEST_ROUTINE_RN:
122
        mov #0x1234, r5
123
        ret
124
 
125
TEST_ROUTINE_aRN:
126
        mov #0x5678, r5
127
        ret
128
 
129
TEST_ROUTINE_aRNi:
130
        mov #0x9abc, r5
131
        ret
132
 
133
TEST_ROUTINE_N:
134
        mov #0xabcd, r5
135
        ret
136
 
137
TEST_ROUTINE_xRN:
138
        mov #0xef01, r5
139
        ret
140
 
141
TEST_ROUTINE_EDE:
142
        mov #0x2345, r5
143
        ret
144
 
145
TEST_ROUTINE_aEDE:
146
        mov #0x6789, r5
147
        ret
148
 
149
 
150
        /* ----------------------            DATA TABLE      --------------- */
151
data_aRn_call:
152
        .word TEST_ROUTINE_aRN
153
 
154
data_aRni_call:
155
        .word TEST_ROUTINE_aRNi
156
 
157
data_xRn_call:
158
        .word 0x0000
159
        .word 0x0000
160
        .word 0x0000
161
        .word 0x0000
162
        .word 0x0000
163
        .word 0x0000
164
        .word 0x0000
165
        .word 0x0000
166
        .word 0x0000
167
        .word 0x0000
168
        .word 0x0000
169
        .word 0x0000
170
        .word 0x0000
171
        .word TEST_ROUTINE_xRN
172
 
173
data_EDE_call:
174
        .word TEST_ROUTINE_EDE
175
 
176
data_aEDE_call:
177
        .word TEST_ROUTINE_aEDE
178
 
179
 
180
        /* ----------------------         INTERRUPT VECTORS  --------------- */
181
 
182
.section .vectors, "a"
183
.word end_of_test  ; Interrupt  0 (lowest priority)    
184
.word end_of_test  ; Interrupt  1                      
185
.word end_of_test  ; Interrupt  2                      
186
.word end_of_test  ; Interrupt  3                      
187
.word end_of_test  ; Interrupt  4                      
188
.word end_of_test  ; Interrupt  5                      
189
.word end_of_test  ; Interrupt  6                      
190
.word end_of_test  ; Interrupt  7                      
191
.word end_of_test  ; Interrupt  8                      
192
.word end_of_test  ; Interrupt  9                      
193
.word end_of_test  ; Interrupt 10                      Watchdog timer
194
.word end_of_test  ; Interrupt 11                      
195
.word end_of_test  ; Interrupt 12                      
196
.word end_of_test  ; Interrupt 13                      
197
.word end_of_test  ; Interrupt 14                      NMI
198
.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.