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 155

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: 141 $                                                                */
33
/* $LastChangedBy: olivier.girard $                                          */
34
/* $LastChangedDate: 2012-05-05 23:22:06 +0200 (Sat, 05 May 2012) $          */
35 2 olivier.gi
/*===========================================================================*/
36
 
37 141 olivier.gi
.include "pmem_defs.asm"
38 2 olivier.gi
 
39
.global main
40
 
41
main:
42
        /* -------------- TEST INSTRUCTION IN WORD MODE ------------------- */
43
 
44
 
45
        # Addressing mode: Rn
46
        #------------------------
47
 
48
        mov     #0x0100, r2        ;# Test 1
49
        mov     #0x7524, r4
50
        sxt          r4            ;# SXT (r4=0x7524  =>  r4=0x0024)
51
        mov          r2, r5
52
 
53
        mov     #0x0100, r2        ;# Test 2
54
        mov     #0x1cb6, r6
55
        sxt          r6            ;# SXT (r6=0x1cb6  =>  r6=0xffb6)
56
        mov          r2, r7
57
 
58
        mov     #0x1000, r15
59
 
60
 
61
        # Addressing mode: @Rn
62
        #------------------------
63
 
64
        mov     #0x0100, r2        ;# Test 1
65 111 olivier.gi
        mov     #0x7524, &DMEM_200
66
        mov   #DMEM_200, r4
67
        mov     #0xaaaa, &DMEM_202
68 2 olivier.gi
        sxt         @r4            ;# SXT (mem00=0x7524  => {mem00=0x0024)
69
        mov          r2, r5
70
 
71
        mov     #0x0100, r2        ;# Test 2
72 111 olivier.gi
        mov     #0x1cb6, &DMEM_202
73
        mov   #DMEM_202, r6
74
        mov     #0xaaaa, &DMEM_204
75 2 olivier.gi
        sxt         @r6            ;# SXT (mem01=0x1cb6  => {mem01=0xffb6)
76
        mov          r2, r7
77
 
78
        mov     #0x2000, r15
79
 
80
 
81
        # Addressing mode: @Rn+
82
        #------------------------
83
 
84
        mov     #0x0100, r2        ;# Test 1
85 111 olivier.gi
        mov     #0x7524, &DMEM_208
86
        mov   #DMEM_208, r4
87
        mov     #0xaaaa, &DMEM_20A
88 2 olivier.gi
        sxt        @r4+            ;# SXT (mem04=0x7524  => {mem04=0x0024)
89
        mov          r2, r5
90
 
91
        mov     #0x0100, r2        ;# Test 2
92 111 olivier.gi
        mov     #0x1cb6, &DMEM_20A
93
        mov   #DMEM_20A, r6
94
        mov     #0xaaaa, &DMEM_20C
95 2 olivier.gi
        sxt        @r6+            ;# SXT (mem05=0x1cb6  => {mem05=0xffb6)
96
        mov          r2, r7
97
 
98
        mov     #0x3000, r15
99
 
100
 
101
        # Addressing mode: X(Rn)
102
        #------------------------
103
 
104
        mov     #0x0100, r2        ;# Test 1
105 111 olivier.gi
        mov     #0x7524, &DMEM_210
106
        mov   #DMEM_200, r4
107
        mov     #0xaaaa, &DMEM_212
108 2 olivier.gi
        sxt       16(r4)            ;# SXT (mem08=0x7524  => {mem08=0x0024)
109
        mov          r2, r5
110
 
111
        mov     #0x0100, r2        ;# Test 2
112 111 olivier.gi
        mov     #0x1cb6, &DMEM_212
113
        mov   #DMEM_200, r6
114
        mov     #0xaaaa, &DMEM_214
115 2 olivier.gi
        sxt       18(r6)            ;# SXT (mem09=0x1cb6  => {mem09=0xffb6)
116
        mov          r2, r7
117
 
118
        mov     #0x4000, r15
119
 
120
 
121
        # Addressing mode: EDE
122
        #------------------------
123 111 olivier.gi
.set   EDE_218,  DMEM_218
124
.set   EDE_21A,  DMEM_21A
125
.set   EDE_21C,  DMEM_21C
126
.set   EDE_21E,  DMEM_21E
127 2 olivier.gi
 
128
        mov     #0x0100, r2        ;# Test 1
129 111 olivier.gi
        mov     #0x7524, &DMEM_218
130
        mov     #0xaaaa, &DMEM_21A
131 141 olivier.gi
        sxt     EDE_218+PMEM_LENGTH            ;# SXT (mem0c=0x7524  => {mem0c=0x0024)
132 2 olivier.gi
        mov          r2, r5
133
 
134
        mov     #0x0100, r2        ;# Test 2
135 111 olivier.gi
        mov     #0x1cb6, &DMEM_21A
136
        mov     #0xaaaa, &DMEM_21C
137 141 olivier.gi
        sxt     EDE_21A+PMEM_LENGTH            ;# SXT (mem0d=0x1cb6  => {mem0d=0xffb6)
138 2 olivier.gi
        mov          r2, r7
139
 
140
        mov     #0x5000, r15
141
 
142
 
143
        # Addressing mode: &EDE
144
        #------------------------
145 111 olivier.gi
.set   aEDE_220,  DMEM_220
146
.set   aEDE_222,  DMEM_222
147
.set   aEDE_224,  DMEM_224
148
.set   aEDE_226,  DMEM_226
149 2 olivier.gi
 
150
        mov     #0x0100, r2        ;# Test 1
151 111 olivier.gi
        mov     #0x7524, &DMEM_220
152
        mov     #0xaaaa, &DMEM_222
153 2 olivier.gi
        sxt   &aEDE_220            ;# SXT (mem10=0x7524  => {mem10=0x0024)
154
        mov          r2, r5
155
 
156
        mov     #0x0100, r2        ;# Test 2
157 111 olivier.gi
        mov     #0x1cb6, &DMEM_222
158
        mov     #0xaaaa, &DMEM_224
159 2 olivier.gi
        sxt   &aEDE_222            ;# SXT (mem11=0x1cb6  => {mem11=0xffb6)
160
        mov          r2, r7
161
 
162
        mov     #0x6000, r15
163
 
164
 
165
        /* ----------------------         END OF TEST        --------------- */
166
end_of_test:
167
        nop
168
        br #0xffff
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.