#include
#define uchar unsigned char
uchar tcnt=0,num=0;
sbit p10=P1^0;
void t0isr() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
tcnt++;
if(tcnt>=20)
{
tcnt=0;
num++;
if(num==2)p10=0;
if(num==5)
{
num=0;
p10=1;
}
}
}
main()
{
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
TR0=1;
EA=1;
p10=1;
while(1);
}