From 84124f29d2969a0d6a31919f4a676eca9f4998ed Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Thu, 8 Jun 2006 19:56:30 +0000 Subject: [PATCH] Fix FPU tos value (found with save/restore logs browsing --- bochs/cpu/i387.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bochs/cpu/i387.h b/bochs/cpu/i387.h index 1a4249e37..6959e2689 100644 --- a/bochs/cpu/i387.h +++ b/bochs/cpu/i387.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: i387.h,v 1.31 2005-06-09 17:42:34 vruppert Exp $ +// $Id: i387.h,v 1.32 2006-06-08 19:56:30 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004 Stanislav Shwartsman @@ -117,13 +117,13 @@ BX_CPP_INLINE void i387_t::FPU_settagi(int tag, int stnr) BX_CPP_INLINE void i387_t::FPU_push(void) { - tos--; + tos = (tos - 1) & 7; } BX_CPP_INLINE void i387_t::FPU_pop(void) { - twd |= 3 << ((tos & 7)*2); - tos++; + twd |= 3 << (tos*2); + tos = (tos + 1) & 7; } BX_CPP_INLINE void i387_t::FPU_save_regi(floatx80 reg, int tag, int stnr)