When using ARM multiple stores and loads, register values are always loaded/stored in ascending order in memory. So, when using a descending multiple store, the registers are written into memory backwards. Your STMDA
instruction effectively breaks down into the following steps:
- store
R7
at R0
- store
R6
at R0 - 4
- store
R5
at R0 - 8
- store
R4
at R0 - 12
- store
R3
at R0 - 16
- store
R2
at R0 - 20
- store
R1
at R0 - 24
- subtract 28 from
R0
(because of writeback - the !
).
So, to answer your questions:
The value of R1
will be stored at R0 - 24
. (Here, I mean the value of R0
before executing the instruction, not afterwards. You're using writeback - the !
- so after the instruction, R0
will have had 28 subtracted from it.)
R1
is stored at R0 - 24
, but as explained above, R1
is the last register to have its value stored in memory. R7
is stored first, and subsequent stores from there grow downwards in memory.
I have to admit I don't know of any documentation that supports this answer. Also, it's been a while since I last did any ARM coding. However, I definitely remember wondering how the ARM stores registers in a descending multiple store. I figured this out by writing a short program to find out.