1 ! bcc 386 floating point routines (version 2) -- _fabs 2 ! author: Bruce Evans 3 4 #include "fplib.h" 5 6 ! double fabs(double value); 7 ! returns the absolute value of a number 8 ! this works for all NaNs, like the 80*87 fabs, but perhaps we should check 9 ! for exceptions that can happen when an 80*87 register is loaded 10 11 .globl _fabs 12 .align ALIGNMENT 13 _fabs: 14 mov eax,PC_SIZE+D_LOW[esp] 15 mov edx,PC_SIZE+D_HIGH[esp] 16 and edx,~D_SIGN_MASK 17 ret 18