/*-----------------------Begin Program------------------------*/
CWR55=10000011b; /* PB ÂÂÎÄ, ÐÑ(0-3) ÂÂÎÄ, îñòàëüíîå íà âûâîä */
DISABLE;
Level=7;
Fl_l=0;
FlSound=1;
Fl_Z=1;
CntNak=0;
Call InitLcd;
call INITUSART;
RusCnt=0;
LcdPtr=0;
call OutStr(.Soob1,-1,0);
Call Sound(0);
do Pole =0 to 30;
call Time(200);
end;
If RxD=0 then do;
RusCnt=0;
LcdPtr=0;
call OutStr(.Error1,-1,0);
Call Sound(4);
end;
else goto BGN;
Do while RXD=0;
do Pole =0 to 50;
call Time(200);
end;
call beep(10,10);
end;
Call Sound(1);
BGN:
Vygr=0;
Call InitLcd;
Call ClrBuf;
Pole=0;
do while 1;
Call OutPole;
Pole=Pole+Input;
If ((Pole=7) and (Vygr=0)) then Pole=Pole+1;
/*---------------------------*/
If ((Pole=2) and (FlUp=0)) then do;
call Que;
if ((Kbd<>'E') or (Ekod=1)) then Pole=1;
end;
/*-------------------------------*/
/*--------SEND REQUEST------*/
if Pole=10 then do;
if Calc=1 then do; /* åñëè âåñ íå ñîîòâåòñòâóåò*/
Pole=9;
call BeepErr;
end;
else do;
Call OutPole;
REPIN: Pole =Kbd;
if Pole='E' then do;
RusCnt=0;
LcdPtr=0;
call OutStr(.Soob2,-1,0);
Call Send(0);
call BeepOK;
CntNak=CntNak+1;
goto BGN;
end;
If Pole='U' then Pole=9;
else goto REPIN;
end;
end;
/*-----------------------------*/
end;
end Contr;