thumb: add disassembler

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2023-09-27 17:31:00 +05:30
parent 208527b7f8
commit 5ec5e6dddc
13 changed files with 716 additions and 71 deletions

View File

@@ -1,8 +1,7 @@
#include "instruction.hh"
#include "util/bits.hh"
namespace matar {
namespace arm {
namespace matar::arm {
std::string
Instruction::disassemble() {
auto condition = stringify(this->condition);
@@ -232,4 +231,3 @@ Instruction::disassemble() {
data);
}
}
}

View File

@@ -2,8 +2,7 @@
#include "util/bits.hh"
#include <iterator>
namespace matar {
namespace arm {
namespace matar::arm {
Instruction::Instruction(uint32_t insn)
: condition(static_cast<Condition>(bit_range(insn, 28, 31))) {
// Branch and exhcange
@@ -275,4 +274,3 @@ Instruction::Instruction(uint32_t insn)
}
}
}
}

View File

@@ -5,8 +5,7 @@
#include <fmt/ostream.h>
#include <variant>
namespace matar {
namespace arm {
namespace matar::arm {
// https://en.cppreference.com/w/cpp/utility/variant/visit
template<class... Ts>
@@ -223,4 +222,3 @@ struct Instruction {
#endif
};
}
}