Specifications

Table Of Contents
Altera Corporation 8–1
October 2007
8. Instruction Set Reference
Introduction
This section introduces the Nios
®
II instruction-word format and
provides a detailed reference of the Nios II instruction set. This chapter
contains the following sections:
“Word Formats” on page 8–1
“Instruction Opcodes” on page 8–3
“Assembler Pseudo-instructions” on page 8–5
“Assembler Macros” on page 8–6
“Instruction Set Reference” on page 8–7
Word Formats
There are three types of Nios II instruction word format: I-type, R-type,
and J-type.
I-Type
The defining characteristic of the I-type instruction-word format is that it
contains an immediate value embedded within the instruction word. I-
type instructions words contain:
A 6-bit opcode field OP
Two 5-bit register fields A and B
A 16 bit immediate data field IMM16
In most cases, fields A and IMM16 specify the source operands, and field
B specifies the destination register. IMM16 is considered signed except
for logical operations and unsigned comparisons.
I-type instructions include arithmetic and logical operations such as
addi and andi; branch operations; load and store operations; and cache-
management operations.
The I-type instruction format is:
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
A B IMM16 OP
NII51017-7.2.0