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

📄 main.lst

📁 89C51单片机驱动扬声器播放音乐的程序
💻 LST
字号:
C51 COMPILER V8.02   MAIN                                                                  12/19/2008 09:44:09 PAGE 1   


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

line level    source

   1          #include <REG52.H> 
   2          void delay(unsigned char n);     
   3                  code unsigned song[]={0xf0,0xf0,0xf8,0x8b,0xf9,0x5b,0xfa,0x14,0xfa, 
   4                  0x0c,0xfb,0x03,0xfb,0x8f,0xfc,0x0b,0xfc,0x43,0xfc,0xab,0xfd, 
   5                  0x08,0xfd,0x33,0xfd,0x81,0xfd,0xc7,0xfe,0x05,0xfe,0x32,0xfe, 
   6                  0x55,0xfe,0x84,0xfe,0x99,0xfe,0xc0,0xfe,0xe3,0xff}; 
   7          
   8          
   9          code int note[]={ 
  10                  0x0000,0xFB03,0xFB8E,0xFC0B,0xFC43,0xFCAB,0xFD08,0xFD32, 
  11                                                    
  12                  0xFD81,0xFDC7,0xFE05,0xFE21,0xFE55,0xFE83,0xFE99,0xFEC0}; 
  13                  unsigned char i=0; 
  14                  unsigned char hi_note,low_note; 
  15                  static void timer1_isr(void) interrupt TF1_VECTOR using 2 
*** ERROR C141 IN LINE 15 OF MAIN.C: syntax error near 'TF1_VECTOR', expected 'const'
*** ERROR C132 IN LINE 15 OF MAIN.C: 'TF1_VECTOR': not in formal parameter list
*** ERROR C141 IN LINE 15 OF MAIN.C: syntax error near 'using'
  16                  { 
  17                     TR1=0; 
*** ERROR C244 IN LINE 17 OF MAIN.C: 'TR1': can't initialize, bad type or class
*** ERROR C132 IN LINE 17 OF MAIN.C: 'TR1': not in formal parameter list
  18                     TL1=low_note; 
*** ERROR C244 IN LINE 18 OF MAIN.C: 'TL1': can't initialize, bad type or class
*** ERROR C132 IN LINE 18 OF MAIN.C: 'TL1': not in formal parameter list
  19                     TH1=hi_note; 
*** ERROR C244 IN LINE 19 OF MAIN.C: 'TH1': can't initialize, bad type or class
*** ERROR C132 IN LINE 19 OF MAIN.C: 'TH1': not in formal parameter list
  20                     TR1=1; 
*** ERROR C244 IN LINE 20 OF MAIN.C: 'TR1': can't initialize, bad type or class
*** ERROR C132 IN LINE 20 OF MAIN.C: 'TR1': not in formal parameter list
  21                     P3_7=~P3_7; 
*** ERROR C244 IN LINE 21 OF MAIN.C: 'P3_7': can't initialize, bad type or class
*** ERROR C202 IN LINE 21 OF MAIN.C: 'P3_7': undefined identifier
*** ERROR C132 IN LINE 21 OF MAIN.C: 'P3_7': not in formal parameter list
  22                  }                
*** ERROR C141 IN LINE 22 OF MAIN.C: syntax error near '}'
  23          static void timer1_initialize(void) 
  24                  { 
  25   1                 EA=0; 
  26   1                 TR1=0; 
  27   1                 TMOD = 0X10; 
  28   1                 ET1=1; 
  29   1                 EA=1; 
  30   1              } 
  31          void singing() 
  32          { 
  33   1         unsigned char beat,temp; 
  34   1         i=0; 
  35   1         do { 
  36   2             temp=song[i];               
  37   2      
  38   2             if (temp==0) {             
  39   3      
  40   3                 TR1=0;                 
C51 COMPILER V8.02   MAIN                                                                  12/19/2008 09:44:09 PAGE 2   

  41   3                 return;                 
  42   3             } 
  43   2             beat=temp & 0x0f;           
  44   2      
  45   2             temp=(temp >> 4) & 0x0f;   
  46   2             if (temp==0) TR1=0;       
  47   2             else { 
  48   3              hi_note=note[temp] >> 8;   
  49   3                 low_note=note[temp] & 0x00FF; 
  50   3                    TR1=1;              
  51   3             } 
  52   2             delay(beat);                      
  53   2      i++; 
  54   2         } while(1);  
  55   1      }     
  56          void main (void)  { 
  57   1         timer1_initialize(); 
  58   1         do { 
  59   2              singing(); 
  60   2         } while (1);                  } 
  61          

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

⌨️ 快捷键说明

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