Kraemer) wrote:
>On Mon, 15 Mar 1999 16:18:25 +0100, Arno Fehm <af...@bigfoot.de>
>wrote:
>> Today, I found something really strange.
>> What would you expect this code to do:
>> VAR i,j : longint;
>> f : real;
>> BEGIN
>> j := 0;
>> f := i / j;
>> END.
>it's hard to say. The variable i has a random value.
>If i=0 you will get a invalid floating point operation (RTE 207) (or
>a RTE 200 with {$N-}), otherwise a Division by 0 (RTE 200).
>> Shouldn't this give a RTE 200?
>> Well, if I compile with FP-emulation, it does crash as expected. But
>> when I use 80x87 code, it does not. This is on my P55C (200MMX).
>> At PCs of friends of mine, the very same thing DOES crash, they have got
>> newer CPUs like PII or AMD K6-2.
>> Is it possible, that this IRQ0 depends on the CPU?
>This error has nothing to do with IRQ0. IRQ0 is the timer hardware
>interrupt which is mapped to INT_8. What you mean is INT_0. But in
>this case it's floating point operation due to the / operator. This is
>handled either by software or by the Copro's hardware which will
>produce an INT_$75 if exceptions are enabled. TP will enable FPU
>exceptions.
>> (Why I'm interested: I had a program, that in special cases
>> unfortunately had a div by 0, but on my PC it worked, so I did not see
>> this problem, only my friends complained about it. I think it is
>> interesting to know that you can't even rely on errors today!)
>If it does not crash on your machine your hardware is buggy or broken
>- or you are cultivating a virus.
>Regards
>Horst