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

📄 main.lst

📁 单片机外部中断检测程序!!! 开发环境:keilC 用于检测外部中断
💻 LST
字号:
C51 COMPILER V7.09   MAIN                                                                  10/12/2006 15:17:51 PAGE 1   


C51 COMPILER V7.09, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: e:\Keil\C51\BIN\C51.EXE main.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include<reg52.h>
   2          
   3          sbit S1=P2^4;
   4          sbit S2=P2^5;
   5          sbit S3=P2^6;
   6          
   7          sbit LED1=P1^0;
   8          sbit LED2=P1^1;
   9          sbit LED3=P1^2;
  10          sbit LED=P0^0;
  11          
  12          bit flag_1=0,flag_2=0;
  13          
  14          void service_int0() interrupt 1 using 1
  15          {
  16   1              flag_1=1;       
  17   1      }
  18          
  19          void service_int1() interrupt 2 using 2
  20          {
  21   1              flag_2=1;               
  22   1      }
  23          
  24          void dlxms(unsigned int x)
  25          {
  26   1              unsigned char j;
  27   1              while(x--)
  28   1              {
  29   2                      for(j=0;j<125;j++)
  30   2                      {;}
  31   2              }       
  32   1      }
  33          
  34          void ck_ini()
  35          {
  36   1              TMOD=0x20;
  37   1              TL1=0xfd;
  38   1              TH1=0xfd;
  39   1              SCON=0xd8;
  40   1              PCON=0x00;      
  41   1      }
  42          
  43          void ck_send(unsigned int sd_data)
  44          {       
  45   1              unsigned char sd[2],i;
  46   1              TR1=1;
  47   1              sd[0]=(unsigned char)sd_data;
  48   1              sd[1]=(unsigned char)(sd_data>>8);
  49   1              for(i=0;i<2;i++)
  50   1              {
  51   2                      SBUF=sd[i];
  52   2                      while(TI==0);
  53   2                      TI=0;   
  54   2              }
  55   1      }
C51 COMPILER V7.09   MAIN                                                                  10/12/2006 15:17:51 PAGE 2   

  56          
  57          void main(void)
  58          {
  59   1              IP=0x00;
  60   1              IE=0x85;
  61   1              ck_ini();
  62   1              LED=0;
  63   1              
  64   1              while(1)
  65   1              {
  66   2                      if(flag_1)
  67   2                      {
  68   3                              if(S1==0)
  69   3                              {
  70   4                                      dlxms(5);
  71   4                                      if(S1==0)
  72   4                                      {
  73   5                                              dlxms(5);
  74   5                                              if(S1==0)
  75   5                                              {
  76   6                                                      LED1=!LED1;
  77   6                                                      LED2=1;
  78   6                                                      LED3=1;
  79   6                                                      ck_send(0x0033);
  80   6                                              }
  81   5                                      }
  82   4                              }
  83   3                      }
  84   2                      if(flag_2)
  85   2                      {
  86   3                              if(S2==0)
  87   3                              {
  88   4                                      dlxms(10);
  89   4                                      if(S2==0)
  90   4                                      {
  91   5                                              dlxms(10);
  92   5                                              if(S2==0)
  93   5                                              {
  94   6                                                      LED1=1;
  95   6                                                      LED2=!LED2;
  96   6                                                      LED3=1;
  97   6                                                      ck_send(0x0044);
  98   6                                              }
  99   5                                      }
 100   4                              }
 101   3                              if(S3==0)
 102   3                              {
 103   4                                      dlxms(10);
 104   4                                      if(S3==0)
 105   4                                      {
 106   5                                              dlxms(10);
 107   5                                              if(S3==0)
 108   5                                              {
 109   6                                                      LED1=1;
 110   6                                                      LED2=1;
 111   6                                                      LED3=!LED3;
 112   6                                                      ck_send(0x0055);
 113   6                                              }
 114   5                                      }
 115   4                              }
 116   3                      }
 117   2                      flag_1=0;flag_2=0;
C51 COMPILER V7.09   MAIN                                                                  10/12/2006 15:17:51 PAGE 3   

 118   2              }
 119   1      }
 120          
 121          
 122          
 123          


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


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

⌨️ 快捷键说明

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