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

📄 disp_b.lst

📁 进行单片机与LCD的接口通讯与显示。使用清华的液晶。
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V6.02  DISP_B                                                                 08/26/2003 20:34:18 PAGE 1   


C51 COMPILER V6.02, COMPILATION OF MODULE DISP_B
OBJECT MODULE PLACED IN D:\LCD_6963\LCD2\DISP_B.OBJ
COMPILER INVOKED BY: C:\COMP51\C51.EXE D:\LCD_6963\LCD2\DISP_B.C DB SB OE

stmt level    source

   1          #include <reg51.h>
   2          #include <math.h>
   3          #include <absacc.h>
   4          #include <string.h>
   5          
   6          #define uchar unsigned char
   7          #define uint unsigned int
   8          
   9          //extern void CCW_PR();
  10          extern void CW2_PR();
  11          extern void CW2_PR_F();
  12          extern O_X,O_Y,code_1;
  13          
  14          uchar dispint(uchar position1,uchar position2,int value)
  15          			  /*用于显示整数(包括负数),第一参数为显示位置(最后一位).
  16          				 用到dispch函数.
  17          				 显示整数前不显示空格*/
  18            {	uchar temp,is_neg=0;
  19   1             	if (value<0)
  20   1      	  {
  21   2      		value=-value;
  22   2      		is_neg=1;
  23   2      	  }
  24   1      	do
  25   1      	  {     O_X=position1;
  26   2                      O_Y=position2;
  27   2      		temp=value%10;
  28   2                      code_1=temp+16;
  29   2             		CW2_PR();
  30   2      		position1=position1-1;
  31   2      		value=(value-temp)/10;
  32   2      	  }
  33   1      	while (value);
  34   1      	if (is_neg)
  35   1      	  {
  36   2                      O_X=position1;
  37   2                      O_Y=position2;
  38   2      		code_1='-'-0x20;
  39   2      		CW2_PR();
  40   2      		position1=position1-1;
  41   2      	  }
  42   1      	return(position1);
  43   1        }
  44          
  45          uchar dispint_f(uchar position1,uchar position2,int value)
  46          			  /*用于显示整数(包括负数),第一参数为显示位置(最后一位).
  47          				 用到dispch函数.
  48          				 显示整数前不显示空格*/
  49            {	uchar temp,is_neg=0;
  50   1             	if (value<0)
  51   1      	  {
  52   2      		value=-value;
  53   2      		is_neg=1;
  54   2      	  }
  55   1      	do
C51 COMPILER V6.02  DISP_B                                                                 08/26/2003 20:34:18 PAGE 2   

  56   1      	  {     O_X=position1;
  57   2                      O_Y=position2;
  58   2      		temp=value%10;
  59   2                      code_1=temp+16;
  60   2             		CW2_PR_F();
  61   2      		position1=position1-1;
  62   2      		value=(value-temp)/10;
  63   2      	  }
  64   1      	while (value);
  65   1      	if (is_neg)
  66   1      	  {
  67   2                      O_X=position1;
  68   2                      O_Y=position2;
  69   2      		code_1='-'-0x20;
  70   2      		CW2_PR_F();
  71   2      		position1=position1-1;
  72   2      	  }
  73   1      	return(position1);
  74   1        }
  75          
  76          void dispf(uchar position1,uchar position2,float value,uchar preci)
  77           /*用于显示实数(包括负数),第一参数为显示位置(最后一位),
  78            第三参数为显示精度。用到dispch dispint函数.	显示实数前不显示空格*/
  79            {
  80   1      	int v1,v2;
  81   1      	uchar  i,cint,is_neg=0;
  82   1      	float idata temp;
  83   1      	if (value<0)
  84   1      	  {
  85   2      		value=-value;
  86   2      		is_neg=1;
  87   2      	  }
  88   1             	v1=(int)value;
  89   1      	temp=value-v1;
  90   1      	for (i=0;i<preci;i++)
  91   1      	  {
  92   2      		temp*=10;
  93   2                 /*     O_X=position1;
  94   2                      O_Y=position2;
  95   2      		code_1='0'-0x20;
  96   2      		CW_PR();
  97   2      		position1=position1-6;    */
  98   2      	  }
  99   1      	v2=(int)(temp+0.5);
 100   1      	dispint(position1,position2,v2);
 101   1              O_X=position1-preci*1;
 102   1              O_Y=position2;
 103   1      	code_1='.'-0x20;
 104   1      	CW2_PR();
 105   1      	position1=position1-1-preci*1;
 106   1      	position1=dispint(position1,position2,v1);
 107   1      	if (is_neg){
 108   2               O_X=position1;
 109   2               O_Y=position2;
 110   2      	 code_1='-'-0x20;
 111   2      	 CW2_PR();
 112   2             }
 113   1       }
*** WARNING C280 IN LINE 81 OF D:\LCD_6963\LCD2\DISP_B.C: 'cint': unreferenced local variable
 114          
 115          void dispf_f(uchar position1,uchar position2,float value,uchar preci)
 116           /*用于显示实数(包括负数),第一参数为显示位置(最后一位),
C51 COMPILER V6.02  DISP_B                                                                 08/26/2003 20:34:18 PAGE 3   

 117            第三参数为显示精度。用到dispch dispint函数.	显示实数前不显示空格*/
 118            {
 119   1      	int    v1,v2;
 120   1      	uchar  i,cint,is_neg=0;
 121   1      	float  temp;
 122   1      	if (value<0)
 123   1      	  {
 124   2      		value=-value;
 125   2      		is_neg=1;
 126   2      	  }
 127   1      	v1=(int)value;
 128   1      	temp=value-v1;
 129   1      	for (i=0;i<preci;i++)
 130   1      	  {
 131   2      		temp*=10;
 132   2                 /*     O_X=position1;
 133   2                      O_Y=position2;
 134   2      		code_1='0'-0x20;
 135   2      		CW_PR();
 136   2      		position1=position1-6;    */
 137   2      	  }
 138   1      	v2=(int)(temp+0.5);
 139   1      	dispint_f(position1,position2,v2);
 140   1              O_X=position1-preci*1;
 141   1              O_Y=position2;
 142   1      	code_1='.'-0x20;
 143   1      	CW2_PR_F();
 144   1      	position1=position1-1-preci*1;
 145   1      	position1=dispint_f(position1,position2,v1);
 146   1      	if (is_neg){
 147   2               O_X=position1;
 148   2               O_Y=position2;
 149   2      	 code_1='-'-0x20;
 150   2      	 CW2_PR_F();
 151   2             }
 152   1       }
*** WARNING C280 IN LINE 120 OF D:\LCD_6963\LCD2\DISP_B.C: 'cint': unreferenced local variable
 153          
 154          /*显示英文*/
 155          void dispes(uchar position1,uchar position2,uchar chanum,uchar* p)
 156            {
 157   1      	uchar idata i;
 158   1      	for(i=0;i<chanum;i++)
 159   1      	  {
 160   2      		position1=position1+1;
 161   2      		if(*(p+i)==0)code_1=0;
 162   2      		else code_1=*(p+i)-0x20;
 163   2                   //    code_1=0x37;
 164   2                      O_X=position1;
 165   2                      O_Y=position2;
 166   2      		CW2_PR();
 167   2      	  }
 168   1        }
 169          /*显示反白英文*/
 170          void dispes_f(uchar position1,uchar position2,uchar chanum,uchar* p)

⌨️ 快捷键说明

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