FreeBSD/sys/contrib/x86emu/x86emu.c
/*
 * REMARKS:
 * Implements the ADD instruction and side effects.
 */
Implements the ADD instruction and side effects.
Implements the ADD instruction and side effects .
static uint8_t 
add_byte(struct x86emu *emu, uint8_t d, uint8_t s)
{
	uint32_t res;	
	uint32_t cc;
	res = d + s;
	CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
	CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
	cc = (s & d) | ((~res) & (s | d));
	CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
	CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
	return (uint8_t) res;
}
static uint8_t add_byte ( struct x86emu * emu , uint8_t d , uint8_t s ) { uint32_t res ; uint32_t cc ; res = d + s ; CONDITIONAL_SET_FLAG ( res & 0x100 , F_CF ) ; CONDITIONAL_SET_FLAG ( ( res & 0xff ) == 0 , F_ZF ) ; CONDITIONAL_SET_FLAG ( res & 0x80 , F_SF ) ; CONDITIONAL_SET_FLAG ( PARITY ( res & 0xff ) , F_PF ) ; cc = ( s & d ) | ( ( ~ res ) & ( s | d ) ) ; CONDITIONAL_SET_FLAG ( XOR2 ( cc >> 6 ) , F_OF ) ; CONDITIONAL_SET_FLAG ( cc & 0x8 , F_AF ) ; return ( uint8_t ) res ; }
REMARKS:
 Implements the ADD instruction and side effects.
REMARKS : Implements the ADD instruction and side effects .
/* all operands in native machine order */ /* calculate the carry chain  SEE NOTE AT TOP. */