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

📄 dy.lst

📁 打印机控制程序
💻 LST
字号:
C51 COMPILER V7.20   DY                                                                    03/31/2005 12:32:51 PAGE 1   


C51 COMPILER V7.20, COMPILATION OF MODULE DY
OBJECT MODULE PLACED IN dy.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE dy.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include <reg52.h>
   2          #include"intrins.h"
   3          
   4          #define uchar unsigned char
   5          #define uint unsigned int
   6          
   7          sbit PRINT_BUSY = P1^1;
   8          
   9          
  10          uchar print_hzinit[4]={0x1b,0x56,0x01,0x00};
  11          //永泰和电子
  12          uchar code print_example[24][15]={
  13          0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 
  14          0x00,0x00,0x00, 0x00,0x20,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 
  15          0x00,0x38,0x00, 0x00,0x30,0x00, 0x00,0x30,0x00, 0x00,0x18,0x00, 0x00,0x00,0x10, 
  16          0x00,0x08,0x00, 0x00,0x20,0x10, 0x00,0xf0,0x00, 0x00,0x10,0x00, 0x0f,0xff,0xf0,
  17          0x00,0x08,0x00, 0x1f,0xff,0xf8, 0x1f,0x00,0x08, 0x00,0x10,0x00, 0x00,0x00,0x60,
  18          0x00,0x00,0x00, 0x00,0x20,0x00, 0x01,0x03,0xfc, 0x00,0x10,0x00, 0x00,0x00,0x80,
  19          0x00,0x08,0x00, 0x00,0x20,0x00, 0x01,0x02,0x08, 0x0f,0xff,0xf0, 0x00,0x01,0x00,
  20          0x03,0xf8,0x30, 0x0f,0xff,0xe0, 0x01,0x02,0x08, 0x08,0x10,0x20, 0x00,0x16,0x00,                           
             -                  
  21          0x00,0x18,0x30, 0x00,0x60,0x00, 0x01,0x1a,0x08, 0x08,0x10,0x20, 0x00,0x18,0x00,
  22          0x00,0x18,0x60, 0x00,0x40,0x08, 0x1f,0xe2,0x08, 0x08,0x10,0x20, 0x00,0x08,0x00,
  23          0x00,0x9c,0xc0, 0x7f,0xff,0xf8, 0x01,0x02,0x08, 0x08,0x10,0x20, 0x00,0x08,0x0c,
  24          0x3f,0xdd,0x00, 0x00,0x82,0x00, 0x03,0x82,0x08, 0x08,0x10,0x20, 0x7f,0xff,0xfe,
  25          0x01,0x9a,0x00, 0x01,0x81,0x00, 0x03,0x62,0x08, 0x0f,0xff,0xe0, 0x00,0x08,0x00,
  26          0x01,0x1a,0x00, 0x01,0x19,0x80, 0x07,0x32,0x08, 0x08,0x10,0x20, 0x00,0x08,0x00,
  27          0x03,0x19,0x00, 0x02,0x10,0xc0, 0x05,0x1a,0x08, 0x08,0x10,0x20, 0x00,0x08,0x00,
  28          0x02,0x19,0x80, 0x05,0x11,0x60, 0x09,0x02,0x08, 0x08,0x10,0x20, 0x00,0x08,0x00,
  29          0x06,0x18,0xc0, 0x08,0x92,0xb8, 0x11,0x02,0x08, 0x08,0x10,0x20, 0x00,0x08,0x00,
  30          0x04,0x18,0x60, 0x10,0x9c,0x1e, 0x21,0x03,0xf8, 0x0f,0xff,0xe0, 0x00,0x08,0x00,
  31          0x08,0x18,0x30, 0x60,0x14,0x00, 0x41,0x02,0x08, 0x08,0x10,0x00, 0x00,0x08,0x00,
  32          0x18,0x18,0x1c, 0x03,0xd3,0x80, 0x01,0x02,0x08, 0x00,0x10,0x08, 0x00,0x08,0x00,
  33          0x30,0x18,0x08, 0x0c,0x10,0xc0, 0x01,0x00,0x00, 0x00,0x10,0x04, 0x00,0x18,0x00,
  34          0x40,0xf8,0x00, 0x08,0xb0,0x40, 0x01,0x80,0x00, 0x00,0x18,0x0e, 0x00,0xf8,0x00,
  35          0x00,0x30,0x00, 0x00,0x70,0x00, 0x01,0x00,0x00, 0x00,0x0f,0xfc, 0x00,0x30,0x00,
  36          0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00};                                                                
  37          
  38          
  39          
  40          
  41          
  42          
  43          
  44          
  45          
  46          code unsigned char print_da[24][3]={0x00,0x00,0x00,0x01,0x80,0x00,0x01,0xc0,0x00,0x01,0xc0,0x00,
  47          0x01,0xc0,0x00,0x01,0x80,0xfc,0x01,0x9f,0xfe,0x01,0xfe,0xc0,
  48          0x1f,0xc0,0xc0,0x0d,0x80,0xc0,0x01,0xe0,0xc0,0x01,0xc0,0xc0,
  49          0x01,0x80,0xc0,0x07,0x80,0xc0,0x1f,0x80,0xc0,0x79,0x80,0xc0,
  50          0x71,0x80,0xc0,0x01,0x86,0xc0,0x07,0x83,0xc0,0x03,0x81,0xc0,
  51          0x03,0x81,0xc0,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00};     //打
  52          
  53          code unsigned char print_yin[24][3]={0x00,0x00,0x00,0x00,0xc0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,
  54          0x03,0x80,0xf8,0x3e,0x0f,0xf8,0x38,0x0c,0x38,0x18,0xcc,0x30,
C51 COMPILER V7.20   DY                                                                    03/31/2005 12:32:51 PAGE 2   

  55          0x1b,0xcc,0x30,0x1f,0x0c,0x30,0x18,0x0c,0x30,0x08,0x6d,0xf0,
  56          0x09,0xcc,0xf0,0x1f,0x0c,0x60,0x1e,0x0c,0x00,0x1c,0x0c,0x00,
  57          0x18,0x0c,0x00,0x00,0x0c,0x00,0x00,0x0c,0x00,0x00,0x0c,0x00,
  58          0x00,0x0c,0x00,0x00,0x0c,0x00,0x00,0x04,0x00,0x00,0x00,0x00};  //印
  59          
  60          code unsigned char print_shi1[24][3]={0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x03,0x80,0x00,0x01,0x80,
  61          0x00,0x01,0x80,0x03,0x81,0x80,0x7f,0x81,0x80,0x31,0x81,0xbc,
  62          0x31,0xbf,0xfc,0x31,0xff,0x80,0x3f,0x81,0x80,0x3d,0xb1,0x80,
  63          0x31,0x99,0x80,0x31,0x9d,0x80,0x71,0x89,0x80,0x71,0x81,0x80,
  64          0x7f,0x81,0x80,0x63,0x81,0x80,0x01,0x01,0xc0,0x00,0x07,0xc0,
  65          0x00,0x03,0x80,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00};      //时
  66          
  67          code unsigned char print_jian[24][3]={0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x01,0xe0,0x03,0x9f,0xf0,
  68          0x01,0x98,0x30,0x18,0x00,0x30,0x18,0x00,0x30,0x18,0x9e,0x30,
  69          0x18,0xff,0x30,0x18,0xc6,0x30,0x18,0xd6,0x30,0x18,0xfe,0x30,
  70          0x18,0xc6,0x30,0x18,0xc6,0x30,0x18,0xfe,0x30,0x18,0xce,0x30,
  71          0x38,0x84,0x30,0x38,0x00,0x30,0x38,0x01,0xf0,0x10,0x00,0xf0,
  72          0x00,0x00,0x60,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00};     //间
  73                                                                                          
  74          code unsigned char print_maohao[24][2]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  75                                                                                          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  76                                                                                          0x00,0x00,0x30,0x00,0x30,0x00,0x00,0x00,
  77                                                                                          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  78                                                                                          0x00,0x00,0x30,0x00,0x30,0x00,0x00,0x00,
  79                                                                                          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};     //:
  80          
  81          
  82          
  83          //打印初始化
  84          void print_init()
  85          {
  86   1              SCON=0X50;    
  87   1              T2CON=0X34;   //波特率为115200
  88   1              RCAP2H=0XFF;
  89   1              RCAP2L=0XFD;
  90   1              REN=1;
  91   1      }
  92          
  93          //向串口发送一个字符 
  94          void psend_char_com(unsigned char ch)  
  95          {
  96   1      while(PRINT_BUSY==0);
  97   1       {   SBUF=ch;
  98   2          while(TI==0);
  99   2          TI=0;
 100   2       }
 101   1      }
 102          //向串口发送一个字符串,strlen为该字符串长度 
 103          void  psend_string_com(unsigned char *str,unsigned int strlen)
 104          {
 105   1          unsigned int k=0;
 106   1          do 
 107   1          {
 108   2              psend_char_com(*(str + k));
 109   2              k++;
 110   2          } while(k < strlen);
 111   1      }
 112          //延时
 113          void delay ()
 114          {
 115   1              unsigned char j;
 116   1      
C51 COMPILER V7.20   DY                                                                    03/31/2005 12:32:51 PAGE 3   

 117   1                      for(j=0;j<97;j++)
 118   1                      {
 119   2                              _nop_();
 120   2                              _nop_();
 121   2                       }              
 122   1      }
 123          
 124          void main()
 125          {
 126   1              unsigned char h,k,a;
 127   1          delay();
 128   1              print_init();
 129   1              for(a=0;a<20;a++)
 130   1      {
 131   2      /*      for(h=0;h<24;h++)               
 132   2              {
 133   2                      psend_string_com(print_hzinit,4);
 134   2                      psend_string_com(print_example[h],15);
 135   2                      for(k=0;k<33;k++)
 136   2                      {
 137   2                              psend_char_com(0x00);
 138   2                      }
 139   2              }
 140   2      //      delay();
 141   2      
 142   2      }*/
 143   2              
 144   2              for(h=0;h<24;h++)               //打印时间:
 145   2              {
 146   3      //              print_hzinit();
 147   3              psend_string_com(print_hzinit,4);
 148   3                      psend_string_com(print_da[h],3);
 149   3                  psend_string_com(print_yin[h],3);
 150   3                      psend_string_com(print_shi1[h],3);
 151   3                      psend_string_com(print_jian[h],3);
 152   3                      psend_string_com(print_maohao[h],2);
 153   3                              for(k=0;k<34;k++)
 154   3                      {
 155   4                              psend_char_com(0x00);
 156   4                      }               
 157   3              }
 158   2      }
 159   1      while(1);
 160   1              
 161   1      }
 162          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    217    ----
   CONSTANT SIZE    =    696    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      4       7
   IDATA SIZE       =   ----    ----
   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 + -