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

📄 project1.lst

📁 这是一个周界报警的报警控制程序,采用89C52芯片,KEIL 51开发!
💻 LST
字号:
C51 COMPILER V7.01  PROJECT1                                                               12/31/2005 12:42:49 PAGE 1   


C51 COMPILER V7.01, COMPILATION OF MODULE PROJECT1
OBJECT MODULE PLACED IN project1.OBJ
COMPILER INVOKED BY: F:\Keil\C51\BIN\C51.EXE project1.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          
   2          /*------------------------------------------------------------------------------
   3                                alarm 2004-4-29
   4          ------------------------------------------------------------------------------*/
   5          
   6          #include "reg52.h"
   7          #include "main.h"
   8          
   9          bit P0_flag;
  10          bit flag_ea = 1;
  11          
  12          unsigned char data flag_Ysd = 0;
  13          unsigned char idata *boot_flag;
  14          unsigned char idata *data1_status;
  15          unsigned char idata *data2_status;
  16          unsigned char idata *ysd_status;
  17          unsigned char data Led_Cum=0;
  18          unsigned char data P0_sbuf;
  19          unsigned char data Camera;
  20          unsigned char data Cummun;
  21          unsigned char data in_p1;
  22          unsigned char data baut;
  23          unsigned char data P0_buf;
  24          unsigned char data P2_buf;
  25          unsigned char data check_flag;
  26          unsigned char data wdt_count;
  27          unsigned char data R_count=0;
  28          unsigned char data data2;
  29          unsigned char data data1;
  30          
  31          unsigned int r_out=1;
  32          unsigned int r_in=0;
  33          
  34          
  35          
  36          
  37          unsigned char rbuf [8];
  38          extern dvr_set;
  39          
  40          
  41          
  42          
  43          /*--------------------------  
  44          MAIN()
  45          ----------------------------*/
  46          extern void input(void);
  47          //void delay(void);
  48          extern void output(void);
  49          extern void howell(unsigned char rbuf1[8]);
  50          extern void ysd(unsigned char rbuf1[8]);
  51          extern void se600hb(unsigned char rbuf1[8]);
  52          extern void auto_alarm(void);
  53          extern void alarm2_in(void);
  54          extern void st5008(unsigned char rbuf1[8]);
  55          extern void master2_in(void);
C51 COMPILER V7.01  PROJECT1                                                               12/31/2005 12:42:49 PAGE 2   

  56          extern void slave(void);
  57          //extern void com_isr(void);
  58          
  59          static void com_isr (void) interrupt 4 using 2
  60                  {
  61   1         wdt_count++; 
  62   1              if (RI != 0)      
  63   1                {
  64   2                RI = 0;
  65   2                
  66   2                if ((r_in + 1) != r_out)
  67   2                 rbuf [r_in++] = SBUF;
  68   2      
  69   2            else
  70   2                    {
  71   3                        rbuf[r_in]=SBUF;
  72   3                    flag_ea=0;
  73   3                r_in=0;
  74   3                EA=0;
  75   3              //        i=rbuf[0];
  76   3                        }
  77   2            } 
  78   1          }
  79          
  80           
  81          void main (void)
  82          
  83          {    
  84   1          boot_flag=0xff;
  85   1          data1_status=0xfe;
  86   1          data2_status=0xfd;
  87   1          ysd_status=0xfc; 
  88   1          
  89   1          T0 = 0;
  90   1       
  91   1              EA =1;
  92   1          in_p1=~P1;
  93   1      
  94   1          BU=0;
  95   1          
  96   1              PCON  = 0x00;
  97   1              SCON  = 0x40;                   /* SCON: mode 1, 8-bit UART, enable rcvr    */
  98   1              TMOD  = 0x21;
  99   1             
 100   1          if(*boot_flag!=0xaa)
 101   1          {
 102   2           *boot_flag=0xaa;
 103   2          data1=0x00;
 104   2          data2=0x00;
 105   2          flag_Ysd=0x00;
 106   2      
 107   2          }
 108   1          else
 109   1          {
 110   2           
 111   2           data1=*data1_status;
 112   2           data2=*data2_status;
 113   2           flag_Ysd=*ysd_status;
 114   2           
 115   2          }
 116   1      
 117   1          baut  = in_p1 & 0x30;               /* TMOD: timer 1, mode 2, 8-bit reload      */
C51 COMPILER V7.01  PROJECT1                                                               12/31/2005 12:42:49 PAGE 3   

 118   1          check_flag = in_p1 & 0xc0;
 119   1          Cummun = in_p1 & 0x0f; 
 120   1              if (baut==0x00)
 121   1          {
 122   2              TH1   = 0xFD;                               /* TH1:  reload value for 9600 baud         */
 123   2          }                                
 124   1          else if (baut==0x30)
 125   1          {
 126   2              TH1   = 0xFA;                               /* TH1:  reload value for 4800 baud         */
 127   2              }
 128   1          else if (baut==0x20)          
 129   1          {  
 130   2              TH1   = 0xF4;                               /* TH1:  reload value for 2400 baud         */
 131   2              }
 132   1          else 
 133   1              {
 134   2              TH1   = 0xE8;                               /* TH1:  reload value for 1200 baud         */
 135   2              }
 136   1            
 137   1          REN   = 1; 
 138   1          TH0=0x3c;                                   //timer0 50ms 
 139   1          TL0=0xb0; 
 140   1          TR1= 1;                                     /* TR1:  timer 1 run                        */
 141   1          ES = 1;
 142   1      
 143   1          WDTRST=0x1E;                               //SET the WDT 
 144   1          WDTRST=0xE1;
 145   1          
 146   1          if(1)
 147   1            {
 148   2             auto_alarm();
 149   2            }
 150   1          
 151   1        
 152   1      
 153   1       //   EA=0;
 154   1      
 155   1         
 156   1          while(1)
 157   1       { 
 158   2          
 159   2          *data1_status=data1;
 160   2          *data2_status=data2;
 161   2              *ysd_status=flag_Ysd;
 162   2          Led_Cum++;
 163   2          
 164   2              if(P0!=0xFF)
 165   2              BU=1;
 166   2              else
 167   2              BU=0;
 168   2              if(Led_Cum>0xFE)
 169   2               {
 170   3                Led_Cum=0;
 171   3                CODE_LED=~CODE_LED;
 172   3               }
 173   2      
 174   2          if(wdt_count<15)
 175   2          {
 176   3           WDTRST=0x1E;
 177   3           WDTRST=0xE1;
 178   3          }
 179   2      
C51 COMPILER V7.01  PROJECT1                                                               12/31/2005 12:42:49 PAGE 4   

 180   2          if(flag_Ysd==0x01 && P0_sbuf!=P0 )
 181   2           {
 182   3                wdt_count=0;
 183   3            P0_sbuf=P0;
 184   3            if(Cummun==0x00)
 185   3            alarm2_in();
 186   3            if(Cummun==0x02)
 187   3            slave();
 188   3            wdt_count=0;
 189   3           }
 190   2      
 191   2         RT_CON=0;
 192   2      
 193   2         if(flag_ea)                                   /*wait the interrupt*/
 194   2         {                                      
 195   3          EA=1;
 196   3          input();                                     //Scan the alarm input
 197   3         } 
 198   2         
 199   2         else if(rbuf[0]==0xf6)                         //howell
 200   2        {
 201   3         if(r_out!=7)
 202   3         {
 203   4          r_out=7;
 204   4          r_in=1;
 205   4          flag_ea=1;
 206   4         } 
 207   3         
 208   3         else if(rbuf[1] != Cummun && Cummun != 0x00)                                //2004-8-2 added
 209   3         {
 210   4          r_out=1;
 211   4          r_in=0;
 212   4          flag_ea=1;
 213   4         }
 214   3          
 215   3         else
 216   3         {
 217   4         howell(rbuf);
 218   4         r_out=1;
 219   4         r_in=0;
 220   4         flag_ea=1;
 221   4         }
 222   3        wdt_count=0;
 223   3        }
 224   2      
 225   2       else if(rbuf[0]==0x2a)                  //ysd M卡
 226   2        {
 227   3           flag_Ysd=0x01;
 228   3           if(r_out!=6 && rbuf[1]==0x04)
 229   3            {
 230   4              r_in=r_out;
 231   4              r_out = 6;
 232   4              //r_in = 1;
 233   4             // flag_ea = 1;
 234   4            }
 235   3           else if(r_out!=8&&rbuf[1]==0x06)
 236   3            {
 237   4             r_in = r_out;
 238   4             r_out = 8;
 239   4            // flag_ea=1;
 240   4            }
 241   3           else if (rbuf[1]!=0x04 && rbuf[1]!=0x06)
C51 COMPILER V7.01  PROJECT1                                                               12/31/2005 12:42:49 PAGE 5   

 242   3           {
 243   4            r_in=r_out;
 244   4            r_out=2;
 245   4           }
 246   3          else
 247   3          {
 248   4           ysd(rbuf);
 249   4           r_out=2;
 250   4           r_in=0;
 251   4           //flag_ea=1;
 252   4          }  
 253   3          flag_ea=1; 
 254   3          wdt_count=0;  
 255   3        }
 256   2          
 257   2         else if(rbuf[0]==0x5a)                         //seboohb M卡
 258   2        {
 259   3          if(r_out!=5)
 260   3          {
 261   4          r_out=5;
 262   4          r_in=1;
 263   4          flag_ea=1;
 264   4          }  
 265   3          else
 266   3          {
 267   4          se600hb(rbuf);
 268   4          r_out=1;
 269   4          r_in=0;
 270   4          flag_ea=1;
 271   4          }
 272   3         wdt_count=0;
 273   3        }
 274   2      
 275   2       else if(rbuf[0]==0xF8)                          //公司协议
 276   2       {
 277   3         if(r_out!=7)
 278   3         {
 279   4          r_out=7;
 280   4          r_in=1;
 281   4          flag_ea=1;
 282   4         }
 283   3         else if(rbuf[1] != Cummun && Cummun != 0x00)                    //2004-8-2 added
 284   3         {
 285   4          r_out=1;
 286   4          r_in=0;
 287   4          flag_ea=1;
 288   4         }
 289   3         else
 290   3         {
 291   4          st5008(rbuf);
 292   4          r_out=1;
 293   4          r_in=0;
 294   4          flag_ea=1;
 295   4         }
 296   3        wdt_count=0;
 297   3       }
 298   2      
 299   2      
 300   2        
 301   2      
 302   2      else
 303   2         flag_ea=1;
C51 COMPILER V7.01  PROJECT1                                                               12/31/2005 12:42:49 PAGE 6   

 304   2          
 305   2      //   output();
 306   2      
 307   2       }
 308   1      }                         


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    614    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     30    ----
   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 + -