I'm trying to decipher some assembly I've come across, and there seem to be quite a few OR's followed directly by a JNE or similiar...what does this mean? Does OR also set flags if the two operands are equal?
The answer is yes, or instruction affects flags
OF and CF are cleared
SF, ZF and PF are set according to the result
if you need more information, the intel pentium manuals are available for a free download at the intel website,
... it's quite a common construction because it doesn't change the value of any register except the flags, and it's often shorter than cmp.
But if you can use test, test is sometimes quicker; because or would usually change the value of the destination register, any subsequent instruction using that register as a source will be delayed in the pipeline (even though this particular or won't change anything) until the or is completed. Not usually a big issue, but...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.