diff --git a/bochs/cpu/proc_ctrl.cc b/bochs/cpu/proc_ctrl.cc index e3d684f61..4b629d03a 100644 --- a/bochs/cpu/proc_ctrl.cc +++ b/bochs/cpu/proc_ctrl.cc @@ -330,17 +330,17 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVDIR64B(bxInstruction_c *i) { #if BX_CPU_LEVEL >= 6 -#if BX_SUPPORT_X86_64 - bx_address src_eaddr = BX_READ_64BIT_REG(i->dst()) & i->asize_mask(); -#else - bx_address src_eaddr = BX_READ_32BIT_REG(i->dst()) & i->asize_mask(); -#endif - BxPackedZmmRegister zmm; // zmm is always made available even if EVEX is not compiled in - read_virtual_zmmword(BX_SEG_REG_ES, src_eaddr, &zmm); + bx_address src_eaddr = BX_CPU_RESOLVE_ADDR(i); + read_virtual_zmmword(i->seg(), src_eaddr, &zmm); + +#if BX_SUPPORT_X86_64 + bx_address dst_eaddr = BX_READ_64BIT_REG(i->dst()); +#else + bx_address dst_eaddr = BX_READ_32BIT_REG(i->dst()); +#endif + write_virtual_zmmword_aligned(BX_SEG_REG_ES, dst_eaddr & i->asize_mask(), &zmm); - bx_address dst_eaddr = BX_CPU_RESOLVE_ADDR(i); - write_virtual_zmmword_aligned(i->seg(), dst_eaddr, &zmm); #endif BX_NEXT_INSTR(i);