#include<reg51.h> #include<intrins.h> #define uchar unsigned char #define uint unsigned int uchar code DSY_CODE[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; uchar Digits_of_6DSY[]={0,0,0,0,0,0}; uchar Count; sbit Dot=P0^7; void DelayMS(uint ms) { uchar t; while(ms--) for(t=0;t<120;t++); } void main() { uchar i,j; P0=0x00; P3=0xff; Count=0; TMOD=0x01; TH0=(65536-50000)/256; TL0=(65536-50000)%256; IE=0x82; TR0=1; while(1) { j=0x7f; for(i=5;i!=-1;i--) { j=_crol_(j,1); P3=j; P0=DSY_CODE[Digits_of_6DSY[i]]; if(i==1) Dot=1; DelayMS(2); } } } void Timer0() interrupt 1 { uchar