Fixed shift flags (thanks Darek for showing the bug)

This commit is contained in:
Stanislav Shwartsman 2009-06-20 09:10:48 +00:00
parent 3e1037e8c0
commit 61cb00c149
2 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: shift16.cc,v 1.48 2009-01-16 18:18:58 sshwarts Exp $
// $Id: shift16.cc,v 1.49 2009-06-20 09:10:48 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -159,7 +159,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SHRD_EwGwM(bxInstruction_c *i)
SET_FLAGS_OSZAPC_LOGIC_16(result_16); /* handle SF, ZF and AF flags */
cf = (op1_16 >> (count - 1)) & 0x1;
of = ((result_16 << 1) ^ result_16) >> 15; // of = result14 ^ result15
of = (((result_16 << 1) ^ result_16) >> 15) & 0x1; // of = result14 ^ result15
SET_FLAGS_OxxxxC(of, cf);
}
@ -200,7 +200,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SHRD_EwGwR(bxInstruction_c *i)
SET_FLAGS_OSZAPC_LOGIC_16(result_16); /* handle SF, ZF and AF flags */
cf = (op1_16 >> (count - 1)) & 0x1;
of = ((result_16 << 1) ^ result_16) >> 15; // of = result14 ^ result15
of = (((result_16 << 1) ^ result_16) >> 15) & 0x1; // of = result14 ^ result15
SET_FLAGS_OxxxxC(of, cf);
}
@ -388,7 +388,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RCR_Ew(bxInstruction_c *i)
}
cf = (op1_16 >> (count - 1)) & 0x1;
of = ((result_16 << 1) ^ result_16) >> 15; // of = result15 ^ result14
of = (((result_16 << 1) ^ result_16) >> 15) & 0x1; // of = result15 ^ result14
SET_FLAGS_OxxxxC(of, cf);
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: shift8.cc,v 1.39 2009-01-16 18:18:58 sshwarts Exp $
// $Id: shift8.cc,v 1.40 2009-06-20 09:10:48 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -218,7 +218,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RCR_Eb(bxInstruction_c *i)
}
cf = (op1_8 >> (count - 1)) & 0x1;
of = ((result_8 << 1) ^ result_8) >> 7; // of = result6 ^ result7
of = (((result_8 << 1) ^ result_8) >> 7) & 0x1; // of = result6 ^ result7
SET_FLAGS_OxxxxC(of, cf);
}