Author: aandrejevic
Date: Fri Nov 22 02:47:48 2013
New Revision: 61070
URL:
http://svn.reactos.org/svn/reactos?rev=61070&view=rev
Log:
[FAST486]
Fix CF calculation in SHRD/SHLD.
Modified:
branches/ntvdm/lib/fast486/extraops.c
Modified: branches/ntvdm/lib/fast486/extraops.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/extraops.c?re…
==============================================================================
--- branches/ntvdm/lib/fast486/extraops.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/fast486/extraops.c [iso-8859-1] Fri Nov 22 02:47:48 2013
@@ -683,7 +683,9 @@
Result = (Destination << Count) | (DoubleSource >> (32 - Count));
/* Update flags */
- State->Flags.Cf = (Destination >> (16 - Count)) & 1;
+ if (Count <= 16) State->Flags.Cf = (Destination >> (16 - Count))
& 1;
+ else State->Flags.Cf = (Source >> (32 - Count)) & 1;
+
if (Count == 1) State->Flags.Of = (Result & SIGN_FLAG_WORD)
!= (Destination & SIGN_FLAG_WORD);
State->Flags.Zf = (Result == 0);
@@ -887,7 +889,9 @@
if (Count >= 16) Result |= (ULONG)(Source | (Source << 16)) >>
(Count - 16);
/* Update flags */
- State->Flags.Cf = (Result >> (Count - 1)) & 1;
+ if (Count <= 16) State->Flags.Cf = (Destination >> (Count - 1)) &
1;
+ else State->Flags.Cf = (Source >> (Count - 17)) & 1;
+
if (Count == 1) State->Flags.Of = (Result & SIGN_FLAG_WORD)
!= (Destination & SIGN_FLAG_WORD);
State->Flags.Zf = (Result == 0);