FreeBSD/sys/contrib/x86emu/x86emu.c
/*
 * REMARKS:
 * Implements the SBB instruction and side effects.
 */
Implements the SBB instruction and side effects.
Implements the SBB instruction and side effects .
static uint32_t 
sbb_long(struct x86emu *emu, uint32_t d, uint32_t s)
{
	uint32_t res;	
	uint32_t bc;
	if (ACCESS_FLAG(F_CF))
		res = d - s - 1;
	else
		res = d - s;
	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
	CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
	bc = (res & (~d | s)) | (~d & s);
	CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
	CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
	return res;
}
static uint32_t sbb_long ( struct x86emu * emu , uint32_t d , uint32_t s ) { uint32_t res ; uint32_t bc ; if ( ACCESS_FLAG ( F_CF ) ) res = d - s - 1 ; else res = d - s ; CONDITIONAL_SET_FLAG ( res & 0x80000000 , F_SF ) ; CONDITIONAL_SET_FLAG ( ( res & 0xffffffff ) == 0 , F_ZF ) ; CONDITIONAL_SET_FLAG ( PARITY ( res & 0xff ) , F_PF ) ; bc = ( res & ( ~ d | s ) ) | ( ~ d & s ) ; CONDITIONAL_SET_FLAG ( bc & 0x80000000 , F_CF ) ; CONDITIONAL_SET_FLAG ( XOR2 ( bc >> 30 ) , F_OF ) ; CONDITIONAL_SET_FLAG ( bc & 0x8 , F_AF ) ; return res ; }
REMARKS:
 Implements the SBB instruction and side effects.
REMARKS : Implements the SBB instruction and side effects .
/* all operands in native machine order */ /* calculate the borrow chain.  See note at top */