diff options
author | Oxore <oxore@protonmail.com> | 2023-05-08 12:37:54 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2023-05-08 12:37:54 +0300 |
commit | 19e313b5891dfaceead13df6dd3e828a9ce90592 (patch) | |
tree | 70310c67c3ae3a4b320d5b0c2b68d32b5b192ead /disasm.cpp | |
parent | 5c8aedf98c462387ad073698918d5cb7d9965a4b (diff) |
Impl ADDX
Diffstat (limited to 'disasm.cpp')
-rw-r--r-- | disasm.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -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( |