FreeBSD/sys/contrib/x86emu/x86emu.c
/*
 * REMARKS:
 * Implements the AND instruction and side effects.
 */
Implements the AND instruction and side effects.
Implements the AND instruction and side effects .
static uint16_t 
and_word(struct x86emu *emu, uint16_t d, uint16_t s)
{
	uint16_t res;	
	res = d & s;
	CLEAR_FLAG(F_OF);
	CLEAR_FLAG(F_CF);
	CLEAR_FLAG(F_AF);
	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
	return res;
}
static uint16_t and_word ( struct x86emu * emu , uint16_t d , uint16_t s ) { uint16_t res ; res = d & s ; CLEAR_FLAG ( F_OF ) ; CLEAR_FLAG ( F_CF ) ; CLEAR_FLAG ( F_AF ) ; CONDITIONAL_SET_FLAG ( res & 0x8000 , F_SF ) ; CONDITIONAL_SET_FLAG ( res == 0 , F_ZF ) ; CONDITIONAL_SET_FLAG ( PARITY ( res & 0xff ) , F_PF ) ; return res ; }
REMARKS:
 Implements the AND instruction and side effects.
REMARKS : Implements the AND instruction and side effects .
/* all operands in native machine order */ /* set the flags  */