EasyManua.ls Logo

Atari ST series - Page 115

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...
GEMDOS Device I/O and Process Control
and date, while the XBIOS functions get or set both at once.
The DOS dock and IKBD clock are not necessarily the same,
although in later versions of TOS (with ROMs that support
the blitter chip), the DOS clock is reset from IKBD clock at
the termination of each process.
The functions used to get and set the DOS time are
known as Tgettime() and Tsettime(), respectively. These
functions are called as follows:
int time;
time = Tgettime();
int time;
Tsettime(time);
where time is a 16-bit code that indicates the time to set with
Tsettime(), or the time returned by Tgettime(). In either
case, the meaning of this code is interpreted as follows:
Bit
Number Description Range
, 0-4 Seconds divided by 2 0-29
5-10 Minutes 0-59
11-15 Hour 0-23
Likewise, the DOS functions used to get and set the date
are called Tgetdate() and Tsetdate():
int date;
date = Tgetdate();
int date;
Tsetdate(date);
where date is a 16-bit code that specifies the date to set with
Tsetdate(), or the date read with Tgetdate(). The meaning
of this code is:
Bit Number Description Range
0-4 Day 1-31
5-8 Month 1-12
9-15 Year 0-119*
* Year value is added to 1980 to get current year.
Since the format of the time and date information
stamped on disk files is the same as the above, you can use
the code provided in the program GDIR.C in Chapter 6 as an
example of how to extract the various fields of information
from their bit-packed storage format.
107

Related product manuals