home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_200 / 250_01 / fmod.s < prev    next >
Text File  |  1987-10-29  |  640b  |  32 lines

  1.     .ttl    "fmod.s"
  2.  
  3. * MC68020/MC68881 IEEE Format Single Precision Routines
  4. *
  5. * Written by: Edmund H. Ramm
  6. *
  7. * _fmod entry point for s.p. modulo, ops. in 4(sp) and 8(sp)
  8. *
  9. *     sp     4        8
  10. *    -------------------------
  11. *    | ret  |dividend|divisor|
  12.  
  13.  
  14.     .text
  15.     .globl    _fmod
  16.  
  17.  
  18. _fmod:
  19. *
  20. *    on exit, d0 = fmod( 4(sp), 8(sp) )
  21. *    remainder = dividend fmod divisor
  22. *
  23. *    fmove.s    4(sp),fp0        * fp0 <-- dividend
  24.     dc.w    $f22f,$4400,$0004
  25. *    fmod.s    8(sp),fp0        * fp0 <-- 4(sp) fmod 8(sp)
  26.     dc.w    $f22f,$4421,$0008
  27. *    fmove.s    fp0,d0            * d0 <-- remainder
  28.     dc.w    $f200,$6400
  29.     rts
  30.  
  31.     .end
  32.