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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src/] [sing-op_call.s43] - Blame information for rev 122

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