Specifications

Usage
The maximum allowed value of IMMED is 65535. The
minimum allowed value is 0. To load a 32-bit constant into a
register, first load the upper 16 bits using a movhi pseudo-
instruction. The %hi() macro can be used to extract the upper
16 bits of a constant or a label. Then, load the lower 16 bits with
an ori instruction. The %lo() macro can be used to extract the
lower 16 bits of a constant or label as shown in the following
code:
movhi rB, %hi(value)
ori rB, rB, %lo(value)
An alternative method to load a 32-bit constant into a register
uses the %hiadj() macro and the addi instruction as shown in
the following code:
movhi rB, %hiadj(value)
addi rB, rB, %lo(value)
Pseudo-instruction
movhi is implemented as orhi rB, r0, IMMED.
movi
Instruction
move signed immediate into word
Operation
rB ← σ(IMMED)
Assembler Syntax
movi rB, IMMED
Example
movi r6, -30
Description
Sign-extends the immediate value IMMED to 32 bits and writes
it to rB.
Usage
The maximum allowed value of IMMED is 32767. The
minimum allowed value is
–32768. To load a 32-bit constant into a register, refer to the
movhi instruction.
Pseudo-instruction
movi is implemented as addi rB, r0, IMMED.
movia
Instruction
move immediate address into word
Operation
rB ← label
Assembler Syntax
movia rB, label
8-56
movi
NII51017
2015.04.02
Altera Corporation
Instruction Set Reference
Send Feedback