Hello,

> I need a fast function that compares three numbers and returns the biggest.
> Do you know an ASM library that can do such a calculation?

function Max2(a, b: integer): integer;
asm
   cmp eax, edx
   jl  @done
   ret
@done:
   mov eax, edx
end;

function Max3(a, b, c: integer): integer;
asm
   cmp eax, edx
   jl  @step1
   ret
@step1:
   cmp ecx, edx
   jl  @done
   mov eax, ecx
   ret
@done:
   mov eax, edx
end;

---
Rgds, Wilfried
http://www.mestdagh.biz

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to