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

  1. ;******************************************************************************
  2. ; Filename: MAX.ASM
  3. ;   Author: Peter Andersson
  4. ;  Version: 0.0
  5. ;  Created: 1994.09.17
  6. ;  Updated: 1995.03.10
  7. ;******************************************************************************
  8. ; Copyright 1994, Peter Andersson.
  9. ; All rights reserved.
  10. ;******************************************************************************
  11. ; Function: ULONG @max(ULONG a,ULONG b)
  12. ;  Comment: Returns the larger of two values
  13. ;    Input: Eax - value a
  14. ;           Edx - value b
  15. ;  Returns: (a>b) ? a : b
  16. ;******************************************************************************
  17.  
  18.     Include    STDDEF.INC
  19.  
  20.     Codeseg
  21.  
  22. Proc    max ,2
  23.         Cmp    Edx,Eax
  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.