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

📄 yibiao1.lst

📁 这是我在我们公司做的C51加油单片机程序
💻 LST
📖 第 1 页 / 共 5 页
字号:
1000   1              xscs1();
1001   1      	write_control(0xb8+hang);
1002   1      	for(lie=0;lie<64;lie++)
1003   1      	{
1004   2      		write_control(0x40+lie);
1005   2      		write_data(0);
1006   2      	}
1007   1              xscs2();
1008   1              write_control(0xb8+hang);
1009   1      	for(lie=0;lie<64;lie++)
1010   1      	{
1011   2      		write_control(0x40+lie);
1012   2      		write_data(0);
1013   2      	}
1014   1      
1015   1      }
1016          void xs_zi(unsigned char hh,unsigned char ll,uint p)
1017          {
1018   1      	unsigned char idata i;
1019   1              unsigned char idata buf;
1020   1              uint idata temp;
1021   1              unsigned char disp_suf[32];
1022   1              temp=dw_zk(p);
1023   1              for(i=0;i<32;i++)
1024   1              {
1025   2                  ZK_CS=0;
1026   2                  buf=XBYTE[temp+i];
1027   2                  ZK_CS=1;
1028   2                  disp_suf[i]=buf;
1029   2                  dlu();
1030   2              }
1031   1              ZK_CS=1;
C51 COMPILER V6.02  YIBIAO1                                                                06/21/2002 13:04:11 PAGE 18  

1032   1              xscs1();
1033   1      	for(i=0;i<16;i++)
1034   1      	{
1035   2      		if ((ll+i)>63)
1036   2      		{
1037   3      			xscs2();
1038   3      			write_control(0xb8+hh);
1039   3      			write_control(0x40+ll+i-64);
1040   3      		}
1041   2      		else
1042   2      		{
1043   3      			xscs1();
1044   3      			write_control(0xb8+hh);
1045   3      			write_control(0x40+ll+i);
1046   3      		}
1047   2      		write_data(disp_suf[i]);
1048   2      		//p++;
1049   2      	}
1050   1      
1051   1      	for(i=0;i<16;i++)
1052   1      	{
1053   2      		if ((ll+i)>63)
1054   2      		{
1055   3      			xscs2();
1056   3      			write_control(0xb8+hh+1);
1057   3      			write_control(0x40+ll+i-64);
1058   3      		}
1059   2      		else
1060   2      		{
1061   3      			xscs1();
1062   3      			write_control(0xb8+hh+1);
1063   3      			write_control(0x40+ll+i);
1064   3      		}
1065   2      		write_data(disp_suf[i+16]);
1066   2      	//	p++;
1067   2      	}
1068   1      
1069   1      }
1070          void xscs1()
1071          {
1072   1              CS1=1;
1073   1              CS2=0;
1074   1      }
1075          void xscs2()
1076          {
1077   1              CS1=0;
1078   1              CS2=1;
1079   1      }
1080           void dlu()
1081          {
1082   1      	_nop_();
1083   1      	_nop_();
1084   1      	_nop_();
1085   1      	_nop_();
1086   1      }
1087          void key_dlu()
1088          {
1089   1              uint k;
1090   1              for(k=0;k<2400;k++);
1091   1      }
1092          void xs_hhz(unsigned char hh,unsigned char ll, uint *p)
1093          {
C51 COMPILER V6.02  YIBIAO1                                                                06/21/2002 13:04:11 PAGE 19  

1094   1              unsigned char i;
1095   1              for(i=0;*(p+i)!=0;i++)
1096   1                      if (*(p+i)!=0xffff)
1097   1                         xs_zi(hh,ll+i*16,*(p+i));
1098   1      }
1099          bit strcomp(unsigned char *p1,unsigned char *p2,unsigned char num)
1100          {
1101   1              unsigned char i;
1102   1              for(i=0;i<num;i++)
1103   1              {
1104   2                      if ((*(p1+i))!=(*(p2+i)))
1105   2                         return 0;
1106   2              }
1107   1              return 1;
1108   1      }
1109          void astobcd(unsigned char n)
1110          {
1111   1            char l,temp;
1112   1            if (n==1) return;
1113   1            for(l=key_buf_p;l<6;l++)
1114   1            key_buf[l]=0x00;
1115   1            for(l=0;l<n;l+=2)
1116   1            {
1117   2                  temp=key_buf[l]<<4;
1118   2                  temp=temp|key_buf[l+1];
1119   2                  key_buf[l/2]=temp;
1120   2            }
1121   1      }
1122          void jezh1()
1123          {
1124   1            union{
1125   1                  ulong da;
1126   1                  unsigned char aa[4];
1127   1              }xdata jes;
1128   1              ulong xdata temp;
1129   1              unsigned char xdata i=0,g=0;
1130   1              huakuang(4,7,0);
1131   1              jes.aa[0]=balance[0];
1132   1              jes.aa[1]=balance[1];
1133   1              jes.aa[2]=balance[2];
1134   1              jes.aa[3]=balance[3];
1135   1              temp=jes.da/1000000000;
1136   1              if (temp!=0)
1137   1              {
1138   2                      xs_shu(4,3*8,yi_1+(temp*8));
1139   2                      i++;
1140   2              }
1141   1              jes.da=jes.da-temp*1000000000;
1142   1              temp=jes.da/100000000;
1143   1              if ((temp!=0)||(i!=0))
1144   1              {
1145   2                      xs_shu(4,4*8,yi_1+(temp*8));
1146   2                      i++;
1147   2              }
1148   1              jes.da=jes.da-temp*100000000;
1149   1              temp=jes.da/10000000;
1150   1              if ((temp!=0)||(i!=0))
1151   1              {
1152   2                      xs_shu(4,5*8,yi_1+(temp*8));
1153   2                      i++;
1154   2              }
1155   1              jes.da=jes.da-temp*10000000;
C51 COMPILER V6.02  YIBIAO1                                                                06/21/2002 13:04:11 PAGE 20  

1156   1              temp=jes.da/1000000;
1157   1              if ((temp!=0)||(i!=0))
1158   1              {
1159   2                      xs_shu(4,6*8,yi_1+(temp*8));
1160   2                      i++;
1161   2              }
1162   1              jes.da=jes.da-temp*1000000;
1163   1              temp=jes.da/100000;
1164   1              if ((temp!=0)||(i!=0))
1165   1              {
1166   2                      xs_shu(4,7*8,yi_1+(temp*8));
1167   2                      i++;
1168   2              }
1169   1              jes.da=jes.da-temp*100000;
1170   1              temp=jes.da/10000;
1171   1              if ((temp!=0)||(i!=0))
1172   1              {
1173   2                      xs_shu(4,8*8,yi_1+(temp*8));
1174   2                      i++;
1175   2              }
1176   1              jes.da=jes.da-temp*10000;
1177   1              temp=jes.da/1000;
1178   1              if ((temp!=0)||(i!=0))
1179   1              {
1180   2                      xs_shu(4,9*8,yi_1+(temp*8));
1181   2                      i++;
1182   2              }
1183   1              jes.da=jes.da-temp*1000;
1184   1              temp=jes.da/100;
1185   1              if ((temp!=0)||(i!=0))
1186   1              {
1187   2                      xs_shu(4,10*8,yi_1+(temp*8));
1188   2                      i++;
1189   2              }
1190   1              if (i==0)
1191   1              {
1192   2                   g=1;
1193   2                   xs_shu(4,10*8,yi_1);
1194   2      
1195   2              }
1196   1              xs_shu(4,11*8,yi_1+(11*8));
1197   1              i++;
1198   1              jes.da=jes.da-temp*100;
1199   1              temp=jes.da/10;
1200   1              if ((temp!=0)||(i!=0))
1201   1              {
1202   2                      xs_shu(4,12*8,yi_1+(temp*8));
1203   2                      i++;
1204   2              }
1205   1              temp=jes.da-temp*10;
1206   1              if ((temp!=0)||(i!=0))
1207   1              {
1208   2                      xs_shu(4,13*8,yi_1+(temp*8));
1209   2                      i++;
1210   2              }
1211   1      }
1212          void xs_key_buf(unsigned char num)
1213          {
1214   1              unsigned char i;
1215   1              for(i=0;i<num;i++)
1216   1              {
1217   2                      if (key_buf[i]==0x0f)
C51 COMPILER V6.02  YIBIAO1                                                                06/21/2002 13:04:11 PAGE 21  

1218   2                          xs_shu(4,112-(num-i)*8,yi_1+11*8);
1219   2                      else
1220   2                          xs_shu(4,112-(num-i)*8,yi_1+key_buf[i]*8);
1221   2              }
1222   1      }
1223          void gettime()
1224          {
1225   1      	unsigned char i;
1226   1              TIME_CLK=0;
1227   1              dlu();
1228   1              TIME_WR=0;
1229   1              dlu();
1230   1              TIME_CE=1;
1231   1              dlu();
1232   1      	second=0;
1233   1      	minutes=0;
1234   1      	hour=0;
1235   1      	week=0;
1236   1      	day=0;
1237   1      	month=0;
1238   1      	year=0;
1239   1      /*读秒*/
1240   1      	for(i=0;i<8;i++)
1241   1      	{
1242   2      		second=second>>1;
1243   2      		dlu();
1244   2      		TIME_CLK=1;
1245   2      		dlu();
1246   2      		if(TIME_SDA) second=second|0x80;
1247   2      		TIME_CLK=0;
1248   2      		//dlu();
1249   2      	}
1250   1      
1251   1      /*读分*/
1252   1      	for(i=0;i<

⌨️ 快捷键说明

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