Fixes in registers read/write -> fixed zero upper of register in POP_Ed
This commit is contained in:
parent
0fa82afe1f
commit
dc5c25133f
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: arith16.cc,v 1.48 2007-11-08 18:21:37 sshwarts Exp $
|
||||
// $Id: arith16.cc,v 1.49 2007-11-13 21:07:07 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -33,13 +33,13 @@
|
||||
|
||||
void BX_CPU_C::INC_RX(bxInstruction_c *i)
|
||||
{
|
||||
Bit16u rx = ++ BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].word.rx;
|
||||
Bit16u rx = ++BX_READ_16BIT_REG(i->opcodeReg());
|
||||
SET_FLAGS_OSZAP_RESULT_16(rx, BX_INSTR_INC16);
|
||||
}
|
||||
|
||||
void BX_CPU_C::DEC_RX(bxInstruction_c *i)
|
||||
{
|
||||
Bit16u rx = -- BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].word.rx;
|
||||
Bit16u rx = --BX_READ_16BIT_REG(i->opcodeReg());
|
||||
SET_FLAGS_OSZAP_RESULT_16(rx, BX_INSTR_DEC16);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: arith32.cc,v 1.54 2007-11-06 08:39:25 sshwarts Exp $
|
||||
// $Id: arith32.cc,v 1.55 2007-11-13 21:07:07 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -43,7 +43,7 @@ void BX_CPU_C::INC_ERX(bxInstruction_c *i)
|
||||
{
|
||||
unsigned opcodeReg = i->opcodeReg();
|
||||
|
||||
Bit32u erx = ++ BX_CPU_THIS_PTR gen_reg[opcodeReg].dword.erx;
|
||||
Bit32u erx = ++ BX_READ_32BIT_REG(opcodeReg);
|
||||
SET_FLAGS_OSZAP_RESULT_32(erx, BX_INSTR_INC32);
|
||||
|
||||
BX_CLEAR_64BIT_HIGH(opcodeReg);
|
||||
@ -53,7 +53,7 @@ void BX_CPU_C::DEC_ERX(bxInstruction_c *i)
|
||||
{
|
||||
unsigned opcodeReg = i->opcodeReg();
|
||||
|
||||
Bit32u erx = -- BX_CPU_THIS_PTR gen_reg[opcodeReg].dword.erx;
|
||||
Bit32u erx = -- BX_READ_32BIT_REG(opcodeReg);
|
||||
SET_FLAGS_OSZAP_RESULT_32(erx, BX_INSTR_DEC32);
|
||||
|
||||
BX_CLEAR_64BIT_HIGH(opcodeReg);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: flag_ctrl.cc,v 1.28 2007-11-07 10:40:40 sshwarts Exp $
|
||||
// $Id: flag_ctrl.cc,v 1.29 2007-11-13 21:07:07 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -214,7 +214,6 @@ void BX_CPU_C::POPF_Fw(bxInstruction_c *i)
|
||||
if ((BX_CPU_THIS_PTR get_IOPL() < 3) && (CR4_VME_ENABLED == 0)) {
|
||||
BX_DEBUG(("POPFW: #GP(0) in v8086 (no VME) mode"));
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
pop_16(&flags16);
|
||||
#if BX_SUPPORT_VME
|
||||
@ -252,7 +251,6 @@ void BX_CPU_C::PUSHF_Fd(bxInstruction_c *i)
|
||||
if (v8086_mode() && (BX_CPU_THIS_PTR get_IOPL()<3)) {
|
||||
BX_DEBUG(("PUSHFD: #GP(0) in v8086 mode"));
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// VM & RF flags cleared in image stored on the stack
|
||||
@ -284,7 +282,6 @@ void BX_CPU_C::POPF_Fd(bxInstruction_c *i)
|
||||
if (BX_CPU_THIS_PTR get_IOPL() < 3) {
|
||||
BX_DEBUG(("POPFD: #GP(0) in v8086 mode"));
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
pop_32(&flags32);
|
||||
// v8086-mode: VM, IOPL, VIP, VIF are unaffected
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: stack16.cc,v 1.21 2007-03-02 21:03:23 sshwarts Exp $
|
||||
// $Id: stack16.cc,v 1.22 2007-11-13 21:07:07 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
void BX_CPU_C::PUSH_RX(bxInstruction_c *i)
|
||||
{
|
||||
push_16(BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].word.rx);
|
||||
push_16(BX_READ_16BIT_REG(i->opcodeReg()));
|
||||
}
|
||||
|
||||
void BX_CPU_C::PUSH16_CS(bxInstruction_c *i)
|
||||
@ -113,7 +113,7 @@ void BX_CPU_C::POP_RX(bxInstruction_c *i)
|
||||
{
|
||||
Bit16u rx;
|
||||
pop_16(&rx);
|
||||
BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].word.rx = rx;
|
||||
BX_WRITE_16BIT_REG(i->opcodeReg(), rx)
|
||||
}
|
||||
|
||||
void BX_CPU_C::POP_Ew(bxInstruction_c *i)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: stack32.cc,v 1.34 2007-03-02 21:03:25 sshwarts Exp $
|
||||
// $Id: stack32.cc,v 1.35 2007-11-13 21:07:08 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -54,14 +54,14 @@ void BX_CPU_C::POP_Ed(bxInstruction_c *i)
|
||||
|
||||
void BX_CPU_C::PUSH_ERX(bxInstruction_c *i)
|
||||
{
|
||||
push_32(BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].dword.erx);
|
||||
push_32(BX_READ_32BIT_REG(i->opcodeReg()));
|
||||
}
|
||||
|
||||
void BX_CPU_C::POP_ERX(bxInstruction_c *i)
|
||||
{
|
||||
Bit32u erx;
|
||||
pop_32(&erx);
|
||||
BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].dword.erx = erx;
|
||||
BX_WRITE_32BIT_REGZ(i->opcodeReg(), erx)
|
||||
}
|
||||
|
||||
void BX_CPU_C::PUSH32_CS(bxInstruction_c *i)
|
||||
|
Loading…
Reference in New Issue
Block a user