Sure, xor’ing a register with itself is the idiom for zeroing it out, but why not sub?
Summary
The Old New Thing post explains why xor reg, reg is used to zero a register on x86, highlighting that it produces shorter code than mov reg, 0 and has distinct flag behavior. It discusses historical and vendor-driven reasons for xoring to zero, mentions Itanium's NaT behavior, and includes anecdotes about early compiler influence and cross-vendor differences in zeroing instructions.