EasyManua.ls Logo

Atari ST series - Page 37

Atari ST series
420 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Functions known as the XBIOS (extended Basic
input/Output System) are at the next level up from the BIOS.
Where the BIOS contains a small number of very low level
I/O routines used mainly by other system routines, the
XBIOS contains a larger number of functions that are more
specific to the ST environment, and of greater interest to the
applications programmer. These functions deal with the char
acter devices, the disk device, the screen display, the sound
chips, the MFP (Multi-Function Peripheral adapter) chip, and
miscellaneous system functions. This chapter covers the
XBIOS device and system functions. The next chapter will
cover the sound and graphics routines, which are of particu
lar interest to ST programmers.
Like the BIOS functions, the XBIOS routines can be
called from user mode. They use registers A0-A2 and D0-D2
as scratch registers, meaning that if you are programming in
machine language and your program uses these registers,
you must save their contents before making an XBIOS call,
and restore them after the XBIOS call terminates. Each of the
XBIOS routines is associated with a command number and,
optionally, command parameters that specify more precisely
what it should do. For example, the XBIOS function to set
one of the hardware color registers has a command number
of 7. It requires two command parameters: One tells the
function which register to set and the other specifies the new
color value (from 0 to 0x777).
To call an XBIOS function from machine language, you
must push the command parameters onto the stack, followed
by the command number, and execute a TRAP #14 state
ment. The TRAP #14 instruction puts the program into su
pervisor mode and begins executing the instructions found at
the address stored in exception vector 46, whose address is
184 ($B8). This exception vector contains the address of the
29

Related product manuals