


#include
# define uchar unsigned char
# define uint unsigned int
Uchar int_time;
Uchar second;
Uchar minute;
Uchar hour;
Uchar date []="L.D.C HINA";
Uchar time []="time 23:59:55";
Uchar second=55 minute=59, hour=23;
Void clock_init ()
{uchar I, j;
for(i=0; i<16. I++)
[I] {write_date (date);
}
Wtite_com (0 x80 + 0 x40);
for(j=0; J<16. J++)
[j] {write_date (time); }
}
Void clock_write (uint s, uint m, uint h)
{write_sfm (0 x47, h); Write_sfm (0 x4a, m); Write_sfm (0 x4d, s);
}
Void main ()
{init1602 ();
Clock_init ();
TMOD=0 x01;
EA=1;
ET0=1;
TH0=(65536-46483)/256;
TL0=(65536-46483) % 256;
TR0=1;
Int_time=0;
Second=55;
Minute=59;
Hour=23;
While (1)
{clock_write (second, minute, hour);
}
}
Void T0_interserve (void) interrupt 1
{int_time + +; If (int_time==20) {int_time=0; Second++; {} the if (second==60) second=0; minute++; {} the if (mintue==60) mintue=0; Hour++; {} the if (hour==24) hour=0} TH0=(65536-46483)/256; TL0=(65536-46483) % 256;
}


CodePudding user response:



CodePudding user response:






CodePudding user response:
Do you have any help eldest brother a look