SPRAB89A September 2011 – March 2014
When a referenced label is in the same section as the reference, the offset is an assembly-time constant. If the offset can be encoded in 15 or fewer bits, it can be added directly to the base address using ADDK:
base: MVC PCE1,tmp ; address of current fetch packet
ADDK label-(base & ~0x1F),tmp ; no reloc; tmp == &label
...
label: ; must be in same section
Here no relocation is needed; the assembler encodes the offset directly. The expression “(base & ~0x1F)" represents the address of the fetch packet containing base.
(If the offset is too large to encode with ADDK, MVK/MVKH/ADD must be used as described in Section 5.2.2.)