0
0
forked from aniani/nasm

mib: Handle MIB EA in a different way from regular EA's

In mib operands, users' intention should be preserved.
e.g.) [eax + eax*1] and [eax*2] must be distinguished and encoded differently.

So  a new EA flag EAF_MIB for mib operands is added.
And a new EA hint EAH_SUMMED for the case of [eax+eax*4] being parsed
as [eax*5] is also added.

NOSPLIT specifier does not have an effect in mib, so [nosplit eax + eax*1]
will be encoded as [eax, eax] rather than [eax*2] as in a regular EA.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
This commit is contained in:
Jin Kyu Song
2013-12-10 16:24:45 -08:00
parent 478f2dafff
commit 4360ba28f0
3 changed files with 57 additions and 39 deletions

5
eval.c
View File

@@ -148,8 +148,11 @@ static expr *add_vectors(expr * p, expr * q)
lasttype = p++->type;
} else { /* *p and *q have same type */
int64_t sum = p->value + q->value;
if (sum)
if (sum) {
addtotemp(p->type, sum);
if (hint)
hint->type = EAH_SUMMED;
}
lasttype = p->type;
p++, q++;
}