C51 COMPILER V9.01   K1_K4控_芁ED移位                                                      12/22/2014 09:03:53 PAGE 1   


C51 COMPILER V9.01, COMPILATION OF MODULE K1_K4控_芁ED移位
OBJECT MODULE PLACED IN k1-k4控制LED移位.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE k1-k4控制LED移位.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1                  #include<reg51.h> 
   2                  #include<intrins.h>    //包含_cror_和_crol_函数 
   3                  #define uchar unsigned char 
   4                  #define uint unsigned int 
   5                  void DelayMS(uint x) 
   6                  { 
   7   1                  uchar i; 
   8   1                  while(x--) 
   9   1              for(i=0;i<120;i++); 
  10   1              } 
  11                  void Move_LED() 
  12                  { 
  13   1                    if ((P1&0x10)==0) P0=_cror_(P0,1);        //K1 
  14   1                    else if((P1&0x20)==0) P0=_crol_(P0,1);     //K2 
  15   1                    else if((P1&0x40)==0) P2=_cror_(P2,1);     //K3 
  16   1                    else if((P1&0x80)==0) P2=_crol_(P2,1);     //K4 
  17   1              } 
  18                  void main() 
  19                  { 
  20   1                    uchar Recent_Key; //最近按键 
  21   1                    P0=0xfe;          //赋初值，第一个LED点亮 
  22   1                    P2=0xfe;         //赋初值，第一个LED点亮 
  23   1                    P1=0xff;          //P1口输出高电平 
  24   1                    Recent_Key=0xff; 
  25   1                    while(1) 
  26   1                    { 
  27   2                        if(Recent_Key!=P1)    //判断按键是否弹起，进行消抖 
  28   2                        { 
  29   3                             Recent_Key=P1;          //保存最近按键 
  30   3                             Move_LED(); 
  31   3                             DelayMS(10); 
  32   3                        }       } } 


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    128    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)
