#include <reg52.h>
LED_[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
disbuf[]={0x01,0x02};
unsigned char m;
void delay(unsigned char time)
{
unsigned char i;
int j=0;
for(i=time;i>0;i--)
for(j=0;j<125;j++);
}
break_() interrupt 3
{
delay(1);
m=m-1;
}
void main()
{
int j=0;
TMOD=0x20;
EA=1;
ET1=1;
TR1=1;
TH1=0x1a;
TL1=0x1a;
m=99;
while(1)
{
if(j==0)
{
P1=disbuf[j];
P2=LED_[m%10];
delay(10);
j=1;
}
else
{
P1=disbuf[j];
P2=LED_[m/10];
delay(10);
j=0;
}
}
}
|