Question: why xor instead of mov 0?
Answer: xor faster than mov? ... Well the useful thing for xor, let's take a look at: 'xor eax,eax' encodes to 2 bytes, as opposed to mov eax,0 Since you specified movl, it's probably going to encode into 'mov eax,00000000', making it a larger instruction which makes fetching it take a bit longer than just a 2 byte instruction.