1 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
2 /* Translated from tasm to GAS by C. Sandmann */
3 /* One comment displaced to get it compiled by as.exe directly !!! */
6 /* This routine assumes DS == SS since [ESI] coding shorter than [EBP] coding */
8 .global __detect_80387
/* direct from the Intel manual */
9 __detect_80387
: /* returns 1 if 387 (or more), else 0 */
11 pushl
%eax
/* Dummy work area on stack */
20 movl
(%esi
),%eax
/* Only ax significant */
27 /* fdiv GAS encodes this as 0xdcf1 !! BUG */
33 movzwl
(%esi
),%eax
/* Clears upper %eax */
36 fninit
/* 387 present, initialize. */
40 /* enable invalid operation exception */
47 popl
%esi
/* Fix stack first */