1.EA=1;//要开中的中断
2.EX0或EX1=1;//说明是外部中断的使能
3.IT0或IT1=1;//IT=0是电平触发IT=1是下降沿触发
4.void int0() interrupt 0 using 1 //外部中断0的中断服务子程序
{
EX0=0;//防止自中断
.......
EX0=1;
}
4.void int1() interrupt 2 using 1 //外部中断1的中断服务子程序
{
EX1=0;//防止自中断
.......
EX1=1;
}