FreeBSD/sys/contrib/x86emu/x86emu.c
/*
 * REMARKS:
 * Implements the AAM instruction and side effects.
 */
Implements the AAM instruction and side effects.
Implements the AAM instruction and side effects .
static uint16_t 
aam_word(struct x86emu *emu, uint8_t d)
{
	uint16_t h, l;
	h = (uint16_t) (d / 10);
	l = (uint16_t) (d % 10);
	l |= (uint16_t) (h << 8);
	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 aam_word ( struct x86emu * emu , uint8_t d ) { uint16_t h , l ; h = ( uint16_t ) ( d / 10 ) ; l = ( uint16_t ) ( d % 10 ) ; l |= ( uint16_t ) ( h << 8 ) ; 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 AAM instruction and side effects.
REMARKS : Implements the AAM instruction and side effects .