Atari ST series Technical Reference Manual page 182

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

move.w # 'X ', — (sp)
move.w # 2 , — (sp)
move.w # 3 , — (sp)
trap
# 1 3
addq.l
#6 ,sp
Calling the BIOS routines from C is much simpler. Most
C compilers come with a library routine called bios(), which
stacks the parameters and executes the TRAP #13 instruc­
tion. For example, the sample call illustrated above could be
accomplished in C by the single statement
bios(3,2,'X');
Since it's easier to remember a command name than a
command number, most C compilers include a header file
called OSBIND.H that defines macros for all of the BIOS
functions. For example, the macro definition for BIOS com­
mand 3 is
#define Bconout(a,b)
Therefore, after you #include OSBINDS.H in your pro­
gram, you can call the sample function like this:
Bconout(2,'X');
To use BIOS functions in your C programs, you must
#include OSBIND.H if you use the macros, and you must
link your program with the library that contains the bios()
function.
174
APPENDIX A
* push character value on stack
* push console device number on stack
* push BIOS command number on stack
* call BIOS handler
* pop parameters (6 bytes) off stack
bios(3,a,b)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents