/*手动外部输入中断后熄灭发光二级管*/#include <REGX51.H>void service_int0() interrupt 0 using 2{ P1_0=1; //发光二级管灭}
void main(){ EA=1; //中断总允许 IT0=1; //后沿负跳有效 EX0=1; //允许外部中断 P1_0=0; //发光二级管开 do{}while(P1_0==0); do{}while(P1_0==1);}