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

📄 print.lst

📁 这是一称的项目原文件,包括T9汉字输入,打印机,24C512,已经引用到产品上
💻 LST
📖 第 1 页 / 共 2 页
字号:
 201   1              SendData(save_type_buffer.gewei);
 202   1              SendData(save_pizhong_buffer.baiwanwei);
 203   1              SendData(save_pizhong_buffer.shiwanwei);
 204   1              SendData(save_pizhong_buffer.wanwei);
 205   1          SendData(save_pizhong_buffer.qianwei);
 206   1              SendData(save_pizhong_buffer.baiwei);
 207   1              SendData(save_pizhong_buffer.shiwei);
 208   1              SendData(save_pizhong_buffer.gewei);
 209   1              SendData(0x0a);      //换行
 210   1      
 211   1      }
 212          
 213          void dayin_leibie(BYTE p_data)          //打印类别
 214          {
 215   1         BYTE tem_1,tem_2;
 216   1              
 217   1         hanzi_fanxiang();
 218   1         tem_1 = p_data / 100;
 219   1         tem_2 = p_data - tem_1 * 100;
 220   1         save_type_buffer.baiwei = 0x30 + tem_1;
 221   1         save_type_buffer.shiwei = 0x30 + tem_2/10;
 222   1         save_type_buffer.gewei  = 0x30 + (p_data - tem_1 * 100 - (tem_2/10) * 10);    
 223   1      
 224   1              SendData(0xc0);     //类
 225   1              SendData(0xe0);
 226   1              SendData(0xb1);     //别
 227   1              SendData(0xf0);
 228   1              SendData(0x3a);     //:
 229   1              SendData(save_type_buffer.baiwei);
 230   1              SendData(save_type_buffer.shiwei);
 231   1              SendData(save_type_buffer.gewei);
 232   1              SendData(0x0a);     //换行
 233   1      
 234   1      }
 235          void hanzi_fanxiang(void)   //汉字,16*16,反向
 236          {
 237   1              SendData(0x1c);
 238   1              SendData(0x26);
 239   1              SendData(0x1c);
 240   1              SendData(0x69);
C51 COMPILER V7.08   PRINT                                                                 03/05/2007 16:38:08 PAGE 5   

 241   1              SendData(0x00); 
 242   1              SendData(0x1b);
 243   1              SendData(0x63);
 244   1              SendData(0x00);
 245   1      }
 246          
 247          void huanhang_dayin(void)    //换行
 248          {
 249   1              SendData(0x0a);
 250   1      }
 251          
 252          void  dayin_yonghu()          //打印用户 
 253          {
 254   1         hanzi_fanxiang();
 255   1         SendData(0xd3);     //用
 256   1         SendData(0xc3);
 257   1         SendData(0xbb);     //户
 258   1         SendData(0xa7);
 259   1         SendData(0x3a);     //:
 260   1         cc256R(&rece_buf[0],0x08,0x0007); 
 261   1         Delay1(5000);
 262   1         SendData(rece_buf[0]);
 263   1         SendData(rece_buf[1]);
 264   1         SendData(rece_buf[2]);
 265   1         SendData(rece_buf[3]);
 266   1         SendData(rece_buf[4]);       
 267   1         SendData(rece_buf[5]);
 268   1         SendData(rece_buf[6]);
 269   1         SendData(rece_buf[7]);
 270   1         SendData(0x0a);        //换行
 271   1      
 272   1      }
 273          
 274          void dayin_xinxi(BYTE *sequence_num,BYTE *time,BYTE *weight)        //存储信息
 275          {
 276   1         
 277   1          long int  sequence_num_temp;
 278   1              long int  weight_temp ;               
 279   1        
 280   1              sequence_num_temp= (*sequence_num)*0x100 + *(sequence_num+1);
 281   1      
 282   1              weight_temp= (*weight)*0x1000000+(*(weight+1))*0x10000+(*(weight+2))*0x100+(*(weight+3));
 283   1      
 284   1              set_pizhong_num_address_bydata(sequence_num_temp) ;
 285   1         
 286   1         if(save_pizhong_buffer.wanwei==0x20)  save_pizhong_buffer.wanwei=0x30;
 287   1         if(save_pizhong_buffer.qianwei==0x20)  save_pizhong_buffer.qianwei=0x30;
 288   1         if(save_pizhong_buffer.baiwei==0x20)  save_pizhong_buffer.baiwei=0x30;
 289   1         if(save_pizhong_buffer.shiwei==0x20)  save_pizhong_buffer.shiwei=0x30;
 290   1       
 291   1              //SendData(save_pizhong_buffer.wanwei);    //屏蔽以后,打印的序号为3位数
 292   1          //SendData(save_pizhong_buffer.qianwei);
 293   1              SendData(save_pizhong_buffer.baiwei);
 294   1              SendData(save_pizhong_buffer.shiwei);
 295   1              SendData(save_pizhong_buffer.gewei);
 296   1      
 297   1              dayin_shijian(time);
 298   1      
 299   1              set_pizhong_num_address_bydata(weight_temp) ;
 300   1              SendData(save_pizhong_buffer.shiwanwei);
 301   1              SendData(save_pizhong_buffer.wanwei);
 302   1              SendData(save_pizhong_buffer.qianwei);
C51 COMPILER V7.08   PRINT                                                                 03/05/2007 16:38:08 PAGE 6   

 303   1              SendData(save_pizhong_buffer.baiwei);
 304   1              SendData(save_pizhong_buffer.shiwei);
 305   1              SendData(save_pizhong_buffer.gewei);
 306   1      
 307   1              SendData(0x0a);        //换行
 308   1      }
 309          
 310          void dayin_riqi(void)           //打印日期
 311          {
 312   1              hanzi_fanxiang();
 313   1              SendData(0xc8);    //日
 314   1              SendData(0xd5);
 315   1              SendData(0xc6);    //期
 316   1              SendData(0xda);
 317   1              SendData(0x3a);    //:
 318   1              
 319   1              Get_1302(&data_to_1302);
 320   1          get_date_from_1302_data(&data_to_1302);
 321   1              SendData(0x32);    //2
 322   1              SendData(0x30);    //0
 323   1              SendData(year_buffer.shiwei);
 324   1              SendData(year_buffer.gewei);
 325   1              SendData(0x2e);     //.
 326   1              SendData(month_buffer.shiwei);
 327   1              SendData(month_buffer.gewei);
 328   1              SendData(0x2e);     //.
 329   1              SendData(day_buffer.shiwei);
 330   1              SendData(day_buffer.gewei);
 331   1          SendData(0x0a);     //换行
 332   1      }
 333          
 334          void delay(void)         //延时,主程序调用了                                
 335          { 
 336   1              unsigned char m,n,s; 
 337   1          for(m=20;m>0;m--)
 338   1          for(n=20;n>0;n--) 
 339   1          for(s=248;s>0;s--); 
 340   1      } 
 341          
 342          void dayin_huizong(void)         //打印汇总
 343          {
 344   1          WORD i,n;
 345   1              WORD  num=0;
 346   1              long int all_leibie_weight=0;
 347   1              long int weight_temp=0;
 348   1          dayin_biaotou();             //表头1
 349   1              dayin_yonghu();              //用户
 350   1              dayin_riqi();                //日期
 351   1              dayin_leibie(save_current_type);
 352   1      
 353   1              for(i=save_current_num;i<=save_current_num;i--)  
 354   1               { 
 355   2                        n=(i-1)*0x0c+0x0010+0x0002;
 356   2                cc256R(&rece_buf[2] , 0x01, n);
 357   2                        Delay1(5000);
 358   2                        if(rece_buf[2]==save_current_type)
 359   2                      {
 360   3                                      num++;
 361   3                                      Delay1(5000);
 362   3                              }
 363   2                        if(i==1)  i=0;
 364   2               }
C51 COMPILER V7.08   PRINT                                                                 03/05/2007 16:38:08 PAGE 7   

 365   1               dayin_zongci(num);             //打印总次
 366   1               dayin_xuhao();                 //序号(表头2)
 367   1           for(i=save_current_num;i<=save_current_num;i--)  
 368   1           {
 369   2            rece_buf[0]=i>>8;
 370   2                rece_buf[1]=i;
 371   2            n=(i-1)*0x0c+0x0010+0x0002;
 372   2      
 373   2            cc256R(&rece_buf[2] , 0x01, n);
 374   2                Delay1(5000);
 375   2                if(rece_buf[2]==save_current_type)
 376   2                  {
 377   3                  cc256R(&rece_buf[2] , 0x06, n+4);
 378   3                      Delay1(5000);
 379   3                      weight_temp=rece_buf[4]*0x1000000+rece_buf[5]*0x10000+ rece_buf[6]*0x100+rece_buf[7]; 
 380   3                      all_leibie_weight+=weight_temp;
 381   3                      Delay1(5000);
 382   3                      dayin_xinxi(&rece_buf[0],&rece_buf[2],&rece_buf[4]); 
 383   3                      Delay1(5000);
 384   3                      }
 385   2                else continue;
 386   2                if(i==1)  i=0;
 387   2           } 
 388   1      
 389   1          dayin_zongzhong(all_leibie_weight);
 390   1               Delay1(5000);
 391   1      
 392   1              dayin_biaowei();
 393   1      }
 394          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   2117    ----
   CONSTANT SIZE    =     64    ----
   XDATA SIZE       =   ----      54
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =     94    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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