Author: aandrejevic Date: Wed Nov 13 13:32:00 2013 New Revision: 60972
URL: http://svn.reactos.org/svn/reactos?rev=60972&view=rev Log: [FAST486] Fix a bug in the ROL and ROR instructions.
Modified: branches/ntvdm/lib/fast486/opgroups.c
Modified: branches/ntvdm/lib/fast486/opgroups.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/opgroups.c?rev... ============================================================================== --- branches/ntvdm/lib/fast486/opgroups.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/opgroups.c [iso-8859-1] Wed Nov 13 13:32:00 2013 @@ -167,8 +167,7 @@ /* Normalize the count */ Count &= 0x1F;
- if (Operation <= 1) Count %= Bits; - else if (Operation <= 3) Count %= Bits + 1; + if ((Operation == 2) || (Operation == 3)) Count %= Bits + 1;
/* If the count is zero, do nothing */ if (Count == 0) return Value; @@ -179,6 +178,7 @@ /* ROL */ case 0: { + Count %= Bits; Result = (Value << Count) | (Value >> (Bits - Count));
/* Update CF and OF */ @@ -192,6 +192,7 @@ /* ROR */ case 1: { + Count %= Bits; Result = (Value >> Count) | (Value << (Bits - Count));
/* Update CF and OF */