diff --git a/src/cpu/core_full/optable.h b/src/cpu/core_full/optable.h index 1d21d4b5..93c51057 100644 --- a/src/cpu/core_full/optable.h +++ b/src/cpu/core_full/optable.h @@ -528,7 +528,7 @@ static OpCode OpCodeTable[1024]={ /* 0x2f0 - 0x2f7 */ {D_LOCK ,0 ,0 ,0 },{D_ICEBP ,0 ,0 ,0 }, {L_PREREPNE ,0 ,0 ,0 },{L_PREREP ,0 ,0 ,0 }, -{0 ,0 ,0 ,0 },{D_CMC ,0 ,0 ,0 }, +{D_HLT ,0 ,0 ,0 },{D_CMC ,0 ,0 ,0 }, {L_MODRM ,8 ,0 ,M_GRP },{L_MODRM ,0xa ,0 ,M_GRP }, /* 0x2f8 - 0x2ff */ {D_CLC ,0 ,0 ,0 },{D_STC ,0 ,0 ,0 }, diff --git a/src/cpu/core_normal/prefix_0f.h b/src/cpu/core_normal/prefix_0f.h index 0f229830..16397144 100644 --- a/src/cpu/core_normal/prefix_0f.h +++ b/src/cpu/core_normal/prefix_0f.h @@ -344,7 +344,9 @@ break; CASE_0F_W(0xb2) /* LSS Ew */ { - GetRMrw;GetEAa; + GetRMrw; + if (rm >= 0xc0) goto illegal_opcode; + GetEAa; if (CPU_SetSegGeneral(ss,LoadMw(eaa+2))) RUNEXCEPTION(); *rmrw=LoadMw(eaa); break; @@ -367,14 +369,18 @@ } CASE_0F_W(0xb4) /* LFS Ew */ { - GetRMrw;GetEAa; + GetRMrw; + if (rm >= 0xc0) goto illegal_opcode; + GetEAa; if (CPU_SetSegGeneral(fs,LoadMw(eaa+2))) RUNEXCEPTION(); *rmrw=LoadMw(eaa); break; } CASE_0F_W(0xb5) /* LGS Ew */ { - GetRMrw;GetEAa; + GetRMrw; + if (rm >= 0xc0) goto illegal_opcode; + GetEAa; if (CPU_SetSegGeneral(gs,LoadMw(eaa+2))) RUNEXCEPTION(); *rmrw=LoadMw(eaa); break; diff --git a/src/cpu/core_normal/prefix_66.h b/src/cpu/core_normal/prefix_66.h index f2aef294..473248e1 100644 --- a/src/cpu/core_normal/prefix_66.h +++ b/src/cpu/core_normal/prefix_66.h @@ -462,14 +462,18 @@ continue; CASE_D(0xc4) /* LES */ { - GetRMrd;GetEAa; + GetRMrd; + if (rm >= 0xc0) goto illegal_opcode; + GetEAa; if (CPU_SetSegGeneral(es,LoadMw(eaa+4))) RUNEXCEPTION(); *rmrd=LoadMd(eaa); break; } CASE_D(0xc5) /* LDS */ { - GetRMrd;GetEAa; + GetRMrd; + if (rm >= 0xc0) goto illegal_opcode; + GetEAa; if (CPU_SetSegGeneral(ds,LoadMw(eaa+4))) RUNEXCEPTION(); *rmrd=LoadMd(eaa); break; diff --git a/src/cpu/core_normal/prefix_66_0f.h b/src/cpu/core_normal/prefix_66_0f.h index 8c00c268..6c5318cd 100644 --- a/src/cpu/core_normal/prefix_66_0f.h +++ b/src/cpu/core_normal/prefix_66_0f.h @@ -237,7 +237,9 @@ } CASE_0F_D(0xb2) /* LSS Ed */ { - GetRMrd;GetEAa; + GetRMrd; + if (rm >= 0xc0) goto illegal_opcode; + GetEAa; if (CPU_SetSegGeneral(ss,LoadMw(eaa+4))) RUNEXCEPTION(); *rmrd=LoadMd(eaa); break; @@ -260,14 +262,18 @@ } CASE_0F_D(0xb4) /* LFS Ed */ { - GetRMrd;GetEAa; + GetRMrd; + if (rm >= 0xc0) goto illegal_opcode; + GetEAa; if (CPU_SetSegGeneral(fs,LoadMw(eaa+4))) RUNEXCEPTION(); *rmrd=LoadMd(eaa); break; } CASE_0F_D(0xb5) /* LGS Ed */ { - GetRMrd;GetEAa; + GetRMrd; + if (rm >= 0xc0) goto illegal_opcode; + GetEAa; if (CPU_SetSegGeneral(gs,LoadMw(eaa+4))) RUNEXCEPTION(); *rmrd=LoadMd(eaa); break; diff --git a/src/cpu/core_normal/prefix_none.h b/src/cpu/core_normal/prefix_none.h index 9622294f..deeeba3c 100644 --- a/src/cpu/core_normal/prefix_none.h +++ b/src/cpu/core_normal/prefix_none.h @@ -687,14 +687,18 @@ continue; CASE_W(0xc4) /* LES */ { - GetRMrw;GetEAa; + GetRMrw; + if (rm >= 0xc0) goto illegal_opcode; + GetEAa; if (CPU_SetSegGeneral(es,LoadMw(eaa+2))) RUNEXCEPTION(); *rmrw=LoadMw(eaa); break; } CASE_W(0xc5) /* LDS */ { - GetRMrw;GetEAa; + GetRMrw; + if (rm >= 0xc0) goto illegal_opcode; + GetEAa; if (CPU_SetSegGeneral(ds,LoadMw(eaa+2))) RUNEXCEPTION(); *rmrw=LoadMw(eaa); break;