#include<reg52.h>
typedef unsigned int uint;
typedef unsigned char uchar;
sbit rs=P3^5;
sbit rw=P3^6;
sbit en=P3^4;
void busy()
{
uchar busy;
P0=0xff;
rs=0;
rw=1;
do
{
en=1;
busy=P0;
en=0;
}while(busy&0x80);
}
void comd(uchar com)
{
busy();
rs=0;
rw=0;
P0=com;
en=1;
en=0;
}
void dated(uchar date)
{
busy();
rs=1;
rw=0;
P0=date;
en=1;
en=0;
}
void init()
{
comd(0x38);
comd(0x0f);
comd(0x07);
comd(0x01);
comd(0x80|0x0f);
}
void main()
{
uint k,i;
uchar *a[]={"monday"," tuesday"};
uchar *pa;
init();
for(i=0;i<2;i++)
{
pa=a[i];
{
while(*pa!='\0')
{
dated(*pa++);
while(k--);
}
}
}
while(1);
}
typedef unsigned int uint;
typedef unsigned char uchar;
sbit rs=P3^5;
sbit rw=P3^6;
sbit en=P3^4;
void busy()
{
uchar busy;
P0=0xff;
rs=0;
rw=1;
do
{
en=1;
busy=P0;
en=0;
}while(busy&0x80);
}
void comd(uchar com)
{
busy();
rs=0;
rw=0;
P0=com;
en=1;
en=0;
}
void dated(uchar date)
{
busy();
rs=1;
rw=0;
P0=date;
en=1;
en=0;
}
void init()
{
comd(0x38);
comd(0x0f);
comd(0x07);
comd(0x01);
comd(0x80|0x0f);
}
void main()
{
uint k,i;
uchar *a[]={"monday"," tuesday"};
uchar *pa;
init();
for(i=0;i<2;i++)
{
pa=a[i];
{
while(*pa!='\0')
{
dated(*pa++);
while(k--);
}
}
}
while(1);
}