about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-05 12:01:43 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-05 12:01:49 +0100
commit48e28bfdc562303ab3b1f47d4f4dec3f973b9914 (patch)
tree5863259239ef103793465767250c3bff48e696fe /src
parent4278ca8b801491d3d31ac8b89c9c66a9dfe60c65 (diff)
downloadbox64-48e28bfdc562303ab3b1f47d4f4dec3f973b9914.tar.gz
box64-48e28bfdc562303ab3b1f47d4f4dec3f973b9914.zip
Adjusted 89 and 8B opcode to clear upper part of regs when ED is a reg
Diffstat (limited to 'src')
-rwxr-xr-xsrc/emu/x64run.c12
1 files changed, 10 insertions, 2 deletions
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 */