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



On Aug 29, 7:04 am, Tauno Voipio <tauno.voi...@xxxxxxxxxxxxx> wrote:
Michael wrote:
On Aug 29, 12:11 am, Niklas Holsti <niklas.hol...@xxxxxxxxxxxxxxx>
wrote:
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
       .      @       .

Thanks, but it generates the same error msg even if you specify r15 in
the list. And sorry, yes, I'm referring to the ARM processor. Any
other ideas?

There are different versions of the ARM processor,
and you still did not tell which.

Are you running in a mode that is not using the
user register set (not user or system)? The ^
modifier temporarily accesses the user register set
from a privileged mode.

You should also leave either the ^ modifier or the !
modifier out - it is not allowed to have both.

--

Tauno Voipio
tauno voipio (at) iki fi- Hide quoted text -

- Show quoted text -

I believe I'm using arm7tdmi. If both ^ and ! cannot be used at the
same time, then you've answered my question - thanks. Too bad, because
it would be nice to push registers onto the user mode stack, and
update the stack pointer.
.


Quantcast