archiveFeb 10, 2021
ARM Data Transfer: Pre/Post-Index and STR/LDR
How ARM moves data between registers and memory with LDR/STR, and how pre-index versus post-index addressing updates the base register.
Store and load instructions
- ARM does not allow memory-to-memory data processing.
- You move data with register ↔ memory transfer instructions.
Load
- Memory → Register
Store
- Register → Memory

Single-register data transfer
<LDR | STR> {<cond>} {<size>} Rd, <address>- LDR, STR, LDRB, STRB (size: WORD, BYTE)
Pre- and post-index addressing
Pre-index method
- After the transfer, the base register is unchanged.
- Append
!to write the computed address back into the base register.

Post-index method
- After the transfer, the base register is updated with base + offset.

- In the example, base register r1 becomes
0x100 + 0xc.