RTCALARM - 4


BEEP();

}

/**

*.Name timer

*.Title

*

*.Descr

*

* INT 1Ah

*

*.Proto int timer(char fn, SYSTIMER *tm)

*

*.Params char fn - :

*

* RTC_GET_TIME - ;

* RTC_SET_TIME - ;

* RTC_GET_DATE - ;

* RTC_SET_DATE - ;

* RTC_SET_ALARM - ;

* RTC_CLEAR_ALARM - .

*

* SYSTIMER tm - ,

*

* :

*

*.Return 0 - ;

* -1 -

* ;

**/

int timer(char fn, SYSTIMER *tm)

{

reg.h.ah = fn;

switch (fn)

{

case RTC_SET_TIME:

{

reg.h.ch = tm->hour;

reg.h.cl = tm->min;

reg.h.dh = tm->sec;

reg.h.dl = tm->daylight_savings;

break;

}

case RTC_SET_DATE:

{

reg.x.cx = tm->year;

reg.h.dh = tm->month;

reg.h.dl = tm->day;

break;

}

case RTC_SET_ALARM:

{

reg.h.ch = tm->hour;

reg.h.cl = tm->min;

reg.h.dh = tm->sec;

break;

}

}

int86(0x1a,&reg,&reg);

if(reg.x.cflag == 1)

return(-1);

switch (fn)

{

case RTC_GET_TIME:

{

tm->hour = reg.h.ch;

tm->min = reg.h.cl;

tm->sec = reg.h.dh;

break;

}

case RTC_GET_DATE:

{

tm->year = reg.x.cx;

tm->month = reg.h.dh;

tm->day = reg.h.dl;

break;

}

}

return 0;

}