#include<reg52.h>
sbit LCD_RS=P3^2;
sbit LCD_RW=P3^1;
sbit LCD_EN=P3^0;
void write_com(uchar com)
{
LCD_RS = 0;
LCD_RW = 0;
P2 = com;
LCD_EN = 0;
delayms(1);
LCD_EN = 1;
delayms(1);
LCD_EN = 0;
}
void write_data(uchar dat)
{
LCD_RS = 1;
LCD_RW = 0;
P2 = dat;
LCD_EN = 0;
delayms(1);
LCD_EN = 1;
delayms(1);
LCD_EN = 0;
}