home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / mntlib32.zoo / _isnan.s < prev    next >
Text File  |  1993-01-14  |  556b  |  34 lines

  1. | double floating point predicates as proposed by IEEE (appendix)
  2. |
  3. |  Isnan(x)  returns true iff x is a NaN
  4. |  Finite(x) returns trus iff x is finite (i.e. not an infiniy or a NaN)
  5. |
  6. | written by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
  7. |
  8. | Revision 1.0 olaf 12-92
  9.     .text
  10.     .even
  11.     .globl    _Isnan
  12.     .globl    _Finite
  13.  
  14. _Isnan:    moveml    sp@(4),d0/d1
  15.     bclr    #31,d0
  16.     cmpl    #0x7ff00000,d0
  17.     ble    No
  18.     tstl    d1
  19.     beq    No
  20.     moveql    #1,d0
  21.     rts
  22. No:    clrl    d0
  23.     rts
  24.  
  25. _Finite: moveml    sp@(4),d0/d1
  26.     bclr    #31,d0
  27.     cmpl    #0x7ff00000,d0
  28.     blt    Yes
  29.     clrl    d0
  30.     rts
  31. Yes:    moveql    #1,d0
  32.     rts
  33.