--- np2/i386c/ia32/instructions/bin_arith.c 2004/03/23 15:29:34 1.10 +++ np2/i386c/ia32/instructions/bin_arith.c 2011/01/15 17:17:23 1.13 @@ -1,5 +1,3 @@ -/* $Id: bin_arith.c,v 1.10 2004/03/23 15:29:34 monaka Exp $ */ - /* * Copyright (c) 2002-2004 NONAKA Kimihiro * All rights reserved. @@ -12,8 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -281,6 +277,9 @@ IDIV_ALEb(UINT32 op) if (((r + 0x80) & 0xff00) == 0) { CPU_AL = (SINT8)r; CPU_AH = tmp % src; +#if (CPU_FAMILY == 4) + CPU_FLAGL ^= A_FLAG; +#endif return; } } @@ -308,6 +307,9 @@ IDIV_AXEw(UINT32 op) if (((r + 0x8000) & 0xffff0000) == 0) { CPU_AX = (SINT16)r; CPU_DX = tmp % src; +#if (CPU_FAMILY == 4) + CPU_FLAGL ^= A_FLAG; +#endif return; } } @@ -335,6 +337,9 @@ IDIV_EAXEd(UINT32 op) if (((r + SQWORD_CONST(0x80000000)) & QWORD_CONST(0xffffffff00000000)) == 0) { CPU_EAX = (SINT32)r; CPU_EDX = (SINT32)(tmp % src); +#if (CPU_FAMILY == 4) + CPU_FLAGL ^= A_FLAG; +#endif return; } } @@ -365,6 +370,9 @@ DIV_ALEb(UINT32 op) if (tmp < ((UINT16)src << 8)) { CPU_AL = tmp / src; CPU_AH = tmp % src; +#if (CPU_FAMILY == 4) + CPU_FLAGL ^= A_FLAG; +#endif return; } } @@ -391,6 +399,9 @@ DIV_AXEw(UINT32 op) if (tmp < ((UINT32)src << 16)) { CPU_AX = (UINT16)(tmp / src); CPU_DX = (UINT16)(tmp % src); +#if (CPU_FAMILY == 4) + CPU_FLAGL ^= A_FLAG; +#endif return; } } @@ -417,6 +428,9 @@ DIV_EAXEd(UINT32 op) if (tmp < ((UINT64)src << 32)) { CPU_EAX = (UINT32)(tmp / src); CPU_EDX = (UINT32)(tmp % src); +#if (CPU_FAMILY == 4) + CPU_FLAGL ^= A_FLAG; +#endif return; } }