Split for JMP_Ew/Ed opcodes from Grp5

This commit is contained in:
Stanislav Shwartsman 2007-12-14 23:15:52 +00:00
parent fd73390ca5
commit 3a6d714398
4 changed files with 34 additions and 28 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.390 2007-12-14 22:41:43 sshwarts Exp $
// $Id: cpu.h,v 1.391 2007-12-14 23:15:52 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -1978,11 +1978,14 @@ public: // for now...
BX_SMF void CALL_Ew(bxInstruction_c *);
BX_SMF void CALL32_Ep(bxInstruction_c *);
BX_SMF void CALL16_Ep(bxInstruction_c *);
BX_SMF void JMP_Ed(bxInstruction_c *);
BX_SMF void JMP_Ew(bxInstruction_c *);
BX_SMF void JMP32_Ep(bxInstruction_c *);
BX_SMF void JMP16_Ep(bxInstruction_c *);
BX_SMF void JMP_EdR(bxInstruction_c *);
BX_SMF void JMP_EwR(bxInstruction_c *);
BX_SMF void JMP_EdM(bxInstruction_c *);
BX_SMF void JMP_EwM(bxInstruction_c *);
BX_SMF void PUSH_EwR(bxInstruction_c *);
BX_SMF void PUSH_EdR(bxInstruction_c *);
BX_SMF void PUSH_EwM(bxInstruction_c *);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ctrl_xfer16.cc,v 1.44 2007-11-24 15:27:27 sshwarts Exp $
// $Id: ctrl_xfer16.cc,v 1.45 2007-12-14 23:15:52 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -539,18 +539,20 @@ void BX_CPU_C::JNLE_Jw(bxInstruction_c *i)
#endif
}
void BX_CPU_C::JMP_Ew(bxInstruction_c *i)
void BX_CPU_C::JMP_EwM(bxInstruction_c *i)
{
Bit16u op1_16;
Bit16u new_IP;
if (i->modC0()) {
op1_16 = BX_READ_16BIT_REG(i->rm());
}
else {
read_virtual_word(i->seg(), RMAddr(i), &op1_16);
}
read_virtual_word(i->seg(), RMAddr(i), &new_IP);
Bit32u new_EIP = op1_16;
branch_near32((Bit32u) new_IP);
BX_INSTR_UCNEAR_BRANCH(BX_CPU_ID, BX_INSTR_IS_JMP, new_IP);
}
void BX_CPU_C::JMP_EwR(bxInstruction_c *i)
{
Bit32u new_EIP = BX_READ_16BIT_REG(i->rm());
branch_near32(new_EIP);
BX_INSTR_UCNEAR_BRANCH(BX_CPU_ID, BX_INSTR_IS_JMP, new_EIP);
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ctrl_xfer32.cc,v 1.56 2007-11-24 15:27:39 sshwarts Exp $
// $Id: ctrl_xfer32.cc,v 1.57 2007-12-14 23:15:52 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -527,24 +527,25 @@ void BX_CPU_C::JMP_Ap(bxInstruction_c *i)
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value, EIP);
}
void BX_CPU_C::JMP_Ed(bxInstruction_c *i)
void BX_CPU_C::JMP_EdM(bxInstruction_c *i)
{
Bit32u new_EIP;
/* op1_32 is a register or memory reference */
if (i->modC0()) {
new_EIP = BX_READ_32BIT_REG(i->rm());
}
else {
/* pointer, segment address pair */
read_virtual_dword(i->seg(), RMAddr(i), &new_EIP);
}
/* pointer, segment address pair */
read_virtual_dword(i->seg(), RMAddr(i), &new_EIP);
branch_near32(new_EIP);
BX_INSTR_UCNEAR_BRANCH(BX_CPU_ID, BX_INSTR_IS_JMP, new_EIP);
}
void BX_CPU_C::JMP_EdR(bxInstruction_c *i)
{
Bit32u new_EIP = BX_READ_32BIT_REG(i->rm());
branch_near32(new_EIP);
BX_INSTR_UCNEAR_BRANCH(BX_CPU_ID, BX_INSTR_IS_JMP, new_EIP);
}
/* Far indirect jump */
void BX_CPU_C::JMP32_Ep(bxInstruction_c *i)
{

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fetchdecode.h,v 1.45 2007-12-09 18:36:05 sshwarts Exp $
// $Id: fetchdecode.h,v 1.46 2007-12-14 23:15:52 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2005 Stanislav Shwartsman
@ -2889,7 +2889,7 @@ static const BxOpcodeInfo_t BxOpcodeInfoG5wM[8] = {
/* 1 */ { BxLockable, &BX_CPU_C::DEC_EwM },
/* 2 */ { BxTraceEnd, &BX_CPU_C::CALL_Ew },
/* 3 */ { BxTraceEnd, &BX_CPU_C::CALL16_Ep },
/* 4 */ { BxTraceEnd, &BX_CPU_C::JMP_Ew },
/* 4 */ { BxTraceEnd, &BX_CPU_C::JMP_EwM },
/* 5 */ { BxTraceEnd, &BX_CPU_C::JMP16_Ep },
/* 6 */ { 0, &BX_CPU_C::PUSH_EwM },
/* 7 */ { 0, &BX_CPU_C::BxError }
@ -2901,7 +2901,7 @@ static const BxOpcodeInfo_t BxOpcodeInfoG5wR[8] = {
/* 1 */ { 0, &BX_CPU_C::DEC_EwR },
/* 2 */ { BxTraceEnd, &BX_CPU_C::CALL_Ew },
/* 3 */ { 0, &BX_CPU_C::BxError }, // CALL16_Ep
/* 4 */ { BxTraceEnd, &BX_CPU_C::JMP_Ew },
/* 4 */ { BxTraceEnd, &BX_CPU_C::JMP_EwR },
/* 5 */ { 0, &BX_CPU_C::BxError }, // JMP16_Ep
/* 6 */ { 0, &BX_CPU_C::PUSH_EwR },
/* 7 */ { 0, &BX_CPU_C::BxError }
@ -2913,7 +2913,7 @@ static const BxOpcodeInfo_t BxOpcodeInfoG5dM[8] = {
/* 1 */ { BxLockable, &BX_CPU_C::DEC_EdM },
/* 2 */ { BxTraceEnd, &BX_CPU_C::CALL_Ed },
/* 3 */ { BxTraceEnd, &BX_CPU_C::CALL32_Ep },
/* 4 */ { BxTraceEnd, &BX_CPU_C::JMP_Ed },
/* 4 */ { BxTraceEnd, &BX_CPU_C::JMP_EdM },
/* 5 */ { BxTraceEnd, &BX_CPU_C::JMP32_Ep },
/* 6 */ { 0, &BX_CPU_C::PUSH_EdM },
/* 7 */ { 0, &BX_CPU_C::BxError }
@ -2925,7 +2925,7 @@ static const BxOpcodeInfo_t BxOpcodeInfoG5dR[8] = {
/* 1 */ { 0, &BX_CPU_C::DEC_EdR },
/* 2 */ { BxTraceEnd, &BX_CPU_C::CALL_Ed },
/* 3 */ { 0, &BX_CPU_C::BxError }, // CALL32_Ep
/* 4 */ { BxTraceEnd, &BX_CPU_C::JMP_Ed },
/* 4 */ { BxTraceEnd, &BX_CPU_C::JMP_EdR },
/* 5 */ { 0, &BX_CPU_C::BxError }, // JMP32_Ep
/* 6 */ { 0, &BX_CPU_C::PUSH_EdR },
/* 7 */ { 0, &BX_CPU_C::BxError }