sbit B0=P3^7; sbit l0=P2^0; sbit l1=P2^2; sbit l2=P2^3; sbit l3=P2^4; sbit kz=P3^0;
unsigned char qiangdanum=0x3f; unsigned
unsigned char ge=0,shi=0; unsigned int num=0,time=0;
void display(); /*显示函数*/ void delay(unsigned int); main() {
TMOD=0X01; /*采用方式一,即十六位计数器*/
TH0=(65536-50000)/256; /*设置初始值*/ TL0=(65536-50000)%256; IT0=0;
EA=1;ET0=1; /*开启总中断源*/ EX0=1; /*启动外部中断0*/ {while(1) {display(); if(kz==0)
TR0=1; /*开启定时器0中断*/ if(num==20) { num=0; time++;
if(time==60) /*60秒的计时*/ time=0; } } }
char
code
table[]={0x3f,0xxx,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};