⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 key4.lst

📁 手把手教你单片机
💻 LST
字号:
C51 COMPILER V8.02   KEY4                                                                  12/14/2010 00:36:12 PAGE 1   


C51 COMPILER V8.02, COMPILATION OF MODULE KEY4
OBJECT MODULE PLACED IN key4.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE key4.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include <reg52.h>
   2          #include "key.h"
   3          
   4          
   5          main()
   6          {
   7   1              P0 = 0xFF;
   8   1              // led初始化
   9   1              ENLED = 0;
  10   1              ADDR3 = 1;
  11   1              ADDR2 = 1;
  12   1              ADDR1 = 1;
  13   1              ADDR0 = 0;
  14   1      
  15   1              while (1)
  16   1              {
  17   2                      KeyOut1 = 0;
  18   2                      KeyOut2 = 1;
  19   2                      KeyOut3 = 1;
  20   2                      KeyOut4 = 1;
  21   2                      if(KeyIn1 == 0) 
  22   2                      {
  23   3                              delay();
  24   3                              if(KeyIn1 == 0)
  25   3                                 P0 = ~1;
  26   3                      }
  27   2                      if(KeyIn2 == 0)
  28   2                      {
  29   3                              delay();
  30   3                              if(KeyIn2 == 0)
  31   3                                 P0 = ~2;
  32   3                      }
  33   2                      if(KeyIn3 == 0)
  34   2                      {
  35   3                              delay();
  36   3                              if(KeyIn3 == 0)
  37   3                                 P0 = ~3;
  38   3                      }       
  39   2                      if(KeyIn4 == 0)
  40   2                      {
  41   3                              delay();
  42   3                              if(KeyIn4 == 0)
  43   3                                 P0 = ~4;
  44   3                      }
  45   2                      while((KeyIn1 == 0)||(KeyIn2 == 0)||
  46   2                            (KeyIn3 == 0)||(KeyIn4 == 0));
  47   2                      
  48   2                      KeyOut1 = 1;
  49   2                      KeyOut2 = 0;
  50   2                      KeyOut3 = 1;
  51   2                      KeyOut4 = 1;
  52   2                      if(KeyIn1 == 0) 
  53   2                      {
  54   3                              delay();
  55   3                              if(KeyIn1 == 0)
C51 COMPILER V8.02   KEY4                                                                  12/14/2010 00:36:12 PAGE 2   

  56   3                                 P0 = ~5;
  57   3                      }
  58   2                      if(KeyIn2 == 0)
  59   2                      {
  60   3                              delay();
  61   3                              if(KeyIn2 == 0)
  62   3                                 P0 = ~6;
  63   3                      }
  64   2                      if(KeyIn3 == 0)
  65   2                      {
  66   3                              delay();
  67   3                              if(KeyIn3 == 0)
  68   3                                 P0 = ~7;
  69   3                      }       
  70   2                      if(KeyIn4 == 0)
  71   2                      {
  72   3                              delay();
  73   3                              if(KeyIn4 == 0)
  74   3                                 P0 = ~8;
  75   3                      }
  76   2                      while((KeyIn1 == 0)||(KeyIn2 == 0)||
  77   2                            (KeyIn3 == 0)||(KeyIn4 == 0));
  78   2      
  79   2                      KeyOut1 = 1;
  80   2                      KeyOut2 = 1;
  81   2                      KeyOut3 = 0;
  82   2                      KeyOut4 = 1;
  83   2                      if(KeyIn1 == 0) 
  84   2                      {
  85   3                              delay();
  86   3                              if(KeyIn1 == 0)
  87   3                                 P0 = ~9;
  88   3                      }
  89   2                      if(KeyIn2 == 0)
  90   2                      {
  91   3                              delay();
  92   3                              if(KeyIn2 == 0)
  93   3                                 P0 = ~10;
  94   3                      }
  95   2                      if(KeyIn3 == 0)
  96   2                      {
  97   3                              delay();
  98   3                              if(KeyIn3 == 0)
  99   3                                 P0 = ~11;
 100   3                      }       
 101   2                      if(KeyIn4 == 0)
 102   2                      {
 103   3                              delay();
 104   3                              if(KeyIn4 == 0)
 105   3                                 P0 = ~12;
 106   3                      }
 107   2                      while((KeyIn1 == 0)||(KeyIn2 == 0)||
 108   2                            (KeyIn3 == 0)||(KeyIn4 == 0));
 109   2      
 110   2                      KeyOut1 = 1;
 111   2                      KeyOut2 = 1;
 112   2                      KeyOut3 = 1;
 113   2                      KeyOut4 = 0;
 114   2                      if(KeyIn1 == 0) 
 115   2                      {
 116   3                              delay();
 117   3                              if(KeyIn1 == 0)
C51 COMPILER V8.02   KEY4                                                                  12/14/2010 00:36:12 PAGE 3   

 118   3                                 P0 = ~13;
 119   3                      }
 120   2                      if(KeyIn2 == 0)
 121   2                      {
 122   3                              delay();
 123   3                              if(KeyIn2 == 0)
 124   3                                 P0 = ~14;
 125   3                      }
 126   2                      if(KeyIn3 == 0)
 127   2                      {
 128   3                              delay();
 129   3                              if(KeyIn3 == 0)
 130   3                                 P0 = ~15;
 131   3                      }       
 132   2                      if(KeyIn4 == 0)
 133   2                      {
 134   3                              delay();
 135   3                              if(KeyIn4 == 0)
 136   3                                 P0 = ~16;
 137   3                      }
 138   2                      
 139   2                 while((KeyIn1 == 0)||(KeyIn2 == 0)||
 140   2                            (KeyIn3 == 0)||(KeyIn4 == 0));
 141   2                      
 142   2              }
 143   1      }
 144          
 145          void delay(void)
 146          {
 147   1              uint16 i=1000;
 148   1      
 149   1              while (i--);
 150   1      
 151   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    305    ----
   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)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -