Entry parameter
Register B
=
FOH
Return parameters
Z flag
= 1 The RS232C interface can be opened.
Z flag
= 0 Busy (i.e., the port
is
being used by another program.)
Register A
= 02H
5.7.8 BIOS Subroutines related to the Clock
"@,.t!j'
Entry Point: WBOOT + 4BH
TIMDAT
is
the entry point for the subroutine which has 6 functions relating
to the clock (time and date), according to the contents
of
the C register. The
TIMDA T routine also uses a series
of
bytes called the Time Descriptor
to
read
or
write the description
of
the time. There are a total
of
11
bytes in the Time
Descriptor, although not always all
of
them may be used by
or
for each func-
tion. The date and time are coded in BCD. The order
of
the bytes are as follows.
Year
Month
Day
Hour
Minute
Second
- 1 byte, 2 BCD digits
- 1 byte, 2 BCD digits
- 1 byte, 2 BCD digits
- 1 byte, 2 BCD digits
- 1 byte, 2 BCD digits
- 1 byte, 2 BCD digits
Day
of
week - 1 byte
(0
= Sunday, 6 = Saturday)
Type - 1 byte (0
= none, 1 =
alarm,
2 = wake, 3 = wake
subroutine).
Address - 2 bytes (message address for alarm
if
type =
1,
wake
string address
if
type = 2
or
subroutine address
if
type = 3).
Alarm - 1 byte (0
= alarm not sounded, 1 = alarm sounded).
It
is
important to make sure
that
the number
of
bytes
of
the Time Descriptor
required by the function are in fact present.
It
is
also important
that
the order
described above
is
adhered to.
TIMDAT (READ TIME)
Function: Reads the time and sets
data
in time descriptor address.
5-28
Entry parameters
Register C
=
DOH
- Time read
function.
..
.
Register DE
= Starting address for 7 bytes
of
Tlme Descnptor mformatlOn
Return Parameters
The contents
of
register pair DE are not changed.
The Year Month Day Weekday
and
time are placed in memory starting
at
the
address placed in the DE register.
TIMDAT (SET TIME)
Function: Allows the date, weekday and time
to
be set.
If
any bytes
of
the
Time Descriptor are set
to
FFH
they will not be updated.
It
is
also
up
to the programmer to check the contents
of
the Time
Descriptor before calling this routine as no checks are made.
Entry Parameters
Register C
=
FFH
- set time
Register DE
= starting address
of
the 7 bytes
of
the Time Descriptor
TIMDAT (ALARM ENABLE)
Function: Enables the
alarm/wake
function.
Entry parameter
Register C
= 80H - Alarm enable
TIMDAT (ALARM DISABLE)
Function: Disables the
alarm/wake
function.
Entry parameter
Register C
= 81H - Alarm disable
TIMDAT (SET ALARM)
Function: Sets the alarm/wake time, whether it
is
an
alarm
or
a wake
function and the address
of
the location
of
the message/wake
string. The time can be set in increments
of
10
seconds.
If
the
byte
OFH
is
specified, applicable digits will be regarded as wild-
card positions.
For
example, setting
FH
for the year, month,
and day will cause the alarm/wake function
to
operate
at
the
specified hour, minute,
and
second every day.
5-29