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 2

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
/*===========================================================================*/
29
 
30
.global main
31
 
32
main:
33
        # Initialization
34
        #------------------------
35
 
36
        mov     #0x0252, r1        ;# Initialize stack pointer
37
        mov     #0x0000, r5        ;# Initialize R5
38
 
39
 
40
        mov     #0x1000, r15
41
 
42
 
43
        # Addressing mode: @Rn
44
        #------------------------
45
 
46
        mov    #data_aRn_call, r4
47
        mov           #0x0000, r5
48
        call                  @r4           ;# CALL TEST_ROUTINE_aRN
49
 
50
        mov     #0x2000, r15
51
 
52
 
53
        # Addressing mode: @Rn+
54
        #------------------------
55
 
56
        mov    #data_aRni_call, r4
57
        mov            #0x0000, r5
58
        call                   @r4+         ;# CALL TEST_ROUTINE_aRNi
59
 
60
        mov     #0x3000, r15
61
 
62
 
63
        # Addressing mode: X(Rn)
64
        #------------------------
65
 
66
        mov    #data_xRn_call, r4
67
        mov           #0x0000, r5
68
        call                26(r4)          ;# CALL TEST_ROUTINE_xRN
69
 
70
        mov     #0x4000, r15
71
 
72
 
73
        # Addressing mode: EDE
74
        #------------------------
75
.set   EDE_21E,  (__data_start+0x001E)
76
 
77
        mov     #0x0000, r5
78
        call    data_EDE_call               ;# CALL TEST_ROUTINE_EDE
79
 
80
        mov     #0x5000, r15
81
 
82
 
83
        # Addressing mode: &EDE
84
        #------------------------
85
.set   aEDE_220,  0x0220
86
 
87
        mov     #0x0000, r5
88
        call  &data_aEDE_call               ;# CALL TEST_ROUTINE_aEDE
89
 
90
        mov     #0x6000, r15
91
 
92
 
93
        /* ----------------------         END OF TEST        --------------- */
94
end_of_test:
95
        nop
96
        br #0xffff
97
 
98
 
99
 
100
        /* ----------------------         TEST FUNCTIONS     --------------- */
101
 
102
TEST_ROUTINE_RN:
103
        mov #0x1234, r5
104
        ret
105
 
106
TEST_ROUTINE_aRN:
107
        mov #0x5678, r5
108
        ret
109
 
110
TEST_ROUTINE_aRNi:
111
        mov #0x9abc, r5
112
        ret
113
 
114
TEST_ROUTINE_N:
115
        mov #0xabcd, r5
116
        ret
117
 
118
TEST_ROUTINE_xRN:
119
        mov #0xef01, r5
120
        ret
121
 
122
TEST_ROUTINE_EDE:
123
        mov #0x2345, r5
124
        ret
125
 
126
TEST_ROUTINE_aEDE:
127
        mov #0x6789, r5
128
        ret
129
 
130
 
131
        /* ----------------------            DATA TABLE      --------------- */
132
data_aRn_call:
133
        .word TEST_ROUTINE_aRN
134
 
135
data_aRni_call:
136
        .word TEST_ROUTINE_aRNi
137
 
138
data_xRn_call:
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 0x0000
148
        .word 0x0000
149
        .word 0x0000
150
        .word 0x0000
151
        .word 0x0000
152
        .word TEST_ROUTINE_xRN
153
 
154
data_EDE_call:
155
        .word TEST_ROUTINE_EDE
156
 
157
data_aEDE_call:
158
        .word TEST_ROUTINE_aEDE
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.