{$n-}                           {coprocessor off}
Function Rootfct(Radicand:LongInt):Integer;external;
{$l Root}
{Enter the path of the Assembler module Root.obj here !}

var i:word;                     {loop counter}
    n:Integer;                  {result of integer calculation}
    r:Real;                     {result of real calculation}

Procedure Root_new;             {calculates root by integer approximation}
Begin
  For i:=1 to 10000 do          {run 10000 times,}
    n:=Rootfct(87654321);       {to obtain speed comparison}
End;

Procedure Root_real;            {calculates root via Pascal function}
Begin
  For i:=1 to 10000 do          {run 10000 times,}
    r:=Sqrt(87654321);          {to get speed comparison}
End;

Begin
  writeLn;
  WriteLn('Root calculation via Pascal function begins');
  Root_Real;
  WriteLn('result: ',r:0:0);
  WriteLn('Root calculation via integer function begins');
  Root_new;
  WriteLn('result: ',n);
End.
