#include<reg51.h> #define uchar unsigned char #define uint unsigned int
// #define r0 P1
void xs(uchar nian0,uchar nian1,uchar nian2,uchar nian3,uchar yue0,uchar yue1,uchar ri0,uchar ri1,uchar shi0,uchar shi1,uchar fen0,uchar fen1,uchar miao0,uchar miao1); uchar code table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}; uchar a,i,nian0,nian1,nian2,nian3,yue0,yue1,ri0,ri1,shi0,shi1,fen0,fen1,miao0,miao1; void et1(); void dealy(uint); void main() {
et1(); while(1) { if(a==2); {
xs(2,0,1,2); dealy(10); } a=0; if(a==2); { xs(0,2,2,7); dealy(10); }
}
} void et0() interrupt 3 { TH0=(65536-50000)/256; TL0=(65536-50000)%256; a++; } void et1() {
TMOD=0x01; EA=1; ET0=1; TR0=1; TH0=(65536-50000)/256; TL0=(65536-50000)%256;
} void xs(uchar nian0,uchar nian1,uchar nian2,uchar nian3,uchar yue0,uchar yue1,uchar ri0,uchar ri1,uchar shi0,uchar shi1,uchar fen0,uchar fen1,uchar miao0,uchar miao1) { P2=0xff; P1=table[nian0]; P2=0xF7;
P2=0xff; P1=table[nian1]; P2=0xfB;
P2=0xff; P1=table[nian2]; P2=0xfD;
P2=0xff; P1=table[nian3]; P2=0xfe;
P2=0xff; P1=table[yue0]; P2=0xfe;
P2=0xff; P1=table[yue1]; P2=0xfe;
P2=0xff; P1=table[ri0]; P2=0xfe;
P2=0xff; P1=table[ri1]; P2=0xfe;
P2=0xff; P1=table[shi0]; P2=0xfe;
P2=0xff; P1=table[shi1]; P2=0xfe;
P2=0xff; P1=table[fen0]; P2=0xfe;
P2=0xff; P1=table[fen1]; P2=0xfe;
P2=0xff; P1=table[miao0]; P2=0xfe;
P2=0xff; P1=table[miao1]; P2=0xfe; } void dealy(uint z) { uint x,y; for(x=0;x<124;x++) for(y=0;y<z;y++);
}
Build target 'Target 1'
compiling 1.c...
1.C(27): warning C209: '_xs': too few actual parameters 1.C(21): warning C209: '_xs': too few actual parameters linking... Program Size: data=39.0 xdata=0 code=286 "1" - 0 Error(s), 2 Warning(s).
|