Hi,
Intel manual says OF is undefined after shifting or rotating > 1 bit.
I found that, after SHL, OF is always the last bit shifted out XOR the highest bit. Can I rely on this?
AF seems to be set after a shift, can I rely on it despite the manual saying AF is undefined? What does undefined mean, it may change for new processors, or the value doesn`t take actual meaning?
Thanks.
Posted on 2003-01-30 21:36:50 by C.Z.
Undefined means it could be different for every processor - you can not predict what it will be on all processors. Some people have when to trouble of testing these things on many processors, but then something like the Transmeta Cursoe come out and these tricks don't work. Best to follow the Intel Manual.
Posted on 2003-01-30 21:44:32 by bitRAKE
bitRAKE:
I guess the CPU operates "shl eax, 3" as the following:
shl eax, 1
shl eax, 1
shl eax, 1
which seems natural and matches the fact.
Anyway, your suggestion is right, however pedantic it seems to follow the manuals so strictly. :) Thank you.
Posted on 2003-01-31 09:48:49 by C.Z.