NASM invalid address behaviour?

Answer

The offset part of an address is given on the form base + index*scale + displacement. There are only certain values that are allowed for the scale part of the offset. These are 1 (the default), 2, 4 and 8.

This is described in Intel's Software Developers Manual Vol 1 (the section named Specifying an Offset):

The offset part of a memory address can be specified directly as a static value (called a displacement) or through an address computation made up of one or more of the following components:
Displacement — An 8-, 16-, or 32-bit value.
Base — The value in a general-purpose register.
Index — The value in a general-purpose register.
Scale factor — A value of 2, 4, or 8 that is multiplied by the index value.

(The above quote is for 32-bit mode, but the same limitation on the scale factor applies in 64-bit mode)

All x86 Questions

Ask your interview questions on x86

Write Your comment or Questions if you want the answers on x86 from x86 Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---