diff --git a/src/ia32/disasm-ia32.cc b/src/ia32/disasm-ia32.cc index 44afdd6ddb..dc4c27e88a 100644 --- a/src/ia32/disasm-ia32.cc +++ b/src/ia32/disasm-ia32.cc @@ -924,14 +924,18 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector out_buffer, break; case 0xF6: - { int mod, regop, rm; - get_modrm(*(data+1), &mod, ®op, &rm); - if (mod == 3 && regop == eax) { - AppendToBuffer("test_b %s,%d", NameOfCPURegister(rm), *(data+2)); + { data++; + int mod, regop, rm; + get_modrm(*data, &mod, ®op, &rm); + if (regop == eax) { + AppendToBuffer("test_b "); + data += PrintRightOperand(data); + int32_t imm = *data; + AppendToBuffer(",0x%x", imm); + data++; } else { UnimplementedInstruction(); } - data += 3; } break; diff --git a/test/cctest/test-disasm-ia32.cc b/test/cctest/test-disasm-ia32.cc index f94cd457cd..c8e0197947 100644 --- a/test/cctest/test-disasm-ia32.cc +++ b/test/cctest/test-disasm-ia32.cc @@ -244,6 +244,9 @@ TEST(DisasmIa320) { __ test(edx, Immediate(12345)); __ test(edx, Operand(ebx, ecx, times_8, 10000)); + __ test(Operand(esi, edi, times_1, -20000000), Immediate(300000000)); + __ test_b(edx, Operand(ecx, ebx, times_2, 1000)); + __ test_b(Operand(eax, -20), 0x9A); __ nop(); __ xor_(edx, 12345);