diff --git a/lib/fast486/extraops.c b/lib/fast486/extraops.c index 046ad9e1a5f..8d57bfc16f9 100644 --- a/lib/fast486/extraops.c +++ b/lib/fast486/extraops.c @@ -566,7 +566,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBitTest) } /* Normalize the bit number */ - BitNumber &= (1 << DataSize) - 1; + BitNumber %= DataSize; if (OperandSize) { @@ -748,7 +748,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBts) } /* Normalize the bit number */ - BitNumber &= (1 << DataSize) - 1; + BitNumber %= DataSize; if (OperandSize) { @@ -1207,7 +1207,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBtr) } /* Normalize the bit number */ - BitNumber &= (1 << DataSize) - 1; + BitNumber %= DataSize; if (OperandSize) { @@ -1432,7 +1432,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBtc) } /* Normalize the bit number */ - BitNumber &= (1 << DataSize) - 1; + BitNumber %= DataSize; if (OperandSize) { diff --git a/lib/fast486/opgroups.c b/lib/fast486/opgroups.c index fd996619415..46ad2344b52 100644 --- a/lib/fast486/opgroups.c +++ b/lib/fast486/opgroups.c @@ -1921,7 +1921,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup0FBA) } /* Normalize the bit number */ - BitNumber &= (1 << DataSize) - 1; + BitNumber %= DataSize; if (OperandSize) {