From: Stanislav S. <ssh...@us...> - 2009-06-20 09:10:56
|
Update of /cvsroot/bochs/bochs/cpu In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9888 Modified Files: shift8.cc shift16.cc Log Message: Fixed shift flags (thanks Darek for showing the bug) Index: shift8.cc =================================================================== RCS file: /cvsroot/bochs/bochs/cpu/shift8.cc,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- shift8.cc 16 Jan 2009 18:18:58 -0000 1.39 +++ shift8.cc 20 Jun 2009 09:10:48 -0000 1.40 @@ -218,7 +218,7 @@ } 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); } Index: shift16.cc =================================================================== RCS file: /cvsroot/bochs/bochs/cpu/shift16.cc,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- shift16.cc 16 Jan 2009 18:18:58 -0000 1.48 +++ shift16.cc 20 Jun 2009 09:10:48 -0000 1.49 @@ -159,7 +159,7 @@ 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 @@ 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 @@ } 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); } |