In most cases, fields A and B specify the source operands, and field C specifies the
destination register.
Some R-Type instructions embed a small immediate value in the five low-order bits of
OPX. Unused bits in OPX are always 0.
R-type instructions include arithmetic and logical operations such as
add
and
nor
;
comparison operations such as
cmpeq
and
cmplt
; the
custom
instruction; and other
operations that need only register operands.
Table 91.
R-Type Instruction Format
Bit Fields
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
A
B
C
OPX
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
OPX
OP
8.1.3. J-Type
J-type instructions contain:
•
A 6-bit opcode field
•
A 26-bit immediate data field
J-type instructions, such as
call
and
jmpi
, transfer execution anywhere within a
256-MB range.
Table 92.
J-Type Instruction Format
Bit Fields
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
IMM26
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
IMM26
OP
8.2. Instruction Opcodes
The OP field in the Nios II instruction word specifies the major class of an opcode as
listed in the two tables below. Most values of OP are encodings for I-type instructions.
One encoding, OP = 0x00, is the J-type instruction
call
. Another encoding, OP =
0x3a, is used for all R-type instructions, in which case, the OPX field differentiates the
instructions. All undefined encodings of OP and OPX are reserved.
Table 93.
OP Encodings
OP
Instruction
OP
Instruction
OP
Instruction
OP
Instruction
0x00
call
0x10
cmplti
0x20
cmpeqi
0x30
cmpltui
0x01
jmpi
0x11
0x21
0x31
0x02
0x12
0x22
0x32
custom
continued...
8. Instruction Set Reference
NII-PRG | 2018.04.18
Nios II Processor Reference Guide
170