请问这个程序有什么错误
显示最后一个}附件存在未知错误
- #include <reg52.h>
- #include<string.h>
- int i=0,k;
- unsigned char mima[]="123456\r",a[10];
- unsigned char tab[]="*";
- unsigned char tab1[]=" input your password : ";
- unsigned char tab2[]=" the password is corret";
- unsigned char tab3[]=" the password is incorret ,please re-enter your password!";
- void send_char(unsigned char c)
- {
- SBUF=c;
- while(TI==0);
- TI=0;
- }
- void send_str(unsigned char *p)
- {
- for(;*p!='\0';p++)
- {
- send_char(*p);
- }
- }
- void interrupt_4() interrupt 4
- {
- if(RI==1)
- {
- a[i]=SBUF;
- {if(a[i]!='\r')
- {
- i++;
- send_str(tab);
- }
- if(a[i]=='\r')
- { i=0;
- send_char('\n');
- }
- else
- {a[i]='\0';
- if(strcmp(a,mima)==0)
- {send_str(tab2); i=0;}
- else
- {
- send_str(tab3);
- i=0;
- }
- }
- RI=0;
- }
- }
- }
- void main()
- {
- SCON=0X50;
- TMOD=0X20;
- PCON=0X80;
- TH1=0XF3;
- TL1=0XF3;
- ES=1;
- EA=1;
- TR1=1;
- send_str(tab1);
- while(1)
- }
复制代码
|