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