andCode:xor edx,edx
?Code:mov edx,0
andCode:xor edx,edx
?Code:mov edx,0
"The Internet treats censorship as damage and routes around it." - John Gilmore
What does your processor manual tell you?
My best code is written with the delete key.
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.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Messing with cache takes time, I guess.
"The Internet treats censorship as damage and routes around it." - John Gilmore
There is little difference between them. Instruction size being the only noticeable diff as has been mentioned.