1
0
Fork 0

handle opcode 0xff subcode 7 as invalid instruction, fixes dif-2 and others

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3484
This commit is contained in:
Sebastian Strohhäcker 2009-10-18 17:52:10 +00:00
parent 23c833c794
commit 8e761077e1
5 changed files with 26 additions and 15 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: decoder.h,v 1.58 2009-10-08 20:01:31 c2woody Exp $ */
/* $Id: decoder.h,v 1.59 2009-10-18 17:52:09 c2woody Exp $ */
#define X86_DYNFPU_DH_ENABLED
#define X86_INLINED_MEMACCESS
@ -2665,7 +2665,8 @@ restart_prefix:
dyn_push(src);
break;
default:
IllegalOption("opcode 0xff");
LOG(LOG_CPU,LOG_ERROR)("CPU:GRP5:Illegal opcode 0xff");
goto illegalopcode;
}}
break;
default:

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: decoder.h,v 1.7 2009-10-08 20:01:31 c2woody Exp $ */
/* $Id: decoder.h,v 1.8 2009-10-18 17:52:10 c2woody Exp $ */
#include "decoder_basic.h"
@ -566,7 +566,16 @@ restart_prefix:
if (dyn_grp4_eb()) goto finish_block;
break;
case 0xff:
if (dyn_grp4_ev()) goto core_close_block;
switch (dyn_grp4_ev()) {
case 0:
break;
case 1:
goto core_close_block;
case 2:
goto illegalopcode;
default:
break;
}
break;
default:

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: decoder_opcodes.h,v 1.9 2009-06-25 19:31:43 c2woody Exp $ */
/* $Id: decoder_opcodes.h,v 1.10 2009-10-18 17:52:10 c2woody Exp $ */
/*
@ -818,7 +818,7 @@ static bool dyn_grp4_eb(void) {
return false;
}
static bool dyn_grp4_ev(void) {
static Bitu dyn_grp4_ev(void) {
dyn_get_modrm();
if (decode.modrm.mod<3) {
dyn_fill_ea(FC_ADDR);
@ -848,10 +848,10 @@ static bool dyn_grp4_ev(void) {
gen_restore_addr_reg();
gen_mov_word_from_reg(FC_ADDR,decode.big_op?(void*)(&reg_eip):(void*)(&reg_ip),decode.big_op);
return true;
return 1;
case 0x4: // JMP Ev
gen_mov_word_from_reg(FC_OP1,decode.big_op?(void*)(&reg_eip):(void*)(&reg_ip),decode.big_op);
return true;
return 1;
case 0x3: // CALL Ep
case 0x5: // JMP Ep
if (!decode.big_op) gen_extend_word(false,FC_OP1);
@ -865,15 +865,16 @@ static bool dyn_grp4_ev(void) {
gen_restore_reg(FC_OP1,FC_ADDR);
gen_call_function_IRRR(decode.modrm.reg == 3 ? (void*)(&CPU_CALL) : (void*)(&CPU_JMP),
decode.big_op,FC_OP2,FC_ADDR,FC_RETOP);
return true;
return 1;
case 0x6: // PUSH Ev
if (decode.big_op) gen_call_function_raw((void*)&dynrec_push_dword);
else gen_call_function_raw((void*)&dynrec_push_word);
break;
default:
IllegalOptionDynrec("dyn_grp4_ev");
// IllegalOptionDynrec("dyn_grp4_ev");
return 2;
}
return false;
return 0;
}

View file

@ -709,8 +709,8 @@
else {GetEAa;Push_32(LoadMd(eaa));}
break;
default:
E_Exit("CPU:66:GRP5:Illegal call %2X",which);
break;
LOG(LOG_CPU,LOG_ERROR)("CPU:66:GRP5:Illegal call %2X",which);
goto illegal_opcode;
}
break;
}

View file

@ -1165,8 +1165,8 @@
else {GetEAa;Push_16(LoadMw(eaa));}
break;
default:
E_Exit("CPU:GRP5:Illegal Call %2X",which);
break;
LOG(LOG_CPU,LOG_ERROR)("CPU:GRP5:Illegal Call %2X",which);
goto illegal_opcode;
}
break;
}