Syntax: STM <options>{<cond>} <base> {!}, <register_list>{^}
Operation: Multiple transfer of data from the registers to memory
Flags: Unaffected
The register_list is the series of register names, separated by commas, the contents of which we want to store in memory. The order of the registers in the list is of no significance, and any number of registers can be stored. The assembler will allow a range of registers to be specified by using a '-' character.
The base field must be given as a simple register. The contents of this are taken to be the start address in memory from which the registers are to be saved.
The options field is a two-character code which defines how the instruction should be executed.
As the ARM executes the instruction, it will store the contents of each of the registers named in <register_list> in consecutive memory words. A copy of the address in the base register is used and modified by the ARM as each register is stored. The actual contents of the base are not changed, unless we request this using the ! write back option.
When {^} is present, the user mode registers are stored instead (this is unpredictable in user and system modes).
Taken at its simplest level, STM can be used to preserve the contents of a register group in an arbitrary block of memory. The original contents can then be restored at a later time using LDM with the same memory address and register_list. However, a major use of STM and LDM is in the creation and access of stacks.
If <base> is not word aligned,the values read will not be rotated automatically as the bottom 2 bits of <base> are ignored.If <base> is the lowest numbered register in <register_list> then the original value of <base> will be stored - otherwise the result of register <base> being in <register_list> is unpredictable.
|
|
|