summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorJin Kyu Song <jin.kyu.song@intel.com>2013-10-15 19:10:13 -0700
committerJin Kyu Song <jin.kyu.song@intel.com>2013-11-20 11:29:41 -0800
commit164d60740f0aa2759ae78874bd5c8692d8d59e60 (patch)
tree237161a1e4ac230347feefa20a9ed1fc0b80a27a /parser.c
parent0bc288f8b9ec5fb30fb816008e81282081d85e82 (diff)
downloadnasm-164d60740f0aa2759ae78874bd5c8692d8d59e60.tar.gz
nasm-164d60740f0aa2759ae78874bd5c8692d8d59e60.tar.bz2
nasm-164d60740f0aa2759ae78874bd5c8692d8d59e60.zip
MPX: Add MPX instructions
Added MPX instructions and corresponding parser and encoder. ICC style mib - base + disp and index are separate - is supported. E.g. bndstx [ebx+3], bnd2, edx -> ebx+3 : base+disp, edx : index As a supplement to NASM style mib - split EA - parser, omitted base+disp is now treated as 0 displacement. E.g. bndstx [,edx], bnd2 -> bndstx [0,edx], bnd2 Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/parser.c b/parser.c
index bb56924..0068ca3 100644
--- a/parser.c
+++ b/parser.c
@@ -821,6 +821,13 @@ is_expression:
process_size_override(result, op);
i = stdscan(NULL, &tokval);
}
+ /* when a comma follows an opening bracket - [ , eax*4] */
+ if (i == ',') {
+ /* treat as if there is a zero displacement virtually */
+ tokval.t_type = TOKEN_NUM;
+ tokval.t_integer = 0;
+ stdscan_set(stdscan_get() - 1); /* rewind the comma */
+ }
} else { /* immediate operand, or register */
mref = false;
bracket = false; /* placate optimisers */