From 4360ba28f0e4767ffe28ef3a037aaa103b5660b6 Mon Sep 17 00:00:00 2001 From: Jin Kyu Song Date: Tue, 10 Dec 2013 16:24:45 -0800 Subject: 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 --- nasm.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nasm.h') diff --git a/nasm.h b/nasm.h index 736c290e..18de37c8 100644 --- a/nasm.h +++ b/nasm.h @@ -584,13 +584,15 @@ enum ea_flags { /* special EA flags */ EAF_TIMESTWO = 4, /* really do EAX*2 not EAX+EAX */ EAF_REL = 8, /* IP-relative addressing */ EAF_ABS = 16, /* non-IP-relative addressing */ - EAF_FSGS = 32 /* fs/gs segment override present */ + EAF_FSGS = 32, /* fs/gs segment override present */ + EAF_MIB = 64, /* mib operand */ }; enum eval_hint { /* values for `hinttype' */ EAH_NOHINT = 0, /* no hint at all - our discretion */ EAH_MAKEBASE = 1, /* try to make given reg the base */ - EAH_NOTBASE = 2 /* try _not_ to make reg the base */ + EAH_NOTBASE = 2, /* try _not_ to make reg the base */ + EAH_SUMMED = 3, /* base and index are summed into index */ }; typedef struct operand { /* operand to an instruction */ -- cgit v1.2.1