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

  1.     .ttl    "fpdiv.s"
  2.  
  3. * MC68020/MC68881 IEEE Format Single Precision Routines
  4. *
  5. * Written by: Edmund H. Ramm
  6. *
  7. * fpdiv entry point for single prec. div, operands in 4(sp) and 8(sp)
  8. *
  9. *     sp     4      8
  10. *    ----------------------
  11. *    | ret  |  a   |   b  |
  12.  
  13.  
  14.     .text
  15.     .globl    fpdiv,_fpdiv
  16.  
  17.  
  18. fpdiv:
  19. _fpdiv:
  20. ~~fpdiv:
  21. *
  22. *    on exit, d0 = 4(sp) / 8(sp)
  23. *    quotient = dividend / divisor
  24. *    c = a / b
  25. *
  26. *    fmove.s    4(sp),fp0        * fp0 <-- "a"
  27.     dc.w    $f22f,$4400,$0004
  28. *    fsgldiv.s    8(sp),fp0    * divide by "b"
  29.     dc.w    $f22f,$4424,$0008
  30. *    fmove.s    fp0,d0            * d0 <-- quotient
  31.     dc.w    $f200,$6400
  32.     rts
  33.  
  34.     .end
  35.