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

📄 remote.lst

📁 keilc51写的
💻 LST
字号:
C51 COMPILER V7.06   REMOTE                                                                05/12/2006 13:22:34 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE REMOTE
OBJECT MODULE PLACED IN remote.OBJ
COMPILER INVOKED BY: E:\MCU\Keil\C51\BIN\C51.EXE remote.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          /*串行通信/红外线解码显示程序
   2            广东工业大学自动化学院04级自动化3班   吴子洲
   3            版权所有,如要转载,请注明出处*/
   4          
   5          #define uchar unsigned char
   6          #define uint unsigned int
   7          #include <reg52.h>
   8          
   9          
  10          uchar code tir[]={              //IR table
  11          /*------0----1----2----3----4----5----6----7----8----9----a----b----c----d----e----f---*/
  12          /*0*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  13          /*1*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  14          /*2*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  15          /*3*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  16          /*4*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  17          /*5*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  18          /*6*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  19          /*7*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  20          /*8*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  21          /*9*/  0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  22          /*a*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  23          /*b*/  0x04,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x02,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  24          /*c*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  25          /*d*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  26          /*e*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  27          /*f*/  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  28          };
  29          
  30          uchar tt;               //infrared ray time couter
  31          uchar ret;              //char receive from serail port
  32          
  33          uchar st;               //infrared ray start
  34          uchar irc;              //ir counter
  35          uint su;        //ir resut
  36          uchar kir;
  37          
  38          void s_ini(void)                ///system initialization
  39          {tt=0;
  40   1      st=0;
  41   1      kir=0xff;
  42   1      IT1=1;                  //int1 falling cause interrupt
  43   1      TMOD=0x22;              //timer 1 and timer 0 all as auto reload timer
  44   1      IE=0x86;                //enale timer0 and int1 interrupt
  45   1      //IP=0x40;              //int1 interrupt as priority interrupt
  46   1      SCON=0x53;              //serial port mode=1;  enable to recive and receive and sent inteerupt
  47   1      TH1=0xFD;               //baund rate=9600bps
  48   1      TH1=0xFD;
  49   1      TH0=0x48;               //200us timer
  50   1      TL0=0x48;
  51   1      TR0=1;
  52   1      TR1=1;
  53   1      
  54   1      }
  55          
C51 COMPILER V7.06   REMOTE                                                                05/12/2006 13:22:34 PAGE 2   

  56          void main(void)
  57          {uchar ky;
  58   1       s_ini();
  59   1       while(1)
  60   1        {ky=kir;
  61   2         kir=0xff;
  62   2         if(ky==0x01)
  63   2           SBUF=0xE1;
  64   2         else if(ky==0x02)
  65   2           SBUF=0xE2;
  66   2         else if(ky==0x03)
  67   2           SBUF=0xE3;
  68   2         else if(ky==0x04)
  69   2           SBUF=0xE4;
  70   2        }
  71   1       } 
  72          
  73          void int1(void) interrupt 2             //interrupt int1 service
  74          {uchar tm;
  75   1       uchar t1,t2;
  76   1       tm=tt;
  77   1       tt=0;
  78   1       if(st==1)              
  79   1         {su*=2;
  80   2          irc++;
  81   2          if(irc>=16)
  82   2                 {if(tm>8)
  83   3                        su+=1;
  84   3                 }
  85   2          if(irc>=32)
  86   2           {t1=su/256;
  87   3                t2=su%256;
  88   3                irc=0;
  89   3                if(t1=~t2)
  90   3                  {t2=tir[t1];
  91   4                       kir=t2;
  92   4                       SBUF=t2;
  93   4                      }
  94   3                       else
  95   3                       kir=0xff;
  96   3          }
  97   2        }
  98   1       if(tm==0x43||tm==0x44)                 //start condition
  99   1         st=1,irc=0,su=0;
 100   1      }
 101          
 102          
 103          void timer0(void) interrupt 1  //interrupt timer0 service
 104          {tt++;
 105   1      }
 106          
 107          void com(void) interrupt 4  //serial port interrupt serice
 108          {if(RI==1)              //receive a char from serail port
 109   1       {ret=SBUF;
 110   2        RI=0;
 111   2       }
 112   1      else if(TI==1)          //had sent a char
 113   1       TI=0;
 114   1      }
 115          
 116          
 117          
C51 COMPILER V7.06   REMOTE                                                                05/12/2006 13:22:34 PAGE 3   

 118          


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