void key_scan()
{
uchar m;
P3=0xf0;P44=1;P42=1;
if(P3!=0xF0||P44!=1||P42!=1)
{
P3=0xf0;P44=1;P42=1;
if(P44==0) n=0;
else if(P42==0) n=1;
else if((P3&0X10)==0) n=3;
else if((P3&0x20)==0) n=2;
P3=0x0F;P44=0;P42=0;
if((P3&0x01)==0) m=n;
else if((P3&0x02)==0) n=n+4;
else if((P3&0x04)==0) n=n+8;
else if((P3&0x08)==0) n=n+12;
}
}
{
uchar m;
P3=0xf0;P44=1;P42=1;
if(P3!=0xF0||P44!=1||P42!=1)
{
P3=0xf0;P44=1;P42=1;
if(P44==0) n=0;
else if(P42==0) n=1;
else if((P3&0X10)==0) n=3;
else if((P3&0x20)==0) n=2;
P3=0x0F;P44=0;P42=0;
if((P3&0x01)==0) m=n;
else if((P3&0x02)==0) n=n+4;
else if((P3&0x04)==0) n=n+8;
else if((P3&0x08)==0) n=n+12;
}
}