Specifications
• A 6-bit opcode field OP
• Three 5-bit register fields A, B, and C
• An 11-bit opcode-extension field OPX
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 8-2: 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
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 8-3: 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
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 8-4: OP Encodings
OP Instruction OP Instruction OP Instruction OP Instruction
0x00 call 0x10 cmplti 0x20 cmpeqi 0x30 cmpltui
8-2
J-Type
NII51017
2015.04.02
Altera Corporation
Instruction Set Reference
Send Feedback