AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database
<=     R13 =     R13_svc
     R14 =     R14_svc

This SWI sets 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 call OS_LeaveOS which is present from RISC OS 5, or via the CallASWI module. Using this SWI has the advantage of triggering callbacks on the way back out of the kernel, but if neither of these are options, the following is safe to use in 26 or 32 bit mode:
     TEQ    PC,PC          ; Determine 26 or 32 bit mode
     MSREQ  CPSR_c,#&10     ; Sets USR32 system
     TEQNEP PC,#0          ; Sets USR26 mode, also idempotent so works round StrongARM MSR bug
     NOP               ; Workaround ARMv2 banked register access after TEQP bug

See PRM 1, page 140.

[sh-index] Back to list of manuals