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