📄 clock.c
字号:
#include<dos.h>
#include<time.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+3974)='P';
*(buf+3975)=0x4f;
*(buf+3976)='u';
*(buf+3977)=0x4f;
*(buf+3978)='B';
*(buf+3979)=0x4f;
*(buf+3980)='i';
*(buf+3981)=0x4f;
*(buf+3982)='n';
*(buf+3983)=0x4f;
*(buf+3984)=t.ti_hour/10+'0';
*(buf+3985)=0x4f;
*(buf+3986)=t.ti_hour%10+'0';
*(buf+3987)=0x4f;
*(buf+3988)=':';
*(buf+3989)=0x4f;
*(buf+3990)=t.ti_min/10+'0';
*(buf+3991)=0x4f;
*(buf+3992)=t.ti_min%10+'0';
*(buf+3993)=0x4f;
*(buf+3994)=':';
*(buf+3995)=0x4f;
*(buf+3996)=t.ti_sec/10+'0';
*(buf+3997)=0x4f;
*(buf+3998)=t.ti_sec%10+'0';
*(buf+3999)=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,255);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -