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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src/] [c-jump_jn.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
/*                 CONDITIONAL JUMP: JN INSTRUCTION                          */
25
/*---------------------------------------------------------------------------*/
26
/* Test the JN instruction.                                                  */
27
/*===========================================================================*/
28
 
29
 
30
.global main
31
 
32
main:
33
        /* -------------- TEST JUMP FORWARD AND BACKWARD ------------------- */
34
 
35
        mov     #0x0004, r2
36
        mov     #0x1234, r4
37
        jn      test_jn_fwrd1
38
        mov     #0x0000, r4
39
        mov     #0x0000, r4
40
        mov     #0x0000, r4
41
test_jn_bckwrd:
42
        mov     #0x9abc, r6
43
        jn      test_jn_fwrd2
44
        mov     #0x0000, r4
45
        mov     #0x0000, r4
46
        mov     #0x0000, r4
47
        mov     #0x0000, r5
48
        mov     #0x0000, r5
49
        mov     #0x0000, r5
50
        mov     #0x0000, r6
51
        mov     #0x0000, r6
52
        mov     #0x0000, r6
53
test_jn_fwrd1:
54
        mov     #0x5678, r5
55
        jn      test_jn_bckwrd
56
        mov     #0x0000, r4
57
        mov     #0x0000, r4
58
        mov     #0x0000, r4
59
        mov     #0x0000, r5
60
        mov     #0x0000, r5
61
        mov     #0x0000, r5
62
 
63
test_jn_fwrd2:
64
 
65
        mov     #0x1000, r15
66
 
67
        /* -------------- TEST JUMP FOR ALL FLAG CONFIGURATIONS ------------ */
68
 
69
        mov     #0x0000, r2             ;# {V,N,Z,C} = 4'b0000
70
        mov     #0x1234, r4
71
        jn      test_jn_0
72
        mov     #0x0000, r4
73
test_jn_0:
74
        mov     #0x2000, r15
75
 
76
        mov     #0x0001, r2             ;# {V,N,Z,C} = 4'b0001
77
        mov     #0x1234, r4
78
        jn      test_jn_1
79
        mov     #0x0000, r4
80
test_jn_1:
81
        mov     #0x2001, r15
82
 
83
        mov     #0x0002, r2             ;# {V,N,Z,C} = 4'b0010
84
        mov     #0x1234, r4
85
        jn      test_jn_2
86
        mov     #0x0000, r4
87
test_jn_2:
88
        mov     #0x2002, r15
89
 
90
        mov     #0x0003, r2             ;# {V,N,Z,C} = 4'b0011
91
        mov     #0x1234, r4
92
        jn      test_jn_3
93
        mov     #0x0000, r4
94
test_jn_3:
95
        mov     #0x2003, r15
96
 
97
        mov     #0x0004, r2             ;# {V,N,Z,C} = 4'b0100
98
        mov     #0x1234, r4
99
        jn      test_jn_4
100
        mov     #0x0000, r4
101
test_jn_4:
102
        mov     #0x2004, r15
103
 
104
        mov     #0x0005, r2             ;# {V,N,Z,C} = 4'b0101
105
        mov     #0x1234, r4
106
        jn      test_jn_5
107
        mov     #0x0000, r4
108
test_jn_5:
109
        mov     #0x2005, r15
110
 
111
        mov     #0x0006, r2             ;# {V,N,Z,C} = 4'b0110
112
        mov     #0x1234, r4
113
        jn      test_jn_6
114
        mov     #0x0000, r4
115
test_jn_6:
116
        mov     #0x2006, r15
117
 
118
        mov     #0x0007, r2             ;# {V,N,Z,C} = 4'b0111
119
        mov     #0x1234, r4
120
        jn      test_jn_7
121
        mov     #0x0000, r4
122
test_jn_7:
123
        mov     #0x2007, r15
124
 
125
        mov     #0x0100, r2             ;# {V,N,Z,C} = 4'b1000
126
        mov     #0x1234, r4
127
        jn      test_jn_8
128
        mov     #0x0000, r4
129
test_jn_8:
130
        mov     #0x2008, r15
131
 
132
        mov     #0x0101, r2             ;# {V,N,Z,C} = 4'b1001
133
        mov     #0x1234, r4
134
        jn      test_jn_9
135
        mov     #0x0000, r4
136
test_jn_9:
137
        mov     #0x2009, r15
138
 
139
        mov     #0x0102, r2             ;# {V,N,Z,C} = 4'b1010
140
        mov     #0x1234, r4
141
        jn      test_jn_A
142
        mov     #0x0000, r4
143
test_jn_A:
144
        mov     #0x200A, r15
145
 
146
        mov     #0x0103, r2             ;# {V,N,Z,C} = 4'b1011
147
        mov     #0x1234, r4
148
        jn      test_jn_B
149
        mov     #0x0000, r4
150
test_jn_B:
151
        mov     #0x200B, r15
152
 
153
        mov     #0x0104, r2             ;# {V,N,Z,C} = 4'b1100
154
        mov     #0x1234, r4
155
        jn      test_jn_C
156
        mov     #0x0000, r4
157
test_jn_C:
158
        mov     #0x200C, r15
159
 
160
        mov     #0x0105, r2             ;# {V,N,Z,C} = 4'b1101
161
        mov     #0x1234, r4
162
        jn      test_jn_D
163
        mov     #0x0000, r4
164
test_jn_D:
165
        mov     #0x200D, r15
166
 
167
        mov     #0x0106, r2             ;# {V,N,Z,C} = 4'b1110
168
        mov     #0x1234, r4
169
        jn      test_jn_E
170
        mov     #0x0000, r4
171
test_jn_E:
172
        mov     #0x200E, r15
173
 
174
        mov     #0x0107, r2             ;# {V,N,Z,C} = 4'b1111
175
        mov     #0x1234, r4
176
        jn      test_jn_F
177
        mov     #0x0000, r4
178
test_jn_F:
179
        mov     #0x200F, r15
180
 
181
 
182
        /* ----------------------         END OF TEST        --------------- */
183
        mov     #0x5000, r15
184
end_of_test:
185
        nop
186
        br #0xffff
187
 
188
 
189
 
190
        /* ----------------------         INTERRUPT VECTORS  --------------- */
191
 
192
.section .vectors, "a"
193
.word end_of_test  ; Interrupt  0 (lowest priority)    
194
.word end_of_test  ; Interrupt  1                      
195
.word end_of_test  ; Interrupt  2                      
196
.word end_of_test  ; Interrupt  3                      
197
.word end_of_test  ; Interrupt  4                      
198
.word end_of_test  ; Interrupt  5                      
199
.word end_of_test  ; Interrupt  6                      
200
.word end_of_test  ; Interrupt  7                      
201
.word end_of_test  ; Interrupt  8                      
202
.word end_of_test  ; Interrupt  9                      
203
.word end_of_test  ; Interrupt 10                      Watchdog timer
204
.word end_of_test  ; Interrupt 11                      
205
.word end_of_test  ; Interrupt 12                      
206
.word end_of_test  ; Interrupt 13                      
207
.word end_of_test  ; Interrupt 14                      NMI
208
.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.