[FAST486]
authorAleksandar Andrejevic <aandrejevic@reactos.org>
Wed, 13 Nov 2013 18:14:01 +0000 (18:14 +0000)
committerAleksandar Andrejevic <aandrejevic@reactos.org>
Wed, 13 Nov 2013 18:14:01 +0000 (18:14 +0000)
The bit number should be normalized to [0, DataSize- 1], not [0, 2 ^ DataSize - 1].

svn path=/branches/ntvdm/; revision=60975

lib/fast486/extraops.c
lib/fast486/opgroups.c

index 046ad9e..8d57bfc 100644 (file)
@@ -566,7 +566,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBitTest)
     }
 
     /* Normalize the bit number */
     }
 
     /* Normalize the bit number */
-    BitNumber &= (1 << DataSize) - 1;
+    BitNumber %= DataSize;
 
     if (OperandSize)
     {
 
     if (OperandSize)
     {
@@ -748,7 +748,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBts)
     }
 
     /* Normalize the bit number */
     }
 
     /* Normalize the bit number */
-    BitNumber &= (1 << DataSize) - 1;
+    BitNumber %= DataSize;
 
     if (OperandSize)
     {
 
     if (OperandSize)
     {
@@ -1207,7 +1207,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBtr)
     }
 
     /* Normalize the bit number */
     }
 
     /* Normalize the bit number */
-    BitNumber &= (1 << DataSize) - 1;
+    BitNumber %= DataSize;
 
     if (OperandSize)
     {
 
     if (OperandSize)
     {
@@ -1432,7 +1432,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBtc)
     }
 
     /* Normalize the bit number */
     }
 
     /* Normalize the bit number */
-    BitNumber &= (1 << DataSize) - 1;
+    BitNumber %= DataSize;
 
     if (OperandSize)
     {
 
     if (OperandSize)
     {
index fd99661..46ad234 100644 (file)
@@ -1921,7 +1921,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup0FBA)
     }
 
     /* Normalize the bit number */
     }
 
     /* Normalize the bit number */
-    BitNumber &= (1 << DataSize) - 1;
+    BitNumber %= DataSize;
 
     if (OperandSize)
     {
 
     if (OperandSize)
     {