Function 22 -
set the system date / time
Options:
* eax = 22
- function number
* ebx = 0
- set the time
* ecx
= 0x00SSMMHH - time in binary coded decimal code (BCD):
* HH = hour 00..23
* MM = minute 00..59
* SS = second 00..59
* ebx = 1
- set the date
* ecx
= 0x00DDMMYY - the date in the binary decimal code (BCD):
* DD = day 01..31
* MM = month 01..12
* YY = year 00..99
* ebx = 2
- set the day of the week
* ecx
= 1 for sunday, ..., 7 for saturday
* ebx = 3
- set the alarm
* ecx
= 0x00SSMMHH
Return value:
* eax = 0
- successful
* eax = 1
- the parameter is set incorrectly
* eax = 2
- CMOS-batteries are out
Remarks:
The value of the
installation of the day of the week seems doubtful, since it is not used very
much (the day of the week can be calculated by date).
The alarm can be set
to operate at a specified time every day. At the same time, it cannot be
disabled by the existing system functions.
The alarm is
triggered by the generation of IRQ8.
In fact, CMOS supports
setting the value 0xFF as one of the parameters for an alarm and means that the
corresponding parameter is ignored. But in the current implementation it will
not work (return value 1).
Alarm clock is a
global system resource; setting the alarm automatically cancels the previous
setting. However, at the moment no program uses it.
Constants for registers:
eax -
SF_SET_TIME_DATE (22)