diff --git a/arch/M68K/M68KDisassembler.c b/arch/M68K/M68KDisassembler.c index e0a712a51e..a1df81c336 100644 --- a/arch/M68K/M68KDisassembler.c +++ b/arch/M68K/M68KDisassembler.c @@ -41,6 +41,7 @@ #include "../../cs_priv.h" #include "../../utils.h" +#include "../../MathExtras.h" #include "../../MCInst.h" #include "../../MCInstrDesc.h" #include "../../MCRegisterInfo.h" @@ -2077,6 +2078,7 @@ static void d68020_cpgen(m68k_info *info) ext->op_size.type = M68K_SIZE_TYPE_FPU; ext->op_size.fpu_size = M68K_FPU_SIZE_SINGLE; get_ea_mode_op(info, op0, info->ir, 4); + op0->simm = BitsToFloat(op0->imm); op0->type = M68K_OP_FP_SINGLE; break; diff --git a/suite/cstest/issues.cs b/suite/cstest/issues.cs index e19c4e4661..199961a9f8 100644 --- a/suite/cstest/issues.cs +++ b/suite/cstest/issues.cs @@ -247,6 +247,10 @@ 0x33,0xc0 == xor ax, ax 0xba,0x5a,0xff == mov dx, 0xff5a +!# issue 1710 M68K floating point immediates broken on big endian hosts +!# CS_ARCH_M68K, CS_MODE_BIG_ENDIAN | CS_MODE_M68K_040, None +0xf2,0x3c,0x44,0x22,0x40,0x49,0x0e,0x56 == fadd.s #3.141500, fp0 + !# issue 1708 M68K floating point loads and stores generate the same op_str !# CS_ARCH_M68K, CS_MODE_BIG_ENDIAN | CS_MODE_M68K_040, None 0xf2,0x27,0x74,0x00 == fmove.d fp0, -(a7)