Robert Willy <
rxj...@gmail.com> wrote:
> Hi,
>
> I read the following ARM code on line. I do not understand why it said that:
> STMFD is equivalent to STMDB.
They're just equivalent ways of writing the same thing. If you have a stack
which extends downwards as it grows, and the stack pointer points to the
last valid element (a 'Full Descending' stack) rather than the next (Empty)
gap, to store something you have to first decrement the stack pointer to get
the next location to store at - you Decrement Before.
If you're using stacks it's easier to pair up the instructions using stack
notation:
STMFD = STMDB (decrement before) = push
LDMFD = LDMIA (increment after) = pop
While if you're copying data you probably want to stick to LDMIA/STMIA or
some similar pair.
Theo