Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4973 right-hear 1
#include 
2
#include 
3
 
4
#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
5
 
6
void _dos_getdate(struct _dosdate_t *date)
7
{
8
 unsigned long tmp;
9
 __asm__ __volatile__("int $0x40":"=a"(tmp):"0"(29));
10
 date->year=2000+(tmp&0xff);
11
 date->month=(tmp>>8)&0xff;
12
 date->day= (tmp>>16)&0xff;
13
 date->dayofweek=0; /* xxx - how to do it correctly ? */
14
 BCD_TO_BIN(date->year);
15
 BCD_TO_BIN(date->month);
16
 BCD_TO_BIN(date->day);
17
}