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

Subversion Repositories openmsp430

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

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 18 olivier.gi
/*                 SINGLE-OPERAND ARITHMETIC: SXT  INSTRUCTION               */
25 2 olivier.gi
/*---------------------------------------------------------------------------*/
26 18 olivier.gi
/* Test the SXT  instruction.                                                */
27
/*                                                                           */
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
        /* -------------- TEST INSTRUCTION IN WORD MODE ------------------- */
42
 
43
 
44
        # Addressing mode: Rn
45
        #------------------------
46
 
47
        mov     #0x0100, r2        ;# Test 1
48
        mov     #0x7524, r4
49
        sxt          r4            ;# SXT (r4=0x7524  =>  r4=0x0024)
50
        mov          r2, r5
51
 
52
        mov     #0x0100, r2        ;# Test 2
53
        mov     #0x1cb6, r6
54
        sxt          r6            ;# SXT (r6=0x1cb6  =>  r6=0xffb6)
55
        mov          r2, r7
56
 
57
        mov     #0x1000, r15
58
 
59
 
60
        # Addressing mode: @Rn
61
        #------------------------
62
 
63
        mov     #0x0100, r2        ;# Test 1
64
        mov     #0x7524, &0x0200
65
        mov     #0x0200, r4
66
        mov     #0xaaaa, &0x0202
67
        sxt         @r4            ;# SXT (mem00=0x7524  => {mem00=0x0024)
68
        mov          r2, r5
69
 
70
        mov     #0x0100, r2        ;# Test 2
71
        mov     #0x1cb6, &0x0202
72
        mov     #0x0202, r6
73
        mov     #0xaaaa, &0x0204
74
        sxt         @r6            ;# SXT (mem01=0x1cb6  => {mem01=0xffb6)
75
        mov          r2, r7
76
 
77
        mov     #0x2000, r15
78
 
79
 
80
        # Addressing mode: @Rn+
81
        #------------------------
82
 
83
        mov     #0x0100, r2        ;# Test 1
84
        mov     #0x7524, &0x0208
85
        mov     #0x0208, r4
86
        mov     #0xaaaa, &0x020A
87
        sxt        @r4+            ;# SXT (mem04=0x7524  => {mem04=0x0024)
88
        mov          r2, r5
89
 
90
        mov     #0x0100, r2        ;# Test 2
91
        mov     #0x1cb6, &0x020A
92
        mov     #0x020A, r6
93
        mov     #0xaaaa, &0x020C
94
        sxt        @r6+            ;# SXT (mem05=0x1cb6  => {mem05=0xffb6)
95
        mov          r2, r7
96
 
97
        mov     #0x3000, r15
98
 
99
 
100
        # Addressing mode: X(Rn)
101
        #------------------------
102
 
103
        mov     #0x0100, r2        ;# Test 1
104
        mov     #0x7524, &0x0210
105
        mov     #0x0200, r4
106
        mov     #0xaaaa, &0x0212
107
        sxt       16(r4)            ;# SXT (mem08=0x7524  => {mem08=0x0024)
108
        mov          r2, r5
109
 
110
        mov     #0x0100, r2        ;# Test 2
111
        mov     #0x1cb6, &0x0212
112
        mov     #0x0200, r6
113
        mov     #0xaaaa, &0x0214
114
        sxt       18(r6)            ;# SXT (mem09=0x1cb6  => {mem09=0xffb6)
115
        mov          r2, r7
116
 
117
        mov     #0x4000, r15
118
 
119
 
120
        # Addressing mode: EDE
121
        #------------------------
122
.set   EDE_218,  (__data_start+0x0018)
123
.set   EDE_21A,  (__data_start+0x001A)
124
.set   EDE_21C,  (__data_start+0x001C)
125
.set   EDE_21E,  (__data_start+0x001E)
126
 
127
        mov     #0x0100, r2        ;# Test 1
128
        mov     #0x7524, &0x0218
129
        mov     #0xaaaa, &0x021A
130
        sxt     EDE_218            ;# SXT (mem0c=0x7524  => {mem0c=0x0024)
131
        mov          r2, r5
132
 
133
        mov     #0x0100, r2        ;# Test 2
134
        mov     #0x1cb6, &0x021A
135
        mov     #0xaaaa, &0x021C
136
        sxt     EDE_21A            ;# SXT (mem0d=0x1cb6  => {mem0d=0xffb6)
137
        mov          r2, r7
138
 
139
        mov     #0x5000, r15
140
 
141
 
142
        # Addressing mode: &EDE
143
        #------------------------
144
.set   aEDE_220,  0x0220
145
.set   aEDE_222,  0x0222
146
.set   aEDE_224,  0x0224
147
.set   aEDE_226,  0x0226
148
 
149
        mov     #0x0100, r2        ;# Test 1
150
        mov     #0x7524, &0x0220
151
        mov     #0xaaaa, &0x0222
152
        sxt   &aEDE_220            ;# SXT (mem10=0x7524  => {mem10=0x0024)
153
        mov          r2, r5
154
 
155
        mov     #0x0100, r2        ;# Test 2
156
        mov     #0x1cb6, &0x0222
157
        mov     #0xaaaa, &0x0224
158
        sxt   &aEDE_222            ;# SXT (mem11=0x1cb6  => {mem11=0xffb6)
159
        mov          r2, r7
160
 
161
        mov     #0x6000, r15
162
 
163
 
164
        /* ----------------------         END OF TEST        --------------- */
165
end_of_test:
166
        nop
167
        br #0xffff
168
 
169
 
170
        /* ----------------------         INTERRUPT VECTORS  --------------- */
171
 
172
.section .vectors, "a"
173
.word end_of_test  ; Interrupt  0 (lowest priority)    
174
.word end_of_test  ; Interrupt  1                      
175
.word end_of_test  ; Interrupt  2                      
176
.word end_of_test  ; Interrupt  3                      
177
.word end_of_test  ; Interrupt  4                      
178
.word end_of_test  ; Interrupt  5                      
179
.word end_of_test  ; Interrupt  6                      
180
.word end_of_test  ; Interrupt  7                      
181
.word end_of_test  ; Interrupt  8                      
182
.word end_of_test  ; Interrupt  9                      
183
.word end_of_test  ; Interrupt 10                      Watchdog timer
184
.word end_of_test  ; Interrupt 11                      
185
.word end_of_test  ; Interrupt 12                      
186
.word end_of_test  ; Interrupt 13                      
187
.word end_of_test  ; Interrupt 14                      NMI
188
.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.