Atari ST series Technical Reference Manual page 62

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

that can help control two of these chips. One of them is the
Programmable Sound Generator chip which will be discussed
more fully in Chapter 4. In addition to its sound functions,
this chip provides two 8-bit I/O ports. These are accessed
through register 14 (I/O port A) and register 15 (I/O port B)
of the sound chip. I/O port B is used for the 8 data bits that
are transmitted through the Centronics parallel port to the
printer. Port A, however, uses each bit for a different control
function. The bit assignments for this port are:
Bit
Number
0
Floppy disk side 0/side 1 select
1
Floppy drive A select
2
Floppy drive B select
3
RS-232 Ready To Send (RTS)
4
RS-232 Data Terminal Ready (DTR)
5
Centronics STROBE line
6
General purpose output, available for application use
(line connected to monitor port)
7
Reserved
Since these ports are located on the PSG chip, it's possi­
ble to read and write to them via the Giaccess() function ex­
plained in Chapter 4. In the case of port A, however, it isn't
a good idea to do so. Since each bit is significant, make sure
you change only the bits relevant to what you're doing. This
usually entails reading the port, changing the value that
you've read, and writing it back to the port.
TOS frequently changes the port A settings via inter­
rupts, however. It uses this port to check the floppy disk
drives for media changes, for example. This means that the
port setting might change between the time you read it and
the time you write back the new value. If that happens, you
will unintentionally change the bits TOS has altered. The
only way around this is to make sure that no interrupts oc­
cur between the time you read the port and the time you
store your new value. This is known as changing the value
atomically because it insures that the read and write opera­
tions will never be split by an interrupt. The XBIOS provides
two functions to change individual bits on I/O port A. These
functions are called like this:
54
CHAPTER 3
Function

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents