RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Software | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

OS_CallASWI

Programmer's Reference Manuals
» Part 15 – SWI Calls
» OS
» OS_CallASWI

OS_CallASWI

(SWI &6F)
Entry
R0–R9 As required for target SWI
R10 Target SWI number
Exit
R0–R9 As defined for target SWI
R10 Preserved

Use

The purpose of this call, is to call a run-time determined SWI.

Notes

This SWI allows a target SWI number to be determined at run time, and passed in a register. This removes the need for a common idiom of dynamic code, in language library SWI veneers for example. In an APCS-R library, use OS_CallASWIR12.

Note that this call is merely an alias for calling the target SWI. It has no entry/exit conditions of its own, except for the special use of R10. To call a target SWI with X bit set, use the X form of the SWI number in R10; there is no distinction between OS_CallASWI and XOS_CallASWI.

You cannot use this SWI to call itself, that is OS_CallASWI or OS_CallASWIR12, since there is no defined final target SWI in this case.

You cannot usefully call OS_BreakPt or OS_CallAVector, as it will corrupt the processor flags before entering the target SWI.

For future compatibility, you should always use this SWI in preference to any local construction for calling a SWI by number. For compatibility with older versions of RISC OS, a new CallASWI module will be made available.

Note that this SWI calling mechanism is almost certainly faster than any other alternative implementation, including the original _kernel_swi and _swix code contained in older versions of the SharedCLibrary. The new SharedCLibrary now simply uses OS_CallASWIR12 for _kernel_swi and _swix.

OS_CallASWI cannot be called from BASIC as BASIC only passes registers R0-R7 via its SYS instruction. It would not be useful anyway.

The CallASWI module provides this functionality for versions of RISC OS 3.70 or earlier.

See also

  • OS_BreakPt
  • OS_CallASWIR12
  • OS_CallAVector
Revised on November 26, 2010 12:24:38 by Trevor Johnson (329)? (127.0.0.1)
Edit | Back in time (2 revisions) | See changes | History | Views: Print | Source | Linked from: OS SWI Calls, OS_CallASWIR12, OS_GenerateError

Search the Wiki

Commercial use

For commercial enquiries, please contact the owners of RISC OS, Castle Technology Ltd.

ROOL Store

The official C/C++ Development kit and more here.

Donate! Why?

Help ROOL make things happen – please consider donating!

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2011 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys