Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 9
    Also not asked I'd like to point out that all LOOP instructions are much slower than the DEC ECX / JNZ counterpart. This is intended as LOOP should nowadays only be used for delay calibration loops used for hardware-drivers and the like. Commented Nov 18, 2009 at 15:23
  • 1
    @NilsPipenbrinck: On which processors is it slower? What's your source? Commented May 18, 2013 at 19:56
  • 2
    @JanusTroelsen, its slower from the 80486 onwards. On the lastest processors it's a lot slower. Source: agner.org/optimize manual #2. Commented Oct 18, 2013 at 14:14
  • @sharptooth, speaking of LOOPE, how after decrementing can ECX be non zero and ZF set? Does LOOPE not affect the ZF flag? Commented Sep 4, 2015 at 18:35
  • Answering my own question. After checking it in gdb I can confirm that none of the loop (LOOP, LOOPE, LOOPNE) instruction affect the ZF flag when they decrement the ECX counter. Now it makes sense. Commented Sep 4, 2015 at 18:56