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)