FreeBSD/sys/contrib/x86emu/x86emu.c
/*
 * REMARKS:
 * Implements the IMUL instruction and side effects.
 */
Implements the IMUL instruction and side effects.
Implements the IMUL instruction and side effects .
static void 
imul_long(struct x86emu *emu, uint32_t s)
{
	int64_t res;
	res = (int64_t)(int32_t)emu->x86.R_EAX * (int32_t)s;
	emu->x86.R_EAX = (uint32_t)res;
	emu->x86.R_EDX = ((uint64_t)res) >> 32;
	if (((emu->x86.R_EAX & 0x80000000) == 0 && emu->x86.R_EDX == 0x00) ||
	    ((emu->x86.R_EAX & 0x80000000) != 0 && emu->x86.R_EDX == 0xFF)) {
		CLEAR_FLAG(F_CF);
		CLEAR_FLAG(F_OF);
	} else {
		SET_FLAG(F_CF);
		SET_FLAG(F_OF);
	}
}
static void imul_long ( struct x86emu * emu , uint32_t s ) { int64_t res ; res = ( int64_t ) ( int32_t ) emu -> x86 . R_EAX * ( int32_t ) s ; emu -> x86 . R_EAX = ( uint32_t ) res ; emu -> x86 . R_EDX = ( ( uint64_t ) res ) >> 32 ; if ( ( ( emu -> x86 . R_EAX & 0x80000000 ) == 0 && emu -> x86 . R_EDX == 0x00 ) || ( ( emu -> x86 . R_EAX & 0x80000000 ) != 0 && emu -> x86 . R_EDX == 0xFF ) ) { CLEAR_FLAG ( F_CF ) ; CLEAR_FLAG ( F_OF ) ; } else { SET_FLAG ( F_CF ) ; SET_FLAG ( F_OF ) ; } }
REMARKS:
 Implements the IMUL instruction and side effects.
REMARKS : Implements the IMUL instruction and side effects .