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

📄 12-4.lst

📁 本光盘的所有代码均在Keil C51 7.0以上版本编译通过。读者的电脑只需要能够运行Windows 98 以上版本的操作系统、并能够安装Keil C51 7.0以上版本的软件即可。
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.09   12_4                                                                  08/11/2005 18:46:34 PAGE 1   


C51 COMPILER V7.09, COMPILATION OF MODULE 12_4
OBJECT MODULE PLACED IN 12-4.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE 12-4.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1                                                                                                            #include <reg51.h>
   2          //功能引脚定义
   3          //#define A0 BIT(PC6)                                           //数据1/命令0选择
   4          sbit A0 = P1^4;
   5          //#define WR BIT(PC5)                                           //读1/写0
   6          sbit _WR = P1^3;
   7          //#define E1 BIT(PC4)                                           //片选1(Master)
   8          sbit E1 = P1^1;
   9          //#define E2 BIT(PC7)                                           //片选2(slave)
  10          sbit E2 = P1^2;
  11          //#define lcd_data PORTA                    //数据 
  12          #define lcd_data P0
  13          
  14          //常用操作宏定义
  15          #define set_E1() (E1=1)                   //1片选M
  16          #define set_E2() (E2=1)                   //1片选S
  17          #define set_A0() (A0=1)                   //1数据    
  18          #define set_WR() (_WR=1)                  //1读
  19          
  20          #define clr_E1() (E1=0)                   //0
  21          #define clr_E2() (E2=0)                   //0
  22          #define clr_A0() (A0=0)                   //0命令
  23          #define clr_WR() (_WR=0)                  //0写
  24          
  25          //液晶显示控制命令表
  26          #define disp_off                        0xAE            //显示关闭
  27          #define disp_on                         0xAF            //显示打开
  28          #define disp_start_line         0xC0            //显示起始地址(后5位-表示0-31行)
  29          #define page_addr_set           0xB8            //页地址设置(0~3)
  30          #define col_addr_set            0x00            //列地址设置(0~61)
  31          #define status_busy                     0x80            //0=ready
  32          #define mode_write          0xEE        //写模式
  33          #define dynamic_driver      0xA4        //动态驱动 
  34          #define adc_select                      0xA0            //clockwise
  35          #define clk32               0xA9                //刷新时钟设置1/32
  36          #define clk16               0xA8                //刷新时钟设置1/16
  37          #define reset                           0xE2            //软件复位
  38          
  39          //新的驱动着重在简化代码,这样外部可调用的函数为:系统初始化,清屏,判忙标志
  40          //ASCII和汉字混合输出函数,RAM buffer数据显示输出(一般用于输出数字)
  41          #include <reg51.h>
  42          #include <intrins.h>
  43          
  44          #define uchar unsigned char
  45          #define uint  unsigned int
  46          #define NOP() _nop_();
  47          
  48          uchar dot_buffer[32];                                   //点阵缓存区
  49          uchar disp_buffer[4];                                   //ram数据显示缓存区
  50          
  51          void lcd_init(void);                                    //LCD初始化
  52          void lcd_clr(void);                     //LCD清屏
  53          void wait_ready(void);                                  //等待ready
  54          void draw_bmp(uchar col,uchar layer,uchar width,uchar *bmp);    
  55                                                  //点阵码显示输出
C51 COMPILER V7.09   12_4                                                                  08/11/2005 18:46:34 PAGE 2   

  56          void disp_one_ascii(uchar col,uchar layer,uchar ascii_code,uchar mode);
  57                                               //单个ascci码输出(ascii_code为ascii编码)
  58          void disp_ram_data(uchar col,uchar layer,uchar n,uchar mode);   
  59                                                  //ram数据(数字)显示输出
  60          void dprintf(uchar col,uchar layer,uchar *buf,uchar mode);     
  61                                                  //通用混合字串显示
  62                                                                                          
  63          typedef struct data_gb16                                //汉字字模数据结构
  64          {
  65                  uchar index[2];
  66                  uchar zimo[32]; 
  67          };
  68          
  69          struct data_gb16 code hz16[] = 
  70          {
  71          "延",   0x00,0x84,0xC4,0xA4,0x94,0x8C,0x00,0xE4,
  72                          0x04,0x04,0xFC,0x42,0x63,0x42,0x00,0x00,
  73                          0x80,0x44,0x28,0x10,0x2C,0x43,0x40,0x4F,
  74                          0x48,0x48,0x4F,0x48,0x4C,0x68,0x20,0x00,
  75          "时",   0x00,0xFC,0x84,0x84,0x84,0xFE,0x14,0x10,
  76                          0x90,0x10,0x10,0x10,0xFF,0x10,0x10,0x00,
  77                          0x00,0x3F,0x10,0x10,0x10,0x3F,0x00,0x00,
  78                          0x00,0x23,0x40,0x80,0x7F,0x00,0x00,0x00         
  79          };
  80          
  81          uchar code ascii[] = {
  82          //前面0x20(32个)ASCII码为控制命令,本程序中不用 
  83          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//   
  84          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  85          0x00,0x00,0x38,0xFC,0xFC,0x38,0x00,0x00,//!
  86          0x00,0x00,0x00,0x0D,0x0D,0x00,0x00,0x00,
  87          0x00,0x0E,0x1E,0x00,0x00,0x1E,0x0E,0x00,//"
  88          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  89          0x20,0xF8,0xF8,0x20,0xF8,0xF8,0x20,0x00,//#
  90          0x02,0x0F,0x0F,0x02,0x0F,0x0F,0x02,0x00,
  91          0x38,0x7C,0x44,0x47,0x47,0xCC,0x98,0x00,//$
  92          0x03,0x06,0x04,0x1C,0x1C,0x07,0x03,0x00,
  93          0x30,0x30,0x00,0x80,0xC0,0x60,0x30,0x00,//%
  94          0x0C,0x06,0x03,0x01,0x00,0x0C,0x0C,0x00,
  95          0x80,0xD8,0x7C,0xE4,0xBC,0xD8,0x40,0x00,//&
  96          0x07,0x0F,0x08,0x08,0x07,0x0F,0x08,0x00,
  97          0x00,0x10,0x1E,0x0E,0x00,0x00,0x00,0x00,//'
  98          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  99          0x00,0x00,0xF0,0xF8,0x0C,0x04,0x00,0x00,//(
 100          0x00,0x00,0x03,0x07,0x0C,0x08,0x00,0x00,
 101          0x00,0x00,0x04,0x0C,0xF8,0xF0,0x00,0x00,//)
 102          0x00,0x00,0x08,0x0C,0x07,0x03,0x00,0x00,
 103          0x80,0xA0,0xE0,0xC0,0xC0,0xE0,0xA0,0x80,//*
 104          0x00,0x02,0x03,0x01,0x01,0x03,0x02,0x00,
 105          0x00,0x80,0x80,0xE0,0xE0,0x80,0x80,0x00,//+
 106          0x00,0x00,0x00,0x03,0x03,0x00,0x00,0x00,
 107          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//,
 108          0x00,0x00,0x10,0x1E,0x0E,0x00,0x00,0x00,
 109          0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,//-
 110          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 111          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//.
 112          0x00,0x00,0x00,0x0C,0x0C,0x00,0x00,0x00,
 113          0x00,0x00,0x00,0x80,0xC0,0x60,0x30,0x00,///
 114          0x0C,0x06,0x03,0x01,0x00,0x00,0x00,0x00,
 115          0xF8,0xFC,0x04,0xC4,0x24,0xFC,0xF8,0x00,//0
 116          0x07,0x0F,0x09,0x08,0x08,0x0F,0x07,0x00,
 117          0x00,0x10,0x18,0xFC,0xFC,0x00,0x00,0x00,//1
C51 COMPILER V7.09   12_4                                                                  08/11/2005 18:46:34 PAGE 3   

 118          0x00,0x08,0x08,0x0F,0x0F,0x08,0x08,0x00,
 119          0x08,0x0C,0x84,0xC4,0x64,0x3C,0x18,0x00,//2
 120          0x0E,0x0F,0x09,0x08,0x08,0x0C,0x0C,0x00,
 121          0x08,0x0C,0x44,0x44,0x44,0xFC,0xB8,0x00,//3
 122          0x04,0x0C,0x08,0x08,0x08,0x0F,0x07,0x00,
 123          0xC0,0xE0,0xB0,0x98,0xFC,0xFC,0x80,0x00,//4
 124          0x00,0x00,0x00,0x08,0x0F,0x0F,0x08,0x00,
 125          0x7C,0x7C,0x44,0x44,0xC4,0xC4,0x84,0x00,//5
 126          0x04,0x0C,0x08,0x08,0x08,0x0F,0x07,0x00,
 127          0xF0,0xF8,0x4C,0x44,0x44,0xC0,0x80,0x00,//6
 128          0x07,0x0F,0x08,0x08,0x08,0x0F,0x07,0x00,
 129          0x0C,0x0C,0x04,0x84,0xC4,0x7C,0x3C,0x00,//7
 130          0x00,0x00,0x0F,0x0F,0x00,0x00,0x00,0x00,
 131          0xB8,0xFC,0x44,0x44,0x44,0xFC,0xB8,0x00,//8
 132          0x07,0x0F,0x08,0x08,0x08,0x0F,0x07,0x00,
 133          0x38,0x7C,0x44,0x44,0x44,0xFC,0xF8,0x00,//9
 134          0x00,0x08,0x08,0x08,0x0C,0x07,0x03,0x00,
 135          0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,//:
 136          0x00,0x00,0x00,0x06,0x06,0x00,0x00,0x00,
 137          0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,//;
 138          0x00,0x00,0x08,0x0E,0x06,0x00,0x00,0x00,
 139          0x00,0x80,0xC0,0x60,0x30,0x18,0x08,0x00,//<
 140          0x00,0x00,0x01,0x03,0x06,0x0C,0x08,0x00,
 141          0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,//=
 142          0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,
 143          0x00,0x08,0x18,0x30,0x60,0xC0,0x80,0x00,//>
 144          0x00,0x08,0x0C,0x06,0x03,0x01,0x00,0x00,
 145          0x18,0x1C,0x04,0xC4,0xE4,0x3C,0x18,0x00,//?
 146          0x00,0x00,0x00,0x0D,0x0D,0x00,0x00,0x00,
 147          0xF0,0xF8,0x08,0xC8,0xC8,0xF8,0xF0,0x00,//@
 148          0x07,0x0F,0x08,0x0B,0x0B,0x0B,0x01,0x00,
 149          0xE0,0xF0,0x98,0x8C,0x98,0xF0,0xE0,0x00,//A
 150          0x0F,0x0F,0x00,0x00,0x00,0x0F,0x0F,0x00,
 151          0x04,0xFC,0xFC,0x44,0x44,0xFC,0xB8,0x00,//B
 152          0x08,0x0F,0x0F,0x08,0x08,0x0F,0x07,0x00,
 153          0xF0,0xF8,0x0C,0x04,0x04,0x0C,0x18,0x00,//C
 154          0x03,0x07,0x0C,0x08,0x08,0x0C,0x06,0x00,
 155          0x04,0xFC,0xFC,0x04,0x0C,0xF8,0xF0,0x00,//D
 156          0x08,0x0F,0x0F,0x08,0x0C,0x07,0x03,0x00,
 157          0x04,0xFC,0xFC,0x44,0xE4,0x0C,0x1C,0x00,//E
 158          0x08,0x0F,0x0F,0x08,0x08,0x0C,0x0E,0x00,
 159          0x04,0xFC,0xFC,0x44,0xE4,0x0C,0x1C,0x00,//F
 160          0x08,0x0F,0x0F,0x08,0x00,0x00,0x00,0x00,
 161          0xF0,0xF8,0x0C,0x84,0x84,0x8C,0x98,0x00,//G
 162          0x03,0x07,0x0C,0x08,0x08,0x07,0x0F,0x00,
 163          0xFC,0xFC,0x40,0x40,0x40,0xFC,0xFC,0x00,//H
 164          0x0F,0x0F,0x00,0x00,0x00,0x0F,0x0F,0x00,
 165          0x00,0x00,0x04,0xFC,0xFC,0x04,0x00,0x00,//I
 166          0x00,0x00,0x08,0x0F,0x0F,0x08,0x00,0x00,
 167          0x00,0x00,0x00,0x04,0xFC,0xFC,0x04,0x00,//J
 168          0x07,0x0F,0x08,0x08,0x0F,0x07,0x00,0x00,
 169          0x04,0xFC,0xFC,0xC0,0xF0,0x3C,0x0C,0x00,//K
 170          0x08,0x0F,0x0F,0x00,0x01,0x0F,0x0E,0x00,
 171          0x04,0xFC,0xFC,0x04,0x00,0x00,0x00,0x00,//L
 172          0x08,0x0F,0x0F,0x08,0x08,0x0C,0x0E,0x00,
 173          0xFC,0xFC,0x38,0x70,0x38,0xFC,0xFC,0x00,//M
 174          0x0F,0x0F,0x00,0x00,0x00,0x0F,0x0F,0x00,
 175          0xFC,0xFC,0x38,0x70,0xE0,0xFC,0xFC,0x00,//N
 176          0x0F,0x0F,0x00,0x00,0x00,0x0F,0x0F,0x00,
 177          0xF0,0xF8,0x0C,0x04,0x0C,0xF8,0xF0,0x00,//O
 178          0x03,0x07,0x0C,0x08,0x0C,0x07,0x03,0x00,
 179          0x04,0xFC,0xFC,0x44,0x44,0x7C,0x38,0x00,//P
C51 COMPILER V7.09   12_4                                                                  08/11/2005 18:46:34 PAGE 4   

 180          0x08,0x0F,0x0F,0x08,0x00,0x00,0x00,0x00,
 181          0xF8,0xFC,0x04,0x04,0x04,0xFC,0xF8,0x00,//Q
 182          0x07,0x0F,0x08,0x0E,0x3C,0x3F,0x27,0x00,
 183          0x04,0xFC,0xFC,0x44,0xC4,0xFC,0x38,0x00,//R
 184          0x08,0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x00,
 185          0x18,0x3C,0x64,0x44,0xC4,0x9C,0x18,0x00,//S
 186          0x06,0x0E,0x08,0x08,0x08,0x0F,0x07,0x00,
 187          0x00,0x1C,0x0C,0xFC,0xFC,0x0C,0x1C,0x00,//T
 188          0x00,0x00,0x08,0x0F,0x0F,0x08,0x00,0x00,
 189          0xFC,0xFC,0x00,0x00,0x00,0xFC,0xFC,0x00,//U
 190          0x07,0x0F,0x08,0x08,0x08,0x0F,0x07,0x00,
 191          0xFC,0xFC,0x00,0x00,0x00,0xFC,0xFC,0x00,//V
 192          0x01,0x03,0x06,0x0C,0x06,0x03,0x01,0x00,
 193          0xFC,0xFC,0x00,0x80,0x00,0xFC,0xFC,0x00,//W
 194          0x03,0x0F,0x0E,0x03,0x0E,0x0F,0x03,0x00,
 195          0x0C,0x3C,0xF0,0xC0,0xF0,0x3C,0x0C,0x00,//X
 196          0x0C,0x0F,0x03,0x00,0x03,0x0F,0x0C,0x00,
 197          0x00,0x3C,0x7C,0xC0,0xC0,0x7C,0x3C,0x00,//Y
 198          0x00,0x00,0x08,0x0F,0x0F,0x08,0x00,0x00,
 199          0x1C,0x0C,0x84,0xC4,0x64,0x3C,0x1C,0x00,//Z
 200          0x0E,0x0F,0x09,0x08,0x08,0x0C,0x0E,0x00,
 201          0x80,0x80,0x80,0x80,0xe0,0xC0,0x80,0x00,//->0x5b(自定义显示字符) 
 202          0x01,0x01,0x01,0x01,0x07,0x03,0x01,0x00
 203          //0x5c开始可以加入其他的自定义字符
 204          };
 205          
 206          void send_mi(uchar instruction)
 207          {  
 208   1              clr_E2();                   //关S    
 209   1          set_E1();                   //开M   
 210   1              wait_ready();
 211   1          clr_A0();                               //指令
 212   1          clr_WR();                               //写触发    
 213   1              NOP();
 214   1              lcd_data = instruction;     //指令码
 215   1              NOP();  
 216   1          clr_E1();                   //关M
 217   1      }
 218          
 219          void send_md(uchar c)
 220          {
 221   1              clr_E2();                   //关S
 222   1          set_E1();                   //开M
 223   1              wait_ready();   
 224   1          set_A0();                               //数据
 225   1          clr_WR();                               //写触发    
 226   1          NOP();
 227   1          lcd_data = c;               //数据
 228   1          NOP();      
 229   1          clr_E1();                   //关M
 230   1      }
 231          
 232          void send_si(uchar instruction)
 233          {     
 234   1              clr_E1();                   //关M
 235   1          set_E2();                   //开S
 236   1              wait_ready();         
 237   1          clr_A0();                               //指令
 238   1          clr_WR();                               //写触发    
 239   1              NOP();
 240   1          lcd_data=instruction;       //指令码
 241   1          NOP();      
C51 COMPILER V7.09   12_4                                                                  08/11/2005 18:46:34 PAGE 5   

 242   1          clr_E2();                   //关S
 243   1      }

⌨️ 快捷键说明

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