Atari ST series Technical Reference Manual page 97

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

GEMDOS Device I/O and Process Control
Since this format is the more readable of the two, it will
be used in the macros in the discussion of GEMDOS routines
and sample programs. To use GEMDOS functions in your C
programs, link your program with the compiler library that
contains the gemdos() function, and #include OSBIND.H if
you use the macros.
Character Device I/O
Like the BIOS and XBIOS, GEMDOS includes a number of
functions that allow you to read characters from a character
device, write characters or strings to such devices, and check
their input and output status. Tliese functions aren't imple­
mented in exactly the same way as the BIOS and XBIOS ver­
sions, however. Where the BIOS and XBIOS tend to use one
function for many devices and require a device number as an
input parameter, GEMDOS provides a separate function for
each device. GEMDOS also throws in a number of variations.
Some keyboard input functions echo the character to the
screen, some don't. Some wait for a keypress to return, oth­
ers return immediately.
There are three functions that wait for a character to be
entered at the console keyboard and return the value of the
character that was entered. The macro for the first of these
functions, Cconin(), is called like this:
long keycode;
keycode = Cconin();
When called, this function doesn't return until a key is
pressed, unless a keypress is already waiting in the queue.
The keycode the function returns is a longword containing
both the ASCII value of the key(s) pressed and the scan
code. The ASCII value is returned in the low byte of the low
word of keycode, while the scan code is returned in the low
byte of the high word. See Appendix J for a complete list of
keycodes. This call is much like the BIOS function Bconin(),
except that Cconin() sends a copy of the key that was
pressed out to the console screen.
The other two character input functions, Crawcin() and
Cnecin(), don't echo the key that is pressed. These functions
are called just like Cconin():
long keycode;
keycode = Craw cin();
long keycode;
keycode = C necin();

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents