Implemented FAST lazy flags version for logic instructions.

Small code cleanup/simplification for others.
This commit is contained in:
Stanislav Shwartsman 2004-08-13 20:00:03 +00:00
parent b820eae6d0
commit a1f830d429
24 changed files with 234 additions and 443 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: access.cc,v 1.44 2004-07-29 20:15:17 sshwarts Exp $
// $Id: access.cc,v 1.45 2004-08-13 20:00:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -25,9 +25,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: arith16.cc,v 1.30 2004-08-09 21:28:47 sshwarts Exp $
// $Id: arith16.cc,v 1.31 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -100,13 +100,10 @@ BX_CPU_C::ADD_GwEEw(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
sum_16 = op1_16 + op2_16;
SET_FLAGS_OSZAPC_16(op1_16, op2_16, sum_16, BX_INSTR_ADD16);
#endif
BX_WRITE_16BIT_REG(nnn, sum_16);
#if !defined(BX_HostAsm_Add16)
SET_FLAGS_OSZAPC_16(op1_16, op2_16, sum_16, BX_INSTR_ADD16);
#endif
}
void
@ -120,18 +117,14 @@ BX_CPU_C::ADD_GwEGw(bxInstruction_c *i)
#if defined(BX_HostAsm_Add16)
Bit32u flags32;
asmAdd16(sum_16, op1_16, op2_16, flags32);
setEFlagsOSZAPC(flags32);
#else
sum_16 = op1_16 + op2_16;
SET_FLAGS_OSZAPC_16(op1_16, op2_16, sum_16, BX_INSTR_ADD16);
#endif
BX_WRITE_16BIT_REG(nnn, sum_16);
#if !defined(BX_HostAsm_Add16)
SET_FLAGS_OSZAPC_16(op1_16, op2_16, sum_16, BX_INSTR_ADD16);
#endif
}
@ -142,7 +135,6 @@ BX_CPU_C::ADD_AXIw(bxInstruction_c *i)
op1_16 = AX;
op2_16 = i->Iw();
sum_16 = op1_16 + op2_16;
AX = sum_16;
@ -235,8 +227,7 @@ BX_CPU_C::SBB_EwGw(bxInstruction_c *i)
Write_RMW_virtual_word(diff_16);
}
SET_FLAGS_OSZAPC_16_CF(op1_16, op2_16, diff_16, BX_INSTR_SBB16,
temp_CF);
SET_FLAGS_OSZAPC_16_CF(op1_16, op2_16, diff_16, BX_INSTR_SBB16, temp_CF);
}
@ -259,8 +250,7 @@ BX_CPU_C::SBB_GwEw(bxInstruction_c *i)
BX_WRITE_16BIT_REG(i->nnn(), diff_16);
SET_FLAGS_OSZAPC_16_CF(op1_16, op2_16, diff_16, BX_INSTR_SBB16,
temp_CF);
SET_FLAGS_OSZAPC_16_CF(op1_16, op2_16, diff_16, BX_INSTR_SBB16, temp_CF);
}
@ -277,8 +267,7 @@ BX_CPU_C::SBB_AXIw(bxInstruction_c *i)
AX = diff_16;
SET_FLAGS_OSZAPC_16_CF(op1_16, op2_16, diff_16, BX_INSTR_SBB16,
temp_CF);
SET_FLAGS_OSZAPC_16_CF(op1_16, op2_16, diff_16, BX_INSTR_SBB16, temp_CF);
}
void
@ -300,8 +289,7 @@ BX_CPU_C::SBB_EwIw(bxInstruction_c *i)
Write_RMW_virtual_word(diff_16);
}
SET_FLAGS_OSZAPC_16_CF(op1_16, op2_16, diff_16, BX_INSTR_SBB16,
temp_CF);
SET_FLAGS_OSZAPC_16_CF(op1_16, op2_16, diff_16, BX_INSTR_SBB16, temp_CF);
}
@ -362,13 +350,10 @@ BX_CPU_C::SUB_GwEw(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
diff_16 = op1_16 - op2_16;
SET_FLAGS_OSZAPC_16(op1_16, op2_16, diff_16, BX_INSTR_SUB16);
#endif
BX_WRITE_16BIT_REG(nnn, diff_16);
#if !defined(BX_HostAsm_Sub16)
SET_FLAGS_OSZAPC_16(op1_16, op2_16, diff_16, BX_INSTR_SUB16);
#endif
}
void
@ -385,13 +370,10 @@ BX_CPU_C::SUB_AXIw(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
diff_16 = op1_16 - op2_16;
SET_FLAGS_OSZAPC_16(op1_16, op2_16, diff_16, BX_INSTR_SUB16);
#endif
AX = diff_16;
#if !defined(BX_HostAsm_Sub16)
SET_FLAGS_OSZAPC_16(op1_16, op2_16, diff_16, BX_INSTR_SUB16);
#endif
}
@ -411,13 +393,10 @@ BX_CPU_C::CMP_EwGw(bxInstruction_c *i)
#if defined(BX_HostAsm_Cmp16)
Bit32u flags32;
asmCmp16(op1_16, op2_16, flags32);
setEFlagsOSZAPC(flags32);
#else
Bit16u diff_16;
diff_16 = op1_16 - op2_16;
Bit16u diff_16 = op1_16 - op2_16;
SET_FLAGS_OSZAPC_16(op1_16, op2_16, diff_16, BX_INSTR_CMP16);
#endif
}
@ -439,13 +418,10 @@ BX_CPU_C::CMP_GwEw(bxInstruction_c *i)
#if defined(BX_HostAsm_Cmp16)
Bit32u flags32;
asmCmp16(op1_16, op2_16, flags32);
setEFlagsOSZAPC(flags32);
#else
Bit16u diff_16;
diff_16 = op1_16 - op2_16;
Bit16u diff_16 = op1_16 - op2_16;
SET_FLAGS_OSZAPC_16(op1_16, op2_16, diff_16, BX_INSTR_CMP16);
#endif
}
@ -464,9 +440,7 @@ BX_CPU_C::CMP_AXIw(bxInstruction_c *i)
asmCmp16(op1_16, op2_16, flags32);
setEFlagsOSZAPC(flags32);
#else
Bit16u diff_16;
diff_16 = op1_16 - op2_16;
Bit16u diff_16 = op1_16 - op2_16;
SET_FLAGS_OSZAPC_16(op1_16, op2_16, diff_16, BX_INSTR_CMP16);
#endif
}
@ -549,12 +523,10 @@ BX_CPU_C::ADD_EEwIw(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
sum_16 = op1_16 + op2_16;
#endif
Write_RMW_virtual_word(sum_16);
#if !defined(BX_HostAsm_Add16)
SET_FLAGS_OSZAPC_16(op1_16, op2_16, sum_16, BX_INSTR_ADD16);
#endif
Write_RMW_virtual_word(sum_16);
}
void
@ -572,12 +544,10 @@ BX_CPU_C::ADD_EGwIw(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
sum_16 = op1_16 + op2_16;
#endif
BX_WRITE_16BIT_REG(i->rm(), sum_16);
#if !defined(BX_HostAsm_Add16)
SET_FLAGS_OSZAPC_16(op1_16, op2_16, sum_16, BX_INSTR_ADD16);
#endif
BX_WRITE_16BIT_REG(i->rm(), sum_16);
}
void
@ -614,7 +584,6 @@ BX_CPU_C::SUB_EwIw(bxInstruction_c *i)
op1_16 = BX_READ_16BIT_REG(i->rm());
#if defined(BX_HostAsm_Sub16)
Bit32u flags32;
asmSub16(diff_16, op1_16, op2_16, flags32);
setEFlagsOSZAPC(flags32);
#else
@ -626,7 +595,6 @@ BX_CPU_C::SUB_EwIw(bxInstruction_c *i)
read_RMW_virtual_word(i->seg(), RMAddr(i), &op1_16);
#if defined(BX_HostAsm_Sub16)
Bit32u flags32;
asmSub16(diff_16, op1_16, op2_16, flags32);
setEFlagsOSZAPC(flags32);
#else
@ -659,15 +627,11 @@ BX_CPU_C::CMP_EwIw(bxInstruction_c *i)
asmCmp16(op1_16, op2_16, flags32);
setEFlagsOSZAPC(flags32);
#else
Bit16u diff_16;
diff_16 = op1_16 - op2_16;
Bit16u diff_16 = op1_16 - op2_16;
SET_FLAGS_OSZAPC_16(op1_16, op2_16, diff_16, BX_INSTR_CMP16);
#endif
}
void
BX_CPU_C::NEG_Ew(bxInstruction_c *i)
{
@ -728,14 +692,13 @@ BX_CPU_C::DEC_Ew(bxInstruction_c *i)
read_RMW_virtual_word(i->seg(), RMAddr(i), &op1_16);
#if defined(BX_HostAsm_Dec16)
Bit32u flags32;
asmDec16(op1_16, flags32);
setEFlagsOSZAP(flags32);
#else
op1_16--;
#endif
Write_RMW_virtual_word(op1_16);
}
}
#if !defined(BX_HostAsm_Dec16)
SET_FLAGS_OSZAP_16(0, 0, op1_16, BX_INSTR_DEC16);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: arith32.cc,v 1.33 2004-08-09 21:28:47 sshwarts Exp $
// $Id: arith32.cc,v 1.34 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -26,8 +26,6 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#define LOG_THIS BX_CPU_THIS_PTR
@ -48,17 +46,13 @@ BX_CPU_C::INC_ERX(bxInstruction_c *i)
asmInc32(BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].dword.erx, flags32);
setEFlagsOSZAP(flags32);
#else
Bit32u erx;
erx = ++ BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].dword.erx;
Bit32u erx = ++ BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].dword.erx;
SET_FLAGS_OSZAP_32(0, 0, erx, BX_INSTR_INC32);
#endif
#if BX_SUPPORT_X86_64
BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].dword.hrx = 0;
#endif
#if !defined(BX_HostAsm_Inc32)
SET_FLAGS_OSZAP_32(0, 0, erx, BX_INSTR_INC32);
#endif
}
void
@ -69,17 +63,13 @@ BX_CPU_C::DEC_ERX(bxInstruction_c *i)
asmDec32(BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].dword.erx, flags32);
setEFlagsOSZAP(flags32);
#else
Bit32u erx;
erx = -- BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].dword.erx;
Bit32u erx = -- BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].dword.erx;
SET_FLAGS_OSZAP_32(0, 0, erx, BX_INSTR_DEC32);
#endif
#if BX_SUPPORT_X86_64
BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].dword.hrx = 0;
#endif
#if !defined(BX_HostAsm_Dec32)
SET_FLAGS_OSZAP_32(0, 0, erx, BX_INSTR_DEC32);
#endif
}
void
@ -120,13 +110,10 @@ BX_CPU_C::ADD_GdEEd(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
sum_32 = op1_32 + op2_32;
SET_FLAGS_OSZAPC_32(op1_32, op2_32, sum_32, BX_INSTR_ADD32);
#endif
BX_WRITE_32BIT_REGZ(nnn, sum_32);
#if !defined(BX_HostAsm_Add32)
SET_FLAGS_OSZAPC_32(op1_32, op2_32, sum_32, BX_INSTR_ADD32);
#endif
}
void
@ -144,13 +131,10 @@ BX_CPU_C::ADD_GdEGd(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
sum_32 = op1_32 + op2_32;
SET_FLAGS_OSZAPC_32(op1_32, op2_32, sum_32, BX_INSTR_ADD32);
#endif
BX_WRITE_32BIT_REGZ(nnn, sum_32);
#if !defined(BX_HostAsm_Add32)
SET_FLAGS_OSZAPC_32(op1_32, op2_32, sum_32, BX_INSTR_ADD32);
#endif
}
@ -366,13 +350,10 @@ BX_CPU_C::SUB_GdEd(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
diff_32 = op1_32 - op2_32;
SET_FLAGS_OSZAPC_32(op1_32, op2_32, diff_32, BX_INSTR_SUB32);
#endif
BX_WRITE_32BIT_REGZ(nnn, diff_32);
#if !defined(BX_HostAsm_Sub32)
SET_FLAGS_OSZAPC_32(op1_32, op2_32, diff_32, BX_INSTR_SUB32);
#endif
}
void
@ -567,13 +548,10 @@ BX_CPU_C::ADD_EEdId(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
sum_32 = op1_32 + op2_32;
SET_FLAGS_OSZAPC_32(op1_32, op2_32, sum_32, BX_INSTR_ADD32);
#endif
Write_RMW_virtual_dword(sum_32);
#if !defined(BX_HostAsm_Add32)
SET_FLAGS_OSZAPC_32(op1_32, op2_32, sum_32, BX_INSTR_ADD32);
#endif
}
void
@ -590,13 +568,10 @@ BX_CPU_C::ADD_EGdId(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
sum_32 = op1_32 + op2_32;
SET_FLAGS_OSZAPC_32(op1_32, op2_32, sum_32, BX_INSTR_ADD32);
#endif
BX_WRITE_32BIT_REGZ(i->rm(), sum_32);
#if !defined(BX_HostAsm_Add32)
SET_FLAGS_OSZAPC_32(op1_32, op2_32, sum_32, BX_INSTR_ADD32);
#endif
}
void

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: arith64.cc,v 1.16 2004-08-09 21:28:47 sshwarts Exp $
// $Id: arith64.cc,v 1.17 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -26,8 +26,6 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#define LOG_THIS BX_CPU_THIS_PTR
@ -167,8 +165,7 @@ BX_CPU_C::ADC_GqEq(bxInstruction_c *i)
/* now write sum back to destination */
BX_WRITE_64BIT_REG(i->nnn(), sum_64);
SET_FLAGS_OSZAPC_64_CF(op1_64, op2_64, sum_64, BX_INSTR_ADC64,
temp_CF);
SET_FLAGS_OSZAPC_64_CF(op1_64, op2_64, sum_64, BX_INSTR_ADC64, temp_CF);
}
void
@ -186,8 +183,7 @@ BX_CPU_C::ADC_RAXId(bxInstruction_c *i)
/* now write sum back to destination */
RAX = sum_64;
SET_FLAGS_OSZAPC_64_CF(op1_64, op2_64, sum_64, BX_INSTR_ADC64,
temp_CF);
SET_FLAGS_OSZAPC_64_CF(op1_64, op2_64, sum_64, BX_INSTR_ADC64, temp_CF);
}
void

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: arith8.cc,v 1.26 2004-08-09 21:28:47 sshwarts Exp $
// $Id: arith8.cc,v 1.27 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -26,8 +26,6 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: bit.cc,v 1.17 2004-08-09 21:28:47 sshwarts Exp $
// $Id: bit.cc,v 1.18 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -465,7 +465,7 @@ BX_CPU_C::BSF_GvEv(bxInstruction_c *i)
/* now write result back to destination */
BX_WRITE_64BIT_REG(i->nnn(), op1_64);
}
}
else
#endif // #if BX_SUPPORT_X86_64
if (i->os32L()) { /* 32 bit operand size mode */

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.169 2004-08-11 21:26:23 sshwarts Exp $
// $Id: cpu.h,v 1.170 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -3208,14 +3208,14 @@ BX_CPU_C::set_PF_base(Bit8u val) {
}
#define SET_FLAGS_OSZAPC_RESULT_8(result, ins) \
SET_FLAGS_OSZAPC_S1S2_SIZE(_8, result, ins)
SET_FLAGS_OSZAPC_RESULT_SIZE(_8, result, ins)
#define SET_FLAGS_OSZAPC_RESULT_16(result, ins) \
SET_FLAGS_OSZAPC_S1S2_SIZE(_16, result, ins)
SET_FLAGS_OSZAPC_RESULT_SIZE(_16, result, ins)
#define SET_FLAGS_OSZAPC_RESULT_32(result, ins) \
SET_FLAGS_OSZAPC_S1S2_SIZE(_32, result, ins)
SET_FLAGS_OSZAPC_RESULT_SIZE(_32, result, ins)
#if BX_SUPPORT_X86_64
#define SET_FLAGS_OSZAPC_RESULT_64(result, ins) \
SET_FLAGS_OSZAPC_S1S2_SIZE(_64, result, ins)
SET_FLAGS_OSZAPC_RESULT_SIZE(_64, result, ins)
#endif
#define SET_FLAGS_OSZAPC_CF_SIZE(size, lf_op1, lf_op2, lf_result, ins, last_CF) { \

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: data_xfer16.cc,v 1.30 2004-06-18 14:11:06 sshwarts Exp $
// $Id: data_xfer16.cc,v 1.31 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -31,53 +31,43 @@
#define LOG_THIS BX_CPU_THIS_PTR
void
BX_CPU_C::MOV_RXIw(bxInstruction_c *i)
void BX_CPU_C::MOV_RXIw(bxInstruction_c *i)
{
BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].word.rx = i->Iw();
}
void
BX_CPU_C::XCHG_RXAX(bxInstruction_c *i)
void BX_CPU_C::XCHG_RXAX(bxInstruction_c *i)
{
Bit16u temp16 = AX;
AX = BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].word.rx;
BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].word.rx = temp16;
}
void
BX_CPU_C::MOV_EEwGw(bxInstruction_c *i)
void BX_CPU_C::MOV_EEwGw(bxInstruction_c *i)
{
write_virtual_word(i->seg(), RMAddr(i), &BX_READ_16BIT_REG(i->nnn()));
}
void
BX_CPU_C::MOV_EGwGw(bxInstruction_c *i)
void BX_CPU_C::MOV_EGwGw(bxInstruction_c *i)
{
Bit16u op2_16 = BX_READ_16BIT_REG(i->nnn());
BX_WRITE_16BIT_REG(i->rm(), op2_16);
}
void
BX_CPU_C::MOV_GwEGw(bxInstruction_c *i)
void BX_CPU_C::MOV_GwEGw(bxInstruction_c *i)
{
// 2nd modRM operand Ex, is known to be a general register Gw.
Bit16u op2_16;
op2_16 = BX_READ_16BIT_REG(i->rm());
Bit16u op2_16 = BX_READ_16BIT_REG(i->rm());
BX_WRITE_16BIT_REG(i->nnn(), op2_16);
}
void
BX_CPU_C::MOV_GwEEw(bxInstruction_c *i)
void BX_CPU_C::MOV_GwEEw(bxInstruction_c *i)
{
// 2nd modRM operand Ex, is known to be a memory operand, Ew.
read_virtual_word(i->seg(), RMAddr(i), &BX_READ_16BIT_REG(i->nnn()));
}
void
BX_CPU_C::MOV_EwSw(bxInstruction_c *i)
void BX_CPU_C::MOV_EwSw(bxInstruction_c *i)
{
#if BX_CPU_LEVEL < 3
BX_PANIC(("MOV_EwSw: incomplete for CPU < 3"));
@ -104,15 +94,14 @@ BX_CPU_C::MOV_EwSw(bxInstruction_c *i)
}
}
void
BX_CPU_C::MOV_SwEw(bxInstruction_c *i)
void BX_CPU_C::MOV_SwEw(bxInstruction_c *i)
{
Bit16u op2_16;
#if BX_CPU_LEVEL < 3
BX_PANIC(("MOV_SwEw: incomplete for CPU < 3"));
#endif
Bit16u op2_16;
/* If attempt is made to load the CS register ... */
if (i->nnn() == BX_SEG_REG_CS) {
UndefinedOpcode(i);
@ -144,8 +133,7 @@ BX_CPU_C::MOV_SwEw(bxInstruction_c *i)
}
}
void
BX_CPU_C::LEA_GwM(bxInstruction_c *i)
void BX_CPU_C::LEA_GwM(bxInstruction_c *i)
{
if (i->modC0()) {
BX_INFO(("LEA_GwM: op2 is a register"));
@ -155,8 +143,7 @@ BX_CPU_C::LEA_GwM(bxInstruction_c *i)
BX_WRITE_16BIT_REG(i->nnn(), (Bit16u) RMAddr(i));
}
void
BX_CPU_C::MOV_AXOw(bxInstruction_c *i)
void BX_CPU_C::MOV_AXOw(bxInstruction_c *i)
{
/* read from memory address */
if (!BX_NULL_SEG_REG(i->seg())) {
@ -167,8 +154,7 @@ BX_CPU_C::MOV_AXOw(bxInstruction_c *i)
}
}
void
BX_CPU_C::MOV_OwAX(bxInstruction_c *i)
void BX_CPU_C::MOV_OwAX(bxInstruction_c *i)
{
/* write to memory address */
if (!BX_NULL_SEG_REG(i->seg())) {
@ -179,8 +165,7 @@ BX_CPU_C::MOV_OwAX(bxInstruction_c *i)
}
}
void
BX_CPU_C::MOV_EwIw(bxInstruction_c *i)
void BX_CPU_C::MOV_EwIw(bxInstruction_c *i)
{
Bit16u op2_16 = i->Iw();
@ -193,11 +178,11 @@ BX_CPU_C::MOV_EwIw(bxInstruction_c *i)
}
}
void
BX_CPU_C::MOVZX_GwEb(bxInstruction_c *i)
void BX_CPU_C::MOVZX_GwEb(bxInstruction_c *i)
{
#if BX_CPU_LEVEL < 3
BX_PANIC(("MOVZX_GvEb: not supported on < 386"));
BX_INFO(("MOVZX_GvEb: not supported on < 386"));
UndefinedOpcode(i);
#else
Bit8u op2_8;
@ -214,11 +199,11 @@ BX_CPU_C::MOVZX_GwEb(bxInstruction_c *i)
#endif /* BX_CPU_LEVEL < 3 */
}
void
BX_CPU_C::MOVZX_GwEw(bxInstruction_c *i)
void BX_CPU_C::MOVZX_GwEw(bxInstruction_c *i)
{
#if BX_CPU_LEVEL < 3
BX_PANIC(("MOVZX_GvEw: not supported on < 386"));
BX_INFO(("MOVZX_GvEw: not supported on < 386"));
UndefinedOpcode(i);
#else
Bit16u op2_16;
@ -235,11 +220,11 @@ BX_CPU_C::MOVZX_GwEw(bxInstruction_c *i)
#endif /* BX_CPU_LEVEL < 3 */
}
void
BX_CPU_C::MOVSX_GwEb(bxInstruction_c *i)
void BX_CPU_C::MOVSX_GwEb(bxInstruction_c *i)
{
#if BX_CPU_LEVEL < 3
BX_PANIC(("MOVSX_GvEb: not supported on < 386"));
BX_INFO(("MOVSX_GvEb: not supported on < 386"));
UndefinedOpcode(i);
#else
Bit8u op2_8;
@ -256,11 +241,11 @@ BX_CPU_C::MOVSX_GwEb(bxInstruction_c *i)
#endif /* BX_CPU_LEVEL < 3 */
}
void
BX_CPU_C::MOVSX_GwEw(bxInstruction_c *i)
void BX_CPU_C::MOVSX_GwEw(bxInstruction_c *i)
{
#if BX_CPU_LEVEL < 3
BX_PANIC(("MOVSX_GvEw: not supported on < 386"));
BX_INFO(("MOVSX_GvEw: not supported on < 386"));
UndefinedOpcode(i);
#else
Bit16u op2_16;
@ -277,18 +262,17 @@ BX_CPU_C::MOVSX_GwEw(bxInstruction_c *i)
#endif /* BX_CPU_LEVEL < 3 */
}
void
BX_CPU_C::XCHG_EwGw(bxInstruction_c *i)
void BX_CPU_C::XCHG_EwGw(bxInstruction_c *i)
{
Bit16u op2_16, op1_16;
#if BX_DEBUGGER && BX_MAGIC_BREAKPOINT
// (mch) Magic break point
// Note for mortals: the instruction to trigger this is "xchgw %bx,%bx"
if (i->nnn() == 3 && i->modC0() && i->rm() == 3) {
BX_CPU_THIS_PTR magic_break = 1;
}
if (i->nnn() == 3 && i->modC0() && i->rm() == 3)
{
BX_CPU_THIS_PTR magic_break = 1;
}
#endif
/* op2_16 is a register, op2_addr is an index of a register */
@ -308,8 +292,7 @@ BX_CPU_C::XCHG_EwGw(bxInstruction_c *i)
BX_WRITE_16BIT_REG(i->nnn(), op1_16);
}
void
BX_CPU_C::CMOV_GwEw(bxInstruction_c *i)
void BX_CPU_C::CMOV_GwEw(bxInstruction_c *i)
{
#if (BX_CPU_LEVEL >= 6) || (BX_CPU_LEVEL_HACKED >= 6)
// Note: CMOV accesses a memory source operand (read), regardless

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: data_xfer32.cc,v 1.29 2004-08-09 21:28:47 sshwarts Exp $
// $Id: data_xfer32.cc,v 1.30 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -46,8 +46,7 @@ BX_CPU_C::XCHG_ERXEAX(bxInstruction_c *i)
#endif
}
void
BX_CPU_C::MOV_ERXId(bxInstruction_c *i)
void BX_CPU_C::MOV_ERXId(bxInstruction_c *i)
{
#if BX_SUPPORT_X86_64
BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].rrx = i->Id();

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: flag_ctrl.cc,v 1.16 2004-07-02 20:24:47 sshwarts Exp $
// $Id: flag_ctrl.cc,v 1.17 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -26,17 +26,11 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#define LOG_THIS BX_CPU_THIS_PTR
void
BX_CPU_C::SAHF(bxInstruction_c *i)
{

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: flag_ctrl_pro.cc,v 1.14 2003-03-02 23:59:09 cbothamy Exp $
// $Id: flag_ctrl_pro.cc,v 1.15 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -30,8 +30,6 @@
#define LOG_THIS BX_CPU_THIS_PTR
void BX_CPP_AttrRegparmN(2)
BX_CPU_C::writeEFlags(Bit32u flags, Bit32u changeMask)
{
@ -57,7 +55,6 @@ BX_CPU_C::writeEFlags(Bit32u flags, Bit32u changeMask)
}
}
void BX_CPP_AttrRegparmN(3)
BX_CPU_C::write_flags(Bit16u flags, bx_bool change_IOPL, bx_bool change_IF)
{

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: lazy_flags.h,v 1.8 2004-08-11 21:26:23 sshwarts Exp $
// $Id: lazy_flags.h,v 1.9 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,81 +27,80 @@
#if BX_PROVIDE_CPU_MEMORY==1
#define BX_INSTR_ADD8 1
#define BX_INSTR_ADD16 2
#define BX_INSTR_ADD32 3
#define BX_INSTR_ADD8 1
#define BX_INSTR_ADD16 2
#define BX_INSTR_ADD32 3
#define BX_INSTR_ADD64 4
#define BX_INSTR_SUB8 4
#define BX_INSTR_SUB16 5
#define BX_INSTR_SUB32 6
#define BX_INSTR_SUB8 5
#define BX_INSTR_SUB16 6
#define BX_INSTR_SUB32 7
#define BX_INSTR_SUB64 8
#define BX_INSTR_ADC8 7
#define BX_INSTR_ADC16 8
#define BX_INSTR_ADC32 9
#define BX_INSTR_ADC8 9
#define BX_INSTR_ADC16 10
#define BX_INSTR_ADC32 11
#define BX_INSTR_ADC64 12
#define BX_INSTR_SBB8 10
#define BX_INSTR_SBB16 11
#define BX_INSTR_SBB32 12
#define BX_INSTR_SBB8 13
#define BX_INSTR_SBB16 14
#define BX_INSTR_SBB32 15
#define BX_INSTR_SBB64 16
#define BX_INSTR_CMP8 13
#define BX_INSTR_CMP16 14
#define BX_INSTR_CMP32 15
#define BX_INSTR_CMP8 17
#define BX_INSTR_CMP16 18
#define BX_INSTR_CMP32 19
#define BX_INSTR_CMP64 20
#define BX_INSTR_INC8 16
#define BX_INSTR_INC16 17
#define BX_INSTR_INC32 18
#define BX_INSTR_INC8 21
#define BX_INSTR_INC16 22
#define BX_INSTR_INC32 23
#define BX_INSTR_INC64 24
#define BX_INSTR_DEC8 19
#define BX_INSTR_DEC16 20
#define BX_INSTR_DEC32 21
#define BX_INSTR_DEC8 25
#define BX_INSTR_DEC16 26
#define BX_INSTR_DEC32 27
#define BX_INSTR_DEC64 28
#define BX_INSTR_NEG8 22
#define BX_INSTR_NEG16 23
#define BX_INSTR_NEG32 24
#define BX_INSTR_NEG8 29
#define BX_INSTR_NEG16 30
#define BX_INSTR_NEG32 31
#define BX_INSTR_NEG64 32
#define BX_INSTR_XADD8 25
#define BX_INSTR_XADD16 26
#define BX_INSTR_XADD32 27
#define BX_INSTR_XADD8 33
#define BX_INSTR_XADD16 34
#define BX_INSTR_XADD32 35
#define BX_INSTR_XADD64 36
#define BX_INSTR_CMPS8 28
#define BX_INSTR_CMPS16 29
#define BX_INSTR_CMPS32 30
#define BX_INSTR_CMPS8 37
#define BX_INSTR_CMPS16 38
#define BX_INSTR_CMPS32 39
#define BX_INSTR_CMPS64 40
#define BX_INSTR_SCAS8 31
#define BX_INSTR_SCAS16 32
#define BX_INSTR_SCAS32 33
#define BX_INSTR_SCAS8 41
#define BX_INSTR_SCAS16 42
#define BX_INSTR_SCAS32 43
#define BX_INSTR_SCAS64 44
#define BX_INSTR_SHR8 34
#define BX_INSTR_SHR16 35
#define BX_INSTR_SHR32 36
#define BX_INSTR_SHR8 45
#define BX_INSTR_SHR16 46
#define BX_INSTR_SHR32 47
#define BX_INSTR_SHR64 48
#define BX_INSTR_SHL8 37
#define BX_INSTR_SHL16 38
#define BX_INSTR_SHL32 39
#define BX_INSTR_SHL8 49
#define BX_INSTR_SHL16 50
#define BX_INSTR_SHL32 51
#define BX_INSTR_SHL64 52
#define BX_INSTR_LOGIC8 42
#define BX_INSTR_LOGIC16 43
#define BX_INSTR_LOGIC32 44
#define BX_INSTR_LOGIC8 53
#define BX_INSTR_LOGIC16 54
#define BX_INSTR_LOGIC32 55
#define BX_INSTR_LOGIC64 56
#if BX_SUPPORT_X86_64
#define BX_INSTR_ADD64 47
#define BX_INSTR_SUB64 48
#define BX_INSTR_ADC64 49
#define BX_INSTR_SBB64 50
#define BX_INSTR_CMP64 51
#define BX_INSTR_INC64 52
#define BX_INSTR_DEC64 53
#define BX_INSTR_NEG64 54
#define BX_INSTR_XADD64 55
#define BX_INSTR_CMPS64 56
#define BX_INSTR_SCAS64 57
#define BX_INSTR_SHR64 58
#define BX_INSTR_SHL64 59
#define BX_INSTR_LOGIC64 60
#endif
#define BX_INSTR_BSF 61
#define BX_INSTR_BSR 62
#define BX_INSTR_BITSCAN8 57
#define BX_INSTR_BITSCAN16 58
#define BX_INSTR_BITSCAN32 59
#define BX_INSTR_BITSCAN64 60
#define BX_LF_INDEX_KNOWN 0
#define BX_LF_INDEX_OSZAPC 1
@ -110,7 +109,6 @@
#define BX_LF_MASK_OSZAPC 0x111111
#define BX_LF_MASK_OSZAP 0x222220
typedef struct {
Bit8u op1_8;
Bit8u op2_8;
@ -134,5 +132,4 @@ typedef struct {
unsigned instr;
} bx_lf_flags_entry;
#endif /* BX_PROVIDE_CPU_MEMORY==1 */

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: logical16.cc,v 1.21 2004-08-11 21:26:23 sshwarts Exp $
// $Id: logical16.cc,v 1.22 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -48,7 +48,7 @@ BX_CPU_C::XOR_EwGw(bxInstruction_c *i)
result_16 = op1_16 ^ op2_16;
#endif
BX_WRITE_16BIT_REG(i->rm(), result_16);
}
}
else {
read_RMW_virtual_word(i->seg(), RMAddr(i), &op1_16);
#if defined(BX_HostAsm_Xor16)
@ -59,14 +59,13 @@ BX_CPU_C::XOR_EwGw(bxInstruction_c *i)
result_16 = op1_16 ^ op2_16;
#endif
Write_RMW_virtual_word(result_16);
}
}
#if !defined(BX_HostAsm_Xor16)
SET_FLAGS_OSZAPC_16(op1_16, op2_16, result_16, BX_INSTR_LOGIC16);
SET_FLAGS_OSZAPC_RESULT_16(result_16, BX_INSTR_LOGIC16);
#endif
}
void
BX_CPU_C::XOR_GwEw(bxInstruction_c *i)
{
@ -86,10 +85,9 @@ BX_CPU_C::XOR_GwEw(bxInstruction_c *i)
BX_WRITE_16BIT_REG(nnn, result_16);
SET_FLAGS_OSZAPC_16(op1_16, op2_16, result_16, BX_INSTR_LOGIC16);
SET_FLAGS_OSZAPC_RESULT_16(result_16, BX_INSTR_LOGIC16);
}
void
BX_CPU_C::XOR_AXIw(bxInstruction_c *i)
{
@ -100,7 +98,7 @@ BX_CPU_C::XOR_AXIw(bxInstruction_c *i)
sum_16 = op1_16 ^ op2_16;
AX = sum_16;
SET_FLAGS_OSZAPC_16(op1_16, op2_16, sum_16, BX_INSTR_LOGIC16);
SET_FLAGS_OSZAPC_RESULT_16(sum_16, BX_INSTR_LOGIC16);
}
void
@ -121,10 +119,9 @@ BX_CPU_C::XOR_EwIw(bxInstruction_c *i)
Write_RMW_virtual_word(result_16);
}
SET_FLAGS_OSZAPC_16(op1_16, op2_16, result_16, BX_INSTR_LOGIC16);
SET_FLAGS_OSZAPC_RESULT_16(result_16, BX_INSTR_LOGIC16);
}
void
BX_CPU_C::OR_EwIw(bxInstruction_c *i)
{
@ -143,10 +140,9 @@ BX_CPU_C::OR_EwIw(bxInstruction_c *i)
Write_RMW_virtual_word(result_16);
}
SET_FLAGS_OSZAPC_16(op1_16, op2_16, result_16, BX_INSTR_LOGIC16);
SET_FLAGS_OSZAPC_RESULT_16(result_16, BX_INSTR_LOGIC16);
}
void
BX_CPU_C::NOT_Ew(bxInstruction_c *i)
{
@ -164,7 +160,6 @@ BX_CPU_C::NOT_Ew(bxInstruction_c *i)
}
}
void
BX_CPU_C::OR_EwGw(bxInstruction_c *i)
{
@ -183,10 +178,9 @@ BX_CPU_C::OR_EwGw(bxInstruction_c *i)
Write_RMW_virtual_word(result_16);
}
SET_FLAGS_OSZAPC_16(op1_16, op2_16, result_16, BX_INSTR_LOGIC16);
SET_FLAGS_OSZAPC_RESULT_16(result_16, BX_INSTR_LOGIC16);
}
void
BX_CPU_C::OR_GwEw(bxInstruction_c *i)
{
@ -207,13 +201,10 @@ BX_CPU_C::OR_GwEw(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
result_16 = op1_16 | op2_16;
SET_FLAGS_OSZAPC_RESULT_16(result_16, BX_INSTR_LOGIC16);
#endif
BX_WRITE_16BIT_REG(i->nnn(), result_16);
#if !defined(BX_HostAsm_Or16)
SET_FLAGS_OSZAPC_16(op1_16, op2_16, result_16, BX_INSTR_LOGIC16);
#endif
}
void
@ -226,7 +217,7 @@ BX_CPU_C::OR_AXIw(bxInstruction_c *i)
sum_16 = op1_16 | op2_16;
AX = sum_16;
SET_FLAGS_OSZAPC_16(op1_16, op2_16, sum_16, BX_INSTR_LOGIC16);
SET_FLAGS_OSZAPC_RESULT_16(sum_16, BX_INSTR_LOGIC16);
}
void
@ -248,7 +239,7 @@ BX_CPU_C::AND_EwGw(bxInstruction_c *i)
#endif
BX_WRITE_16BIT_REG(i->rm(), result_16);
}
}
else {
read_RMW_virtual_word(i->seg(), RMAddr(i), &op1_16);
@ -261,14 +252,13 @@ BX_CPU_C::AND_EwGw(bxInstruction_c *i)
#endif
Write_RMW_virtual_word(result_16);
}
}
#if !defined(BX_HostAsm_And16)
SET_FLAGS_OSZAPC_16(op1_16, op2_16, result_16, BX_INSTR_LOGIC16);
SET_FLAGS_OSZAPC_RESULT_16(result_16, BX_INSTR_LOGIC16);
#endif
}
void
BX_CPU_C::AND_GwEw(bxInstruction_c *i)
{
@ -289,16 +279,12 @@ BX_CPU_C::AND_GwEw(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
result_16 = op1_16 & op2_16;
SET_FLAGS_OSZAPC_RESULT_16(result_16, BX_INSTR_LOGIC16);
#endif
BX_WRITE_16BIT_REG(i->nnn(), result_16);
#if !defined(BX_HostAsm_And16)
SET_FLAGS_OSZAPC_16(op1_16, op2_16, result_16, BX_INSTR_LOGIC16);
#endif
}
void
BX_CPU_C::AND_AXIw(bxInstruction_c *i)
{
@ -313,13 +299,10 @@ BX_CPU_C::AND_AXIw(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
result_16 = op1_16 & op2_16;
SET_FLAGS_OSZAPC_RESULT_16(result_16, BX_INSTR_LOGIC16);
#endif
AX = result_16;
#if !defined(BX_HostAsm_And16)
SET_FLAGS_OSZAPC_16(op1_16, op2_16, result_16, BX_INSTR_LOGIC16);
#endif
}
void
@ -341,7 +324,7 @@ BX_CPU_C::AND_EwIw(bxInstruction_c *i)
#endif
BX_WRITE_16BIT_REG(i->rm(), result_16);
}
}
else {
read_RMW_virtual_word(i->seg(), RMAddr(i), &op1_16);
@ -354,14 +337,13 @@ BX_CPU_C::AND_EwIw(bxInstruction_c *i)
#endif
Write_RMW_virtual_word(result_16);
}
}
#if !defined(BX_HostAsm_And16)
SET_FLAGS_OSZAPC_16(op1_16, op2_16, result_16, BX_INSTR_LOGIC16);
SET_FLAGS_OSZAPC_RESULT_16(result_16, BX_INSTR_LOGIC16);
#endif
}
void
BX_CPU_C::TEST_EwGw(bxInstruction_c *i)
{
@ -381,15 +363,11 @@ BX_CPU_C::TEST_EwGw(bxInstruction_c *i)
asmTest16(op1_16, op2_16, flags32);
setEFlagsOSZAPC(flags32);
#else
Bit16u result_16;
result_16 = op1_16 & op2_16;
SET_FLAGS_OSZAPC_16(op1_16, op2_16, result_16, BX_INSTR_LOGIC16);
Bit16u result_16 = op1_16 & op2_16;
SET_FLAGS_OSZAPC_RESULT_16(result_16, BX_INSTR_LOGIC16);
#endif
}
void
BX_CPU_C::TEST_AXIw(bxInstruction_c *i)
{
@ -403,13 +381,11 @@ BX_CPU_C::TEST_AXIw(bxInstruction_c *i)
asmTest16(op1_16, op2_16, flags32);
setEFlagsOSZAPC(flags32);
#else
Bit16u result_16;
result_16 = op1_16 & op2_16;
SET_FLAGS_OSZAPC_16(op1_16, op2_16, result_16, BX_INSTR_LOGIC16);
Bit16u result_16 = op1_16 & op2_16;
SET_FLAGS_OSZAPC_RESULT_16(result_16, BX_INSTR_LOGIC16);
#endif
}
void
BX_CPU_C::TEST_EwIw(bxInstruction_c *i)
{
@ -429,8 +405,7 @@ BX_CPU_C::TEST_EwIw(bxInstruction_c *i)
asmTest16(op1_16, op2_16, flags32);
setEFlagsOSZAPC(flags32);
#else
Bit16u result_16;
result_16 = op1_16 & op2_16;
SET_FLAGS_OSZAPC_16(op1_16, op2_16, result_16, BX_INSTR_LOGIC16);
Bit16u result_16 = op1_16 & op2_16;
SET_FLAGS_OSZAPC_RESULT_16(result_16, BX_INSTR_LOGIC16);
#endif
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: logical32.cc,v 1.22 2004-08-11 21:26:23 sshwarts Exp $
// $Id: logical32.cc,v 1.23 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -48,10 +48,9 @@ BX_CPU_C::XOR_EdGd(bxInstruction_c *i)
Write_RMW_virtual_dword(result_32);
}
SET_FLAGS_OSZAPC_32(op1_32, op2_32, result_32, BX_INSTR_LOGIC32);
SET_FLAGS_OSZAPC_RESULT_32(result_32, BX_INSTR_LOGIC32);
}
void
BX_CPU_C::XOR_GdEd(bxInstruction_c *i)
{
@ -71,10 +70,9 @@ BX_CPU_C::XOR_GdEd(bxInstruction_c *i)
BX_WRITE_32BIT_REGZ(nnn, result_32);
SET_FLAGS_OSZAPC_32(op1_32, op2_32, result_32, BX_INSTR_LOGIC32);
SET_FLAGS_OSZAPC_RESULT_32(result_32, BX_INSTR_LOGIC32);
}
void
BX_CPU_C::XOR_EAXId(bxInstruction_c *i)
{
@ -91,7 +89,7 @@ BX_CPU_C::XOR_EAXId(bxInstruction_c *i)
EAX = sum_32;
#endif
SET_FLAGS_OSZAPC_32(op1_32, op2_32, sum_32, BX_INSTR_LOGIC32);
SET_FLAGS_OSZAPC_RESULT_32(sum_32, BX_INSTR_LOGIC32);
}
void
@ -112,10 +110,9 @@ BX_CPU_C::XOR_EdId(bxInstruction_c *i)
Write_RMW_virtual_dword(result_32);
}
SET_FLAGS_OSZAPC_32(op1_32, op2_32, result_32, BX_INSTR_LOGIC32);
SET_FLAGS_OSZAPC_RESULT_32(result_32, BX_INSTR_LOGIC32);
}
void
BX_CPU_C::OR_EdId(bxInstruction_c *i)
{
@ -134,7 +131,7 @@ BX_CPU_C::OR_EdId(bxInstruction_c *i)
Write_RMW_virtual_dword(result_32);
}
SET_FLAGS_OSZAPC_32(op1_32, op2_32, result_32, BX_INSTR_LOGIC32);
SET_FLAGS_OSZAPC_RESULT_32(result_32, BX_INSTR_LOGIC32);
}
void
@ -173,7 +170,7 @@ BX_CPU_C::OR_EdGd(bxInstruction_c *i)
Write_RMW_virtual_dword(result_32);
}
SET_FLAGS_OSZAPC_32(op1_32, op2_32, result_32, BX_INSTR_LOGIC32);
SET_FLAGS_OSZAPC_RESULT_32(result_32, BX_INSTR_LOGIC32);
}
@ -197,13 +194,10 @@ BX_CPU_C::OR_GdEd(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
result_32 = op1_32 | op2_32;
SET_FLAGS_OSZAPC_RESULT_32(result_32, BX_INSTR_LOGIC32);
#endif
BX_WRITE_32BIT_REGZ(i->nnn(), result_32);
#if !defined(BX_HostAsm_Or32)
SET_FLAGS_OSZAPC_32(op1_32, op2_32, result_32, BX_INSTR_LOGIC32);
#endif
}
@ -222,11 +216,10 @@ BX_CPU_C::OR_EAXId(bxInstruction_c *i)
EAX = sum_32;
#endif
SET_FLAGS_OSZAPC_32(op1_32, op2_32, sum_32, BX_INSTR_LOGIC32);
SET_FLAGS_OSZAPC_RESULT_32(sum_32, BX_INSTR_LOGIC32);
}
void
BX_CPU_C::AND_EdGd(bxInstruction_c *i)
{
@ -259,10 +252,10 @@ BX_CPU_C::AND_EdGd(bxInstruction_c *i)
#endif
Write_RMW_virtual_dword(result_32);
}
}
#if !defined(BX_HostAsm_And32)
SET_FLAGS_OSZAPC_32(op1_32, op2_32, result_32, BX_INSTR_LOGIC32);
SET_FLAGS_OSZAPC_RESULT_32(result_32, BX_INSTR_LOGIC32);
#endif
}
@ -287,13 +280,10 @@ BX_CPU_C::AND_GdEd(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
result_32 = op1_32 & op2_32;
SET_FLAGS_OSZAPC_RESULT_32(result_32, BX_INSTR_LOGIC32);
#endif
BX_WRITE_32BIT_REGZ(i->nnn(), result_32);
#if !defined(BX_HostAsm_And32)
SET_FLAGS_OSZAPC_32(op1_32, op2_32, result_32, BX_INSTR_LOGIC32);
#endif
}
@ -307,11 +297,11 @@ BX_CPU_C::AND_EAXId(bxInstruction_c *i)
#if defined(BX_HostAsm_And32)
Bit32u flags32;
asmAnd32(result_32, op1_32, op2_32, flags32);
setEFlagsOSZAPC(flags32);
#else
result_32 = op1_32 & op2_32;
SET_FLAGS_OSZAPC_RESULT_32(result_32, BX_INSTR_LOGIC32);
#endif
#if BX_SUPPORT_X86_64
@ -319,10 +309,6 @@ BX_CPU_C::AND_EAXId(bxInstruction_c *i)
#else
EAX = result_32;
#endif
#if !defined(BX_HostAsm_And32)
SET_FLAGS_OSZAPC_32(op1_32, op2_32, result_32, BX_INSTR_LOGIC32);
#endif
}
void
@ -337,7 +323,6 @@ BX_CPU_C::AND_EdId(bxInstruction_c *i)
#if defined(BX_HostAsm_And32)
Bit32u flags32;
asmAnd32(result_32, op1_32, op2_32, flags32);
setEFlagsOSZAPC(flags32);
#else
@ -345,7 +330,7 @@ BX_CPU_C::AND_EdId(bxInstruction_c *i)
#endif
BX_WRITE_32BIT_REGZ(i->rm(), result_32);
}
}
else {
read_RMW_virtual_dword(i->seg(), RMAddr(i), &op1_32);
@ -358,10 +343,10 @@ BX_CPU_C::AND_EdId(bxInstruction_c *i)
#endif
Write_RMW_virtual_dword(result_32);
}
}
#if !defined(BX_HostAsm_And32)
SET_FLAGS_OSZAPC_32(op1_32, op2_32, result_32, BX_INSTR_LOGIC32);
SET_FLAGS_OSZAPC_RESULT_32(result_32, BX_INSTR_LOGIC32);
#endif
}
@ -385,15 +370,11 @@ BX_CPU_C::TEST_EdGd(bxInstruction_c *i)
asmTest32(op1_32, op2_32, flags32);
setEFlagsOSZAPC(flags32);
#else
Bit32u result_32;
result_32 = op1_32 & op2_32;
SET_FLAGS_OSZAPC_32(op1_32, op2_32, result_32, BX_INSTR_LOGIC32);
Bit32u result_32 = op1_32 & op2_32;
SET_FLAGS_OSZAPC_RESULT_32(result_32, BX_INSTR_LOGIC32);
#endif
}
void
BX_CPU_C::TEST_EAXId(bxInstruction_c *i)
{
@ -407,9 +388,8 @@ BX_CPU_C::TEST_EAXId(bxInstruction_c *i)
asmTest32(op1_32, op2_32, flags32);
setEFlagsOSZAPC(flags32);
#else
Bit32u result_32;
result_32 = op1_32 & op2_32;
SET_FLAGS_OSZAPC_32(op1_32, op2_32, result_32, BX_INSTR_LOGIC32);
Bit32u result_32 = op1_32 & op2_32;
SET_FLAGS_OSZAPC_RESULT_32(result_32, BX_INSTR_LOGIC32);
#endif
}
@ -433,8 +413,7 @@ BX_CPU_C::TEST_EdId(bxInstruction_c *i)
asmTest32(op1_32, op2_32, flags32);
setEFlagsOSZAPC(flags32);
#else
Bit32u result_32;
result_32 = op1_32 & op2_32;
SET_FLAGS_OSZAPC_32(op1_32, op2_32, result_32, BX_INSTR_LOGIC32);
Bit32u result_32 = op1_32 & op2_32;
SET_FLAGS_OSZAPC_RESULT_32(result_32, BX_INSTR_LOGIC32);
#endif
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: logical64.cc,v 1.10 2004-08-11 21:26:23 sshwarts Exp $
// $Id: logical64.cc,v 1.11 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -59,7 +59,7 @@ BX_CPU_C::XOR_EqGq(bxInstruction_c *i)
Write_RMW_virtual_qword(result_64);
}
SET_FLAGS_OSZAPC_64(op1_64, op2_64, result_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(result_64, BX_INSTR_LOGIC64);
}
void
@ -84,7 +84,7 @@ BX_CPU_C::XOR_GqEq(bxInstruction_c *i)
/* now write result back to destination */
BX_WRITE_64BIT_REG(i->nnn(), result_64);
SET_FLAGS_OSZAPC_64(op1_64, op2_64, result_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(result_64, BX_INSTR_LOGIC64);
}
void
@ -100,7 +100,7 @@ BX_CPU_C::XOR_RAXId(bxInstruction_c *i)
/* now write sum back to destination */
RAX = sum_64;
SET_FLAGS_OSZAPC_64(op1_64, op2_64, sum_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(sum_64, BX_INSTR_LOGIC64);
}
void
@ -129,7 +129,7 @@ BX_CPU_C::XOR_EqId(bxInstruction_c *i)
Write_RMW_virtual_qword(result_64);
}
SET_FLAGS_OSZAPC_64(op1_64, op2_64, result_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(result_64, BX_INSTR_LOGIC64);
}
void
@ -158,7 +158,7 @@ BX_CPU_C::OR_EqId(bxInstruction_c *i)
Write_RMW_virtual_qword(result_64);
}
SET_FLAGS_OSZAPC_64(op1_64, op2_64, result_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(result_64, BX_INSTR_LOGIC64);
}
void
@ -213,7 +213,7 @@ BX_CPU_C::OR_EqGq(bxInstruction_c *i)
Write_RMW_virtual_qword(result_64);
}
SET_FLAGS_OSZAPC_64(op1_64, op2_64, result_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(result_64, BX_INSTR_LOGIC64);
}
void
@ -237,7 +237,7 @@ BX_CPU_C::OR_GqEq(bxInstruction_c *i)
/* now write result back to destination */
BX_WRITE_64BIT_REG(i->nnn(), result_64);
SET_FLAGS_OSZAPC_64(op1_64, op2_64, result_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(result_64, BX_INSTR_LOGIC64);
}
void
@ -252,7 +252,7 @@ BX_CPU_C::OR_RAXId(bxInstruction_c *i)
/* now write sum back to destination */
RAX = sum_64;
SET_FLAGS_OSZAPC_64(op1_64, op2_64, sum_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(sum_64, BX_INSTR_LOGIC64);
}
void
@ -282,7 +282,7 @@ BX_CPU_C::AND_EqGq(bxInstruction_c *i)
Write_RMW_virtual_qword(result_64);
}
SET_FLAGS_OSZAPC_64(op1_64, op2_64, result_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(result_64, BX_INSTR_LOGIC64);
}
void
@ -306,7 +306,7 @@ BX_CPU_C::AND_GqEq(bxInstruction_c *i)
/* now write result back to destination */
BX_WRITE_64BIT_REG(i->nnn(), result_64);
SET_FLAGS_OSZAPC_64(op1_64, op2_64, result_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(result_64, BX_INSTR_LOGIC64);
}
void
@ -321,7 +321,7 @@ BX_CPU_C::AND_RAXId(bxInstruction_c *i)
/* now write sum back to destination */
RAX = sum_64;
SET_FLAGS_OSZAPC_64(op1_64, op2_64, sum_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(sum_64, BX_INSTR_LOGIC64);
}
void
@ -350,7 +350,7 @@ BX_CPU_C::AND_EqId(bxInstruction_c *i)
Write_RMW_virtual_qword(result_64);
}
SET_FLAGS_OSZAPC_64(op1_64, op2_64, result_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(result_64, BX_INSTR_LOGIC64);
}
void
@ -372,7 +372,7 @@ BX_CPU_C::TEST_EqGq(bxInstruction_c *i)
result_64 = op1_64 & op2_64;
SET_FLAGS_OSZAPC_64(op1_64, op2_64, result_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(result_64, BX_INSTR_LOGIC64);
}
void
@ -388,7 +388,7 @@ BX_CPU_C::TEST_RAXId(bxInstruction_c *i)
result_64 = op1_64 & op2_64;
SET_FLAGS_OSZAPC_64(op1_64, op2_64, result_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(result_64, BX_INSTR_LOGIC64);
}
void
@ -410,7 +410,7 @@ BX_CPU_C::TEST_EqId(bxInstruction_c *i)
result_64 = op1_64 & op2_64;
SET_FLAGS_OSZAPC_64(op1_64, op2_64, result_64, BX_INSTR_LOGIC64);
SET_FLAGS_OSZAPC_RESULT_64(result_64, BX_INSTR_LOGIC64);
}
#endif /* if BX_SUPPORT_X86_64 */

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: logical8.cc,v 1.24 2004-08-11 21:26:23 sshwarts Exp $
// $Id: logical8.cc,v 1.25 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -48,7 +48,7 @@ BX_CPU_C::XOR_EbGb(bxInstruction_c *i)
Write_RMW_virtual_byte(result);
}
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
}
void
@ -69,10 +69,9 @@ BX_CPU_C::XOR_GbEb(bxInstruction_c *i)
BX_WRITE_8BIT_REGx(i->nnn(), i->extend8bitL(), result);
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
}
void
BX_CPU_C::XOR_ALIb(bxInstruction_c *i)
{
@ -83,10 +82,9 @@ BX_CPU_C::XOR_ALIb(bxInstruction_c *i)
sum = op1 ^ op2;
AL = sum;
SET_FLAGS_OSZAPC_8(op1, op2, sum, BX_INSTR_LOGIC8);
SET_FLAGS_OSZAPC_RESULT_8(sum, BX_INSTR_LOGIC8);
}
void
BX_CPU_C::XOR_EbIb(bxInstruction_c *i)
{
@ -105,7 +103,7 @@ BX_CPU_C::XOR_EbIb(bxInstruction_c *i)
Write_RMW_virtual_byte(result);
}
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
}
@ -128,7 +126,7 @@ BX_CPU_C::OR_EbIb(bxInstruction_c *i)
Write_RMW_virtual_byte(result);
}
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
}
@ -168,10 +166,9 @@ BX_CPU_C::OR_EbGb(bxInstruction_c *i)
Write_RMW_virtual_byte(result);
}
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
}
void
BX_CPU_C::OR_GbEb(bxInstruction_c *i)
{
@ -192,13 +189,10 @@ BX_CPU_C::OR_GbEb(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
result = op1 | op2;
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
#endif
BX_WRITE_8BIT_REGx(i->nnn(), i->extend8bitL(), result);
#if !defined(BX_HostAsm_Or8)
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
#endif
}
@ -217,17 +211,13 @@ BX_CPU_C::OR_ALIb(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
result = op1 | op2;
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
#endif
AL = result;
#if !defined(BX_HostAsm_Or8)
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
#endif
}
void
BX_CPU_C::AND_EbGb(bxInstruction_c *i)
{
@ -247,7 +237,7 @@ BX_CPU_C::AND_EbGb(bxInstruction_c *i)
#endif
BX_WRITE_8BIT_REGx(i->rm(), i->extend8bitL(), result);
}
}
else {
read_RMW_virtual_byte(i->seg(), RMAddr(i), &op1);
@ -260,10 +250,10 @@ BX_CPU_C::AND_EbGb(bxInstruction_c *i)
#endif
Write_RMW_virtual_byte(result);
}
}
#if !defined(BX_HostAsm_And8)
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
#endif
}
@ -288,22 +278,17 @@ BX_CPU_C::AND_GbEb(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
result = op1 & op2;
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
#endif
BX_WRITE_8BIT_REGx(i->nnn(), i->extend8bitL(), result);
#if !defined(BX_HostAsm_And8)
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
#endif
}
void
BX_CPU_C::AND_ALIb(bxInstruction_c *i)
{
Bit8u op1, op2, result;
op1 = AL;
op2 = i->Ib();
@ -313,18 +298,12 @@ BX_CPU_C::AND_ALIb(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
result = op1 & op2;
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
#endif
AL = result;
#if !defined(BX_HostAsm_And8)
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
#endif
}
void
BX_CPU_C::AND_EbIb(bxInstruction_c *i)
{
@ -344,7 +323,7 @@ BX_CPU_C::AND_EbIb(bxInstruction_c *i)
#endif
BX_WRITE_8BIT_REGx(i->rm(), i->extend8bitL(), result);
}
}
else {
read_RMW_virtual_byte(i->seg(), RMAddr(i), &op1);
@ -357,10 +336,10 @@ BX_CPU_C::AND_EbIb(bxInstruction_c *i)
#endif
Write_RMW_virtual_byte(result);
}
}
#if !defined(BX_HostAsm_And8)
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
#endif
}
@ -384,10 +363,8 @@ BX_CPU_C::TEST_EbGb(bxInstruction_c *i)
asmTest8(op1, op2, flags32);
setEFlagsOSZAPC(flags32);
#else
Bit8u result;
result = op1 & op2;
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
Bit8u result = op1 & op2;
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
#endif
}
@ -402,19 +379,14 @@ BX_CPU_C::TEST_ALIb(bxInstruction_c *i)
#if defined(BX_HostAsm_Test8)
Bit32u flags32;
asmTest8(op1, op2, flags32);
setEFlagsOSZAPC(flags32);
#else
Bit8u result;
result = op1 & op2;
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
Bit8u result = op1 & op2;
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
#endif
}
void
BX_CPU_C::TEST_EbIb(bxInstruction_c *i)
{
@ -436,7 +408,6 @@ BX_CPU_C::TEST_EbIb(bxInstruction_c *i)
#else
Bit8u result;
result = op1 & op2;
SET_FLAGS_OSZAPC_8(op1, op2, result, BX_INSTR_LOGIC8);
SET_FLAGS_OSZAPC_RESULT_8(result, BX_INSTR_LOGIC8);
#endif
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: mult16.cc,v 1.11 2004-08-09 21:28:47 sshwarts Exp $
// $Id: mult16.cc,v 1.12 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -150,7 +150,6 @@ BX_CPU_C::DIV_AXEw(bxInstruction_c *i)
#endif
/* now write quotient back to destination */
AX = quotient_16l;
DX = remainder_16;
}
@ -193,7 +192,6 @@ BX_CPU_C::IDIV_AXEw(bxInstruction_c *i)
#endif
/* now write quotient back to destination */
AX = quotient_16l;
DX = remainder_16;
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: mult32.cc,v 1.12 2004-08-09 21:28:47 sshwarts Exp $
// $Id: mult32.cc,v 1.13 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -155,7 +155,6 @@ BX_CPU_C::DIV_EAXEd(bxInstruction_c *i)
*/
/* now write quotient back to destination */
RAX = quotient_32l;
RDX = remainder_32;
}
@ -196,7 +195,6 @@ BX_CPU_C::IDIV_EAXEd(bxInstruction_c *i)
*/
/* now write quotient back to destination */
RAX = quotient_32l;
RDX = remainder_32;
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: mult8.cc,v 1.12 2004-08-09 21:28:47 sshwarts Exp $
// $Id: mult8.cc,v 1.13 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -30,7 +30,6 @@
#define LOG_THIS BX_CPU_THIS_PTR
void
BX_CPU_C::MUL_ALEb(bxInstruction_c *i)
{
@ -140,7 +139,6 @@ BX_CPU_C::DIV_ALEb(bxInstruction_c *i)
#endif
/* now write quotient back to destination */
AL = quotient_8l;
AH = remainder_8;
}
@ -189,7 +187,6 @@ BX_INFO(("AH: %02x, AL: %02x", (unsigned) AH, (unsigned) AL));
#endif
/* now write quotient back to destination */
AL = quotient_8l;
AH = remainder_8;
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: paging.cc,v 1.44 2004-06-18 14:11:07 sshwarts Exp $
// $Id: paging.cc,v 1.45 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -42,9 +42,6 @@
#define this (BX_CPU(0))
#endif
#if 0
// X86 Registers Which Affect Paging:
// ==================================
@ -263,9 +260,6 @@
// - Pentium Pro+ processors maintain separate 4K and 4M TLBs.
#endif
#if BX_SUPPORT_PAGING
#define BX_INVALID_TLB_ENTRY 0xffffffff

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: protect_ctrl.cc,v 1.29 2004-04-17 17:10:58 sshwarts Exp $
// $Id: protect_ctrl.cc,v 1.30 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -26,17 +26,11 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#define LOG_THIS BX_CPU_THIS_PTR
void
BX_CPU_C::ARPL_EwGw(bxInstruction_c *i)
{

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: protect_ctrl_pro.cc,v 1.6 2001-10-03 13:10:37 bdenney Exp $
// $Id: protect_ctrl_pro.cc,v 1.7 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -25,18 +25,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#define LOG_THIS BX_CPU_THIS_PTR
void
BX_CPU_C::enter_protected_mode(void)
{
@ -55,7 +48,6 @@ if ( BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.rpl!=0 || BX_CPU_THIS_PTR sre
void
BX_CPU_C::enter_real_mode(void)
{
// ???
// BX_INFO(("processor switching into REAL mode!!!"));
// debug(BX_CPU_THIS_PTR prev_eip);
if (v8086_mode()) BX_PANIC(("protect_ctrl: v8086 mode unsupported"));

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: shift16.cc,v 1.19 2004-08-09 21:28:47 sshwarts Exp $
// $Id: shift16.cc,v 1.20 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -420,6 +420,7 @@ BX_CPU_C::SHR_Ew(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
result_16 = (op1_16 >> count);
SET_FLAGS_OSZAPC_16(op1_16, count, result_16, BX_INSTR_SHR16);
#endif
/* now write result back to destination */
@ -429,10 +430,6 @@ BX_CPU_C::SHR_Ew(bxInstruction_c *i)
else {
Write_RMW_virtual_word(result_16);
}
#if !defined(BX_HostAsm_Shr16)
SET_FLAGS_OSZAPC_16(op1_16, count, result_16, BX_INSTR_SHR16);
#endif
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: shift32.cc,v 1.20 2004-08-09 21:28:47 sshwarts Exp $
// $Id: shift32.cc,v 1.21 2004-08-13 20:00:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -383,6 +383,7 @@ BX_CPU_C::SHR_Ed(bxInstruction_c *i)
setEFlagsOSZAPC(flags32);
#else
result_32 = (op1_32 >> count);
SET_FLAGS_OSZAPC_32(op1_32, count, result_32, BX_INSTR_SHR32);
#endif
/* now write result back to destination */
@ -392,10 +393,6 @@ BX_CPU_C::SHR_Ed(bxInstruction_c *i)
else {
Write_RMW_virtual_dword(result_32);
}
#if !defined(BX_HostAsm_Shr32)
SET_FLAGS_OSZAPC_32(op1_32, count, result_32, BX_INSTR_SHR32);
#endif
}
void