Mail Archives: djgpp/1996/08/07/08:46:17
Geoffrey Higginson wrote:
>
> My DJGPP programs require floating point calculations. Though they
> work on other machines (via either co-processor or emulator support)
> they fail (read: crash with a floating point exception) on the
> NextGen 586 processor. Why?
>
> Since numerous other programs fail to recognize the chip correctly
> (Windows 95, for example, considers it to be a 386) I assume that
> the cause of the exception is DJGPP's floating point support
> bailing out.
>
> Out of curiosity, I attempted to use the emulator (a strange thing to
> do on a 586 I admit). No debugger was availiable, but my simple
> test program never ceased execution.
>
> So, how does one do floating point on the NextGen? (Short of
> replacing the d*mned CPU please).
>
> -----
> Geoffrey Higginson <ghiggins AT direct DOT ca>
It is in the file djgpp/src/libc/emu387/fpu.s
[...]
.global __detect_80387 /* direct from the Intel manual */
__detect_80387: /* returns 1 if 387 (or more), else 0 */
pushl %esi
pushl %eax /* Dummy work area on stack */
movl %esp,%esi
fninit
movw $0x5a5a,(%esi)
fnstsw (%esi)
cmpb $0,(%esi)
jne Lno_387
[...]
That is how it does it, but that probably does not help you any further.
The function is called by npxsetup.c, same directory. It checks
the environment variable 387 to see if you set it to "N", but
unfortunately not, if you set it to "Y". Charles, is that not something
to change?
--
Ciao
Tom
*************************************************************
* Thomas Demmer *
* Lehrstuhl fuer Stroemungsmechanik *
* Ruhr-Uni-Bochum *
* Universitaetsstr. 150 *
* D-44780 Bochum *
* Tel: +49 234 700 6434 *
* Fax: +49 234 709 4162 *
* http://www.lstm.ruhr-uni-bochum.de/~demmer *
*************************************************************
- Raw text -