Skip to main content

IAR Embedded Workbench for RISC-V 3.40

%pcrel_lo Lower 12 bits PC-relative

In this section:
Precedence

2

Description

%pcrel_lo uses PC-relative addressing and takes the lower 12 bits, and sign-extends them. The intended use for this operator is for instructions like ADDI, LW, and SW to construct a 32-bit value together with the AUIPC instruction.

Example
  auipc   a0, %pcrel_hi(myVar)
relative_to:
  addi    a0, a0, %pcrel_lo(relative_to)