51单片机时钟汇编程序 你确定是中断问题?要别人帮忙不把完整的程序贴出来,大神也帮不了你的程序这么精贵你不要问,自己搞定就好了
基于51单片机的时钟程序
求51单片机时钟程序。只要秒和分, 这是一个显示时分秒的程序,你参考一下includedefine uchar unsigned charuchar code ledtab[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};0-9unsigned char sec,min,hour,scanled;unsigned char key,flashbit,mode,time;unsigned char disdat[6];sbit led=P1^0;void delay(unsigned int x){unsigned int i,j;for(i=0;i;i+)for(j=0;j;j+);}void dischg(){disdat[0]=sec%10;disdat[1]=sec/10;disdat[2]=min%10;disdat[3]=min/10;disdat[4]=hour%10;disdat[5]=hour/10;}void flash(){switch(flashbit){case 0:break;case 1:disdat[4]=0x10;disdat[5]=0x10;delay(50);dischg();delay(80);break;case 2:disdat[2]=0x10;disdat[3]=0x10;delay(50);dischg();delay(80);break;case 3:disdat[0]=0x10;disdat[1]=0x10;delay(50);dischg();delay(80);break;default:break;}}void t0isr()interrupt 1/秒计时{TR0=0;TH0=0x3c;TL0=0xb0;TR0=1;time+;switch(mode){case 0:if(time=20){time=0;sec+;if(sec>;59){sec=0;min+;if(min>;59){hour+;if(hour>;99)hour=0;}}}break;case 1:if(time=20){time=0;if(sec>;0)sec-;else if(min>;0){sec=59;min-。