TH0=(65536-4000)/256; TL0=(65536-4000)%256; TR0=1;
ET0=1;
EA=1;
P3=channel;
while(1)
{
ST=0;
ST=1;
ST=0;
while(EOC==0);
OE=1;
getdata=P0;
OE=0;
dispbuf[2]=getdata/100; getdata=getdata%10;
dispbuf[1]=getdata/10; dispbuf[0]=getdata%10; }
}
void t0(void) interrupt 1 using 0 {
TH0=(65536-4000)/256; TL0=(65536-4000)%256;
P1=dispcode[dispbuf[dispcount]]; P2=dispbitcode[dispcount]; dispcount++;
if(dispcount==8)
{
dispcount=0;