Ejemplo n.º 1
0
void xImpl_Test::operator()( const xRegisterInt& to, int imm ) const
{
	if( to.IsAccumulator() ) {
		xOpAccWrite( to.GetPrefix16(), to.Is8BitOp() ? 0xa8 : 0xa9, 0, to );
	} else {
		xOpWrite( to.GetPrefix16(), to.Is8BitOp() ? 0xf6 : 0xf7, 0, to );
	}
	to.xWriteImm( imm );
}
Ejemplo n.º 2
0
void xImpl_Test::operator()( const xRegisterInt& to, int imm ) const
{
	to.prefix16();

	if( to.IsAccumulator() )
		xWrite8( to.Is8BitOp() ? 0xa8 : 0xa9 );
	else
	{
		xWrite8( to.Is8BitOp() ? 0xf6 : 0xf7 );
		EmitSibMagic( 0, to );
	}
	to.xWriteImm( imm );
}
Ejemplo n.º 3
0
static void _imul_ImmStyle( const xRegisterInt& param1, const SrcType& param2, int imm )
{
	// for iMul OpSize is allowed to be 16 or 32 bit only.
	const uint OpSize = param1.GetOperandSize();

	pxAssert( OpSize == param2.GetOperandSize() );
	pxAssert( OpSize > 1 );

	xOpWrite0F( (OpSize == 2) ? 0x66 : 0, is_s8( imm ) ? 0x6b : 0x69, param1, param2 );

	if( is_s8( imm ) )
		xWrite8( (u8)imm );
	else
		param1.xWriteImm( imm );
}
Ejemplo n.º 4
0
static void _g1_EmitOp( G1Type InstType, const xRegisterInt& to, int imm )
{
	to.prefix16();
	if( !to.Is8BitOp() && is_s8( imm ) )
	{
		xWrite8( 0x83 );
		EmitSibMagic( InstType, to );
		xWrite<s8>( imm );
	}
	else
	{
		if( to.IsAccumulator() )
			xWrite8( (to.Is8BitOp() ? 4 : 5) | (InstType<<3) );
		else
		{
			xWrite8( to.Is8BitOp() ? 0x80 : 0x81 );
			EmitSibMagic( InstType, to );
		}
		to.xWriteImm( imm );
	}
}