[En-Nut-Discussion] ARM 7 why access the SPSR
Lwazi
lwazidub at gmail.com
Fri Apr 6 21:41:39 CEST 2012
2012/4/6 京川 <64018 at 263.net>:
> en-nut-discussion,您好!
> i see infomation from arm
>
> http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489c/Cihjcedb.html
>
> You must not attempt to access the SPSR when the processor is in User or System mode. This is your responsibility. The assembler cannot warn you about this, because it has no information about the processor mode at execution time.
>
> If you attempt to access the SPSR when the processor is in User or System mode, the result is unpredictable.
>
> but in context.c we see thes code below
>
<-- snip -->
>
>
> why wencan use this code "msr spsr, r0 ",help me please
Quick answer: context.c is wrong. Bad things will happen on some
processors at runtime others will run ok.
Lwazi
More information about the En-Nut-Discussion
mailing list