diff --git a/src/cpu/core_full/op.h b/src/cpu/core_full/op.h index 29f9bc44..0adb0a64 100644 --- a/src/cpu/core_full/op.h +++ b/src/cpu/core_full/op.h @@ -616,6 +616,16 @@ switch (inst.code.op) { LOG(LOG_CPU,LOG_ERROR)("Unhandled FPU ESCAPE %d",inst.code.save); goto nextopcode; #endif + case O_BOUNDw: + { + Bit16s bound_min, bound_max; + bound_min=LoadMw(inst.rm_eaa); + bound_max=LoadMw(inst.rm_eaa+2); + if ( (((Bit16s)inst.op1.w) < bound_min) || (((Bit16s)inst.op1.w) > bound_max) ) { + EXCEPTION(5); + } + } + break; case 0: break; default: diff --git a/src/cpu/core_full/optable.h b/src/cpu/core_full/optable.h index bc6c9908..b74bbc9f 100644 --- a/src/cpu/core_full/optable.h +++ b/src/cpu/core_full/optable.h @@ -69,7 +69,7 @@ static OpCode OpCodeTable[1024]={ /* 0x60 - 0x67 */ {D_PUSHAw ,0 ,0 ,0 },{D_POPAw ,0 ,0 ,0 }, -{L_MODRM ,O_BOUNDw ,0 ,0 },{L_MODRM ,O_ARPL ,S_Ew ,M_EwGw }, +{L_MODRM ,O_BOUNDw ,0 ,M_Gw },{L_MODRM ,O_ARPL ,S_Ew ,M_EwGw }, {L_PRESEG ,0 ,0 ,fs },{L_PRESEG ,0 ,0 ,gs }, {L_PREOP ,0 ,0 ,0 },{L_PREADD ,0 ,0 ,0 }, /* 0x68 - 0x6f */ @@ -455,8 +455,7 @@ static OpCode OpCodeTable[1024]={ /* 0x288 - 0x28f */ {L_MODRM ,0 ,S_Eb ,M_Gb },{L_MODRM ,0 ,S_Ed ,M_Gd }, {L_MODRM ,0 ,S_Gb ,M_Eb },{L_MODRM ,0 ,S_Gd ,M_Ed }, -//TODO Check if the saving a segment in 32bit reg does zero extension? -{L_MODRM ,0 ,S_Ed ,M_SEG },{L_MODRM ,0 ,S_Gd ,M_EA }, +{L_MODRM ,0 ,S_EdMw ,M_SEG },{L_MODRM ,0 ,S_Gd ,M_EA }, {L_MODRM ,0 ,S_SEGm ,M_Ew },{L_MODRM ,0 ,S_Ed ,M_POPd }, /* 0x290 - 0x297 */ diff --git a/src/cpu/core_full/save.h b/src/cpu/core_full/save.h index 0f7f4fe4..6c8f9c55 100644 --- a/src/cpu/core_full/save.h +++ b/src/cpu/core_full/save.h @@ -33,6 +33,10 @@ switch (inst.code.save) { if (inst.rm<0xc0) SaveMd(inst.rm_eaa,inst.op1.d); else reg_32(inst.rm_eai)=inst.op1.d; break; + case S_EdMw: /* Special one 16 to memory, 32 zero extend to reg */ + if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst.op1.w); + else reg_32(inst.rm_eai)=inst.op1.d; + break; case S_Gd: reg_32(inst.rm_index)=inst.op1.d; break; diff --git a/src/cpu/core_full/support.h b/src/cpu/core_full/support.h index b5a40f59..df35dc4f 100644 --- a/src/cpu/core_full/support.h +++ b/src/cpu/core_full/support.h @@ -100,7 +100,7 @@ enum { S_C_Eb, S_Eb,S_Gb,S_EbGb, S_Ew,S_Gw,S_EwGw, - S_Ed,S_Gd,S_EdGd, + S_Ed,S_Gd,S_EdGd,S_EdMw, S_REGb,S_REGw,S_REGd,