First post, by danoon
I hope you don't mind that I keep asking questions about the normal core implementation.
cpu\core_normal\prefix_0f.h
CASE_0F_W(0xb7) /* MOVZX Gw,Ew */
CASE_0F_W(0xbf) /* MOVSX Gw,Ew */
{
GetRMrw;
if (rm >= 0xc0 ) {GetEArw;*rmrw=*earw;}
else {GetEAa;*rmrw=LoadMw(eaa);}
break;
}
In the intel manual at http://www.intel.com/Assets/PDF/manual/253666.pdf it talks about:
0F B7 /r MOVZX r32,r/m16
Move word to doubleword, zero-extension.
0F BF /r MOVSX r32,r/m16
Move word to doubleword, with sign-extension.
It seems to mean the implemenation in dosbox should be
CASE_0F_W(0xb7) /* MOVZX Gd,Ew */
{
GetRMrd;
if (rm >= 0xc0 ) {GetEArw;*rmrd=*earw;}
else {GetEAa;*rmrd=LoadMw(eaa);}
break;
}
break;
CASE_0F_W(0xbf) /* MOVSX Gd,Ew */
{
GetRMrd;
if (rm >= 0xc0 ) {GetEArw;*rmrd=(Bits16s)*earw;}
else {GetEAa;*rmrd=LoadMw(eaa);}
break;
}
GetRMrw was changed to GetRMrd and the movsx added a (Bit16s) cast.
Any thoughts on this?