What is a (working) example of Conditional mov (cmov) example? Inline asm in C preferred. I am not sure if it needs cmp before it or not. Also, I tried to make the below with CMov, but can't do it.
int n = 0, d;
int a[5];
a[0] = 134;
a[1] = 70;
a[2] = 735;
...
__asm
{
LEA edi, a
mov eax, 150
//cmp eax, 128 ; if legal & needed
cmovae eax,[EDI+1]
mov d, eax
}
Either VC or GCC are welcomed! Please explain about cmov more.