mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-09-22 10:43:39 -04:00
nosplit: Limit the effect of NOSPLIT
[nosplit eax+eax] was encoded [eax*2] previously but this seems against the user's intention. So in this case, nosplit is ignored now and [eax+eax] will be generated. Document is also updated accordingly. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
This commit is contained in:
@@ -2629,7 +2629,7 @@ static enum ea_type process_ea(operand *input, ea *output, int bits,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (((s == 2 && it != REG_NUM_ESP &&
|
if (((s == 2 && it != REG_NUM_ESP &&
|
||||||
!(eaflags & EAF_TIMESTWO)) ||
|
(!(eaflags & EAF_TIMESTWO) || (ht == EAH_SUMMED))) ||
|
||||||
s == 3 || s == 5 || s == 9) && bt == -1) {
|
s == 3 || s == 5 || s == 9) && bt == -1) {
|
||||||
/* convert 3*EAX to EAX+2*EAX */
|
/* convert 3*EAX to EAX+2*EAX */
|
||||||
bt = it, bx = ix, s--;
|
bt = it, bx = ix, s--;
|
||||||
|
@@ -1460,6 +1460,8 @@ fact, it will also split \c{[eax*2+offset]} into
|
|||||||
\c{[eax+eax+offset]}. You can combat this behaviour by the use of
|
\c{[eax+eax+offset]}. You can combat this behaviour by the use of
|
||||||
the \c{NOSPLIT} keyword: \c{[nosplit eax*2]} will force
|
the \c{NOSPLIT} keyword: \c{[nosplit eax*2]} will force
|
||||||
\c{[eax*2+0]} to be generated literally.
|
\c{[eax*2+0]} to be generated literally.
|
||||||
|
However, \c{NOSPLIT} in \c{[nosplit eax+eax]} will be ignored because user's
|
||||||
|
intention here is considered as \c{[eax+eax]}.
|
||||||
|
|
||||||
In 64-bit mode, NASM will by default generate absolute addresses. The
|
In 64-bit mode, NASM will by default generate absolute addresses. The
|
||||||
\i\c{REL} keyword makes it produce \c{RIP}-relative addresses. Since
|
\i\c{REL} keyword makes it produce \c{RIP}-relative addresses. Since
|
||||||
@@ -4465,8 +4467,8 @@ be used.
|
|||||||
\c call foo ; BND will be prefixed
|
\c call foo ; BND will be prefixed
|
||||||
\c nobnd call foo ; BND will NOT be prefixed
|
\c nobnd call foo ; BND will NOT be prefixed
|
||||||
|
|
||||||
DEFAULT NOBND can disable DEFAULT BND and then \c{BND} prefix will be added
|
\c{DEFAULT NOBND} can disable \c{DEFAULT BND} and then \c{BND} prefix will be
|
||||||
only when explicitly specified in code.
|
added only when explicitly specified in code.
|
||||||
|
|
||||||
\H{section} \i\c{SECTION} or \i\c{SEGMENT}: Changing and \i{Defining
|
\H{section} \i\c{SECTION} or \i\c{SEGMENT}: Changing and \i{Defining
|
||||||
Sections}
|
Sections}
|
||||||
|
Reference in New Issue
Block a user