home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / lib / mntc6846.zoo / patch / dfutodf.s < prev    next >
Encoding:
Text File  |  1994-06-16  |  1.1 KB  |  36 lines

  1.  ! C68 32 bit unsigned => 8-byte-floating point conversion routine
  2.  !-----------------------------------------------------------------------------
  3.  ! ported to 68000 by Kai-Uwe Bloem, 12/89
  4.  !  #1  original author: Peter S. Housel 3/28/89
  5.  !  #2  Redid register usage, and then added wrapper routine
  6.  !    to provide C68 IEEE compatibility    Dave & Keith Walker    02/92
  7.  !  #3    Changed entry/exit code for C68 v4.3 compatibility
  8.  !    Removed ACK entry points                -djw-    09/93
  9.  !-----------------------------------------------------------------------------
  10.  
  11. BIAS8    =    0x3FF - 1
  12.  
  13.     .sect .text
  14.     .define    .Xdfutodf
  15.  
  16. !----------------------------------------
  17. !    sp    Return address
  18. !    sp+4    address of result
  19. !    sp+8    address of value to convert
  20. !----------------------------------------
  21. .Xdfutodf:
  22.     move.l    4(sp),a1    ! return value address
  23.     move.l    8(sp),d1    ! source value
  24.  
  25.     move.w    #BIAS8+32-11,d0    ! radix point after 32 bits
  26.     clr.w    d2        ! sign is always positive
  27.     clr.l    4(a1)        ! write mantissa onto stack
  28.     move.l    d1,(a1)
  29.     clr.w    d1        ! set rounding = 0
  30.     jsr    .Xnorm8
  31.  
  32.     move.l    (sp)+,a1    ! get return address
  33.     add.l    #8,sp        ! remove parameters from stack
  34.     jmp    (a1)        ! ... and return
  35.  
  36.