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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src/] [two-op_xor.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
/*                 TWO-OPERAND ARITHMETIC: XOR[.B] INSTRUCTION               */
25
/*---------------------------------------------------------------------------*/
26
/* Test the XOR[.B] instruction.                                             */
27
/*===========================================================================*/
28
 
29
 
30
.global main
31
 
32
main:
33
        /* -------------- TEST INSTRUCTION IN WORD MODE ------------------- */
34
 
35
        mov     #0x0000, r2
36
        mov     #0x3333, r4
37
        mov     #0x8888, r5
38
        xor          r4, r5        ;# XOR r5^r4 (0x8888^0x3333=0xbbbb)
39
 
40
        mov     #0x0001, r2
41
        mov     #0x5555, r4
42
        mov     #0x9999, r6
43
        xor          r4, r6        ;# XOR r6^r4 (0x9999^0x5555=0xcccc)
44
 
45
        mov     #0x1000, r15
46
 
47
 
48
        /* -------------- TEST INSTRUCTION IN BYTE MODE ------------------- */
49
 
50
        mov     #0x0000, r2
51
        mov     #0x3333, r4
52
        mov     #0x8888, r5
53
        xor.b        r4, r5        ;# XOR r5^r4 (0x0088^0x0033=0x00bb)
54
 
55
        mov     #0x0001, r2
56
        mov     #0x5555, r4
57
        mov     #0x9999, r6
58
        xor.b        r4, r6        ;# XOR r6^r4 (0x0099^0x0055=0x00cc)
59
 
60
        mov     #0x2000, r15
61
 
62
 
63
        /* ------------------ TEST FLAGS IN WORD MODE ---------------------- */
64
 
65
        mov     #0x0000, r2        ;# V=0, N=0, Z=0, C=1
66
        mov     #0x0aaa, r4        ;#
67
        mov     #0x0666, r5        ;#
68
        xor          r4, r5        ;# XOR r5^r4 (0x0666^0x0aaa=0x0ccc)
69
        mov     #0x3000, r15
70
 
71
        mov     #0x0000, r2        ;# V=0, N=0, Z=1, C=0
72
        mov     #0x0444, r4        ;#
73
        mov     #0x0444, r5        ;#
74
        xor          r4, r5        ;# XOR r5^r4 (0x0444^0x0444=0x0000)
75
        mov     #0x3001, r15
76
 
77
        mov     #0x0000, r2        ;# V=0, N=1, Z=0, C=1
78
        mov     #0x8aaa, r4        ;#
79
        mov     #0x0666, r5        ;#
80
        xor          r4, r5        ;# XOR r5^r4 (0x8aaa^0x0666=0x8ccc)
81
        mov     #0x3002, r15
82
 
83
        mov     #0x0000, r2        ;# V=1, N=0, Z=0, C=1
84
        mov     #0x8aaa, r4        ;#
85
        mov     #0x8666, r5        ;#
86
        xor          r4, r5        ;# XOR r5^r4 (0x8aaa^0x8666=0x0ccc)
87
        mov     #0x3003, r15
88
 
89
        mov     #0x0000, r2        ;# V=1, N=0, Z=1, C=0
90
        mov     #0x8444, r4        ;#
91
        mov     #0x8444, r5        ;#
92
        xor          r4, r5        ;# XOR r5^r4 (0x8444^0x8444=0x0000)
93
        mov     #0x3004, r15
94
 
95
 
96
        /* ------------------ TEST FLAGS IN BYTE MODE --------------------- */
97
 
98
        mov     #0x0000, r2        ;# V=0, N=0, Z=0, C=1
99
        mov     #0x660a, r4        ;#
100
        mov     #0xaa06, r5        ;#
101
        xor.b        r4, r5        ;# XOR r5^r4 (0x0006^0x000a=0x000c)
102
        mov     #0x4000, r15
103
 
104
        mov     #0x0000, r2        ;# V=0, N=0, Z=1, C=0
105
        mov     #0x6604, r4        ;#
106
        mov     #0xaa04, r5        ;#
107
        xor.b        r4, r5        ;# XOR r5^r4 (0x0004^0x0004=0x0000)
108
        mov     #0x4001, r15
109
 
110
        mov     #0x0000, r2        ;# V=0, N=1, Z=0, C=1
111
        mov     #0x558a, r4        ;#
112
        mov     #0x0006, r5        ;#
113
        xor.b        r4, r5        ;# XOR r5^r4 (0x008a^0x0006=0x008c)
114
        mov     #0x4002, r15
115
 
116
        mov     #0x0000, r2        ;# V=1, N=0, Z=0, C=1
117
        mov     #0x558a, r4        ;#
118
        mov     #0x5586, r5        ;#
119
        xor.b        r4, r5        ;# XOR r5^r4 (0x008a^0x0086=0x000c)
120
        mov     #0x4003, r15
121
 
122
        mov     #0x0000, r2        ;# V=1, N=0, Z=1, C=0
123
        mov     #0x6684, r4        ;#
124
        mov     #0xaa84, r5        ;#
125
        xor.b        r4, r5        ;# XOR r5^r4 (0x0084^0x0084=0x0000)
126
        mov     #0x4004, r15
127
 
128
 
129
        /* ----------------------         END OF TEST        --------------- */
130
        mov      #0x5000, r15
131
end_of_test:
132
        nop
133
        br #0xffff
134
 
135
 
136
        /* ----------------------         INTERRUPT VECTORS  --------------- */
137
 
138
.section .vectors, "a"
139
.word end_of_test  ; Interrupt  0 (lowest priority)    
140
.word end_of_test  ; Interrupt  1                      
141
.word end_of_test  ; Interrupt  2                      
142
.word end_of_test  ; Interrupt  3                      
143
.word end_of_test  ; Interrupt  4                      
144
.word end_of_test  ; Interrupt  5                      
145
.word end_of_test  ; Interrupt  6                      
146
.word end_of_test  ; Interrupt  7                      
147
.word end_of_test  ; Interrupt  8                      
148
.word end_of_test  ; Interrupt  9                      
149
.word end_of_test  ; Interrupt 10                      Watchdog timer
150
.word end_of_test  ; Interrupt 11                      
151
.word end_of_test  ; Interrupt 12                      
152
.word end_of_test  ; Interrupt 13                      
153
.word end_of_test  ; Interrupt 14                      NMI
154
.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.