Next: Nios II Directives, Previous: Nios II Syntax, Up: NiosII-Dependent
%hiadj(expression)The value of %hiadj(expression) is:
((expression >> 16) & 0xffff) + ((expression >> 15) & 0x01)
The %hiadj relocation is intended to be used with
the addi, ld or st instructions
along with a %lo, in order to load a 32-bit constant.
movhi r2, %hiadj(symbol)
addi r2, r2, %lo(symbol)
%hi(expression)%lo(expression)%gprel(expression)_gp from
expression.
The intention of the %gprel relocation is
to have a fast small area of memory which only
takes a 16-bit immediate to access.
.section .sdata
fastint:
.int 123
.section .text
ldw r4, %gprel(fastint)(gp)
%call(expression)%call_lo(expression)%call_hiadj(expression)%got(expression)%got_lo(expression)%got_hiadj(expression)%gotoff(expression)%gotoff_lo(expression)%gotoff_hiadj(expression)%tls_gd(expression)%tls_ie(expression)%tls_le(expression)%tls_ldm(expression)%tls_ldo(expression)