Board index » delphi » FPU Emulator in TP

FPU Emulator in TP

Hello all,

I have been experimenting with the TP FPU Emulator. According to the
manual, the FPU has 8 stacks and so the following function

function Fib(N: Integer): Extended;
begin
  if N = 0 then
    Fib := 0.0
  else
    if N = 1 then
      Fib := 1.0
    else
      Fib := Fib(N-1) + Fib(N-2)
end;

will crash for N > 8. However, I am seeing FPU overflows for
N > 15, instead! More importantly, these overflows only occur with the
co-processor- the emulator seems quite happy to go up to 200 (of course, it
locked the computer up in the process...) This is all very strange...

I am running all this on a Pentium- does the Pentium simply have more FP
stacks? Does the FP Emulator not bother to check for overflows (Sounds
{*word*193} if the emulator has fewer stacks than the processor...)

Can anyone shed any light on this please?
Thanks,
Chris.

 

Re:FPU Emulator in TP


On 10 Feb 1996 17:38:44 -0000, cjran...@vossnet.co.uk(Chris Rankin)
wrote:

Quote
>will crash for N > 8. However, I am seeing FPU overflows for
>N > 15, instead! More importantly, these overflows only occur with the
>co-processor- the emulator seems quite happy to go up to 200 (of course, it
>locked the computer up in the process...) This is all very strange...

You didn't say which TP version you're using.  In some of them, the
emulator had a bug, and didn't check for overflow at all.  It just
stomped all over your stack segment and eventually locked up.

The Pentium still has a 8 entry floating point stack, but some
programs extend the stack into memory, by copying things out whenever
a stack fault occurs.  I don't know if TP does this or not, but I
believe Windows does.

Duncan Murdoch

Re:FPU Emulator in TP


Re:FPU Emulator in TP


On 10 Feb 96 05:38pm, CHRIS RANKIN wrote to ALL:

 CR> I have been experimenting with the TP FPU Emulator. According to the
 CR> manual, the FPU has 8 stacks and so the following function
 CR>  
 CR> function Fib(N: Integer): Extended;
 CR> begin
 CR>   if N = 0 then
 CR>     Fib := 0.0
 CR>   else
 CR>     if N = 1 then
 CR>       Fib := 1.0
 CR>     else
 CR>       Fib := Fib(N-1) + Fib(N-2)
 CR> end;
 CR>  
 CR> will crash for N > 8. However, I am seeing FPU overflows for
 CR> N > 15, instead! More importantly, these overflows only occur with the
 CR> co-processor- the emulator seems quite happy to go up to 200 (of
 CR> course, it locked the computer up in the process...) This is all very
 CR> strange...
 CR> I am running all this on a Pentium- does the Pentium simply have more FP
 CR> stacks? Does the FP Emulator not bother to check for overflows (Sounds
 CR> {*word*193} if the emulator has fewer stacks than the processor...)

This is what bp\examples\dos\fib8087.pas says too.  I suspect
that it was true for the 8087 but somewhere along the line the
size of the stack increased to 16.  I get the same results on my
Pentium and my Cyrix 386->486 CPU.  The emulator must not have
the same stack restrictions.

Jud McCranie  jud.mccra...@swsbbs.com

 * Silver Xpress V4.02B03P SW20178

Other Threads