Entry | |
---|---|
- | - |
Exit | |
---|---|
All registers preserved |
The purpose of this call is to set the processor to Supervisor mode.
Interrupt and Fast Interrupt status is unaltered. Note that SWI calls while in SVC mode will alter R14, and will use R13 as stack.
To return to User mode on an ARM6 or later:
MSR CPSR_c,#0
MOV R0,R0 ;Anything that doesn’t use R8-R14 or to return to user mode leaving the other PSR bits constant
MRS R14,CPSR
BIC R14,R14,#%11 ; Only sets usermode
MSR CPSR_cxsf,R14
To return to User mode pre ARM6 (deprecated):
TEQP PC,#0
MOV R0,R0 ;Anything that doesn’t use R8-R14 or to return to user mode leaving the other PSR bits constant
BIC R14,PC,#%11 ;Only sets usermode.
TEQP R14,#0
MOV R0,R0