Doc. # 1-0000315 | |||
---|---|---|---|
Date Updated | 07-07-2005 | Date Created | 07-27-2000 |
Document Type | Knowledge Base | Related OS | |
Related Product |
How to get/set DOS/BIOS/RTC Date and Time? | |||
---|---|---|---|
Solution:
Get DOS Date
Software interrupt AH = 0x2A
CX:Year
DH:Month
DL:Day
AL:
0 - Sunday
1 - Monday
2 - Tuesday
3 - Wednesday
4 - Thursday
5 - Friday
6 - Saturday
Set DOS Date
Software interrupt AH = 0x2B
Success: AL - 0
Fail : AL - FF
Get DOS Time
Software interrupt AH = 0x2C
CH for Hour : 0-23
CL for Minute : 0-59
DH for Second : 0-59
DL for 1/100 second : 0-00
Set DOS Time
Software interrupt AH = 0x2D
Success: AL=0
Fail: AL=FF
For BIOS Time
Software Interrupt 0x1A, 0x04/0x02
Get RTC Date (CMOS)
To read 128 Bytes CMOS data (for AWARD BIOS), you must use direct port address.
Index Port 70
Data Port 71
For Year (09H)
C:>DEBUG
-o 70 09
-i 71
98
For Centry (32H)
C:>DEBUG
-o 70 32
-i 71
19
Outportb (0x70,0)
seconds = inportb (0x71)
outportb (0x70,2)
minutes = inportb (0x71)
|