LDR is a command in ARM and also a pseudo command.
When LDR, = imd // r is used as the register, imd is the immediate number
LDR is a pseudo command. The compiler determines whether to use the ldr command or mov or mvn command based on the size of the number of immediate values.
When imd can be operated by mov or mvn, it is translated into an mov or mvn command. When imd is greater than mov or mvn, the compiler will store imd in a memory unit, and then use a ldr command to load the value of this memory unit into the register.
LDR r, label, and LDR, = label:
LDR, = label will load the value represented by label into the Register, while LDR and label will use label as the address and load the value from the address pointed by label to the Register.
For example, if the label value is 0x8000, LDR, = label will load 0x8000 to the Register, while LDR and label will load the value at memory 0x8000 to the Register.
ADR and ADRL pseudocommands:
The ADR and ADRL commands are used to load an address into a register.
ADR reads pseudocommands from a small range of addresses. The ADR command reads the address value of the PC relative offset to the Register. During compilation of the source program, the ADR pseudo command is replaced by the compiler in a suitable command. Generally, the compiler uses an ADD or SUB command to implement the ADR pseudo command function, if a command cannot be used for implementation, an error is generated. The address range that can be loaded. The value range is-1020 ~ when the byte is aligned ~ 1020. When non-Word Alignment occurs ~ In the range of 255.
ADRL is an address read instruction in a medium range. It will be translated into two commands by the compiler. If two commands cannot be used, an error is generated.
The address range that can be loaded by ADRL is-64 kB ~ when non-byte alignment occurs ~ 64 KB to 64 KB;-kb to-KB ~ Between kb.