WHEN (AO==2)#(AO==1) THEN {
WHEN CLR==0 THEN {NMA:= 0; AOMIN:=!AOMIN; AOMOUT:=!AOMOUT;}
WHEN (CLR==1)&(CI==1) THEN {NMA:=NMA+1; AOMIN:=!AOMIN; AOMOUT:=!AOMOUT;}
WHEN (CLR==1)&(CI==0) THEN {NMA:=NMA; AOMIN:=!AOMIN; AOMOUT:=!AOMOUT;}
}
ELSE
{AO=1;NMA=11;}