summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorJin Kyu Song <jin.kyu.song@intel.com>2013-12-10 16:24:45 -0800
committerJin Kyu Song <jin.kyu.song@intel.com>2013-12-11 16:56:19 -0800
commit4360ba28f0e4767ffe28ef3a037aaa103b5660b6 (patch)
treed66cad3a8c786b4291c28879d038caaffd53a897 /eval.c
parent478f2dafff5b58c7c965cfe2277ff71e1492815a (diff)
downloadnasm-4360ba28f0e4767ffe28ef3a037aaa103b5660b6.tar.gz
nasm-4360ba28f0e4767ffe28ef3a037aaa103b5660b6.tar.bz2
nasm-4360ba28f0e4767ffe28ef3a037aaa103b5660b6.zip
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>
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index c57ff04..403a793 100644
--- a/eval.c
+++ b/eval.c
@@ -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++;
}