From ace025dca923090d9487f85be03c81ad2db953e5 Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Wed, 13 Nov 2013 18:14:01 +0000 Subject: [PATCH] [FAST486] 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 | 8 ++++---- lib/fast486/opgroups.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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) {