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 18

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