FreeBSD/sys/contrib/x86emu/x86emu.c
/*
 * REMARKS:
 * Implements the DAA instruction and side effects.
 */
Implements the DAA instruction and side effects.
Implements the DAA instruction and side effects .
static uint8_t 
daa_byte(struct x86emu *emu, uint8_t d)
{
	uint32_t res = d;
	if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
		res += 6;
		SET_FLAG(F_AF);
	}
	if (res > 0x9F || ACCESS_FLAG(F_CF)) {
		res += 0x60;
		SET_FLAG(F_CF);
	}
	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
	CONDITIONAL_SET_FLAG((res & 0xFF) == 0, F_ZF);
	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
	return (uint8_t) res;
}
static uint8_t daa_byte ( struct x86emu * emu , uint8_t d ) { uint32_t res = d ; if ( ( d & 0xf ) > 9 || ACCESS_FLAG ( F_AF ) ) { res += 6 ; SET_FLAG ( F_AF ) ; } if ( res > 0x9F || ACCESS_FLAG ( F_CF ) ) { res += 0x60 ; SET_FLAG ( F_CF ) ; } CONDITIONAL_SET_FLAG ( res & 0x80 , F_SF ) ; CONDITIONAL_SET_FLAG ( ( res & 0xFF ) == 0 , F_ZF ) ; CONDITIONAL_SET_FLAG ( PARITY ( res & 0xff ) , F_PF ) ; return ( uint8_t ) res ; }
REMARKS:
 Implements the DAA instruction and side effects.
REMARKS : Implements the DAA instruction and side effects .