# pragma l   /* list off */
# pragma p   /* non portable */

/**************************************************************************

                       H.CALL - Acorn OS call definitions
                       ----------------------------------

Author : David Allison
Date   : 2 August 1987
Issue  : 1.0

(C) 1987 Beebug Limited

*************************************************************************/

typedef struct
   {
   unsigned short A ;
   unsigned short P ;
   unsigned short Y ;
   unsigned short X ;
   } call_buf ;       /* holds registers to pass to called routine */


extern long call (char *addr,call_buf *regs,...) ;

/* calls machine code subroutine.  Takes as the first parameter the address of
   the routine to call.  The optional second parameter is the address of a
   call_buf struct containing the register values to pass.  The rest of the
   parameters are arguments to be passed.

   returns a long (4 bytes) containing the contents of the registers at
   the execution of the RTS.  The order is : APYX (hi to lo)

*/


/* MOS calls */

# define OSBYTE 0xfff4U
# define OSWORD 0xfff1U
# define OSCLI  0xfff7U
# define OSNEWL 0xffe7U
# define OSWRCH 0xffeeU
# define OSASCI 0xffe3U
# define OSRDCH 0xffe0U
# define NVRDCH 0xffcbU
# define NVWRCH 0xffc8U
# define GSREAD 0xffc5U
# define GSINIT 0xffc2U
# define OSEVEN 0xffbfU
# define OSRDRM 0xffb9U
# define OSRDSC 0xffb9U
# define OSWRSC 0xffb3U

/* filing system calls */

# define OSFILE 0xffddU
# define OSARGS 0xffdaU
# define OSBGET 0xffd7U
# define OSBPUT 0xffd4U
# define OSGBPB 0xffd1U
# define OSFIND 0xffceU

