Author: hbelusca Date: Sun Nov 3 22:44:55 2013 New Revision: 60856
URL: http://svn.reactos.org/svn/reactos?rev=60856&view=rev Log: [FAST486]: Replace (boolean_condition) ? TRUE : FALSE; by: (boolean_condition) .
Modified: branches/ntvdm/lib/fast486/extraops.c branches/ntvdm/lib/fast486/opcodes.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] Sun Nov 3 22:44:55 2013 @@ -743,8 +743,8 @@ State->Flags.Of = ((Accumulator & SIGN_FLAG_BYTE) != (Destination & SIGN_FLAG_BYTE)) && ((Accumulator & SIGN_FLAG_BYTE) != (Result & SIGN_FLAG_BYTE)); State->Flags.Af = (Accumulator & 0x0F) < (Destination & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
if (State->Flags.Zf) @@ -799,8 +799,8 @@ State->Flags.Of = ((Accumulator & SIGN_FLAG_LONG) != (Destination & SIGN_FLAG_LONG)) && ((Accumulator & SIGN_FLAG_LONG) != (Result & SIGN_FLAG_LONG)); State->Flags.Af = (Accumulator & 0x0F) < (Destination & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
if (State->Flags.Zf) @@ -834,8 +834,8 @@ State->Flags.Of = ((Accumulator & SIGN_FLAG_WORD) != (Destination & SIGN_FLAG_WORD)) && ((Accumulator & SIGN_FLAG_WORD) != (Result & SIGN_FLAG_WORD)); State->Flags.Af = (Accumulator & 0x0F) < (Destination & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
if (State->Flags.Zf) @@ -1267,9 +1267,9 @@ State->Flags.Cf = (Result < Source) && (Result < Destination); State->Flags.Of = ((Source & SIGN_FLAG_BYTE) == (Destination & SIGN_FLAG_BYTE)) && ((Source & SIGN_FLAG_BYTE) != (Result & SIGN_FLAG_BYTE)); - State->Flags.Af = (((Source & 0x0F) + (Destination & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Af = ((((Source & 0x0F) + (Destination & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write the sum to the destination */ @@ -1330,9 +1330,9 @@ State->Flags.Cf = (Result < Source) && (Result < Destination); State->Flags.Of = ((Source & SIGN_FLAG_LONG) == (Destination & SIGN_FLAG_LONG)) && ((Source & SIGN_FLAG_LONG) != (Result & SIGN_FLAG_LONG)); - State->Flags.Af = (((Source & 0x0F) + (Destination & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Af = ((((Source & 0x0F) + (Destination & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write the sum to the destination */ @@ -1369,9 +1369,9 @@ State->Flags.Cf = (Result < Source) && (Result < Destination); State->Flags.Of = ((Source & SIGN_FLAG_WORD) == (Destination & SIGN_FLAG_WORD)) && ((Source & SIGN_FLAG_WORD) != (Result & SIGN_FLAG_WORD)); - State->Flags.Af = (((Source & 0x0F) + (Destination & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Af = ((((Source & 0x0F) + (Destination & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write the sum to the destination */
Modified: branches/ntvdm/lib/fast486/opcodes.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/opcodes.c?rev=... ============================================================================== --- branches/ntvdm/lib/fast486/opcodes.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/opcodes.c [iso-8859-1] Sun Nov 3 22:44:55 2013 @@ -473,19 +473,19 @@ { Value = ++State->GeneralRegs[Opcode & 0x07].Long;
- State->Flags.Of = (Value == SIGN_FLAG_LONG) ? TRUE : FALSE; - State->Flags.Sf = (Value & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Of = (Value == SIGN_FLAG_LONG); + State->Flags.Sf = ((Value & SIGN_FLAG_LONG) != 0); } else { Value = ++State->GeneralRegs[Opcode & 0x07].LowWord;
- State->Flags.Of = (Value == SIGN_FLAG_WORD) ? TRUE : FALSE; - State->Flags.Sf = (Value & SIGN_FLAG_WORD) ? TRUE : FALSE; - } - - State->Flags.Zf = (Value == 0) ? TRUE : FALSE; - State->Flags.Af = ((Value & 0x0F) == 0) ? TRUE : FALSE; + State->Flags.Of = (Value == SIGN_FLAG_WORD); + State->Flags.Sf = ((Value & SIGN_FLAG_WORD) != 0); + } + + State->Flags.Zf = (Value == 0); + State->Flags.Af = ((Value & 0x0F) == 0); State->Flags.Pf = Fast486CalculateParity(LOBYTE(Value));
/* Return success */ @@ -507,19 +507,19 @@ { Value = --State->GeneralRegs[Opcode & 0x07].Long;
- State->Flags.Of = (Value == (SIGN_FLAG_LONG - 1)) ? TRUE : FALSE; - State->Flags.Sf = (Value & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Of = (Value == (SIGN_FLAG_LONG - 1)); + State->Flags.Sf = ((Value & SIGN_FLAG_LONG) != 0); } else { Value = --State->GeneralRegs[Opcode & 0x07].LowWord;
- State->Flags.Of = (Value == (SIGN_FLAG_WORD - 1)) ? TRUE : FALSE; - State->Flags.Sf = (Value & SIGN_FLAG_WORD) ? TRUE : FALSE; - } - - State->Flags.Zf = (Value == 0) ? TRUE : FALSE; - State->Flags.Af = ((Value & 0x0F) == 0x0F) ? TRUE : FALSE; + State->Flags.Of = (Value == (SIGN_FLAG_WORD - 1)); + State->Flags.Sf = ((Value & SIGN_FLAG_WORD) != 0); + } + + State->Flags.Zf = (Value == 0); + State->Flags.Af = ((Value & 0x0F) == 0x0F); State->Flags.Pf = Fast486CalculateParity(LOBYTE(Value));
/* Return success */ @@ -1186,9 +1186,9 @@ State->Flags.Cf = (Result < FirstValue) && (Result < SecondValue); State->Flags.Of = ((FirstValue & SIGN_FLAG_BYTE) == (SecondValue & SIGN_FLAG_BYTE)) && ((FirstValue & SIGN_FLAG_BYTE) != (Result & SIGN_FLAG_BYTE)); - State->Flags.Af = (((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1239,9 +1239,9 @@ State->Flags.Cf = (Result < FirstValue) && (Result < SecondValue); State->Flags.Of = ((FirstValue & SIGN_FLAG_LONG) == (SecondValue & SIGN_FLAG_LONG)) && ((FirstValue & SIGN_FLAG_LONG) != (Result & SIGN_FLAG_LONG)); - State->Flags.Af = (((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1270,9 +1270,9 @@ State->Flags.Cf = (Result < FirstValue) && (Result < SecondValue); State->Flags.Of = ((FirstValue & SIGN_FLAG_WORD) == (SecondValue & SIGN_FLAG_WORD)) && ((FirstValue & SIGN_FLAG_WORD) != (Result & SIGN_FLAG_WORD)); - State->Flags.Af = (((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1311,9 +1311,9 @@ State->Flags.Cf = (Result < FirstValue) && (Result < SecondValue); State->Flags.Of = ((FirstValue & SIGN_FLAG_BYTE) == (SecondValue & SIGN_FLAG_BYTE)) && ((FirstValue & SIGN_FLAG_BYTE) != (Result & SIGN_FLAG_BYTE)); - State->Flags.Af = (((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1350,9 +1350,9 @@ State->Flags.Cf = (Result < FirstValue) && (Result < SecondValue); State->Flags.Of = ((FirstValue & SIGN_FLAG_LONG) == (SecondValue & SIGN_FLAG_LONG)) && ((FirstValue & SIGN_FLAG_LONG) != (Result & SIGN_FLAG_LONG)); - State->Flags.Af = (((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1376,9 +1376,9 @@ State->Flags.Cf = (Result < FirstValue) && (Result < SecondValue); State->Flags.Of = ((FirstValue & SIGN_FLAG_WORD) == (SecondValue & SIGN_FLAG_WORD)) && ((FirstValue & SIGN_FLAG_WORD) != (Result & SIGN_FLAG_WORD)); - State->Flags.Af = (((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1421,8 +1421,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1472,8 +1472,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1501,8 +1501,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1540,8 +1540,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1577,8 +1577,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1601,8 +1601,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1645,8 +1645,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1696,8 +1696,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1725,8 +1725,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1759,8 +1759,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1796,8 +1796,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1820,8 +1820,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1864,8 +1864,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1915,8 +1915,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1944,8 +1944,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1983,8 +1983,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2020,8 +2020,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2044,8 +2044,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2087,8 +2087,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* The result is discarded */ @@ -2135,8 +2135,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result); } else @@ -2158,8 +2158,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result); }
@@ -2194,8 +2194,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* The result is discarded */ @@ -2229,8 +2229,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result); } else @@ -2250,8 +2250,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result); }
@@ -2465,9 +2465,9 @@ State->Flags.Cf = State->Flags.Cf || ((Result < FirstValue) && (Result < SecondValue)); State->Flags.Of = ((FirstValue & SIGN_FLAG_BYTE) == (SecondValue & SIGN_FLAG_BYTE)) && ((FirstValue & SIGN_FLAG_BYTE) != (Result & SIGN_FLAG_BYTE)); - State->Flags.Af = (((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2522,9 +2522,9 @@ State->Flags.Cf = State->Flags.Cf || ((Result < FirstValue) && (Result < SecondValue)); State->Flags.Of = ((FirstValue & SIGN_FLAG_LONG) == (SecondValue & SIGN_FLAG_LONG)) && ((FirstValue & SIGN_FLAG_LONG) != (Result & SIGN_FLAG_LONG)); - State->Flags.Af = (((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2557,9 +2557,9 @@ State->Flags.Cf = State->Flags.Cf || ((Result < FirstValue) && (Result < SecondValue)); State->Flags.Of = ((FirstValue & SIGN_FLAG_WORD) == (SecondValue & SIGN_FLAG_WORD)) && ((FirstValue & SIGN_FLAG_WORD) != (Result & SIGN_FLAG_WORD)); - State->Flags.Af = (((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2603,9 +2603,9 @@ State->Flags.Cf = State->Flags.Cf || ((Result < FirstValue) && (Result < SecondValue)); State->Flags.Of = ((FirstValue & SIGN_FLAG_BYTE) == (SecondValue & SIGN_FLAG_BYTE)) && ((FirstValue & SIGN_FLAG_BYTE) != (Result & SIGN_FLAG_BYTE)); - State->Flags.Af = (((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2646,9 +2646,9 @@ State->Flags.Cf = State->Flags.Cf || ((Result < FirstValue) && (Result < SecondValue)); State->Flags.Of = ((FirstValue & SIGN_FLAG_LONG) == (SecondValue & SIGN_FLAG_LONG)) && ((FirstValue & SIGN_FLAG_LONG) != (Result & SIGN_FLAG_LONG)); - State->Flags.Af = (((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2676,9 +2676,9 @@ State->Flags.Cf = State->Flags.Cf || ((Result < FirstValue) && (Result < SecondValue)); State->Flags.Of = ((FirstValue & SIGN_FLAG_WORD) == (SecondValue & SIGN_FLAG_WORD)) && ((FirstValue & SIGN_FLAG_WORD) != (Result & SIGN_FLAG_WORD)); - State->Flags.Af = (((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2751,8 +2751,8 @@ State->Flags.Of = ((FirstValue & SIGN_FLAG_BYTE) != (SecondValue & SIGN_FLAG_BYTE)) && ((FirstValue & SIGN_FLAG_BYTE) != (Result & SIGN_FLAG_BYTE)); State->Flags.Af = (FirstValue & 0x0F) < ((SecondValue + 1) & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2812,8 +2812,8 @@ State->Flags.Of = ((FirstValue & SIGN_FLAG_LONG) != (SecondValue & SIGN_FLAG_LONG)) && ((FirstValue & SIGN_FLAG_LONG) != (Result & SIGN_FLAG_LONG)); State->Flags.Af = (FirstValue & 0x0F) < ((SecondValue + 1) & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2850,8 +2850,8 @@ State->Flags.Of = ((FirstValue & SIGN_FLAG_WORD) != (SecondValue & SIGN_FLAG_WORD)) && ((FirstValue & SIGN_FLAG_WORD) != (Result & SIGN_FLAG_WORD)); State->Flags.Af = (FirstValue & 0x0F) < ((SecondValue + 1) & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2892,8 +2892,8 @@ State->Flags.Of = ((FirstValue & SIGN_FLAG_BYTE) != (SecondValue & SIGN_FLAG_BYTE)) && ((FirstValue & SIGN_FLAG_BYTE) != (Result & SIGN_FLAG_BYTE)); State->Flags.Af = (FirstValue & 0x0F) < ((SecondValue + 1) & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2933,8 +2933,8 @@ State->Flags.Of = ((FirstValue & SIGN_FLAG_LONG) != (SecondValue & SIGN_FLAG_LONG)) && ((FirstValue & SIGN_FLAG_LONG) != (Result & SIGN_FLAG_LONG)); State->Flags.Af = (FirstValue & 0x0F) < ((SecondValue + Carry) & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -2959,8 +2959,8 @@ State->Flags.Of = ((FirstValue & SIGN_FLAG_WORD) != (SecondValue & SIGN_FLAG_WORD)) && ((FirstValue & SIGN_FLAG_WORD) != (Result & SIGN_FLAG_WORD)); State->Flags.Af = (FirstValue & 0x0F) < ((SecondValue + Carry) & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -3069,8 +3069,8 @@ State->Flags.Of = ((FirstValue & SIGN_FLAG_BYTE) != (SecondValue & SIGN_FLAG_BYTE)) && ((FirstValue & SIGN_FLAG_BYTE) != (Result & SIGN_FLAG_BYTE)); State->Flags.Af = (FirstValue & 0x0F) < (SecondValue & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Check if this is not a CMP */ @@ -3138,8 +3138,8 @@ State->Flags.Of = ((FirstValue & SIGN_FLAG_LONG) != (SecondValue & SIGN_FLAG_LONG)) && ((FirstValue & SIGN_FLAG_LONG) != (Result & SIGN_FLAG_LONG)); State->Flags.Af = (FirstValue & 0x0F) < (SecondValue & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Check if this is not a CMP */ @@ -3185,8 +3185,8 @@ State->Flags.Of = ((FirstValue & SIGN_FLAG_WORD) != (SecondValue & SIGN_FLAG_WORD)) && ((FirstValue & SIGN_FLAG_WORD) != (Result & SIGN_FLAG_WORD)); State->Flags.Af = (FirstValue & 0x0F) < (SecondValue & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Check if this is not a CMP */ @@ -3235,8 +3235,8 @@ State->Flags.Of = ((FirstValue & SIGN_FLAG_BYTE) != (SecondValue & SIGN_FLAG_BYTE)) && ((FirstValue & SIGN_FLAG_BYTE) != (Result & SIGN_FLAG_BYTE)); State->Flags.Af = (FirstValue & 0x0F) < (SecondValue & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Check if this is not a CMP */ @@ -3278,8 +3278,8 @@ State->Flags.Of = ((FirstValue & SIGN_FLAG_LONG) != (SecondValue & SIGN_FLAG_LONG)) && ((FirstValue & SIGN_FLAG_LONG) != (Result & SIGN_FLAG_LONG)); State->Flags.Af = (FirstValue & 0x0F) < (SecondValue & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_LONG) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Check if this is not a CMP */ @@ -3308,8 +3308,8 @@ State->Flags.Of = ((FirstValue & SIGN_FLAG_WORD) != (SecondValue & SIGN_FLAG_WORD)) && ((FirstValue & SIGN_FLAG_WORD) != (Result & SIGN_FLAG_WORD)); State->Flags.Af = (FirstValue & 0x0F) < (SecondValue & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Check if this is not a CMP */ @@ -4847,8 +4847,8 @@ State->GeneralRegs[FAST486_REG_EAX].LowByte = Value %= Base;
/* Update flags */ - State->Flags.Zf = (Value == 0) ? TRUE : FALSE; - State->Flags.Sf = (Value & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Value == 0); + State->Flags.Sf = ((Value & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Value);
return TRUE; @@ -4873,8 +4873,8 @@ State->GeneralRegs[FAST486_REG_EAX].LowByte = Value;
/* Update flags */ - State->Flags.Zf = (Value == 0) ? TRUE : FALSE; - State->Flags.Sf = (Value & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Value == 0); + State->Flags.Sf = ((Value & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Value);
return TRUE; @@ -5570,8 +5570,8 @@ State->Flags.Of = ((FirstValue & SignFlag) != (SecondValue & SignFlag)) && ((FirstValue & SignFlag) != (Result & SignFlag)); State->Flags.Af = (FirstValue & 0x0F) < (SecondValue & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SignFlag) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SignFlag) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Increment/decrement ESI and EDI */ @@ -5894,8 +5894,8 @@ State->Flags.Of = ((FirstValue & SignFlag) != (SecondValue & SignFlag)) && ((FirstValue & SignFlag) != (Result & SignFlag)); State->Flags.Af = (FirstValue & 0x0F) < (SecondValue & 0x0F); - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SignFlag) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SignFlag) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Increment/decrement EDI */
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] Sun Nov 3 22:44:55 2013 @@ -61,7 +61,7 @@ State->Flags.Cf = (Result < FirstValue) && (Result < SecondValue); State->Flags.Of = ((FirstValue & SignFlag) == (SecondValue & SignFlag)) && ((FirstValue & SignFlag) != (Result & SignFlag)); - State->Flags.Af = (((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + (SecondValue & 0x0F)) & 0x10) != 0);
break; } @@ -85,8 +85,7 @@ || ((Result < FirstValue) && (Result < (SecondValue + Carry))); State->Flags.Of = ((FirstValue & SignFlag) == (SecondValue & SignFlag)) && ((FirstValue & SignFlag) != (Result & SignFlag)); - State->Flags.Af = (((FirstValue & 0x0F) + ((SecondValue + Carry) & 0x0F)) & 0x10) - ? TRUE : FALSE; + State->Flags.Af = ((((FirstValue & 0x0F) + ((SecondValue + Carry) & 0x0F)) & 0x10) != 0);
break; } @@ -144,8 +143,8 @@ }
/* Update ZF, SF and PF */ - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SignFlag) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SignFlag) != 0); State->Flags.Pf = Fast486CalculateParity(LOBYTE(Result));
/* Return the result */ @@ -185,7 +184,7 @@
/* Update CF and OF */ State->Flags.Cf = Result & 1; - if (Count == 1) State->Flags.Of = ((Result & HighestBit) ? TRUE : FALSE) + if (Count == 1) State->Flags.Of = ((Result & HighestBit) != 0) ^ State->Flags.Cf;
break; @@ -197,10 +196,9 @@ Result = (Value >> Count) | (Value << (Bits - Count));
/* Update CF and OF */ - State->Flags.Cf = (Result & HighestBit) ? TRUE : FALSE; + State->Flags.Cf = ((Result & HighestBit) != 0); if (Count == 1) State->Flags.Of = State->Flags.Cf - ^ ((Result & (HighestBit >> 1)) - ? TRUE : FALSE); + ^ ((Result & (HighestBit >> 1)) != 0);
break; } @@ -213,8 +211,8 @@ | (Value >> (Bits - Count + 1));
/* Update CF and OF */ - State->Flags.Cf = (Value & (1 << (Bits - Count))) ? TRUE : FALSE; - if (Count == 1) State->Flags.Of = ((Result & HighestBit) ? TRUE : FALSE) + State->Flags.Cf = ((Value & (1 << (Bits - Count))) != 0); + if (Count == 1) State->Flags.Of = ((Result & HighestBit) != 0) ^ State->Flags.Cf;
break; @@ -228,10 +226,9 @@ | (Value << (Bits - Count + 1));
/* Update CF and OF */ - State->Flags.Cf = (Value & (1 << (Bits - Count))) ? TRUE : FALSE; + State->Flags.Cf = ((Value & (1 << (Bits - Count))) != 0); if (Count == 1) State->Flags.Of = State->Flags.Cf - ^ ((Result & (HighestBit >> 1)) - ? TRUE : FALSE); + ^ ((Result & (HighestBit >> 1)) != 0);
break; } @@ -243,9 +240,9 @@ Result = Value << Count;
/* Update CF and OF */ - State->Flags.Cf = (Value & (1 << (Bits - Count))) ? TRUE : FALSE; - if (Count == 1) State->Flags.Of = ((Result & HighestBit) ? TRUE : FALSE) - ^ (State->Flags.Cf ? TRUE : FALSE); + State->Flags.Cf = ((Value & (1 << (Bits - Count))) != 0); + if (Count == 1) State->Flags.Of = ((Result & HighestBit) != 0) + ^ State->Flags.Cf;
break; } @@ -256,8 +253,8 @@ Result = Value >> Count;
/* Update CF and OF */ - State->Flags.Cf = (Value & (1 << (Count - 1))) ? TRUE : FALSE; - if (Count == 1) State->Flags.Of = (Value & HighestBit) ? TRUE : FALSE; + State->Flags.Cf = ((Value & (1 << (Count - 1))) != 0); + if (Count == 1) State->Flags.Of = ((Value & HighestBit) != 0);
break; } @@ -271,7 +268,7 @@ if (Value & HighestBit) Result |= ((1 << Count) - 1) << (Bits - Count);
/* Update CF and OF */ - State->Flags.Cf = (Value & (1 << (Count - 1))) ? TRUE : FALSE; + State->Flags.Cf = ((Value & (1 << (Count - 1))) != 0); if (Count == 1) State->Flags.Of = FALSE;
break; @@ -281,8 +278,8 @@ if (Operation >= 4) { /* Update ZF, SF and PF */ - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & HighestBit) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & HighestBit) != 0); State->Flags.Pf = Fast486CalculateParity(Result); }
@@ -945,8 +942,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
break; @@ -966,11 +963,11 @@ UCHAR Result = -Value;
/* Update the flags */ - State->Flags.Cf = (Value != 0) ? TRUE : FALSE; + State->Flags.Cf = (Value != 0); State->Flags.Of = (Value & SIGN_FLAG_BYTE) && (Result & SIGN_FLAG_BYTE); - State->Flags.Af = ((Value & 0x0F) != 0) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Af = ((Value & 0x0F) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -983,7 +980,7 @@ USHORT Result = (USHORT)Value * (USHORT)State->GeneralRegs[FAST486_REG_EAX].LowByte;
/* Update the flags */ - State->Flags.Cf = State->Flags.Of = HIBYTE(Result) ? TRUE : FALSE; + State->Flags.Cf = State->Flags.Of = (HIBYTE(Result) != 0);
/* Write back the result */ State->GeneralRegs[FAST486_REG_EAX].LowWord = Result; @@ -998,7 +995,7 @@
/* Update the flags */ State->Flags.Cf = State->Flags.Of = - ((Result < -128) || (Result > 127)) ? TRUE : FALSE; + ((Result < -128) || (Result > 127));
/* Write back the result */ State->GeneralRegs[FAST486_REG_EAX].LowWord = (USHORT)Result; @@ -1110,8 +1107,8 @@ /* Update the flags */ State->Flags.Cf = FALSE; State->Flags.Of = FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SignFlag) ? TRUE : FALSE; + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SignFlag) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
break; @@ -1141,11 +1138,11 @@ if (!OperandSize) Result &= 0xFFFF;
/* Update the flags */ - State->Flags.Cf = (Value != 0) ? TRUE : FALSE; + State->Flags.Cf = (Value != 0); State->Flags.Of = (Value & SignFlag) && (Result & SignFlag); - State->Flags.Af = ((Value & 0x0F) != 0) ? TRUE : FALSE; - State->Flags.Zf = (Result == 0) ? TRUE : FALSE; - State->Flags.Sf = (Result & SignFlag) ? TRUE : FALSE; + State->Flags.Af = ((Value & 0x0F) != 0); + State->Flags.Zf = (Result == 0); + State->Flags.Sf = ((Result & SignFlag) != 0); State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */ @@ -1170,7 +1167,7 @@
/* Update the flags */ State->Flags.Cf = State->Flags.Of = - (Result & 0xFFFFFFFF00000000ULL) ? TRUE : FALSE; + ((Result & 0xFFFFFFFF00000000ULL) != 0);
/* Write back the result */ State->GeneralRegs[FAST486_REG_EAX].Long = Result & 0xFFFFFFFFULL; @@ -1181,7 +1178,7 @@ ULONG Result = (ULONG)Value * (ULONG)State->GeneralRegs[FAST486_REG_EAX].LowWord;
/* Update the flags */ - State->Flags.Cf = State->Flags.Of = HIWORD(Result) ? TRUE : FALSE; + State->Flags.Cf = State->Flags.Of = (HIWORD(Result) != 0);
/* Write back the result */ State->GeneralRegs[FAST486_REG_EAX].LowWord = LOWORD(Result); @@ -1200,7 +1197,7 @@
/* Update the flags */ State->Flags.Cf = State->Flags.Of = - ((Result < -2147483648LL) || (Result > 2147483647LL)) ? TRUE : FALSE; + ((Result < -2147483648LL) || (Result > 2147483647LL));
/* Write back the result */ State->GeneralRegs[FAST486_REG_EAX].Long = Result & 0xFFFFFFFFULL; @@ -1212,7 +1209,7 @@
/* Update the flags */ State->Flags.Cf = State->Flags.Of = - ((Result < -32768) || (Result > 32767)) ? TRUE : FALSE; + ((Result < -32768) || (Result > 32767));
/* Write back the result */ State->GeneralRegs[FAST486_REG_EAX].LowWord = LOWORD(Result); @@ -1316,20 +1313,20 @@ { /* Increment and update OF and AF */ Value++; - State->Flags.Of = (Value == SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Of = (Value == SIGN_FLAG_BYTE); State->Flags.Af = ((Value & 0x0F) == 0); } else { /* Decrement and update OF and AF */ - State->Flags.Of = (Value == SIGN_FLAG_BYTE) ? TRUE : FALSE; + State->Flags.Of = (Value == SIGN_FLAG_BYTE); Value--; State->Flags.Af = ((Value & 0x0F) == 0x0F); }
/* Update flags */ - State->Flags.Sf = (Value & SIGN_FLAG_BYTE) ? TRUE : FALSE; - State->Flags.Zf = (Value == 0) ? TRUE : FALSE; + State->Flags.Zf = (Value == 0); + State->Flags.Sf = ((Value & SIGN_FLAG_BYTE) != 0); State->Flags.Pf = Fast486CalculateParity(Value);
/* Write back the result */ @@ -1377,13 +1374,13 @@ { /* Increment and update OF and AF */ Value++; - State->Flags.Of = (Value == SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Of = (Value == SIGN_FLAG_LONG); State->Flags.Af = ((Value & 0x0F) == 0); } else if (ModRegRm.Register == 1) { /* Decrement and update OF and AF */ - State->Flags.Of = (Value == SIGN_FLAG_LONG) ? TRUE : FALSE; + State->Flags.Of = (Value == SIGN_FLAG_LONG); Value--; State->Flags.Af = ((Value & 0x0F) == 0x0F); } @@ -1495,8 +1492,8 @@ if (ModRegRm.Register <= 1) { /* Update flags */ - State->Flags.Sf = (Value & SIGN_FLAG_LONG) ? TRUE : FALSE; - State->Flags.Zf = (Value == 0) ? TRUE : FALSE; + State->Flags.Sf = ((Value & SIGN_FLAG_LONG) != 0); + State->Flags.Zf = (Value == 0); State->Flags.Pf = Fast486CalculateParity(Value);
/* Write back the result */ @@ -1520,13 +1517,13 @@ { /* Increment and update OF */ Value++; - State->Flags.Of = (Value == SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Of = (Value == SIGN_FLAG_WORD); State->Flags.Af = ((Value & 0x0F) == 0); } else if (ModRegRm.Register == 1) { /* Decrement and update OF */ - State->Flags.Of = (Value == SIGN_FLAG_WORD) ? TRUE : FALSE; + State->Flags.Of = (Value == SIGN_FLAG_WORD); Value--; State->Flags.Af = ((Value & 0x0F) == 0x0F); } @@ -1645,8 +1642,8 @@ if (ModRegRm.Register <= 1) { /* Update flags */ - State->Flags.Sf = (Value & SIGN_FLAG_WORD) ? TRUE : FALSE; - State->Flags.Zf = (Value == 0) ? TRUE : FALSE; + State->Flags.Sf = ((Value & SIGN_FLAG_WORD) != 0); + State->Flags.Zf = (Value == 0); State->Flags.Pf = Fast486CalculateParity(Value);
/* Write back the result */