From 090dd61a1e30d831a2e4a6eba03adbd383e51950 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Sun, 18 Nov 2007 18:52:44 +0000 Subject: [PATCH] code cleanup in stack16/32.cc --- bochs/cpu/stack16.cc | 42 +++++++++++++++++++++--------------------- bochs/cpu/stack32.cc | 44 +++++++++++++++++++++----------------------- 2 files changed, 42 insertions(+), 44 deletions(-) diff --git a/bochs/cpu/stack16.cc b/bochs/cpu/stack16.cc index 5ec578d4f..41a940488 100644 --- a/bochs/cpu/stack16.cc +++ b/bochs/cpu/stack16.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: stack16.cc,v 1.24 2007-11-18 18:49:19 sshwarts Exp $ +// $Id: stack16.cc,v 1.25 2007-11-18 18:52:44 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -139,6 +139,26 @@ void BX_CPU_C::POP_EwR(bxInstruction_c *i) BX_WRITE_16BIT_REG(i->rm(), val16); } +void BX_CPU_C::PUSH_Iw(bxInstruction_c *i) +{ + push_16(i->Iw()); +} + +void BX_CPU_C::PUSH_EwM(bxInstruction_c *i) +{ + Bit16u op1_16; + + /* pointer, segment address pair */ + read_virtual_word(i->seg(), RMAddr(i), &op1_16); + + push_16(op1_16); +} + +void BX_CPU_C::PUSH_EwR(bxInstruction_c *i) +{ + push_16(BX_READ_16BIT_REG(i->rm())); +} + #if BX_CPU_LEVEL >= 3 void BX_CPU_C::PUSHAD16(bxInstruction_c *i) { @@ -209,23 +229,3 @@ void BX_CPU_C::POPAD16(bxInstruction_c *i) AX = ax; } #endif - -void BX_CPU_C::PUSH_Iw(bxInstruction_c *i) -{ - push_16(i->Iw()); -} - -void BX_CPU_C::PUSH_EwM(bxInstruction_c *i) -{ - Bit16u op1_16; - - /* pointer, segment address pair */ - read_virtual_word(i->seg(), RMAddr(i), &op1_16); - - push_16(op1_16); -} - -void BX_CPU_C::PUSH_EwR(bxInstruction_c *i) -{ - push_16(BX_READ_16BIT_REG(i->rm())); -} diff --git a/bochs/cpu/stack32.cc b/bochs/cpu/stack32.cc index 9488d38fa..602f79314 100644 --- a/bochs/cpu/stack32.cc +++ b/bochs/cpu/stack32.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: stack32.cc,v 1.37 2007-11-18 18:49:19 sshwarts Exp $ +// $Id: stack32.cc,v 1.38 2007-11-18 18:52:44 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -157,7 +157,26 @@ void BX_CPU_C::POP32_SS(bxInstruction_c *i) BX_CPU_THIS_PTR async_event = 1; } -#if BX_CPU_LEVEL >= 2 +void BX_CPU_C::PUSH_Id(bxInstruction_c *i) +{ + push_32(i->Id()); +} + +void BX_CPU_C::PUSH_EdM(bxInstruction_c *i) +{ + Bit32u op1_32; + + /* pointer, segment address pair */ + read_virtual_dword(i->seg(), RMAddr(i), &op1_32); + + push_32(op1_32); +} + +void BX_CPU_C::PUSH_EdR(bxInstruction_c *i) +{ + push_32(BX_READ_32BIT_REG(i->rm())); +} + void BX_CPU_C::PUSHAD32(bxInstruction_c *i) { Bit32u temp_ESP = ESP; @@ -226,27 +245,6 @@ void BX_CPU_C::POPAD32(bxInstruction_c *i) ECX = ecx; EAX = eax; } -#endif - -void BX_CPU_C::PUSH_Id(bxInstruction_c *i) -{ - push_32(i->Id()); -} - -void BX_CPU_C::PUSH_EdM(bxInstruction_c *i) -{ - Bit32u op1_32; - - /* pointer, segment address pair */ - read_virtual_dword(i->seg(), RMAddr(i), &op1_32); - - push_32(op1_32); -} - -void BX_CPU_C::PUSH_EdR(bxInstruction_c *i) -{ - push_32(BX_READ_32BIT_REG(i->rm())); -} #if BX_CPU_LEVEL >= 2 void BX_CPU_C::ENTER_IwIb(bxInstruction_c *i)