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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src/] [c-jump_jne.s43] - Blame information for rev 162

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
/*                 CONDITIONAL JUMP: JNE INSTRUCTION                         */
25 2 olivier.gi
/*---------------------------------------------------------------------------*/
26 18 olivier.gi
/* Test the JNE 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 JUMP FORWARD AND BACKWARD ------------------- */
42
 
43
        mov     #0x0000, r2
44
        mov     #0x1234, r4
45
        jne     test_jne_fwrd1
46
        mov     #0x0000, r4
47
        mov     #0x0000, r4
48
        mov     #0x0000, r4
49
test_jne_bckwrd:
50
        mov     #0x9abc, r6
51
        jne     test_jne_fwrd2
52
        mov     #0x0000, r4
53
        mov     #0x0000, r4
54
        mov     #0x0000, r4
55
        mov     #0x0000, r5
56
        mov     #0x0000, r5
57
        mov     #0x0000, r5
58
        mov     #0x0000, r6
59
        mov     #0x0000, r6
60
        mov     #0x0000, r6
61
test_jne_fwrd1:
62
        mov     #0x5678, r5
63
        jne     test_jne_bckwrd
64
        mov     #0x0000, r4
65
        mov     #0x0000, r4
66
        mov     #0x0000, r4
67
        mov     #0x0000, r5
68
        mov     #0x0000, r5
69
        mov     #0x0000, r5
70
 
71
test_jne_fwrd2:
72
 
73
        mov     #0x1000, r15
74
 
75
        /* -------------- TEST JUMP FOR ALL FLAG CONFIGURATIONS ------------ */
76
 
77
        mov     #0x0000, r2             ;# {V,N,Z,C} = 4'b0000
78
        mov     #0x1234, r4
79
        jne     test_jne_0
80
        mov     #0x0000, r4
81
test_jne_0:
82
        mov     #0x2000, r15
83
 
84
        mov     #0x0001, r2             ;# {V,N,Z,C} = 4'b0001
85
        mov     #0x1234, r4
86
        jne     test_jne_1
87
        mov     #0x0000, r4
88
test_jne_1:
89
        mov     #0x2001, r15
90
 
91
        mov     #0x0002, r2             ;# {V,N,Z,C} = 4'b0010
92
        mov     #0x1234, r4
93
        jne     test_jne_2
94
        mov     #0x0000, r4
95
test_jne_2:
96
        mov     #0x2002, r15
97
 
98
        mov     #0x0003, r2             ;# {V,N,Z,C} = 4'b0011
99
        mov     #0x1234, r4
100
        jne     test_jne_3
101
        mov     #0x0000, r4
102
test_jne_3:
103
        mov     #0x2003, r15
104
 
105
        mov     #0x0004, r2             ;# {V,N,Z,C} = 4'b0100
106
        mov     #0x1234, r4
107
        jne     test_jne_4
108
        mov     #0x0000, r4
109
test_jne_4:
110
        mov     #0x2004, r15
111
 
112
        mov     #0x0005, r2             ;# {V,N,Z,C} = 4'b0101
113
        mov     #0x1234, r4
114
        jne     test_jne_5
115
        mov     #0x0000, r4
116
test_jne_5:
117
        mov     #0x2005, r15
118
 
119
        mov     #0x0006, r2             ;# {V,N,Z,C} = 4'b0110
120
        mov     #0x1234, r4
121
        jne     test_jne_6
122
        mov     #0x0000, r4
123
test_jne_6:
124
        mov     #0x2006, r15
125
 
126
        mov     #0x0007, r2             ;# {V,N,Z,C} = 4'b0111
127
        mov     #0x1234, r4
128
        jne     test_jne_7
129
        mov     #0x0000, r4
130
test_jne_7:
131
        mov     #0x2007, r15
132
 
133
        mov     #0x0100, r2             ;# {V,N,Z,C} = 4'b1000
134
        mov     #0x1234, r4
135
        jne     test_jne_8
136
        mov     #0x0000, r4
137
test_jne_8:
138
        mov     #0x2008, r15
139
 
140
        mov     #0x0101, r2             ;# {V,N,Z,C} = 4'b1001
141
        mov     #0x1234, r4
142
        jne     test_jne_9
143
        mov     #0x0000, r4
144
test_jne_9:
145
        mov     #0x2009, r15
146
 
147
        mov     #0x0102, r2             ;# {V,N,Z,C} = 4'b1010
148
        mov     #0x1234, r4
149
        jne     test_jne_A
150
        mov     #0x0000, r4
151
test_jne_A:
152
        mov     #0x200A, r15
153
 
154
        mov     #0x0103, r2             ;# {V,N,Z,C} = 4'b1011
155
        mov     #0x1234, r4
156
        jne     test_jne_B
157
        mov     #0x0000, r4
158
test_jne_B:
159
        mov     #0x200B, r15
160
 
161
        mov     #0x0104, r2             ;# {V,N,Z,C} = 4'b1100
162
        mov     #0x1234, r4
163
        jne     test_jne_C
164
        mov     #0x0000, r4
165
test_jne_C:
166
        mov     #0x200C, r15
167
 
168
        mov     #0x0105, r2             ;# {V,N,Z,C} = 4'b1101
169
        mov     #0x1234, r4
170
        jne     test_jne_D
171
        mov     #0x0000, r4
172
test_jne_D:
173
        mov     #0x200D, r15
174
 
175
        mov     #0x0106, r2             ;# {V,N,Z,C} = 4'b1110
176
        mov     #0x1234, r4
177
        jne     test_jne_E
178
        mov     #0x0000, r4
179
test_jne_E:
180
        mov     #0x200E, r15
181
 
182
        mov     #0x0107, r2             ;# {V,N,Z,C} = 4'b1111
183
        mov     #0x1234, r4
184
        jne     test_jne_F
185
        mov     #0x0000, r4
186
test_jne_F:
187
        mov     #0x200F, r15
188
 
189
 
190
        /* ----------------------         END OF TEST        --------------- */
191
        mov     #0x5000, r15
192
end_of_test:
193
        nop
194
        br #0xffff
195
 
196
 
197
 
198
        /* ----------------------         INTERRUPT VECTORS  --------------- */
199
 
200
.section .vectors, "a"
201
.word end_of_test  ; Interrupt  0 (lowest priority)    
202
.word end_of_test  ; Interrupt  1                      
203
.word end_of_test  ; Interrupt  2                      
204
.word end_of_test  ; Interrupt  3                      
205
.word end_of_test  ; Interrupt  4                      
206
.word end_of_test  ; Interrupt  5                      
207
.word end_of_test  ; Interrupt  6                      
208
.word end_of_test  ; Interrupt  7                      
209
.word end_of_test  ; Interrupt  8                      
210
.word end_of_test  ; Interrupt  9                      
211
.word end_of_test  ; Interrupt 10                      Watchdog timer
212
.word end_of_test  ; Interrupt 11                      
213
.word end_of_test  ; Interrupt 12                      
214
.word end_of_test  ; Interrupt 13                      
215
.word end_of_test  ; Interrupt 14                      NMI
216
.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.