#include
#define uchar unsigned chr
uchar code table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
uchar key;
void ext0() interrupt 0
{
key++;
key%=10;
}
void ext1() interrupt 2
{
dat--;
if(dat>9)dat=9;
}
main()
{
EX0=1;
EX1=1;
IT0=1;
IT1=1;
EA=1;
while(1)P2=table[dat];
}