USERV

From BeebWiki
Revision as of 09:56, 20 December 2024 by Jgharston (talk | contribs) (Initial page.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Specification

This vector is called to extend the MOS in various ways.

 On entry:
   A=&00     *LINE, XY=>command line
   A=&01     OSBYTE &88 (called by *CODE)
   A=&02-&DF reserved
   A=&E0-&FF OSWORD &E0-&FF
 On exit:
   All registers can be trashed by the handler

Programming considerations

When USERV is called with A=1 or A=&E0+ it will have been called from the OSBYTE or OSWORD handler:

  • X and Y will already have been stored in the MOS register store at &F0 and &F1, so (&F0),Y addressing can be used to access the OSWORD control block. Note that if your code calls OSBYTE/OSWORD then &F0/&F1 will be overwritten.
  • Interupts will be disabled, and will be restored on return from the USERV code.
  • A will be restored on return from the USER code.
  • X and Y are undefined on return from OSWORD, so the USERV code does not need to restore them.

Extensions

Calling USERV with A=&02-&DF can be used for application-specific extensions, but should be treated as "private" to that application usage.

Examples