UM10429
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2010. All rights reserved.
User manual
Rev. 1 — 20 October 2010
208 of 258
NXP Semiconductors
UM10429
Chapter 19: Appendix LPC1102 ARM Cortex-M0 reference
•
the value in the register specified by
Rn
must be word aligned. See
for more information.
•
for STM, if
Rn
appears in
reglist
, then it must be the first register in the list.
19.4.4.5.4
Condition flags
These instructions do not change the flags.
19.4.4.5.5
Examples
LDM
R0,{R0,R3,R4}
; LDMIA is a synonym for LDM
STMIA
R1!,{R2-R4,R6}
19.4.4.5.6
Incorrect examples
STM
R5!,{R4,R5,R6} ; Value stored for R5 is unpredictable
LDM
R2,{}
; There must be at least one register in the list
19.4.4.6 PUSH and POP
Push registers onto, and pop registers off a full-descending stack.
19.4.4.6.1
Syntax
PUSH
reglist
POP
reglist
where:
reglist
is a non-empty list of registers, enclosed in braces. It can contain register ranges.
It must be comma separated if it contains more than one register or register range.
19.4.4.6.2
Operation
PUSH stores registers on the stack, with the lowest numbered register using the lowest
memory address and the highest numbered register using the highest memory address.
POP loads registers from the stack, with the lowest numbered register using the lowest
memory address and the highest numbered register using the highest memory address.
PUSH uses the value in the SP register minus four as the highest memory address,
POP uses the value in the SP register as the lowest memory address, implementing a
full-descending stack. On completion,
PUSH updates the SP register to point to the location of the lowest store value,
POP updates the SP register to point to the location above the highest location loaded.
If a POP instruction includes PC in its
reglist
, a branch to this location is performed when
the POP instruction has completed. Bit[0] of the value read for the PC is used to update
the APSR T-bit. This bit must be 1 to ensure correct operation.
19.4.4.6.3
Restrictions
In these instructions:
•
reglist
must use only R0-R7.