fabs.x 434 B

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