From 48e28bfdc562303ab3b1f47d4f4dec3f973b9914 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 5 Mar 2021 12:01:43 +0100 Subject: Adjusted 89 and 8B opcode to clear upper part of regs when ED is a reg --- src/emu/x64run.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/emu/x64run.c b/src/emu/x64run.c index 478f87c5..13ec515e 100755 --- a/src/emu/x64run.c +++ b/src/emu/x64run.c @@ -283,7 +283,11 @@ x64emurun: if(rex.w) ED->q[0] = GD->q[0]; else - ED->dword[0] = GD->dword[0]; + //if ED is a reg, than the opcode works like movzx + if((nextop&0xC0)==0xC0) + ED->q[0] = GD->dword[0]; + else + ED->dword[0] = GD->dword[0]; break; case 0x8B: /* MOV Gd,Ed */ @@ -293,7 +297,11 @@ x64emurun: if(rex.w) GD->q[0] = ED->q[0]; else - GD->dword[0] = ED->dword[0]; + //if ED is a reg, than the opcode works like movzx + if((nextop&0xC0)==0xC0) + GD->q[0] = ED->dword[0]; + else + GD->dword[0] = ED->dword[0]; break; case 0x8D: /* LEA Gd,M */ -- cgit 1.4.1