8.3. Assembler Pseudo-Instructions
Pseudo-instructions are used in assembly source code like regular assembly
instructions. Each pseudo-instruction is implemented at the machine level using an
equivalent instruction. The
movia
pseudo-instruction is the only exception, being
implemented with two instructions. Most pseudo-instructions do not appear in
disassembly views of machine code.
Table 95.
Assembler Pseudo-Instructions
Pseudo-Instruction
Equivalent Instruction
bgt rA, rB, label
blt rB, rA, label
bgtu rA, rB, label
bltu rB, rA, label
ble rA, rB, label
bge rB, rA, label
bleu rA, rB, label
bgeu rB, rA, label
cmpgt rC, rA, rB
cmplt rC, rB, rA
cmpgti rB, rA, IMMED
cmpgei rB, rA, (IMMED+1)
cmpgtu rC, rA, rB
cmpltu rC, rB, rA
cmpgtui rB, rA, IMMED
cmpgeui rB, rA, (IMMED+1)
cmple rC, rA, rB
cmpge rC, rB, rA
cmplei rB, rA, IMMED
cmplti rB, rA, (IMMED+1)
cmpleu rC, rA, rB
cmpgeu rC, rB, rA
cmpleui rB, rA, IMMED
cmpltui rB, rA, (IMMED+1)
mov rC, rA
add rC, rA, r0
movhi rB, IMMED
orhi rB, r0, IMMED
movi rB, IMMED
addi, rB, r0, IMMED
movia rB, label
orhi rB, r0, %hiadj(label)
addi, rB, r0, %lo(label)
movui rB, IMMED
ori rB, r0, IMMED
nop
add r0, r0, r0
subi rB, rA, IMMED
addi rB, rA, (-IMMED)
Refer to the Application Binary Interface chapter of the Nios II Processor Reference
Handbook for more information about global pointers.
Related Information
Application Binary Interface
on page 146
8.4. Assembler Macros
The Nios II assembler provides macros to extract halfwords from labels and from 32-
bit immediate values. These macros return 16-bit signed values or 16-bit unsigned
values depending on where they are used. When used with an instruction that requires
8. Instruction Set Reference
NII-PRG | 2018.04.18
Nios II Processor Reference Guide
172