diff options
author | Mark Mendell <mark.p.mendell@intel.com> | 2014-05-30 15:05:09 -0400 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-05-30 13:04:11 -0700 |
commit | 67d18be2a5bddbd8ee9ef144b34ccaeba08a1db2 (patch) | |
tree | 77a7d6e731f63ec95005e52261585d1b93324929 /disassembler | |
parent | b413cd79c46b7c48ac763cb8152a55a4ed60fe9f (diff) | |
download | art-67d18be2a5bddbd8ee9ef144b34ccaeba08a1db2.zip art-67d18be2a5bddbd8ee9ef144b34ccaeba08a1db2.tar.gz art-67d18be2a5bddbd8ee9ef144b34ccaeba08a1db2.tar.bz2 |
Support disassembly of 16-bit immediates
Change-Id: I66f5ce93077241204311e52c547599f5287bae04
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
Diffstat (limited to 'disassembler')
-rw-r--r-- | disassembler/disassembler_x86.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/disassembler/disassembler_x86.cc b/disassembler/disassembler_x86.cc index cba4ebf..614eca1 100644 --- a/disassembler/disassembler_x86.cc +++ b/disassembler/disassembler_x86.cc @@ -1040,8 +1040,13 @@ DISASSEMBLER_ENTRY(cmp, instr++; } else { CHECK_EQ(immediate_bytes, 4u); - args << StringPrintf("%d", *reinterpret_cast<const int32_t*>(instr)); - instr += 4; + if (prefix[2] == 0x66) { // Operand size override from 32-bit to 16-bit. + args << StringPrintf("%d", *reinterpret_cast<const int16_t*>(instr)); + instr += 2; + } else { + args << StringPrintf("%d", *reinterpret_cast<const int32_t*>(instr)); + instr += 4; + } } } else if (branch_bytes > 0) { DCHECK(!has_modrm); |