From e9829f1830938e21ace41fe0d126161e82209a7e Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Wed, 9 Oct 2013 19:49:41 +0000 Subject: [PATCH] [SOFT386] Fix the carry flag in the SAR instruction. svn path=/branches/ntvdm/; revision=60589 --- lib/soft386/opgroups.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;