FreeBSD/sys/contrib/x86emu/x86emu.c
/*
 * REMARKS:
 * Implements the AAD instruction and side effects.
 */
Implements the AAD instruction and side effects.
Implements the AAD instruction and side effects .
static uint16_t 
aad_word(struct x86emu *emu, uint16_t d)
{
	uint16_t l;
	uint8_t hb, lb;
	hb = (uint8_t) ((d >> 8) & 0xff);
	lb = (uint8_t) ((d & 0xff));
	l = (uint16_t) ((lb + 10 * hb) & 0xFF);
	CLEAR_FLAG(F_CF);
	CLEAR_FLAG(F_AF);
	CLEAR_FLAG(F_OF);
	CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
	CONDITIONAL_SET_FLAG(l == 0, F_ZF);
	CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
	return l;
}
static uint16_t aad_word ( struct x86emu * emu , uint16_t d ) { uint16_t l ; uint8_t hb , lb ; hb = ( uint8_t ) ( ( d >> 8 ) & 0xff ) ; lb = ( uint8_t ) ( ( d & 0xff ) ) ; l = ( uint16_t ) ( ( lb + 10 * hb ) & 0xFF ) ; CLEAR_FLAG ( F_CF ) ; CLEAR_FLAG ( F_AF ) ; CLEAR_FLAG ( F_OF ) ; CONDITIONAL_SET_FLAG ( l & 0x80 , F_SF ) ; CONDITIONAL_SET_FLAG ( l == 0 , F_ZF ) ; CONDITIONAL_SET_FLAG ( PARITY ( l & 0xff ) , F_PF ) ; return l ; }
REMARKS:
 Implements the AAD instruction and side effects.
REMARKS : Implements the AAD instruction and side effects .