Atari ST series Technical Reference Manual page 198

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

move.w
# 7 , - (sp)
trap
# 1 4
addq.l
#6,sp
Calling the XBIOS routines from C is much simpler.
Most C compilers come with a library routine called xbios(),
that stacks the parameters and executes the TRAP #14 in­
struction. For example, the sample call illustrated above
could be accomplished in C by the single statement
xbios(7,0,0x770);
Since it's easier to remember a command name than a
command number, most C compilers include a header file
called OSBIND.H.H that defines macros for all of the XBIOS
functions. For example, the macro definition for XBIOS com­
mand 7 is:
#define Setcolor (a,b)
Therefore, after you #include OSBIND.H.H in your pro­
gram, you can call the sample function like this:
Setcolor(0,0x777);
The C macro format is the one most commonly found in
discussions of XBIOS routines and sample programs. To use
XBIOS functions in your C programs, you must #include
OSBIND.H if you use the macros, and you must link your
program with the compiler library that contains the xbios()
function.
190
APPENDIX B
* push XBIOS command number on
stack
* call XBIOS handler
* pop parameters (6 bytes) off stack
xbios(7,a,b)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents