[En-Nut-Discussion] ARM 7 why access the SPSR
lwazidub at gmail.com
Fri Apr 6 21:41:39 CEST 2012
2012/4/6 京川 <64018 at 263.net>:
> i see infomation from arm
> 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.
More information about the En-Nut-Discussion