51单片机,简单电子密码锁设计

为啥这串代码运行完,单片机没反应
#include <reg51.h>
sbit P3_0=P3^0;
void delay(unsigned int i);
void main()
{
unsigned char button;
unsigned char code tab[7]={0xc0,0xf9,0xa4,0xb0,0xbf,0x86,0x8c};
P0=0xff;
while (1)
{
P1=tab[4];
P3_0=1;
button=P0;
button&=0x0f;
switch(button )
{
case 0x0e: P1=tab[0];delay(400);P1=tab[5];break;
case 0x0d: P1=tab[1];delay(400);P1=tab[5];break;
case 0x0b: P1=tab[2];delay(400);P1=tab[6];P3_0=0;break;
case 0x07: P1=tab[3];delay(400);P1=tab[5];break;
}
delay(1200);
}
}
void delay(unsigned int i)
{
unsigned int j,k;
for(k=0;k<i;k++)

for(j=0;j<255;j++);

}

img