home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / lib / mntc6846.zoo / patch / dfneg.s < prev    next >
Encoding:
Text File  |  1994-11-14  |  1.0 KB  |  35 lines

  1.  !  c68 8 byte floating point negate routine
  2.  !-----------------------------------------------------------------------------
  3.  ! ported to 68000 by Kai-Uwe Bloem, 12/89
  4.  !  #1  original author: Peter S. Housel
  5.  !  #2  Added routine to provide C68 IEEE compatibility
  6.  !                        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.     .sect .text
  12.  
  13.     .define .Xdfneg
  14.  
  15. !----------------------------------------
  16. !    sp    Return address
  17. !    sp+4    address of result
  18. !    sp+8    address of value
  19. !----------------------------------------
  20.  
  21. .Xdfneg:
  22.     move.l    4(sp),a1    ! Pointer to result
  23.     move.l    8(sp),a0    ! Pointer to value
  24.     move.l    0(a0),0(a1)    ! First half
  25.     move.l    4(a0),4(a1)    ! Second half
  26.     bne    2f        ! We must negate if non-zero
  27.     tst.l    0(a0)        ! Test for 0 in first part
  28.     beq    8f        ! skip negate if also zero
  29. 2:    eor.b    #0x80,0(a1)    ! flip sign bit
  30.  
  31. 8:    move.l    (sp)+,a0    ! get return address
  32.     add.l    #8,sp        ! remove parameters
  33.     jmp    (a0)        ! return
  34.  
  35.