关于中断返回的问题,新手求教

2019-07-15 11:06发布

# include<REG51.H>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar i;
//= = = = = = = = = = = =
void DelayMS(uint x) //延时
{
uchar i;
while(x--) for(i=0;i<120;i++);
}
//= = = = = = = = =  = = =
int1() interrupt 2  //K1中断程序
{char k;
for(k=0;k<=2;k++)
    {P0=0x00;   //发光二极管全亮
     DelayMS(150);
     P0=0xFF;  //发光二极管全灭
     DelayMS(150);
   }
}

//= = = = = = = = = = = = = =
void main()
  {
   IT1=0;
   EX1=1;
   EA=1;
   P0=0xfe;
    while(1)
  {DelayMS(150);
     P0=_crol_(P0,1); //P0 的值向左循环移动
     DelayMS(150);
  }  }

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。