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

📄 hello.lst

📁 定时器设置
💻 LST
字号:
C51 COMPILER V8.02   HELLO                                                                 03/04/2006 22:09:04 PAGE 1   


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

line level    source

   1          /*------------------------------------------------------------------------------
   2          HELLO.C
   3          
   4          Copyright 1995-2005 Keil Software, Inc.
   5          ------------------------------------------------------------------------------*/
   6          
   7          #include <REG52.H>                /* special function register declarations   */
   8          /* for the intended 8051 derivative         */
   9          
  10          #include <stdio.h>                /* prototype declarations for I/O functions */
  11          #include <stdlib.h>                      /* standard library .h-file          */
  12          #include <ctype.h>                       /* character functions               */
  13          #include <intrins.h>
  14          
  15          #ifdef MONITOR51                         /* Debugging with Monitor-51 needs   */
              char code reserve [3] _at_ 0x23;         /* space for serial interrupt if     */
              #endif                                   /* Stop Exection with Serial Intr.   */
  18          
  19          
  20          
  21          //定义按健
  22          sbit K1 = P3^4;
  23          sbit K2 = P3^5;
  24          
  25          sbit LED = P1^0;
  26          
  27          sbit P12MOTO=P1^2;
  28          
  29          sbit P33=P3^3;
  30          
  31          
  32           unsigned char one=0;
  33          
  34          //延时
  35          void delay(unsigned char n)
  36          {        
  37   1       while(n--);
  38   1      
  39   1      }
  40          
  41          void timer3(void)interrupt 3
  42           {
  43   1               TH1=0x0;
  44   1               TL1=0x0;
  45   1               TF1=0;
  46   1               if(one>200)
  47   1               {
  48   2                      LED=!LED;
  49   2                      one=0;
  50   2               }
  51   1              else
  52   1                  one++;
  53   1              
  54   1       }
  55          
C51 COMPILER V8.02   HELLO                                                                 03/04/2006 22:09:04 PAGE 2   

  56          //  void timer0(void)interrupt 0
  57          // {
  58          //       TH1=0x0;
  59          //       TL1=0x0;
  60          //       //TF1=0;
  61          //       if(one>200)
  62          //       {
  63          //              LED=!LED;
  64          //              one=0;
  65          //       }
  66          //      else
  67          //          one++;
  68          //      
  69          // }
  70          //
  71          //
  72          // void timer1(void)interrupt 1
  73          // {
  74          //       TH1=0x0;
  75          //       TL1=0x0;
  76          //       TF1=0;
  77          //       if(one>200)
  78          //       {
  79          //              LED=!LED;
  80          //              one=0;
  81          //       }
  82          //      else
  83          //          one++;
  84          //      
  85          // }
  86          //
  87          // 
  88          // void timer2(void)interrupt 2
  89          // {
  90          //       TH1=0x0;
  91          //       TL1=0x0;
  92          //       TF1=0;
  93          //       if(one>200)
  94          //       {
  95          //              LED=!LED;
  96          //              one=0;
  97          //       }
  98          //      else
  99          //          one++;
 100          //      
 101          // } 
 102          
 103          
 104          /*------------------------------------------------
 105          The main C function.  Program execution starts
 106          here after stack initialization.
 107          ------------------------------------------------*/
 108          void main (void) {
 109   1      
 110   1              unsigned int i;  
 111   1      
 112   1      
 113   1      #ifndef MONITOR51
 114   1              SCON  = 0x50;                   /* SCON: mode 1, 8-bit UART, enable rcvr  101 0000    */
 115   1              RCAP2H = 0xFF;
 116   1              TH2   = 0xff;                
 117   1              RCAP2L =0xBF;
C51 COMPILER V8.02   HELLO                                                                 03/04/2006 22:09:04 PAGE 3   

 118   1              TL2  =  0xFB;
 119   1              T2CON = 0x34;                       //0011 0100
 120   1              //TR1   = 1;                  /* TR1:  timer 1 run                          */
 121   1              TI    = 1;                  /* TI:   set TI to send first char of UART    */
 122   1              ES  =0;
 123   1              //EA =1;
 124   1      
 125   1      
 126   1         // IE=0xff;          //开所有中断
 127   1      //      IP=0x10;
 128   1      
 129   1      #endif
 130   1      
 131   1      
 132   1              /*------------------------------------------------
 133   1              Note that an embedded program never exits (because
 134   1              there is no operating system to return to).  It
 135   1              must loop and execute forever.
 136   1              ------------------------------------------------*/
 137   1                      
 138   1      
 139   1              //
 140   1              TMOD =0x00;
 141   1              TH1=0;
 142   1              TL1=0;
 143   1              IE1=1;
 144   1      //
 145   1      //
 146   1              EA=1;
 147   1              ET1=1;
 148   1      //      
 149   1              TR1=1;
 150   1      
 151   1      
 152   1      
 153   1      //   TMOD =0x01;
 154   1      //   TH0=0x0;
 155   1      //   TL0=0x0;
 156   1      //   EA=1;
 157   1      //   ET0=1;
 158   1      //   TR0=1;
 159   1      
 160   1              //设置
 161   1              K1=1;
 162   1              K2=1;
 163   1              LED =1; 
 164   1      //      delay(1);
 165   1      
 166   1      
 167   1              for(;;)
 168   1              {
 169   2                delay(1);
 170   2              }
 171   1      
 172   1      
 173   1      
 174   1              
 175   1      }
*** WARNING C280 IN LINE 110 OF HELLO.C: 'i': unreferenced local variable


MODULE INFORMATION:   STATIC OVERLAYABLE
C51 COMPILER V8.02   HELLO                                                                 03/04/2006 22:09:04 PAGE 4   

   CODE SIZE        =     90    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      1       2
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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