home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / FUNK108A.ZIP / DOS32V30.ZIP / PAL / MATH / MIN.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-05-20  |  830 b   |  33 lines

  1. ;******************************************************************************
  2. ; Filename: MIN.ASM
  3. ;   Author: Peter Andersson
  4. ;  Version: 0.0
  5. ;  Created: 1994.09.17
  6. ;  Updated: 1995.03.10
  7. ;******************************************************************************
  8. ; Copyright Peter Andersson, 1994-1995.
  9. ; All rights reserved.
  10. ;******************************************************************************
  11. ; Function: ULONG @min(ULONG a,ULONG b)
  12. ;  Comment: Returns the smaller of two values
  13. ;    Input: Eax - value a
  14. ;           Edx - value b
  15. ;  Returns: (a>b) ? b : a
  16. ;******************************************************************************
  17.  
  18.     Include    STDDEF.INC
  19.  
  20.     Codeseg
  21.  
  22. Proc    min ,2
  23.         Cmp    Eax,Edx
  24.         Sbb    Ecx,Ecx
  25.         And    Eax,Ecx
  26.         Not    Ecx
  27.         And    Edx,Ecx
  28.         Or    Eax,Edx
  29.         Ret
  30. Endp
  31.  
  32.     End
  33.