
附录 A 主机程序
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit RS=P2^0; //1:数据输入,0:指令输入
sbit RW=P2^1; //1: 读出,0:写入
sbit E=P2^2; //1:有效,0:无效
sbit key0=P1^0;
sbit key1=P1^1;
sbit key2=P1^2;
sbit key3=P1^3;
sbit key4=P1^4;
sbit key5=P1^5;
sbit key6=P1^6;
sbit key7=P1^7;
sbit BEEP=P2^6;
sbit hold=P3^4;
uint sev=0;
uint sev1=0;
uint sev2=0;
uint sev3=0;
uint sev4=0;
uint m=0,i=0;
uint rank[10]={0}; //排队叫号存储的数组
uint num=0; //窗口消的号码
uint jz=0;
uint LengthFlag=0; //队列长度
uint num_count=1; //排队叫的号码
uchar data test[]="Hello!"; //初始显示的字符
uchar data prompt1[]="Your No.is 00!"; //1062 第一行显示的字符
uchar data prompt2[]="No.00 come to No"; //1062 第一行显示的字符
uchar data prompt3[]="0.window,Please!"; //1062 第二行显示的字符
uchar pdata prompt4[]="The queue is"; //1062 第一行显示的字符
uchar pdata prompt5[]="full,please wait"; //1062 第二行显示的字符
uchar pdata prompt6[]="Sorry,the queue "; //1062 第一行显示的字符
uchar pdata prompt7[]="is empty!"; //1062 第二行显示的字符
uchar data prompt8[]="00 is left";
uchar pdata prompt9[]="All is 00";
uchar pdata prompt10[]="W1 - 00";
uchar pdata prompt11[]="W2 - 00";
uchar pdata prompt12[]="W3 - 00";
uchar pdata prompt13[]="W4 - 00";
uchar data prompt14[]="Insert!";
void delay(int n) //延时子程序