;******************************************************************************
; Filename: MAX.ASM
; Author: Peter Andersson
; Version: 0.0
; Created: 1994.09.17
; Updated: 1995.03.10
;******************************************************************************
; Copyright 1994, Peter Andersson.
; All rights reserved.
;******************************************************************************
; Function: ULONG @max(ULONG a,ULONG b)
; Comment: Returns the larger of two values
; Input: Eax - value a
; Edx - value b
; Returns: (a>b) ? a : b
;******************************************************************************
Include STDDEF.INC
Codeseg
Proc max ,2
Cmp Edx,Eax
Sbb Ecx,Ecx
And Eax,Ecx
Not Ecx
And Edx,Ecx
Or Eax,Edx
Ret
Endp
End