FreeBSD/sys/contrib/x86emu/x86emu.c
/*
 * REMARKS:
 * Implements the AAA instruction and side effects.
 */
Implements the AAA instruction and side effects.
Implements the AAA instruction and side effects .
static uint16_t 
aaa_word(struct x86emu *emu, uint16_t d)
{
	uint16_t res;
	if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
		d += 0x6;
		d += 0x100;
		SET_FLAG(F_AF);
		SET_FLAG(F_CF);
	} else {
		CLEAR_FLAG(F_CF);
		CLEAR_FLAG(F_AF);
	}
	res = (uint16_t) (d & 0xFF0F);
	CLEAR_FLAG(F_SF);
	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
	return res;
}
static uint16_t aaa_word ( struct x86emu * emu , uint16_t d ) { uint16_t res ; if ( ( d & 0xf ) > 0x9 || ACCESS_FLAG ( F_AF ) ) { d += 0x6 ; d += 0x100 ; SET_FLAG ( F_AF ) ; SET_FLAG ( F_CF ) ; } else { CLEAR_FLAG ( F_CF ) ; CLEAR_FLAG ( F_AF ) ; } res = ( uint16_t ) ( d & 0xFF0F ) ; CLEAR_FLAG ( F_SF ) ; CONDITIONAL_SET_FLAG ( res == 0 , F_ZF ) ; CONDITIONAL_SET_FLAG ( PARITY ( res & 0xff ) , F_PF ) ; return res ; }
REMARKS:
 Implements the AAA instruction and side effects.
REMARKS : Implements the AAA instruction and side effects .