1
0
Fork 0

fix dimul flags calculation for corner cases (thanks to bavi)

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3649
This commit is contained in:
Sebastian Strohhäcker 2010-10-09 13:49:48 +00:00
parent eff418eaee
commit 2a8b0b397f

View file

@ -798,7 +798,7 @@
Bits res=((Bit16s)op2) * ((Bit16s)op3); \
save(op1,res & 0xffff); \
FillFlagsNoCFOF(); \
if ((res> -32768) && (res<32767)) { \
if ((res>= -32768) && (res<=32767)) { \
SETFLAGBIT(CF,false);SETFLAGBIT(OF,false); \
} else { \
SETFLAGBIT(CF,true);SETFLAGBIT(OF,true); \
@ -810,8 +810,8 @@
Bit64s res=((Bit64s)((Bit32s)op2))*((Bit64s)((Bit32s)op3)); \
save(op1,(Bit32s)res); \
FillFlagsNoCFOF(); \
if ((res>-((Bit64s)(2147483647)+1)) && \
(res<(Bit64s)2147483647)) { \
if ((res>=-((Bit64s)(2147483647)+1)) && \
(res<=(Bit64s)2147483647)) { \
SETFLAGBIT(CF,false);SETFLAGBIT(OF,false); \
} else { \
SETFLAGBIT(CF,true);SETFLAGBIT(OF,true); \