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

  1.  !  C68 4 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.     .define .Xsfneg
  13.  
  14. !----------------------------------------
  15. !    sp    Return address
  16. !    sp+4    address of result
  17. !    sp+8    address of value
  18. !----------------------------------------
  19.  
  20. .Xsfneg:            ! floating point negate
  21.     move.l    4(sp),a1    ! Pointer to result
  22.     move.l    8(sp),a0    ! Pointer to value
  23.     move.l    0(a0),0(a1)    ! Move across value
  24.     beq    8f        ! skip negate if also zero
  25.     eor.b    #0x80,0(a1)    ! flip sign bit
  26.  
  27. 8:    move.l    (sp)+,a0    ! get return address
  28.     add.l    #8,sp        ! remove parameters from stack
  29.     jmp    (a0)        ! return
  30.  
  31.