diff options
author | Jin Kyu Song <jin.kyu.song@intel.com> | 2013-10-15 19:10:13 -0700 |
---|---|---|
committer | Jin Kyu Song <jin.kyu.song@intel.com> | 2013-11-20 11:29:41 -0800 |
commit | 164d60740f0aa2759ae78874bd5c8692d8d59e60 (patch) | |
tree | 237161a1e4ac230347feefa20a9ed1fc0b80a27a /parser.c | |
parent | 0bc288f8b9ec5fb30fb816008e81282081d85e82 (diff) | |
download | nasm-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.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 */ |