SPRAB89A September 2011 – March 2014
This is a position independent way of addressing code (or constant data in the code segment). The address is computed as the sum of the address of the current fetch packet and a constant.
base: MVC PCE1,tmp1 ; address of current fetch packet
MVK $PCR_OFFSET(label,base),tmp2 ; label-base, reloc R_C6000_PCR_L16
MVKH $PCR_OFFSET(label,base),tmp2 ; label-base, reloc R_C6000_PCR_H16
ADD tmp1,tmp2,tmp2 ; &label
The $PCR_OFFSET assembly operator evaluates to the offset between the fetch packet containing the instruction labeled by base (MVC) and the target symbol.