home *** CD-ROM | disk | FTP | other *** search
/ Creative Computers / CreativeComputers.iso / shareware / text / dvi_3.62 / source / dvisrc.lha / gnufxumu.s < prev    next >
Text File  |  1993-07-09  |  689b  |  47 lines

  1.  
  2. ; Datei: DVIFXUMU.S
  3. ; Autor: Ingo Eichenseher
  4. ; Letzte Aenderung: 09.04.1991 07:29
  5.  
  6.             export    fixumul;
  7.  
  8.             TEXT
  9.  
  10. ; --------------------------------------------------------
  11. ; unsigned long fixumul (unsigned long x, unsigned long y)
  12. ; --------------------------------------------------------
  13.  
  14. x            EQU        d0
  15. y            EQU        d1
  16. r            EQU        d2
  17.  
  18. fixumul:    movem.l    d3-d4,-(sp)
  19.             move    #16,d3
  20.  
  21.             move.w    x,r
  22.             mulu    y,r
  23.             lsr.l    d3,r
  24.  
  25.             swap    x
  26.             move.w    x,d4
  27.             mulu    y,d4
  28.             add.l    d4,r
  29.  
  30.             swap    y
  31.             move.w    y,d4
  32.             mulu    x,d4
  33.             lsl.l    d3,d4
  34.             add.l    d4,r
  35.  
  36.             swap    x
  37.             move.w    x,d4
  38.             mulu    y,d4
  39.             add.l    d4,r
  40.  
  41.             movem.l    (sp)+,d3-d4
  42.             move.l    r,d0
  43.  
  44.             rts
  45.  
  46.             END
  47.