http://www.ousob.com --- Legacy Redefined #include <dos.h> #include <extend50.h> CLIPPER b_rtc() { union REGS regs; unsigned int tens, ones, century, i_year, i_month, i_day; char realDate[9]; struct dosdate_t realTimeDate; regs.h.ah = 0x04; /* read real time clock */ int86(0x1A,&regs,&regs); ones = (regs.h.ch & 0x0F); /* century */ tens = (regs.h.ch >> 4) * 10; century = (tens + ones) * 100; ones = (regs.h.cl & 0x0F); /* year */ tens = (regs.h.cl >> 4) * 10; i_year = (tens + ones) ; realTimeDate.year = (century + i_year); ones = (regs.h.dh & 0x0F); /* month */ tens = (regs.h.dh >> 4) * 10; i_month = (tens + ones); realTimeDate.month = i_month; ones = (regs.h.dl & 0x0F); /* day */ tens = (regs.h.dl >> 4) * 10; i_day = (tens + ones); realTimeDate.day = i_day; _dos_setdate(&realTimeDate); _ret(); }