1 #ifndef CYGONCE_NIOS2_OPCODE_H
2 #define CYGONCE_NIOS2_OPCODE_H
4 //=============================================================================
8 // Opcodes for Nios II.
10 //=============================================================================
11 //####ECOSGPLCOPYRIGHTBEGIN####
12 // -------------------------------------------
13 // This file is part of eCos, the Embedded Configurable Operating System.
15 // eCos is free software; you can redistribute it and/or modify it under
16 // the terms of the GNU General Public License as published by the Free
17 // Software Foundation; either version 2 or (at your option) any later version.
19 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 // You should have received a copy of the GNU General Public License along
25 // with eCos; if not, write to the Free Software Foundation, Inc.,
26 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
28 // As a special exception, if other files instantiate templates or use macros
29 // or inline functions from this file, or you compile this file and link it
30 // with other works to produce a work based on this file, this file does not
31 // by itself cause the resulting work to be covered by the GNU General Public
32 // License. However the source code for this file must still be made available
33 // in accordance with section (3) of the GNU General Public License.
35 // This exception does not invalidate any other reasons why a work based on
36 // this file might be covered by the GNU General Public License.
38 // -------------------------------------------
39 //####ECOSGPLCOPYRIGHTEND####
40 //=============================================================================
42 // Provide structures and defines used for decoding Nios II instructions
44 // Define the instruction formats.
71 //Values for the 'op' field.
84 #define OP_CMPEQI 0x20
85 #define OP_CMPGEI 0x08
86 #define OP_CMPGEUI 0x28
87 #define OP_CMPLTI 0x10
88 #define OP_CMPLTUI 0x30
89 #define OP_CMPNEI 0x18
90 #define OP_FLUSHD 0x3b
94 #define OP_LDBUIO 0x23
98 #define OP_LDHUIO 0x2b
100 #define OP_LDWIO 0x37
105 #define OP_STBIO 0x25
107 #define OP_STHIO 0x2d
109 #define OP_STWIO 0x35
111 #define OP_XORHI 0x3c
113 #define OP_RTYPE 0x3a
115 // Values of the 'opx' field for when the opcode = OP_RTYPE
117 #define OPX_ERET 0x01
118 #define OPX_ROLI 0x02
120 #define OPX_FLUSHP 0x04
123 #define OPX_MULXUU 0x07
124 #define OPX_CMPGE 0x08
125 #define OPX_BRET 0x09
127 #define OPX_FLUSHI 0x0c
130 #define OPX_CMPLT 0x10
131 #define OPX_SLLI 0x12
134 #define OPX_MULXSU 0x17
135 #define OPX_CMPNE 0x18
136 #define OPX_SRLI 0x1a
138 #define OPX_NEXTPC 0x1c
139 #define OPX_CALLR 0x1d
141 #define OPX_MULXSS 0x1f
142 #define OPX_CMPEQ 0x20
143 #define OPX_DIVU 0x24
145 #define OPX_RDCTL 0x26
147 #define OPX_CMPGEU 0x28
148 #define OPX_TRAP 0x2d
149 #define OPX_WRCTL 0x2e
150 #define OPX_CMPLTU 0x30
152 #define OPX_BREAK 0x34
153 #define OPX_SYNC 0x36
155 #define OPX_SRAI 0x3a
158 // Instructions with specal significance to debuggers.
160 #define BREAK_INSTR 0x005b603a // instruction code for break (actually trap)
161 #define NOP_INSTR 0x0001883a // instruction code for no-op
163 #endif // CYGONCE_NIOS2_OPCODE_H