diff --git a/lib/soft386/opgroups.c b/lib/soft386/opgroups.c index af99f840336..2822305a16c 100644 --- a/lib/soft386/opgroups.c +++ b/lib/soft386/opgroups.c @@ -273,7 +273,7 @@ Soft386RotateOperation(PSOFT386_STATE State, if (Value & HighestBit) Result |= ((1 << Count) - 1) << (Bits - Count); /* Update CF and OF */ - State->Flags.Cf = Value & 1; + State->Flags.Cf = (Value & (1 << (Count - 1))) ? TRUE : FALSE; if (Count == 1) State->Flags.Of = FALSE; break;