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

📄 irshou.lst

📁 音乐控制程序
💻 LST
字号:
C51 COMPILER V7.06   IRSHOU                                                                03/25/2008 10:07:46 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE IRSHOU
OBJECT MODULE PLACED IN irshou.OBJ
COMPILER INVOKED BY: D:\KIEL C\C51\BIN\C51.EXE irshou.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          #include<AT89x55.H> 
   2          #include <stdio.h>
   3          #include <INTRINS.H> 
   4          //#include  "Uart.h"
   5          #define uint  unsigned int
   6          #define uchar unsigned char
   7          sbit ir=P1^6;
   8          sbit out=P1^7;
   9          uchar irdata[4];
  10          uchar *irdat;
  11          uint count;
  12          uchar count1,count2;
  13          uchar t;
  14          bit    flag,flag1,flag0;
  15          //*********************************
  16          //t*2us   4.5ms  equ 561   9ms equ 1124  0.56ms equ 69 
  17          //*********************************
  18          void delay(uint t)
  19               { while(--t);
  20   1               }
  21          //*********************************
  22          //
  23          //*********************************
  24          
  25          uchar irshou()
  26          { //uchar data1,BitCnt,i;
  27   1        
  28   1        while(ir==0)
  29   1                 {   count++;
  30   2                     if(count>250)
  31   2                  {flag=1;
  32   3                   }
  33   2                        if(flag==1)
  34   2                {
  35   3                // out=0;
  36   3                         flag=0;
  37   3                 t=33;
  38   3                         while(--t)
  39   3                         {   //1
  40   4                     while(ir==1)
  41   4                         {count1++;
  42   5                             if(count1<50)
  43   5                      {flag1=1;
  44   6                       }
  45   5                              if(flag1==1)
  46   5                     {
  47   6                      //out=0;
  48   6                             flag1=0;
  49   6                     }
  50   5                                 }
  51   4                                 //0
  52   4                                  while(ir==0)
  53   4                         {count2++;
  54   5                             if(count2<50)
  55   5                      {flag0=1;
C51 COMPILER V7.06   IRSHOU                                                                03/25/2008 10:07:46 PAGE 2   

  56   6                       }
  57   5                              if(flag0==1)
  58   5                     {
  59   6                      out=0;
  60   6                             flag0=0;
  61   6                     }
  62   5                                 }
  63   4                                 count1=0;
  64   4                                 count2=0;
  65   4                                 out=1;
  66   4      
  67   4                                 //return(0);
  68   4                         }
  69   3                 }
  70   2                 }
  71   1         return 0; 
  72   1      }
  73          
  74          
  75          void uart_init()
  76          {
  77   1      
  78   1         SCON  = 0xDA;        // SCON: mode 1, 8-bit UART, enable rcvr      */
  79   1         TMOD |= 0x20;        // TMOD: timer 1, mode 2, 8-bit reload        */
  80   1         TH1   = 0xFD;         // TH1:  reload value for 1200 baud @ 12MHz   */
  81   1         TR1   = 1;           // TR1:  timer 1 run                          */
  82   1         TI    = 1;           // TI:   set TI to send first char of UART    */
  83   1         
  84   1      }
  85          
  86          void send(unsigned char ch)
  87             {SBUF=ch;
  88   1          while(TI==0);
  89   1          TI=0;
  90   1          }
  91          uchar irdatout(uchar *data1)
  92               { uchar i;
  93   1                 for(i=0;i<4;i++) //共4个字节
  94   1                      {
  95   2                              *data1=i;//clear data first
  96   2                              *data1<<=1;
  97   2                              P2=*data1;
  98   2                              delay(20000);
  99   2                              data1++;
 100   2                              //P3=*data1;
 101   2      
 102   2                      }
 103   1                      }
*** WARNING C173 IN LINE 103 OF IRSHOU.C: missing return-expression
 104          
 105          void main()
 106          {  // uint count;
 107   1         // uchar count1=0,count2=0;
 108   1          //irdat=0x01;
 109   1          //*irdat=&irdata[4];
 110   1         // uart_init();
 111   1          unsigned char i;
 112   1         // flag=1;
 113   1         //send('0'+count);
 114   1             
 115   1              while(1)
 116   1              { 
C51 COMPILER V7.06   IRSHOU                                                                03/25/2008 10:07:46 PAGE 3   

 117   2             
 118   2              ///     out=0;  
 119   2                 irdatout(&irdata);
 120   2                 P3=irdata[3];
 121   2                // count=0;
 122   2           // irshou();
 123   2           
 124   2                // count1=count/10;
 125   2                 //count2=count%10;
 126   2                // send('0'+count1);
 127   2                // send('0'+count2);
 128   2                // send('\n');
 129   2               // count=0; 
 130   2               //  out=1;
 131   2               //  delay(10000);
 132   2                //if(count1
 133   2                 //P2=count1;
 134   2                 //ComOutChar(count1);
 135   2                //irf(irdat);
 136   2                //data2<<1;
 137   2                //P2=data2;
 138   2                //out=1;
 139   2               
 140   2               }
 141   1      }
*** WARNING C280 IN LINE 111 OF IRSHOU.C: 'i': unreferenced local variable
 142          
 143          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    204    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     12       4
   IDATA SIZE       =   ----    ----
   BIT SIZE         =      3    ----
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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