Mail Archives: djgpp/1998/08/26/09:31:15
On Wed, 26 Aug 1998 10:24:36 +0200 Fabrice ILPONSE <fabrice AT asim DOT lip6 DOT fr>
writes:
>GAMMELJL AT SLU DOT EDU wrote:
>>
>> Thanks to those who responded to my query about
>> movl $0x0,%edx vs xorl %edx,%edx
>> The movl sets %edx to zero, whereas xorl sets %edx and the carry bit
>to
>> zero. Thus the two statements above are not exactly the same thing.
>> This fact could make little difference to all but a few programmers,
>> and those few probably already know to avoid the xorl command when
>> writing codes in assembly language. I find that the movl command
>> results in faster executables even when xorl can be used as above
>> (in those cases in which the carry bit does not matter).
IIRC, Intel CPUs have special functionality for xoring a register with
itself.
It's something about avoiding a partial register stall after modifying
the
32-bit extended register and than accessing the low-half of it using
the complementary 16-bit register. Could someone correct me?
Karl
- Raw text -