Author: aandrejevic Date: Tue Nov 12 19:25:50 2013 New Revision: 60966
URL: http://svn.reactos.org/svn/reactos?rev=60966&view=rev Log: [FAST486] In rotate operations, the count is always masked with 0x1F, regardless of the operand size.
Modified: branches/ntvdm/lib/fast486/extraops.c branches/ntvdm/lib/fast486/opgroups.c
Modified: branches/ntvdm/lib/fast486/extraops.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/extraops.c?rev... ============================================================================== --- branches/ntvdm/lib/fast486/extraops.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/extraops.c [iso-8859-1] Tue Nov 12 19:25:50 2013 @@ -637,8 +637,7 @@ }
/* Normalize the count */ - if (OperandSize) Count &= 0x1F; - else Count &= 0x0F; + Count &= 0x1F;
/* Do nothing if the count is zero */ if (Count == 0) return TRUE; @@ -840,8 +839,7 @@ }
/* Normalize the count */ - if (OperandSize) Count &= 0x1F; - else Count &= 0x0F; + Count &= 0x1F;
/* Do nothing if the count is zero */ if (Count == 0) return TRUE;
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] Tue Nov 12 19:25:50 2013 @@ -163,16 +163,11 @@ ULONG HighestBit = 1 << (Bits - 1); ULONG Result;
- if ((Operation != 2) && (Operation != 3)) - { - /* Mask the count */ - Count &= Bits - 1; - } - else - { - /* For RCL and RCR, the CF is included in the value */ - Count %= Bits + 1; - } + /* Normalize the count */ + Count &= 0x1F; + + /* If the count is zero, do nothing */ + if (Count == 0) goto SetFlags;
/* Check which operation is this */ switch (Operation) @@ -275,6 +270,7 @@ } }
+SetFlags: if (Operation >= 4) { /* Update ZF, SF and PF */