diff --git a/src/Instruction.cpp b/src/Instruction.cpp index 78f2b36..dbe019e 100644 --- a/src/Instruction.cpp +++ b/src/Instruction.cpp @@ -13,22 +13,19 @@ Instruction::Instruction(uint32_t instr) { } extension_t Instruction::check_extension() const { - if (((m_instr & 0x0000007F) == 0b0110011) + if (((m_instr & 0x0000007F) == 0b0110011) && ( ((m_instr & 0x7F000000) >> 25) == 0b0000001)) { return M_EXTENSION; } else if ((m_instr & 0x0000007F) == 0b0101111) { - return A_EXTENSION; - } else if ((m_instr & 0x00000003) == 0b11) { + return A_EXTENSION; + } else if ((m_instr & 0x00000003) == 0b00) { + return C_EXTENSION; + } else if ((m_instr & 0x00000003) == 0b01) { + return C_EXTENSION; + } else if ((m_instr & 0x00000003) == 0b10) { + return C_EXTENSION; + } else { return BASE_EXTENSION; - } else if ((m_instr & 0x00000003) == 0b00) { - return C_EXTENSION; - } else if ((m_instr & 0x00000003) == 0b01) { - return C_EXTENSION; - } else if ((m_instr & 0x00000003) == 0b10) { - return C_EXTENSION; - } else { - std::cout << "Unknown\n"; - return UNKNOWN_EXTENSION; } }