Keil™, An ARM® Company

RealView Assembler User's Guide

Load and store multiple instructions available in ARM and Thumb

2.7.1. Load and store multiple instructions available in ARM and Thumb

The following instructions are available in both ARM and Thumb instruction sets:

LDM

Load Multiple registers.

STM

Store Multiple registers.

PUSH

Store multiple registers onto the stack and update the stack pointer.

POP

Load multiple registers off the stack, and update the stack pointer.

In LDM and STM instructions:

  • The list of registers loaded or stored can include:

    • in ARM instructions, any or all of r0‑r15

    • in 32‑bit Thumb‑2 instructions, any or all of r0‑r12, and optionally r14 or r15 with some restrictions

    • in 16‑bit Thumb and Thumb‑2 instructions, any or all of r0‑r7.

  • The address can be:

    • incremented after each transfer

    • incremented before each transfer (ARM instructions only)

    • decremented after each transfer (ARM instructions only)

    • decremented before each transfer (not in 16‑bit Thumb).

  • The base register can be either:

    • updated to point to the next block of data in memory

    • left as it was before the instruction (not in 16‑bit Thumb).

When the base register is updated to point to the next block in memory, this is called writeback, that is, the adjusted address is written back to the base register.

In PUSH and POP instructions:

  • The stack pointer (r13) is the base register, and is always updated.

  • The address is incremented after each transfer in POP instructions, and decremented before each transfer in PUSH instructions.

  • The list of registers loaded or stored can include:

    • in ARM instructions, any or all of r0‑r15

    • in 32‑bit Thumb‑2 instructions, any or all of r0‑r12, and optionally r14 or r15 with some restrictions

    • in 16‑bit Thumb‑2 and Thumb instructions, any or all of r0‑r7, and optionally r14 (PUSH only) or r15 (POP only).

Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0379A