summaryrefslogtreecommitdiff
path: root/disasm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'disasm.cpp')
-rw-r--r--disasm.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/disasm.cpp b/disasm.cpp
index d33f55a..63fb89c 100644
--- a/disasm.cpp
+++ b/disasm.cpp
@@ -1368,10 +1368,23 @@ static void chunk_mf000_vc000(DisasmNode &n, uint16_t i, const DataBuffer &c, co
}
static inline void disasm_addx(
- DisasmNode &node, const uint16_t instr, const DataBuffer &code, const Settings &s)
+ DisasmNode &node, const uint16_t instr, const DataBuffer &, const Settings &)
{
- // TODO
- return disasm_verbatim(node, instr, code, s);
+ const OpSize opsize = static_cast<OpSize>((instr >> 6) & 3);
+ // Already handled by parent call of `disasm_add_addx_adda`
+ assert(opsize != OpSize::kInvalid);
+ const int m = (instr >> 3) & 1;
+ const int xn = instr & 7;
+ const int xi = (instr >> 9) & 7;
+ const auto src = m ? AddrModeArg::AnAddrDecr(xn) : AddrModeArg::Dn(xn);
+ const auto dst = m ? AddrModeArg::AnAddrDecr(xi) : AddrModeArg::Dn(xi);
+ char src_str[32]{};
+ char dst_str[32]{};
+ src.SNPrint(src_str, sizeof(src_str));
+ dst.SNPrint(dst_str, sizeof(dst_str));
+ snprintf(node.mnemonic, kMnemonicBufferSize, "addx%c", suffix_from_opsize(opsize));
+ snprintf(node.arguments, kArgsBufferSize, "%s,%s", src_str, dst_str);
+ node.size = kInstructionSizeStepBytes + src.Size() + dst.Size();
}
static inline void disasm_adda(