UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS) 怎么显示这个??
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
char code duma[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
char code wema[]={0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7};
uchar code table[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
uchar i,num,t,y;
uchar qian,bai,shi,ge;
void inter_init()
{ EA=1;
ET1=1;
TMOD=0X10;
TH1=(65536-5000)/256;
TL1=(65536-5000)%256;
TR1=1;
}
void inter_init1()
{ EA=1;
ET0=1;
TMOD=0x01;
TH0=(65535-50000)/256;
TL0=(65535-50000)%256;
TR0=1;
}
void delay(uchar x)
{ uchar a,b;
for(a=x;a>0;a--)
for(b=200;b>0;b--);
}
void display(uchar qian,bai,shi,ge)
{ P2=duma[qian] ;
P1= wema[1];
delay(15);
P2=duma[bai] ;
P1= wema[2];
delay(15);
P2=duma[shi] ;
P1= wema[3];
delay(15);
P2=duma[ge] ;
P1= wema[4];
delay(15);
}
void main()
{ inter_init();
num=5432;
while(1)
{ if(i==2)
{ i=0;
if(num==5000)
num=5000;
else
num--;
}
}
qian=num/1000;
bai=num%1000/100;
shi=num%1000%100/10;
ge=num%10;
display(qian,bai,shi,ge);
inter_init1();
for(t=0;t<8;t++)
{
P2=table[t];
if(y==10)
y=0;
}
}
void time0()interrupt 1 using 1
{
TH0=(65535-5000)/256;
TL0=(65535-5000)%256;
i++;
}
void time1()interrupt 3 using 1 //如果用T1的话,应为interrupt 3
{
TH0=(65535-50000)/256; //因为晶振用的是11.0592MHZ。在取初值时,大概定义为一个中断为50MS
TL0=(65535-50000)%256;
y++;
} |