uses
  Crc16,
  NumToStr,
  Crt;

var
  Crc : tCrc16;

Begin
  ClrScr;
  WriteLn('Test kontrolniho polynomu, Crc16');
  with Crc do
  begin
    SetResidue(0);
    MakeCrc( $01);
    WriteLn('$01 '+WordStrHex(GetResidue));
    MakeCrc( $01);
    WriteLn('$01 '+WordStrHex(GetResidue));
    MakeCrc( $02);
    WriteLn('$02 '+WordStrHex(GetResidue));
    MakeCrc( $05);
    WriteLn('$05 '+WordStrHex(GetResidue));
    MakeCrc( $00);
    WriteLn('$00 '+WordStrHex(GetResidue));
    MakeCrc( $01);
    WriteLn('$01 '+WordStrHex(GetResidue));
    MakeCrc( $02);
    WriteLn('$02 '+WordStrHex(GetResidue));
    MakeCrc( $03);
    WriteLn('$03 '+WordStrHex(GetResidue));
    MakeCrc( $04);
    WriteLn('$04 '+WordStrHex(GetResidue));
    MakeCrc( $05);
    WriteLn('$05 '+WordStrHex(GetResidue));
  end;
  ReadLn;
  WriteLn('Test kontrolniho polynomu, Crc16');
  with Crc do
  begin
    SetResidue(0);
    MakeCrc( $01);
    WriteLn('$01 '+WordStrHex(GetResidue));
    MakeCrc( $02);
    WriteLn('$02 '+WordStrHex(GetResidue));
    MakeCrc( $01);
    WriteLn('$01 '+WordStrHex(GetResidue));
    MakeCrc( $05);
    WriteLn('$05 '+WordStrHex(GetResidue));
    MakeCrc( $00);
    WriteLn('$00 '+WordStrHex(GetResidue));
    MakeCrc( $04);
    WriteLn('$04 '+WordStrHex(GetResidue));
    MakeCrc( $00);
    WriteLn('$00 '+WordStrHex(GetResidue));
    MakeCrc( $00);
    WriteLn('$00 '+WordStrHex(GetResidue));
    MakeCrc( $00);
    WriteLn('$00 '+WordStrHex(GetResidue));
    MakeCrc( $00);
    WriteLn('$00 '+WordStrHex(GetResidue));
  end;
  ReadLn;
  WriteLn('Test kontrolniho polynomu, Crc16');
  with Crc do
  begin
    SetResidue(0);
    MakeCrc( $80);
    WriteLn('$80 '+WordStrHex(GetResidue));
  end;
  ReadLn;
End.