Program PhoneCardReader; Uses Crt; Label 1; Var Size, SizeM: Integer; N, M, B: Integer; Value: Integer; S1, S2, S3, S4, S5: Integer; begin ClrScr; 1: GotoXY(1,1); Port[$378]:=1; Port[$378]:=3; Port[$378]:=1; M:=0; B:=0; Size:=0; SizeM:=0; S1:=0; S2:=0; S3:=0; S4:=0; S5:=0; For N:=0 to 127 do begin Value:=Port[$379]; If Value=126 Then Value:=1; If Value=254 Then Value:=0; M:=M+1; B:=B+1; If ((B>63) and (B<71)) and (Value=1) Then S1:=S1+1; If ((B>70) and (B<79)) and (Value=1) Then S2:=S2+1; If ((B>78) and (B<87)) and (Value=1) Then S3:=S3+1; If ((B>86) and (B<95)) and (Value=1) Then S4:=S4+1; If ((B>94) and (B<103)) and (Value=1) Then S5:=S5+1; If M=9 Then Begin WriteLN(''); M:=1; end; Write(Value,''); Port[$378]:=2; Port[$378]:=0; end; WriteLN(''); WriteLN(''); Size:=S1*1008+S2*108+S3*18+S4*8+S5; SizeM:=Round(Int(Size/28)); WriteLN('На карточке осталось: ',Size); WriteLN('На карточке осталось(минуты): ',SizeM,':',Round(Int((Size-SizeM*28)*15/7))); {goto 1;} end.