From 9b25131b4f7845ec67d5a5d3d969a508dd3695c9 Mon Sep 17 00:00:00 2001 From: "whesse@chromium.org" Date: Mon, 27 Jul 2009 10:39:46 +0000 Subject: [PATCH] X64: Add mov rax,(mem64) to disassembler. Review URL: http://codereview.chromium.org/159397 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2540 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/x64/disasm-x64.cc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/x64/disasm-x64.cc b/src/x64/disasm-x64.cc index 8b746c4ba4..4e91f3111c 100644 --- a/src/x64/disasm-x64.cc +++ b/src/x64/disasm-x64.cc @@ -1343,6 +1343,39 @@ int DisassemblerX64::InstructionDecode(v8::internal::Vector out_buffer, data += 2; break; + case 0xA1: // Fall through. + case 0xA3: + switch (operand_size()) { + case DOUBLEWORD_SIZE: { + const char* memory_location = NameOfAddress( + reinterpret_cast( + *reinterpret_cast(data + 1))); + if (*data & 0x2 == 0x2) { // Opcode 0xA3 + AppendToBuffer("movzxlq rax,(%s)", memory_location); + } else { // Opcode 0xA1 + AppendToBuffer("movzxlq (%s),rax", memory_location); + } + data += 5; + break; + } + case QUADWORD_SIZE: { + // New x64 instruction mov rax,(imm_64). + const char* memory_location = NameOfAddress( + *reinterpret_cast(data + 1)); + if (*data & 0x2 == 0x2) { // Opcode 0xA3 + AppendToBuffer("movq rax,(%s)", memory_location); + } else { // Opcode 0xA1 + AppendToBuffer("movq (%s),rax", memory_location); + } + data += 9; + break; + } + default: + UnimplementedInstruction(); + data += 2; + } + break; + case 0xA8: AppendToBuffer("test al,0x%x", *reinterpret_cast(data + 1)); data += 2;