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 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
/*                 SINGLE-OPERAND ARITHMETIC: CALL  INSTRUCTION              */
25
/*---------------------------------------------------------------------------*/
26
/* Test the CALL  instruction.                                               */
27
/*===========================================================================*/
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     #0x0000, r5
47
        mov  #TEST_ROUTINE_RN, r4
48
        mov     #0x5555, &0x0300
49
        call         r4            ;# CALL TEST_ROUTINE_RN
50
 
51
        mov     #0x2000, r15
52
 
53
 
54
        # Addressing mode: @Rn
55
        #------------------------
56
 
57
        mov     #0x0212, r4
58
        mov     #0x0000, r5
59
        mov   #TEST_ROUTINE_aRN, &0x0212
60
        mov     #0x5555, &0x0300
61
        call        @r4           ;# CALL TEST_ROUTINE_aRN
62
 
63
        mov     #0x3000, r15
64
 
65
 
66
        # Addressing mode: @Rn+
67
        #------------------------
68
 
69
        mov     #0x0216, r4
70
        mov     #0x0000, r5
71
        mov   #TEST_ROUTINE_aRNi, &0x0216
72
        mov     #0x5555, &0x0300
73
        call       @r4+           ;# CALL TEST_ROUTINE_aRNi
74
 
75
        mov     #0x4000, r15
76
 
77
 
78
        # Addressing mode: #N
79
        #------------------------
80
 
81
        mov     #0x0000, r5
82
        mov     #0x5555, &0x0300
83
        call    #TEST_ROUTINE_N   ;# CALL TEST_ROUTINE_N
84
 
85
        mov     #0x5000, r15
86
 
87
 
88
        # Addressing mode: X(Rn)
89
        #------------------------
90
 
91
        mov     #0x0200, r4
92
        mov     #0x0000, r5
93
        mov  #TEST_ROUTINE_xRN, &0x021A
94
        mov     #0x5555, &0x0300
95
        call      26(r4)           ;# CALL TEST_ROUTINE_xRN
96
 
97
        mov     #0x6000, r15
98
 
99
 
100
        # Addressing mode: EDE
101
        #------------------------
102
.set   EDE_21E,  (__data_start+0x001E)
103
 
104
        mov     #0x0000, r5
105
        mov  #TEST_ROUTINE_EDE, &0x021E
106
        mov     #0x5555, &0x0300
107
        call    EDE_21E            ;# CALL TEST_ROUTINE_EDE
108
 
109
        mov     #0x7000, r15
110
 
111
 
112
        # Addressing mode: &EDE
113
        #------------------------
114
.set   aEDE_220,  0x0220
115
 
116
        mov     #0x0000, r5
117
        mov  #TEST_ROUTINE_aEDE, &aEDE_220
118
        mov     #0x5555, &0x0300
119
        call  &aEDE_220            ;# CALL TEST_ROUTINE_aEDE
120
 
121
        mov     #0x8000, r15
122
 
123
 
124
        /* ----------------------         END OF TEST        --------------- */
125
end_of_test:
126
        nop
127
        br #0xffff
128
 
129
 
130
 
131
        /* ----------------------         TEST FUNCTIONS     --------------- */
132
 
133
TEST_ROUTINE_RN:
134
        mov #0x1234, r5
135
        ret
136
 
137
TEST_ROUTINE_aRN:
138
        mov #0x5678, r5
139
        ret
140
 
141
TEST_ROUTINE_aRNi:
142
        mov #0x9abc, r5
143
        ret
144
 
145
TEST_ROUTINE_N:
146
        mov #0xabcd, r5
147
        ret
148
 
149
TEST_ROUTINE_xRN:
150
        mov #0xef01, r5
151
        ret
152
 
153
TEST_ROUTINE_EDE:
154
        mov #0x2345, r5
155
        ret
156
 
157
TEST_ROUTINE_aEDE:
158
        mov #0x6789, r5
159
        ret
160
 
161
 
162
 
163
        /* ----------------------         INTERRUPT VECTORS  --------------- */
164
 
165
.section .vectors, "a"
166
.word end_of_test  ; Interrupt  0 (lowest priority)    
167
.word end_of_test  ; Interrupt  1                      
168
.word end_of_test  ; Interrupt  2                      
169
.word end_of_test  ; Interrupt  3                      
170
.word end_of_test  ; Interrupt  4                      
171
.word end_of_test  ; Interrupt  5                      
172
.word end_of_test  ; Interrupt  6                      
173
.word end_of_test  ; Interrupt  7                      
174
.word end_of_test  ; Interrupt  8                      
175
.word end_of_test  ; Interrupt  9                      
176
.word end_of_test  ; Interrupt 10                      Watchdog timer
177
.word end_of_test  ; Interrupt 11                      
178
.word end_of_test  ; Interrupt 12                      
179
.word end_of_test  ; Interrupt 13                      
180
.word end_of_test  ; Interrupt 14                      NMI
181
.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.