Nios II Classic Processor Reference Guide

ID 683620
Date 10/28/2016
Public
Document Table of Contents

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 100.  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
0x03 ldbu 0x13 initda 0x23 ldbuio 0x33 initd
0x04 addi 0x14 ori 0x24 muli 0x34 orhi
0x05 stb 0x15 stw 0x25 stbio 0x35 stwio
0x06 br 0x16 blt 0x26 beq 0x36 bltu
0x07 ldb 0x17 ldw 0x27 ldbio 0x37 ldwio
0x08 cmpgei 0x18 cmpnei 0x28 cmpgeui 0x38 rdprs
0x09   0x19   0x29   0x39  
0x0A   0x1A   0x2A   0x3A R-type
0x0B ldhu 0x1B flushda 0x2B ldhuio 0x3B flushd
0x0C andi 0x1C xori 0x2C andhi 0x3C xorhi
0x0D sth 0x1D   0x2D sthio 0x3D  
0x0E bge 0x1E bne 0x2E bgeu 0x3E  
0x0F ldh 0x1F   0x2F ldhio 0x3F  
Table 101.  OPX Encodings for R-Type Instructions
OPX Instruction OPX Instruction OPX Instruction OPX Instruction
0x00   0x10 cmplt 0x20 cmpeq 0x30 cmpltu
0x01 eret 0x11   0x21   0x31 add
0x02 roli 0x12 slli 0x22   0x32  
0x03 rol 0x13 sll 0x23   0x33  
0x04 flushp 0x14 wrprs 0x24 divu 0x34 break
0x05 ret 0x15   0x25 div 0x35  
0x06 nor 0x16 or 0x26 rdctl 0x36 sync
0x07 mulxuu 0x17 mulxsu 0x27 mul 0x37  
0x08 cmpge 0x18 cmpne 0x28 cmpgeu 0x38  
0x09 bret 0x19   0x29 initi 0x39 sub
0x0A   0x1A srli 0x2A   0x3A srai
0x0B ror 0x1B srl 0x2B   0x3B sra
0x0C flushi 0x1C nextpc 0x2C   0x3C  
0x0D jmp 0x1D callr 0x2D trap 0x3D  
0x0E and 0x1E xor 0x2E wrctl 0x3E  
0x0F   0x1F mulxss 0x2F   0x3F