Can anyone please explain me the difference between the assembly instructions LOOP, LOOPE and LOOPNE.
Thanks.
Can anyone please explain me the difference between the assembly instructions LOOP, LOOPE and LOOPNE.
Thanks.
Time for a Google Books Reference
EDIT: Synopsis from link: LOOPE and LOOPNE are essentially LOOP instructions with one additional check. LOOPE loops "while zero flag," meaning it will loop as long as zero flag ZF is one and the increment is not reached, and LOOPNE loops "while not zero flag," meaning it continues the loop as long as ZF is zero and the increment is not reached. Keep in mind that neither of these instructions inherently affect the status of ZF.
LOOP decrements ecx and checks if ecx is not zero, if that condition is met it jumps at specified label, otherwise falls through.
LOOPE decrements ecx and checks that ecx is not zero and ZF is set - if these conditions are met, it jumps at label, otherwise falls through.
LOOPNE is same as LOOPE except that it requires ZF to be not set (i.e be zero) to do the jump.
Have you tried looking it up in an instruction set reference, for example in this one by Intel?