From ea6ec077c9fb31d8c437e01cd447d362aa429edb Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Mon, 8 Jun 2015 15:25:48 +0000 Subject: [PATCH] [FAST486] Fix IMUL. MINSHORT and MAXSHORT aren't good constants since they don't have a (SHORT) cast, and (LONG)((SHORT)MINSHORT) is uglier than just using -32768. svn path=/trunk/; revision=68078 --- reactos/lib/fast486/opcodes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/lib/fast486/opcodes.c b/reactos/lib/fast486/opcodes.c index 4356defd3c8..e3b589c8bd6 100644 --- a/reactos/lib/fast486/opcodes.c +++ b/reactos/lib/fast486/opcodes.c @@ -3532,7 +3532,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeImulModrmImm) Product = (LONGLONG)Multiplicand * (LONGLONG)Multiplier; /* Check for carry/overflow */ - State->Flags.Cf = State->Flags.Of = ((Product < MINLONG) || (Product > MAXLONG)); + State->Flags.Cf = State->Flags.Of = ((Product < -2147483648LL) || (Product > 2147483647LL)); /* Write-back the result */ Fast486WriteModrmDwordOperands(State, @@ -3559,7 +3559,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeImulModrmImm) Product = (LONG)Multiplicand * (LONG)Multiplier; /* Check for carry/overflow */ - State->Flags.Cf = State->Flags.Of = ((Product < MINSHORT) || (Product > MAXSHORT)); + State->Flags.Cf = State->Flags.Of = ((Product < -32768) || (Product > 32767)); /* Write-back the result */ Fast486WriteModrmWordOperands(State,