h6. [[OS SWI Calls]] h6(. » OS_EnterOS h2. OS_EnterOS h5. (SWI &16) |_<^{width:3em}. Entry | | |<^. - |<^. - | |_<^{width:3em}. Exit | | |\2<^. All registers preserved | h4. Use The purpose of this call is to set the processor to Supervisor mode. h4. Notes 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: <pre>MSR CPSR_c,#%10000 ; USR32</pre> alternatively to return to either USR32 or USR26 <pre> MRS R14,CPSR BIC R14,R14,#%1111 ; Only sets usermode MSR CPSR_c,R14</pre> To return to User mode pre ARM6 (deprecated): <pre> TEQP PC,#0 MOV R0,R0 ; Anything that doesn't use banked R8-R14</pre> alternatively to return to user mode leaving the other PSR bits constant <pre> BIC R14,PC,#%11 ; Only sets usermode TEQP R14,#0 MOV R0,R0 ; Anything that doesn't use banked R8-R14</pre> h4. See also * [[OS_LeaveOS]]