andCode:xor edx,edx
?Code:mov edx,0
Printable View
andCode:xor edx,edx
?Code:mov edx,0
What does your processor manual tell you?
Speed.
Not speed. The two instructions take the same time, so the only speed difference can come from cache hits. Code size. The xor takes one byte, the mov two or more, not quite sure.
Messing with cache takes time, I guess.
There is little difference between them. Instruction size being the only noticeable diff as has been mentioned.