{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

n2cpu_nii51017 - 8 Instruction Set Reference NII51017-7.1.0...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Altera Corporation 8–1 May 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–4 “Assembler Pseudo-instructions” on page 8–6 “Assembler Macros” on page 8–7 “Instruction Set Reference” on page 8–8 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.1.0
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
8–2 Altera Corporation Nios II Processor Reference Handbook May 2007 Word Formats R-Type The defining characteristic of the R-type instruction-word format is that all arguments and results are specified as registers. R-type instructions contain: 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 low-order bits of OPX. 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. The R-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 C OPX OP
Background image of page 2
Altera Corporation 8–3 May 2007 Nios II Processor Reference Handbook Instruction Set Reference J-Type J-type instructions contain: A 6-bit opcode field A 26-bit immediate data field The only J-type instruction is call . The J-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 IMMED26 OP
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
8–4 Altera Corporation Nios II Processor Reference Handbook May 2007 Instruction Opcodes Instruction Opcodes The OP field in the Nios II instruction word specifies the major class of an opcode as shown in Table 8–1 and Table 8–2 . 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.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}