as: LM32-Modifiers
1
1 9.20.2.2 Relocatable Expression Modifiers
1 .........................................
1
1 The assembler supports several modifiers when using relocatable
1 addresses in LM32 instruction operands. The general syntax is the
1 following:
1
1 modifier(relocatable-expression)
1
1 'lo'
1
1 This modifier allows you to use bits 0 through 15 of an address
1 expression as 16 bit relocatable expression.
1
1 'hi'
1
1 This modifier allows you to use bits 16 through 23 of an address
1 expression as 16 bit relocatable expression.
1
1 For example
1
1 ori r4, r4, lo(sym+10)
1 orhi r4, r4, hi(sym+10)
1
1 'gp'
1
1 This modified creates a 16-bit relocatable expression that is the
1 offset of the symbol from the global pointer.
1
1 mva r4, gp(sym)
1
1 'got'
1
1 This modifier places a symbol in the GOT and creates a 16-bit
1 relocatable expression that is the offset into the GOT of this
1 symbol.
1
1 lw r4, (gp+got(sym))
1
1 'gotofflo16'
1
1 This modifier allows you to use the bits 0 through 15 of an address
1 which is an offset from the GOT.
1
1 'gotoffhi16'
1
1 This modifier allows you to use the bits 16 through 31 of an
1 address which is an offset from the GOT.
1
1 orhi r4, r4, gotoffhi16(lsym)
1 addi r4, r4, gotofflo16(lsym)
1