mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
[FAST486]
Fix CF calculation in SHRD/SHLD. svn path=/branches/ntvdm/; revision=61070
This commit is contained in:
parent
24954c9d07
commit
9a8c7e2a04
1 changed files with 6 additions and 2 deletions
|
@ -683,7 +683,9 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeShld)
|
|||
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 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeShrd)
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue