From the page in the Intel docs "Introduction to x64 Assembly" you can see this code
Label: ; this is a label in assembly
INX EAX ; increment eax
LOOP Label ; decrement ECX, loop if not 0
Why do they say INX
and not INC
?
From the page in the Intel docs "Introduction to x64 Assembly" you can see this code
Label: ; this is a label in assembly
INX EAX ; increment eax
LOOP Label ; decrement ECX, loop if not 0
Why do they say INX
and not INC
?
There's no INX instruction in the x86 instruction set. The instruction meant to be used here is the INC instruction. Since the X key is next to the C key on most keyboards this a simple mistake to make.
Without spending much time reading it, I would have to question the value of any sort introductory document that uses the LOOP instruction in an example. There is rarely a good reason to the LOOP instruction in code being written today, or anytime in the last 25 years.