FreeBSD/sys/contrib/x86emu/x86emu.c
static uint16_t 
rcl_word(struct x86emu *emu, uint16_t d, uint8_t s)
{
	unsigned int res, cnt, mask, cf;

	res = d;
	if ((cnt = s % 17) != 0) {
		cf = (d >> (16 - cnt)) & 0x1;
		res = (d << cnt) & 0xffff;
		mask = (1 << (cnt - 1)) - 1;
		res |= (d >> (17 - cnt)) & mask;
		if (ACCESS_FLAG(F_CF)) {
			res |= 1 << (cnt - 1);
		}
		CONDITIONAL_SET_FLAG(cf, F_CF);
		CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 14) & 0x2)),
		    F_OF);
	}
	return (uint16_t) res;
}
/*
 * REMARKS:
 * Implements the RCL instruction and side effects.
 */
Implements the RCL instruction and side effects.
Implements the RCL instruction and side effects .
static uint16_t 
rcl_word(struct x86emu *emu, uint16_t d, uint8_t s)
{
	unsigned int res, cnt, mask, cf;
	res = d;
	if ((cnt = s % 17) != 0) {
		cf = (d >> (16 - cnt)) & 0x1;
		res = (d << cnt) & 0xffff;
		mask = (1 << (cnt - 1)) - 1;
		res |= (d >> (17 - cnt)) & mask;
		if (ACCESS_FLAG(F_CF)) {
			res |= 1 << (cnt - 1);
		}
		CONDITIONAL_SET_FLAG(cf, F_CF);
		CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 14) & 0x2)),
		    F_OF);
	}
	return (uint16_t) res;
}
static uint16_t rcl_word ( struct x86emu * emu , uint16_t d , uint8_t s ) { unsigned int res , cnt , mask , cf ; res = d ; if ( ( cnt = s % 17 ) != 0 ) { cf = ( d >> ( 16 - cnt ) ) & 0x1 ; res = ( d << cnt ) & 0xffff ; mask = ( 1 << ( cnt - 1 ) ) - 1 ; res |= ( d >> ( 17 - cnt ) ) & mask ; if ( ACCESS_FLAG ( F_CF ) ) { res |= 1 << ( cnt - 1 ) ; } CONDITIONAL_SET_FLAG ( cf , F_CF ) ; CONDITIONAL_SET_FLAG ( cnt == 1 && XOR2 ( cf + ( ( res >> 14 ) & 0x2 ) ) , F_OF ) ; } return ( uint16_t ) res ; }
REMARKS:
 Implements the RCL instruction and side effects.
REMARKS : Implements the RCL instruction and side effects .