program Test_CcittW41;

uses
  NumToStr,
  Crc,
  CCittW41;

label L_End;
var
  B    : Byte;
  W    : Word;
  i    : integer;
  CrcW41 : tccittW41;
Begin
  B:=$80;
  W:=0;
  WriteLn;
  write(WordStrBin(B),'   ',WordStrBin(W));
  with CrcW41 do
  begin
    SetResidue(0);
    for i:=1 to 110 do
    begin
      WriteLn;
      Write(i:5,'   ',WordStrBin(B),'   ');
      Crc.Crc16(B,W);
      MakeCrc(B);
      B:=0;
      Write(WordStrBin(W),'   '+WordStrHex(W)+' '+WordStrHex(GetResidue));
      if W=1 then goto L_End;
    end;
  end;
 L_End:
End.