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 141

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