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

📄 dod.lst

📁 本人学习51单片机时写的一些程序
💻 LST
字号:
C51 COMPILER V6.12  DOD                                                                    05/08/2008 14:36:36 PAGE 1   


C51 COMPILER V6.12, COMPILATION OF MODULE DOD
OBJECT MODULE PLACED IN .\dod.OBJ
COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE .\dod.c DEBUG OBJECTEXTEND

stmt level    source

   1          //#pragma src
   2          #include<reg52.h>
   3          #include<absacc.h>
   4          //#include <asm.h>
   5          
   6          //#pragma OT(4,speed)
   7          //#include<float.h>
   8          
   9          #define uint unsigned int
  10          #define uchar unsigned char
  11          #define usv=0.34 //um/us
  12          
  13          sbit USOut=P1^0;//us=ultrasonic
  14          sbit USIn=P3^3;
  15          sbit dula=P2^6;
  16          sbit wela=P2^7;
  17          
  18          int a;
  19          
  20          uchar USBuffer=0,Byturns=1,T1times=0,T0times=0,th,tl,tt=0;
  21          uchar i,j,k,qian_c,bai_c,shi_c,ge_c;
  22          uint s=0,ss;
  23          
  24          uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,    //数码管编码
  25                                  0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
  26          extern void send(void);
  27          
  28          
  29          void delay(uchar i)
  30          {
  31   1        for(j=i;j>0;j--)
  32   1          for(k=125;k>0;k--);
  33   1      }
  34          
  35          void display(uchar qian_c,uchar bai_c,uchar shi_c,uchar ge_c)
  36          {
  37   1      	//P0=0xff;
  38   1      	
  39   1      	dula=0;
  40   1      	P0=table[qian_c];
  41   1      	dula=1;
  42   1      	dula=0;
  43   1      	//P0=0xff;  
  44   1      	wela=0;
  45   1      	P0=0xfe;
  46   1      	wela=1;
  47   1      	wela=0;
  48   1      	delay(3);
  49   1      	 
  50   1      	dula=0;
  51   1      	P0=table[bai_c];
  52   1      	dula=1;
  53   1      	dula=0;
  54   1      	 //P0=0xff; 
  55   1      	wela=0;
C51 COMPILER V6.12  DOD                                                                    05/08/2008 14:36:36 PAGE 2   

  56   1      	P0=0xfd;
  57   1      	wela=1;
  58   1      	wela=0;
  59   1      	delay(3);
  60   1      
  61   1      
  62   1        
  63   1      	dula=0;
  64   1      	P0=table[shi_c];
  65   1      	dula=1;
  66   1      	dula=0;  
  67   1      //P0=0xff; 
  68   1      	wela=0;
  69   1      	P0=0xfb;
  70   1      	wela=1;
  71   1      	wela=0;
  72   1      	delay(3);	
  73   1      
  74   1      	dula=0;
  75   1      	P0=table[ge_c];
  76   1      	dula=1;
  77   1      	dula=0; 
  78   1      //P0=0xff; 
  79   1      	wela=0;
  80   1      	P0=0xf7;
  81   1      	wela=1;
  82   1      	wela=0;
  83   1      
  84   1      	  
  85   1      	delay(3);	
  86   1      
  87   1      }
  88          
  89          void send(void);
  90          
  91          void main(void)//主函数
  92          {
  93   1      	dula=0;	
  94   1      	delayus();
*** WARNING C206 IN LINE 94 OF .\DOD.C: 'delayus': missing function-prototype
  95   1      	wela=0;
  96   1      	EA=1;
  97   1      	IT0=1;
  98   1      	//ET0=1;
  99   1      	ET1=1;
 100   1      	EX1=1;
 101   1      	TMOD=0x10;
 102   1      	TH1=0x3C;
 103   1      	TL1=0xB0;
 104   1      	//TH0=0xFF;//13us
 105   1      	//TL0=0xF3;
 106   1      	USOut=1;
 107   1      	USIn=1;
 108   1      	TR1=1;
 109   1      	TR0=1;
 110   1      	for(;;)
 111   1      	{
 112   2      		//SOut=1;
 113   2      	//USIn=1;
 114   2      			display(qian_c,bai_c,shi_c,ge_c);
 115   2      	if(tt)
 116   2      		{	
C51 COMPILER V6.12  DOD                                                                    05/08/2008 14:36:36 PAGE 3   

 117   3      
 118   3      			send: 
 119   3                nop
 120   3      			tt=0;
*** ERROR C202 IN LINE 120 OF .\DOD.C: 'nop': undefined identifier
*** ERROR C141 IN LINE 120 OF .\DOD.C: syntax error near 'tt'
 121   3      
 122   3      		}
 123   2      		
 124   2      
 125   2      
 126   2      	}
 127   1      }
 128          
 129          
 130          /*void timer0(void) interrupt 1 using 1
 131          {
 132          	TH0=0xFF;
 133          	TL0=0xF3;
 134          	USOut=!USOut;
 135          	Byturns=!Byturns;
 136          	T0times++;
 137          	if(T0times>=10)
 138          		{
 139          			//T0times=0;
 140          			TR0=0;//关闭定时器0	
 141          			ET0=0;
 142          			//USOut=!USOut;
 143          		}
 144          }
 145          */
 146          void timer1(void) interrupt 3 //using 2
 147          {
 148   1      	TH1=0x3C;
 149   1      	TL1=0xB0;
 150   1      	T1times++;
 151   1      	if(T1times>=20)
 152   1      	{
 153   2      		T1times=0;
 154   2      	// T0times=0;
 155   2      		TR0=1;
 156   2      		ET0=1;
 157   2      		tt=1;
 158   2      	}
 159   1      	//display(15,15,15,15);
 160   1      }
 161          
 162          void intsvr1(void) interrupt 2 //using 3
 163          {	
 164   1      	th=TH1-0x3C;
 165   1      	tl=TL1-0xB0;
 166   1      	//a=1;
 167   1      	tt=1; 
 168   1      	s=(th*256+tl);//mm
 169   1      	s=s*usv/2;
 170   1      //	s=8694;
 171   1      	qian_c=s/1000;
 172   1      	bai_c=s%1000/100;
 173   1      	shi_c=s%100/10;
 174   1      	ge_c=s%10;
 175   1      	EX1=0;
 176   1      }
C51 COMPILER V6.12  DOD                                                                    05/08/2008 14:36:36 PAGE 4   


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

⌨️ 快捷键说明

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