Is it safe to do a CMP or TEST, then do a MOV, then do a conditional jump based on flags... in that order?
MOV never effects the flags.
Quote from: cork on August 05, 2010, 12:17:14 AM
Is it safe to do a CMP or TEST, then do a MOV, then do a conditional jump based on flags... in that order?
In those words, yes, it is always safe. :U
In the words "Does MOV ever affect the flags?", technically
yes, since if you MOV to certain control registers, it can affect certain control flags, but not condition flags. That's probably way more information than you needed, though, since I don't know if I've ever encountered a case where I did a MOV that affected the flags. :wink
Edit: Whoops, "yes" (in italics), instead of "no", as the rest of the sentence suggested. :lol
Yes it is safe as it does not modify flags. Its useful to know this as it also allows you to re-order code at times to try and find a better scheduling of instructions.
Quote from: hutch-- on August 05, 2010, 02:01:08 AM
Yes it is safe as it does not modify flags. Its useful to know this as it also allows you to re-order code at times to try and find a better scheduling of instructions.
Thanks Rockoon, Neo and Hutch.