Next: LM32-Chars, Previous: LM32-Regs, Up: LM32 Syntax [Contents][Index]
The assembler supports several modifiers when using relocatable addresses in LM32 instruction operands. The general syntax is the following:
modifier(relocatable-expression)
loThis modifier allows you to use bits 0 through 15 of an address expression as 16 bit relocatable expression.
hiThis modifier allows you to use bits 16 through 23 of an address expression as 16 bit relocatable expression.
For example
ori r4, r4, lo(sym+10) orhi r4, r4, hi(sym+10)
gpThis modified creates a 16-bit relocatable expression that is the offset of the symbol from the global pointer.
mva r4, gp(sym)
gotThis modifier places a symbol in the GOT and creates a 16-bit relocatable expression that is the offset into the GOT of this symbol.
lw r4, (gp+got(sym))
gotofflo16This modifier allows you to use the bits 0 through 15 of an address which is an offset from the GOT.
gotoffhi16This modifier allows you to use the bits 16 through 31 of an address which is an offset from the GOT.
orhi r4, r4, gotoffhi16(lsym) addi r4, r4, gotofflo16(lsym)