/* 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;
/* ROL */
case 0:
{
+ Count %= Bits;
Result = (Value << Count) | (Value >> (Bits - Count));
/* Update CF and OF */
/* ROR */
case 1:
{
+ Count %= Bits;
Result = (Value >> Count) | (Value << (Bits - Count));
/* Update CF and OF */