1、#include#include#define uint unsigned int#define uchar unsigned charuchartemp,num,a,b,c,d,e,f,t,h;uint shu;uchar code table=0x07,0x7d,0x6d,0x66,0x4f,0x5b;void delay(uint z) uint x,y; for(x=z;z0;z-) for(y=110;y0;y-);void mer() temp=0xfe; P0=temp; shu=432; TMOD=0X11; TH0=(65536-50000)/256; TL0=(65536-
2、50000)%256; TH1=(65536-50000)/256; TL1=(65536-50000)%256; EA=1; ET0=1; ET1=1; TR0=1; TR1=1; void display(uchar a,uchar b,uchar c,uchar d,uchar e,uchar f) P0=table1; P2=5;delay(2); P0=table2;P2=4;delay(2); P0=table3;P2=2;delay(2); P0=tabled;P2=3;delay(2); P0=tablee;P2=2;delay(2); P0=tablef;P2=1;delay
3、(2); void main() mer(); while(1) display(1,2,3,d,e,f); void mer1() interrupt 1 TH0=(65536-50000)/256; TL0=(65536-50000)%256; t+; if(t=2) t=0; temp=_crol_(temp,1); P0=temp; void mer2() interrupt 3 TH1=(65536-50000)/256; TL1=(65536-50000)%256; d=shu/100; e=shu%100/10; f=shu%10; if(h=10) h=0; shu-; if(shu=398) TR0=0; P0=0Xff; TR1=0;