Re: STM - Get assembler error when updating base register using ^



Michael wrote:
stmia r0!, {r1-r14}^

I'm getting an error on the above instruction, but don't understand
why. Can anyone help? If you could point me to where it states that
this is illegal, I'd appreciate that also. Thanks.

I assume this question is for the ARM instruction set -- but you don't say which ARM version. The ARM7TDMI Data *** (August 1995) says, in section 4.11.4 (Use of the S bit, with LDM/STM) that "base write-back should not be used" when R15 is not in the register list and the S bit is set (i.e. the ^ is used), just as in your case.

The Data *** does not give a reason for this prohibition, but I guess it has to do with the fact that this instruction (thanks to the ^ modifier) deals with two register sets, the User bank registers (transferred) and the current-mode registers (the Data *** does not explicitly say so, but I assume that the base register, here R0, is always the current-mode register, not the User bank register).

HTH

--
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
. @ .
.


Quantcast