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 19

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: 19 $                                                                */
33
/* $LastChangedBy: olivier.girard $                                          */
34
/* $LastChangedDate: 2009-08-04 23:47:15 +0200 (Tue, 04 Aug 2009) $          */
35 2 olivier.gi
/*===========================================================================*/
36
 
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     #0x0000, r5
55
        mov  #TEST_ROUTINE_RN, r4
56
        mov     #0x5555, &0x0300
57
        call         r4            ;# CALL TEST_ROUTINE_RN
58
 
59
        mov     #0x2000, r15
60
 
61
 
62
        # Addressing mode: @Rn
63
        #------------------------
64
 
65
        mov     #0x0212, r4
66
        mov     #0x0000, r5
67
        mov   #TEST_ROUTINE_aRN, &0x0212
68
        mov     #0x5555, &0x0300
69
        call        @r4           ;# CALL TEST_ROUTINE_aRN
70
 
71
        mov     #0x3000, r15
72
 
73
 
74
        # Addressing mode: @Rn+
75
        #------------------------
76
 
77
        mov     #0x0216, r4
78
        mov     #0x0000, r5
79
        mov   #TEST_ROUTINE_aRNi, &0x0216
80
        mov     #0x5555, &0x0300
81
        call       @r4+           ;# CALL TEST_ROUTINE_aRNi
82
 
83
        mov     #0x4000, r15
84
 
85
 
86
        # Addressing mode: #N
87
        #------------------------
88
 
89
        mov     #0x0000, r5
90
        mov     #0x5555, &0x0300
91
        call    #TEST_ROUTINE_N   ;# CALL TEST_ROUTINE_N
92
 
93
        mov     #0x5000, r15
94
 
95
 
96
        # Addressing mode: X(Rn)
97
        #------------------------
98
 
99
        mov     #0x0200, r4
100
        mov     #0x0000, r5
101
        mov  #TEST_ROUTINE_xRN, &0x021A
102
        mov     #0x5555, &0x0300
103
        call      26(r4)           ;# CALL TEST_ROUTINE_xRN
104
 
105
        mov     #0x6000, r15
106
 
107
 
108
        # Addressing mode: EDE
109
        #------------------------
110
.set   EDE_21E,  (__data_start+0x001E)
111
 
112
        mov     #0x0000, r5
113
        mov  #TEST_ROUTINE_EDE, &0x021E
114
        mov     #0x5555, &0x0300
115
        call    EDE_21E            ;# CALL TEST_ROUTINE_EDE
116
 
117
        mov     #0x7000, r15
118
 
119
 
120
        # Addressing mode: &EDE
121
        #------------------------
122
.set   aEDE_220,  0x0220
123
 
124
        mov     #0x0000, r5
125
        mov  #TEST_ROUTINE_aEDE, &aEDE_220
126
        mov     #0x5555, &0x0300
127
        call  &aEDE_220            ;# CALL TEST_ROUTINE_aEDE
128
 
129
        mov     #0x8000, r15
130
 
131
 
132
        /* ----------------------         END OF TEST        --------------- */
133
end_of_test:
134
        nop
135
        br #0xffff
136
 
137
 
138
 
139
        /* ----------------------         TEST FUNCTIONS     --------------- */
140
 
141
TEST_ROUTINE_RN:
142
        mov #0x1234, r5
143
        ret
144
 
145
TEST_ROUTINE_aRN:
146
        mov #0x5678, r5
147
        ret
148
 
149
TEST_ROUTINE_aRNi:
150
        mov #0x9abc, r5
151
        ret
152
 
153
TEST_ROUTINE_N:
154
        mov #0xabcd, r5
155
        ret
156
 
157
TEST_ROUTINE_xRN:
158
        mov #0xef01, r5
159
        ret
160
 
161
TEST_ROUTINE_EDE:
162
        mov #0x2345, r5
163
        ret
164
 
165
TEST_ROUTINE_aEDE:
166
        mov #0x6789, r5
167
        ret
168
 
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.