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_byte(struct x86emu *emu, uint8_t s)
{
	int16_t res = (int16_t) ((int8_t) emu->x86.R_AL * (int8_t) s);
	emu->x86.R_AX = res;
	if (((emu->x86.R_AL & 0x80) == 0 && emu->x86.R_AH == 0x00) ||
	    ((emu->x86.R_AL & 0x80) != 0 && emu->x86.R_AH == 0xFF)) {
		CLEAR_FLAG(F_CF);
		CLEAR_FLAG(F_OF);
	} else {
		SET_FLAG(F_CF);
		SET_FLAG(F_OF);
	}
}
static void imul_byte ( struct x86emu * emu , uint8_t s ) { int16_t res = ( int16_t ) ( ( int8_t ) emu -> x86 . R_AL * ( int8_t ) s ) ; emu -> x86 . R_AX = res ; if ( ( ( emu -> x86 . R_AL & 0x80 ) == 0 && emu -> x86 . R_AH == 0x00 ) || ( ( emu -> x86 . R_AL & 0x80 ) != 0 && emu -> x86 . R_AH == 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 .