Honour direction bit in fmove instruction (#1709)
Co-authored-by: Michal Schulz <michal@Michals-iMac-Pro.local>
diff --git a/arch/M68K/M68KDisassembler.c b/arch/M68K/M68KDisassembler.c
index 4b26e02..bc25152 100644
--- a/arch/M68K/M68KDisassembler.c
+++ b/arch/M68K/M68KDisassembler.c
@@ -2062,9 +2062,18 @@
ext->op_size.type = M68K_SIZE_TYPE_CPU;
ext->op_size.cpu_size = 0;
- op0 = &ext->operands[0];
- op1 = &ext->operands[1];
-
+ // Special case - adjust direction of fmove
+ if ((opmode == 0x00) && ((next >> 13) & 0x1) != 0)
+ {
+ op0 = &ext->operands[1];
+ op1 = &ext->operands[0];
+ }
+ else
+ {
+ op0 = &ext->operands[0];
+ op1 = &ext->operands[1];
+ }
+
if (rm == 0 && supports_single_op && src == dst) {
ext->op_count = 1;
op0->reg = M68K_REG_FP0 + dst;