RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

Exit Handler

OS SWI Calls
» OS_Exit
» Exit Handler

Exit Handler

Entry
R12 Workspace pointer
Other registers: Undefined
User mode, IRQs+FIQs enabled

Notes

This is called in USER mode whenever OS_Exit or OS_ExitAndDie is called. It should restore all handlers to their previous values and then call OS_Exit to pass to the previous handler. However, care must be taken to ensure R0-R2 are valid when calling OS_Exit, as the OS will typically have corrupted them prior to calling the exit handler. If it’s desirable to pass through the original return code, that can be read via Sys$ReturnCode, as it will have been stored prior to the exit handler being invoked.

R13 may be undefined, either avoid the use of R13 in the handler or provide your own stack space.

The exit handler will not be invoked if an error is generated due to the return code being out of range (instead, you can expect the Error Handler to be invoked)

See also

  • OS_Exit
  • OS_ExitAndDie
  • System Control Handlers
Revised on June 11, 2018 23:47:20 by Jeffrey Lee (213) (86.137.26.134)
Edit | Back in time (4 revisions) | See changes | History | Views: Print | Source | Linked from: OS_ChangeRedirection, OS_ExitAndDie, OS_FSControl 2, System Control Handlers, OS_RemoveCursors, OS_SetEnv, OS_Exit

Search the Wiki

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2018 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