Specifications
Table 3-44: Move Instructions
Instruction Description
mov
movhi
movi
movui
movia
mov copies the value of one register to another register. movi moves a 16-bit signed
immediate value to a register, and sign-extends the value to 32 bits. movui and movhi
move a 16-bit immediate value into the lower or upper 16-bits of a register, inserting
zeros in the remaining bit positions. Use movia to load a register with an address.
Comparison Instructions
The Nios II architecture supports a number of comparison instructions. All of these compare two
registers or a register and an immediate value, and write either one (if true) or zero to the result register.
These instructions perform all the equality and relational operators of the C programming language.
Table 3-45: Comparison Instructions
Instruction Description
cmpeq ==
cmpne !=
cmpge signed >=
cmpgeu unsigned >=
cmpgt signed >
cmpgtu unsigned >
cmple unsigned <=
cmpleu unsigned <=
cmplt signed <
cmpltu unsigned <
cmpeqi
cmpnei
cmpgei
cmpgeui
cmpgti
cmpgtui
cmplei
cmpleui
cmplti
cmpltui
These instructions are immediate versions of the comparison operations. They
compare the value of a register and a 16-bit immediate value. Signed operations
sign-extend the immediate value to 32-bits. Unsigned operations fill the upper
bits with zero.
Shift and Rotate Instructions
The following instructions provide shift and rotate operations. The number of bits to rotate or shift can be
specified in a register or an immediate value.
3-62
Comparison Instructions
NII51003
2015.04.02
Altera Corporation
Programming Model
Send Feedback