Skip to main content

IAR Embedded Workbench for Arm 9.70.x

LDR (CODE16)

In this section:
Syntax
LDRregister,=expression1

or

LDRregister,expression2
Parameters

register

The register to load. LDR can access the low registers (R0R7) only.

expression1

Any 32-bit expression.

expression2

A program location counter-relative expression +4 to +1024 from the program location counter.

Description

As in Arm mode, the first form of the LDR pseudo-instruction in Thumb mode loads a register with any 32-bit expression. Note that the first form can be translated into a MOVS instruction, which modifies the program status register.

The second form of the instruction reads a 32-bit value from an address specified by the expression. However, the offset from the program location counter to the constant must be positive and less than 1 Kbyte.