求高手 我写的小程序编译不了!
第一个:#include<reg52.h>
#define uchar unsigned char
#define unit unsigned int
void main()
{
uchar temp,Ctemp;
SCON=0x40;
TMOD=0x20;
TH1=0Xe6;
TL1=0xe6;
TR1=1;
temp=0xff;
next:
P1=P1|0xff;
if(P1 !=temp)
{
Ctemp=P1;
SBUF=temp;
while(TI==0)
TI=0;
}
goto next;
}
第二个:
#include<reg52.h>
#define uchar unsigned char
#define uint unsigend int
void main()
{
SCON=0X50;
TMOD=0X20;
TH1=0xe6;
TR1=1;
loop:
while(RI==0)
RI=0;
P1=SBUF;
goto loop;
}