previous | start | next

IA32: Compiler Idioms

It may also be helpful in examining executable files to be aware of alternate code the gcc compiler will occasionally use instead of what may be expected.

Some easy ones:

Purpose Alternate Expected
Set %eax to 0 xor %eax, %eax movl $0, %eax
Check if %edi is 0
and jump to L1 if it is
test %edi, %edi
je L1
cmpl $0, %edi
je L1


previous | start | next