#include"time.h" #include "dos.h" char far *buf; void (interrupt far *oldintfun)(); struct time t; union REGS i,o; void interrupt far newintfun() { static int time1=0,count=0; time1++; if(time1>=18) { count++; t.ti_sec++; if(t.ti_sec>=60) { t.ti_sec=0; t.ti_min++; if(t.ti_min>=60) { t.ti_min=0; t.ti_hour=t.ti_hour>=23 ? 0: t.ti_hour+1; } } *(buf+144)=t.ti_hour/10+'0'; *(buf+145)=0x4f; *(buf+146)=t.ti_hour%10+'0'; *(buf+147)=0x4f; *(buf+148)=':'; *(buf+149)=0x4f; *(buf+150)=t.ti_min/10+'0'; *(buf+151)=0x4f; *(buf+152)=t.ti_min%10+'0'; *(buf+153)=0x4f; *(buf+154)=':'; *(buf+155)=0x4f; *(buf+156)=t.ti_sec/10+'0'; *(buf+157)=0x4f; *(buf+158)=t.ti_sec%10+'0'; *(buf+159)=0x4f;
if (count==5) {count=0;time1=-1;} else time1=0; } oldintfun(); }
main() { void interrupt far newintfun(); i.h.ah=0x0f; int86(0x10,&i,&o); if(o.h.al!=7) buf=(char far *)0xb8000000l; else buf=(char far *)0xb0000000l; gettime(&t); oldintfun=getvect(0x1c); setvect(0x1c,newintfun); keep(0,3000); }
|