Skip to content

Commit

Permalink
Honour direction bit in fmove instruction (capstone-engine#1709)
Browse files Browse the repository at this point in the history
Co-authored-by: Michal Schulz <[email protected]>
  • Loading branch information
michalsc and Michal Schulz authored Dec 3, 2020
1 parent 2bc4e7c commit cb3c354
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions arch/M68K/M68KDisassembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -2062,9 +2062,18 @@ static void d68020_cpgen(m68k_info *info)
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;
Expand Down

0 comments on commit cb3c354

Please sign in to comment.