summaryrefslogtreecommitdiff
path: root/disasm.cpp
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2024-02-04 19:51:35 +0300
committerOxore <oxore@protonmail.com>2024-02-04 19:51:35 +0300
commit9fd2eba95beb6c9ce6fb26e1442aa2f68aac9b1f (patch)
tree9d351968b9757ccca48212fc2687d6df996d4fa2 /disasm.cpp
parent853bda8e4c9210062a1b793f3499270c9e4cf532 (diff)
Impl deep graph walk and distinct jump following option
This commit changes the default behavior which technically breaks backwards compatibility. It would be a concern if somebody else besides me is using this tool, but I doubt it would be the case, LOL.
Diffstat (limited to 'disasm.cpp')
-rw-r--r--disasm.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/disasm.cpp b/disasm.cpp
index ed30f4b..2b2ea81 100644
--- a/disasm.cpp
+++ b/disasm.cpp
@@ -1573,19 +1573,14 @@ static size_t m68k_disasm(DisasmNode &n, uint16_t i, const DataView &c)
size_t DisasmNode::Disasm(const DataView &code)
{
- // We assume that machine have no MMU and ROM data always starts with 0
+ // We assume that machine have no MMU and ROM data always starts at 0
assert(this->address < code.size);
- // It is possible to have multiple DisasmNode::Disasm() calls, and there is
- // no point to disassemble it again if it already has opcode determined
- if (this->op.opcode != OpCode::kNone) {
- return this->size;
- }
size = kInstructionSizeStepBytes;
ref_kinds = 0;
ref1_addr = 0;
ref2_addr = 0;
const uint16_t instr = GetU16BE(code.buffer + this->address);
- if (this->type == TracedNodeType::kInstruction) {
+ if (IsInstruction(this->type)) {
return m68k_disasm(*this, instr, code);
} else {
// Data should not be disassembled
@@ -1595,7 +1590,7 @@ size_t DisasmNode::Disasm(const DataView &code)
size_t DisasmNode::DisasmAsRaw(const DataView &code)
{
- // We assume that machine have no MMU and ROM data always starts with 0
+ // We assume that machine have no MMU and ROM data always starts at 0
assert(this->address < code.size);
size = kInstructionSizeStepBytes;
ref_kinds = 0;