I\'m taking an x86 assembly language programming class and know that certain instructions shouldn\'t be used anymore -- because they\'re slow on modern processors; for example,
Oh, but there still might be a good reason to use the loop
instruction. For example, loop label
only requires two bytes. As opposed to dec cx
followed by jnz label
requires three bytes. Sometimes code size is more important than speed.
I would suggest, however, that if you're just learning x86 assembly--especially if this is your first foray into assembly language--that you first concentrate on how to do things. Once you've gotten a better feel for how things work, then worry about making them faster.