108 www.xilinx.com MicroBlaze Processor Reference Guide
1-800-255-7778 UG081 (v6.0) June 1, 2006
Chapter 4: MicroBlaze Instruction Set Architecture
The instruction immloads the IMMvalue into a temporaryregister. Italso locks thisvalue
so it can be used by the following instruction and form a 32-bit immediate value.
The instruction imm is used in conjunction with Type B instructions. Since Type B
instructions have only a 16-bit immediate value ﬁeld, a 32-bit immediate value cannot be
used directly. However, 32-bit immediate values can be used in MicroBlaze. By default,
Type B Instructions willtake the 16-bit IMM ﬁeld value and sign extend it to 32 bits to use
as the immediate operand. This behavior can be overridden by preceding the Type B
instruction with an imm instruction. The imm instruction locks the 16-bit IMM value
temporarily for the next instruction. A Type B instruction that immediately follows the
imm instruction will then form a 32-bit immediate value from the 16-bit IMM value of the
imm instruction (upper 16 bits) and its own 16-bit immediate value ﬁeld (lower 16 bits). If
no Type B instruction follows the IMM instruction, the locked value gets unlocked and
are allowed between them.
The assembler provided by Xilinx automatically detects the need for imm instructions.
When a 32-bit IMM value is speciﬁed in a Type B instruction, the assembler converts the
it in the executable ﬁle.
1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 IMM
0 6 11 16 31