PT630 Programming Reference Guide
Page 36 of 59
------------------------------------------------------------------------------------------------------------------
1.5.18 Set Interrupt Vector
Entry Parameter: AH = 25H
AL
=
interrupt
number
DS:BX
=
address
of
interrupt
routine
Return
Value:
None
Example
:
void TS_set_interrupt_vector(int vect,unsigned int ds,unsigned int dx)
{
regs.h.ah= 0x25;
regs.h.al= (unsigned char)vect;
segregs.ds=ds;
regs.x.dx=dx;
int86x(0x21,®s,®s,&segregs);
}
1.5.19 Get System Date
Entry Parameter: AH = 2AH
Return Value: CX = year (1980 - 2079)
DH = month (1 - 12)
DL = day (1 - 31)
AL = weekday (0 - 6)
Example
:
void TS_get_date(int *year,int *month,int *day,int *week)
{
TD_int_dos1(0x2a,0,0,0);
*year = regs.x.cx;
*month = regs.h.dh;
*day = regs.h.dl;
*week = regs.h.al;
}
1.5.20 Set System Date
Entry Parameter: AH = 2BH
CX = year (1980 - 2079)
DH = month (1 - 12)
DL = day (1 - 31)
Return Value: AL = 0/FFH
; OK/Setting error
Example
:
int TS_set_date(int year,int month,int day)
{
regs.h.ah = 0x2b;
regs.x.cx = year;
regs.h.dh = month;
regs.h.dl = day;
int86(0x21,®s,®s);
return((int)regs.h.al);
}