27 #ifndef FCML_COMMON_HPP_
28 #define FCML_COMMON_HPP_
46 #define FCML_TO_CPP_BOOL( x ) ( (x) ? true : false )
53 typedef std::basic_string<fcml_char> fcml_cstring;
59 typedef std::basic_ostringstream<fcml_char> fcml_costream;
74 static fcml_string
strDup(
const fcml_string str ) {
78 #if defined(FCML_MSCC)
79 fcml_string newStr = _strdup( str );
81 fcml_string newStr = strdup( str );
84 throw std::bad_alloc();
88 static void strFree( fcml_string str ) {
113 virtual T
next() = 0;
123 Nullable(
const T& value,
bool is_not_null =
false ) :
124 _value( value ), _is_not_null( is_not_null ) {
128 _is_not_null(
false ) {
131 bool isNotNull()
const {
135 void setNotNull(
bool isNull) {
136 _is_not_null = isNull;
147 void setValue(
const T& value) {
148 this->_value = value;
165 this->_error = error;
169 this->_error = error;
172 this->_msg = cpy._msg;
173 this->_error = cpy._error;
178 if ( &exc !=
this ) {
179 this->_msg = exc._msg;
180 this->_error = exc._error;
185 const fcml_cstring getMsg()
const {
192 void*
operator new(
size_t size ) {
193 return ::operator
new( size );
296 instructionPrefix._prefix = prefix;
297 return instructionPrefix;
518 _addressSizeAttribute(FCML_DS_32),
519 _operandSizeAttribute(FCML_DS_32),
533 _addressSizeAttribute(addressSizeAttribute),
534 _operandSizeAttribute(operandSizeAttribute),
551 return _opMode == ep._opMode &&
553 _operandSizeAttribute == ep._operandSizeAttribute &&
554 _addressSizeAttribute == ep._addressSizeAttribute;
565 return !(ep == *
this);
577 return _addressSizeAttribute;
587 _addressSizeAttribute = addressSizeAttribute;
597 return _operandSizeAttribute;
607 _operandSizeAttribute = operandSizeAttribute;
664 fcml_usize _addressSizeAttribute;
666 fcml_usize _operandSizeAttribute;
680 _size( FCML_DS_64 ), _isSigned( FCML_FALSE ), _vint8( 0 ), _vint16( 0 ), _vint32( 0 ), _vint64( 0 ) {
685 _size( FCML_DS_8 ), _isSigned( FCML_TRUE ), _vint8( value ), _vint16( 0 ), _vint32( 0 ), _vint64( 0 ) {
690 _size( FCML_DS_16 ), _isSigned( FCML_TRUE ), _vint8( 0 ), _vint16( value ), _vint32( 0 ), _vint64( 0 ) {
695 _size( FCML_DS_32 ), _isSigned( FCML_TRUE ), _vint8( 0 ), _vint16( 0 ), _vint32( value ), _vint64( 0 ) {
700 _size( FCML_DS_64 ), _isSigned( FCML_TRUE ), _vint8( 0 ), _vint16( 0 ), _vint32( 0 ), _vint64( value ) {
705 _size( FCML_DS_8 ), _isSigned( FCML_FALSE ), _vint8( static_cast<fcml_uint8_t>( value ) ), _vint16( 0 ), _vint32( 0 ), _vint64( 0 ) {
710 _size( FCML_DS_16 ), _isSigned( FCML_FALSE ), _vint8( 0 ), _vint16( static_cast<fcml_uint16_t>( value ) ), _vint32( 0 ), _vint64( 0 ) {
715 _size( FCML_DS_32 ), _isSigned( FCML_FALSE ), _vint8( 0 ), _vint16( 0 ), _vint32( static_cast<fcml_uint32_t>( value ) ), _vint64( 0 ) {
720 _size( FCML_DS_64 ), _isSigned( FCML_FALSE ), _vint8( 0 ), _vint16( 0 ), _vint32( 0 ), _vint64( static_cast<fcml_uint64_t>( value ) ) {
803 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) ==
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) ==
static_cast<fcml_uint64_t
>( value );
814 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) ==
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) ==
static_cast<fcml_uint64_t
>( value );
825 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) ==
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) ==
static_cast<fcml_uint64_t
>( value );
836 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) ==
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) ==
static_cast<fcml_uint64_t
>( value );
847 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) ==
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) ==
static_cast<fcml_uint64_t
>( value );
858 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) ==
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) ==
static_cast<fcml_uint64_t
>( value );
869 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) ==
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) ==
static_cast<fcml_uint64_t
>( value );
880 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) ==
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) ==
static_cast<fcml_uint64_t
>( value );
891 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) ==
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) ==
static_cast<fcml_uint64_t
>( value );
902 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) !=
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) !=
static_cast<fcml_uint64_t
>( value );
913 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) !=
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) !=
static_cast<fcml_uint64_t
>( value );
924 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) !=
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) !=
static_cast<fcml_uint64_t
>( value );
935 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) !=
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) !=
static_cast<fcml_uint64_t
>( value );
946 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) !=
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) !=
static_cast<fcml_uint64_t
>( value );
957 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) !=
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) !=
static_cast<fcml_uint64_t
>( value );
968 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) !=
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) !=
static_cast<fcml_uint64_t
>( value );
979 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) !=
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) !=
static_cast<fcml_uint64_t
>( value );
990 return _isSigned ?
static_cast<fcml_int64_t
>( *this ) !=
static_cast<fcml_int64_t
>( value ) : static_cast<fcml_uint64_t>( *
this ) !=
static_cast<fcml_uint64_t
>( value );
998 operator fcml_int8_t()
const {
1002 result =
static_cast<fcml_int8_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1005 result =
static_cast<fcml_int8_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1008 result =
static_cast<fcml_int8_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1011 result =
static_cast<fcml_int8_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1023 operator fcml_uint8_t()
const {
1024 fcml_uint8_t result;
1027 result =
static_cast<fcml_uint8_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1030 result =
static_cast<fcml_uint8_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1033 result =
static_cast<fcml_uint8_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1036 result =
static_cast<fcml_uint8_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1049 operator fcml_int16_t()
const {
1050 fcml_int16_t result;
1053 result =
static_cast<fcml_int16_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1056 result =
static_cast<fcml_int16_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1059 result =
static_cast<fcml_int16_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1062 result =
static_cast<fcml_int16_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1075 operator fcml_uint16_t()
const {
1076 fcml_uint16_t result;
1079 result =
static_cast<fcml_uint16_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1082 result =
static_cast<fcml_uint16_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1085 result =
static_cast<fcml_uint16_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1088 result =
static_cast<fcml_uint16_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1101 operator fcml_int32_t()
const {
1102 fcml_int32_t result;
1105 result =
static_cast<fcml_int32_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1108 result =
static_cast<fcml_int32_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1111 result =
static_cast<fcml_int32_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1114 result =
static_cast<fcml_int32_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1127 operator fcml_uint32_t()
const {
1128 fcml_uint32_t result;
1131 result =
static_cast<fcml_uint32_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1134 result =
static_cast<fcml_uint32_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1137 result =
static_cast<fcml_uint32_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1140 result =
static_cast<fcml_uint32_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1153 operator fcml_int64_t()
const {
1154 fcml_int64_t result;
1157 result =
static_cast<fcml_int64_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1160 result =
static_cast<fcml_int64_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1163 result =
static_cast<fcml_int64_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1166 result =
static_cast<fcml_int64_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1179 operator fcml_uint64_t()
const {
1180 fcml_uint64_t result;
1183 result =
static_cast<fcml_uint64_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1186 result =
static_cast<fcml_uint64_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1189 result =
static_cast<fcml_uint64_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1192 result =
static_cast<fcml_uint64_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1232 minus( *
this, arg );
1241 const Integer &thisRef = *
this;
1243 plus( result, src );
1252 const Integer &thisRef = *
this;
1254 minus( result, src );
1263 const Integer &thisRef = *
this;
1274 const Integer &thisRef = *
this;
1369 callMathExpression( &doMinus, &doUMinus, result, src );
1377 callMathExpression( &doMul, &doUMul, result, src );
1385 callMathExpression( &doDiv, &doUDiv, result, src );
1393 callMathExpression( &doPlus, &doUPlus, result, src );
1402 static fcml_int64_t doPlus( fcml_int64_t thisValue, fcml_int64_t thatValue ) {
1403 return thisValue + thatValue;
1410 static fcml_int64_t doMinus( fcml_int64_t thisValue, fcml_int64_t thatValue ) {
1411 return thisValue - thatValue;
1418 static fcml_int64_t doMul( fcml_int64_t thisValue, fcml_int64_t thatValue ) {
1419 return thisValue * thatValue;
1426 static fcml_int64_t doDiv( fcml_int64_t thisValue, fcml_int64_t thatValue ) {
1427 return thisValue / thatValue;
1434 static fcml_uint64_t doUPlus( fcml_uint64_t thisValue, fcml_uint64_t thatValue ) {
1435 return thisValue + thatValue;
1442 static fcml_uint64_t doUMinus( fcml_uint64_t thisValue, fcml_uint64_t thatValue ) {
1443 return thisValue - thatValue;
1450 static fcml_uint64_t doUMul( fcml_uint64_t thisValue, fcml_uint64_t thatValue ) {
1451 return thisValue * thatValue;
1458 static fcml_uint64_t doUDiv( fcml_uint64_t thisValue, fcml_uint64_t thatValue ) {
1459 return thisValue / thatValue;
1466 void callMathExpression( fcml_int64_t (*signedExpressionFn)( fcml_int64_t thisValue, fcml_int64_t thatValue ), fcml_uint64_t (*unsignedExpressionFn)( fcml_uint64_t thisValue, fcml_uint64_t thatValue ),
Integer &result,
const Integer &src )
const {
1470 fcml_int64_t thisValue;
1471 fcml_int64_t thatValue;
1474 switch( src._size ) {
1476 thatValue = src._isSigned ? src._vint8 :
static_cast<fcml_uint8_t
>( src._vint8 );
1479 thatValue = src._isSigned ? src._vint16 :
static_cast<fcml_uint16_t
>( src._vint16 );
1482 thatValue = src._isSigned ? src._vint32 :
static_cast<fcml_uint32_t
>( src._vint32 );
1485 thatValue = src._isSigned ? src._vint64 :
static_cast<fcml_uint64_t
>( src._vint64 );
1490 switch( result._size ) {
1492 thisValue = result._isSigned ? result._vint8 :
static_cast<fcml_uint8_t
>(result._vint8 );
1493 thisValue = (*signedExpressionFn)( thisValue, thatValue );
1494 result._vint8 =
static_cast<fcml_int8_t
>( thisValue );
1497 thisValue = result._isSigned ? result._vint16 :
static_cast<fcml_uint16_t
>( result._vint16 );
1498 thisValue = (*signedExpressionFn)( thisValue, thatValue );
1499 result._vint16 =
static_cast<fcml_int16_t
>( thisValue );
1502 thisValue = result._isSigned ? result._vint32 :
static_cast<fcml_uint32_t
>( result._vint32 );
1503 thisValue = (*signedExpressionFn)( thisValue, thatValue );
1504 result._vint32 =
static_cast<fcml_int32_t
>( thisValue );
1507 thisValue = result._isSigned ? result._vint64 :
static_cast<fcml_uint64_t
>( result._vint64 );
1508 thisValue = (*signedExpressionFn)( thisValue, thatValue );
1509 result._vint64 = thisValue;
1515 fcml_uint64_t thisValue;
1516 fcml_uint64_t thatValue;
1519 switch( src._size ) {
1521 thatValue = src._isSigned ? src._vint8 :
static_cast<fcml_uint8_t
>( src._vint8 );
1524 thatValue = src._isSigned ? src._vint16 :
static_cast<fcml_uint16_t
>( src._vint16 );
1527 thatValue = src._isSigned ? src._vint32 :
static_cast<fcml_uint32_t
>( src._vint32 );
1530 thatValue = src._isSigned ? src._vint64 :
static_cast<fcml_uint64_t
>( src._vint64 );
1535 switch( result._size ) {
1537 thisValue = result._isSigned ? result._vint8 :
static_cast<fcml_uint8_t
>( result._vint8 );
1538 thisValue = (*unsignedExpressionFn)( thisValue, thatValue );
1539 result._vint8 =
static_cast<fcml_int8_t
>( thisValue );
1542 thisValue = result._isSigned ? result._vint16 :
static_cast<fcml_uint16_t
>( result._vint16 );
1543 thisValue = (*unsignedExpressionFn)( thisValue, thatValue );
1544 result._vint16 =
static_cast<fcml_int16_t
>( thisValue );
1547 thisValue = result._isSigned ? result._vint32 :
static_cast<fcml_uint32_t
>( result._vint32 );
1548 thisValue = (*unsignedExpressionFn)( thisValue, thatValue );
1549 result._vint32 =
static_cast<fcml_int32_t
>( thisValue );
1552 thisValue = result._isSigned ? result._vint64 :
static_cast<fcml_uint64_t
>( result._vint64 );
1553 thisValue = (*unsignedExpressionFn)( thisValue, thatValue );
1554 result._vint64 = thisValue;
1563 fcml_bool _isSigned;
1565 fcml_int16_t _vint16;
1566 fcml_int32_t _vint32;
1567 fcml_int64_t _vint64;
1607 _x64_exp(FCML_FALSE) {
1619 _x64_exp(reg.x64_exp? true : false) {
1634 _x64_exp(x64_exp?true:false) {
1726 return _reg == reg._reg && _type == reg._type && _size == reg._size && _x64_exp == reg._x64_exp;
1736 return !( reg == *this );
3171 _offset_size(FCML_DS_16),
3172 _offset16(offset16),
3183 _offset_size(FCML_DS_32),
3185 _offset32(offset32) {
3200 fcml_int32_t thisOffset;
3201 switch( _offset_size ) {
3203 thisOffset = _offset32;
3206 thisOffset = _offset16;
3209 fcml_int32_t thatOffset;
3210 switch( fp._offset_size ) {
3212 thatOffset = fp._offset32;
3215 thatOffset = fp._offset16;
3218 return thisOffset == thatOffset;
3228 return !(fp == *
this);
3265 return _offset_size;
3275 _offset_size = offsetSize;
3295 _offset16 = offset16;
3315 _offset32 = offset32;
3341 fcml_uint16_t _segment;
3343 fcml_usize _offset_size;
3345 fcml_int16_t _offset16;
3347 fcml_int32_t _offset32;
3364 _isDefaultReg(false) {
3374 _segmentSelector(segmentSelector),
3391 return segmentSelector._segmentSelector == _segmentSelector;
3401 return !(*
this == segmentSelector);
3410 return _segmentSelector;
3420 if( ® !=
this ) {
3421 _isDefaultReg = reg._isDefaultReg;
3422 _segmentSelector = reg._segmentSelector;
3451 return _isDefaultReg;
3471 return _segmentSelector;
3481 return _segmentSelector;
3491 _segmentSelector = segmentSelector;
3525 _displacement(displacement) {
3547 _displacement(displacement) {
3559 _scaleFactor(scaleFactor),
3560 _displacement(displacement) {
3585 _scaleFactor(scaleFactor) {
3599 _scaleFactor(scaleFactor),
3600 _displacement(displacement) {
3618 if( &address ==
this ) {
3621 return _base == address._base &&
3622 _index == address._index &&
3623 _scaleFactor == address._scaleFactor &&
3624 _displacement == address._displacement;
3634 return !(address == *
this);
3752 return _displacement;
3762 return _displacement;
3773 _displacement = displacement;
3816 return _scaleFactor;
3827 _scaleFactor = scaleFactor;
3837 fcml_uint8_t _scaleFactor;
3868 _size_operator( FCML_DS_UNDEF ),
3880 _size_operator( sizeOperator ),
3893 _size_operator( sizeOperator ),
3895 _effective_address( effectiveAddress ) {
3907 _size_operator( sizeOperator ),
3909 _segment_selector( segmentSelector ),
3910 _effective_address( effectiveAddress ) {
4008 if( &address ==
this ) {
4011 return _size_operator == address._size_operator &&
4012 _address_form == address._address_form &&
4013 _segment_selector == address._segment_selector &&
4014 _effective_address == address._effective_address &&
4015 _offset == address._offset;
4025 return !(address == *this );
4040 return Address( effectiveAddress, segmentSelector, sizeOperator );
4052 return Address( effectiveAddress, sizeOperator );
4064 return Address( offset, sizeOperator );
4096 return _address_form;
4108 _address_form = addressForm;
4119 return _effective_address;
4129 return _effective_address;
4140 _effective_address = effectiveAddress;
4183 return _segment_selector;
4193 return _segment_selector;
4204 _segment_selector = segmentSelector;
4215 return _size_operator;
4225 _size_operator = sizeOperator;
4232 fcml_usize _size_operator;
4298 _farPointer( pointer ) {
4311 _address( address ) {
4341 switch( _operandType ) {
4343 equal = _address == op._address;
4346 equal = _farPointer == op._farPointer;
4349 equal = _immediate == op._immediate;
4352 equal = _register == op._register;
4358 return equal && op._hints == _hints;
4369 return !(op == *
this);
4425 _farPointer = pointer;
4446 void off(
const Integer &offset, fcml_usize sizeOperator = FCML_DS_UNDEF ) {
4448 _address =
Address( offset, sizeOperator );
4460 _address =
Address( effectiveAddress, sizeOperator );
4473 _address =
Address( effectiveAddress, segmentSelector, sizeOperator );
4498 _register =
Register( reg, size, type, x64_exp );
4603 _farPointer = farPointer;
4635 _immediate = immediate;
4646 return _operandType;
4657 _operandType = operandType;
4689 this->_register =
reg;
5012 return Operand(
Address( effectiveAddress, segmentSelector, sizeOperator ) );
5023 return Operand(
Address( effectiveAddress, segmentSelector, FCML_DS_8 ) );
5034 return Operand(
Address( effectiveAddress, segmentSelector, FCML_DS_16 ) );
5045 return Operand(
Address( effectiveAddress, segmentSelector, FCML_DS_32 ) );
5056 return Operand(
Address( effectiveAddress, segmentSelector, FCML_DS_64 ) );
5249 static Operand eff(
const Register &index, fcml_uint8_t scaleFactor,
const Integer &displacement, fcml_usize sizeOperator = FCML_DS_UNDEF ) {
5524 _isNegation(false) {
5535 _conditionType( type ),
5536 _isNegation( negation ) {
6121 return cond._conditionType == _conditionType && cond._isNegation == _isNegation;
6132 return !(*
this == cond);
6144 return _conditionType;
6154 _conditionType = conditionType;
6189 bool check(
ConditionType type,
bool negation =
false )
const {
6190 return _conditionType == type && _isNegation == negation;
6217 _isConditional(false),
6230 _mnemonic(mnemonic),
6231 _isConditional(false),
6248 _operands[_operandsCount++] = operand;
6263 _operands[index] = operand;
6274 checkArrayAccess(index);
6275 return _operands[index];
6286 checkArrayAccess(index);
6287 return _operands[index];
6332 _condition = condition;
6365 return _isConditional;
6398 _mnemonic = mnemonic;
6409 return _operandsCount;
6420 _operandsCount = operandsCount;
6442 _prefixes = prefixes;
6592 void checkArrayAccess( fcml_int index)
const {
6605 fcml_cstring _mnemonic;
6607 bool _isConditional;
6609 Condition _condition;
6613 fcml_int _operandsCount;
6633 IB(
const fcml_cstring &mnemonic ) :
6636 _mnemonic(mnemonic),
6649 _prefixes(prefixes),
6650 _mnemonic(mnemonic),
6664 _mnemonic(mnemonic),
6678 _prefixes(prefixes),
6679 _mnemonic(mnemonic),
6720 _operands[_operandsCount++] = operand;
6730 static IB inst(
const fcml_cstring &mnemonic ) {
6731 return IB(mnemonic);
7130 _operands[_operandsCount++].
imm(imm);
7143 _operands[_operandsCount++].
far_ptr(seg, addr);
7156 _operands[_operandsCount++].
far_ptr(seg, addr);
7168 _operands[_operandsCount++].
far_ptr( pointer );
7180 _operands[_operandsCount++].
addr(address);
7191 IB&
off(
const Integer &offset, fcml_usize sizeOperator = FCML_DS_UNDEF ) {
7193 _operands[_operandsCount++].
off( offset, sizeOperator );
7205 _operands[_operandsCount++].
off( offset, FCML_DS_8 );
7217 _operands[_operandsCount++].
off( offset, FCML_DS_16 );
7229 _operands[_operandsCount++].
off( offset, FCML_DS_32 );
7241 _operands[_operandsCount++].
off( offset, FCML_DS_64 );
7254 _operands[_operandsCount++].
addr( effectiveAddress, sizeOperator );
7266 _operands[_operandsCount++].
addr( effectiveAddress, FCML_DS_8 );
7278 _operands[_operandsCount++].
addr( effectiveAddress, FCML_DS_16 );
7290 _operands[_operandsCount++].
addr( effectiveAddress, FCML_DS_32 );
7302 _operands[_operandsCount++].
addr( effectiveAddress, FCML_DS_64 );
7316 _operands[_operandsCount++].
addr( effectiveAddress, segmentSelector, sizeOperator );
7329 _operands[_operandsCount++].
addr( effectiveAddress, segmentSelector, FCML_DS_8 );
7342 _operands[_operandsCount++].
addr( effectiveAddress, segmentSelector, FCML_DS_8 );
7355 _operands[_operandsCount++].
addr( effectiveAddress, segmentSelector, FCML_DS_8 );
7368 _operands[_operandsCount++].
addr( effectiveAddress, segmentSelector, FCML_DS_8 );
7380 _operands[_operandsCount++].
reg( reg );
7395 _operands[_operandsCount++].
reg(
Register( reg, size, type, x64_exp ) );
7406 IB&
eff(
const Integer &displacement, fcml_usize sizeOperator = FCML_DS_UNDEF ) {
7581 IB&
eff(
const Register &index, fcml_uint8_t scaleFactor,
const Integer &displacement, fcml_usize sizeOperator = FCML_DS_UNDEF ) {
7708 IB&
eff(
const Register &base,
const Register &index, fcml_uint8_t scaleFactor, fcml_usize sizeOperator = FCML_DS_UNDEF ) {
7884 _prefixes |= prefix._prefix;
7895 _hints |= hint._hint;
7906 if( _operandsCount == 0 ) {
7909 _operands[_operandsCount-1].
setHints( _operands[_operandsCount-1].getHints() | hint._hint );
7922 return _operands[_operandsCount++];
7930 void sanityCheck()
const {
7932 throw IllegalStateException(
FCML_TEXT(
"Operand's number exceeds maximal number of operands allowed." ) );
7943 fcml_cstring _mnemonic;
7945 fcml_int _operandsCount;
8009 dest.
setType( static_cast<Register::RegisterType>( src.
type ) );
8093 dest.
setConditionType( static_cast<Condition::ConditionType>( src.condition_type ) );
8094 dest.
setNegation( src.is_negation ?
true :
false );
8109 convert( src.
operands[i], dest[i] );
8122 convert( src[i], dest.
operands[i] );
8129 Env::strFree( instruction.
mnemonic );
8137 #endif //FCML_COMMON_HPP_
fcml_char * mnemonic
Dialect-dependent instruction mnemonic.
Definition: fcml_common.h:617
IB & effw(const Register &base)
Adds an an effective address based operator for a base register and word size operator.
Definition: fcml_common.hpp:7484
EntryPoint()
Creates an empty entry point instance.
Definition: fcml_common.hpp:516
IB & eff(const Integer &displacement, fcml_usize sizeOperator=FCML_DS_UNDEF)
Adds an an effective address based operator for a displacement and optional size operator.
Definition: fcml_common.hpp:7406
An instruction builder.
Definition: fcml_common.hpp:6624
bool operator==(const fcml_uint32_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:846
bool isNoBranchHint() const
Returns true if no_branch_hint prefix is set.
Definition: fcml_common.hpp:6536
fcml_ip ip
Instruction pointer EIP/RIP.
Definition: fcml_common.h:657
#define FCML_PREFIX_LOCK
LOCK prefix (0xF0)
Definition: fcml_common.h:48
static Operand effw(const Register &base, const Register &index, fcml_uint8_t scaleFactor)
Factory method which creates an effective address based operator for a base register, index register, scale factor and word size operator.
Definition: fcml_common.hpp:5390
static const Register R14()
Factory method for a register.
Definition: fcml_common.hpp:2746
IB & far_ptr(fcml_uint16_t seg, fcml_int32_t addr)
Adds a far pointer operand.
Definition: fcml_common.hpp:7154
static const Register DIL()
Factory method for a register.
Definition: fcml_common.hpp:2286
static FarPointer off32(fcml_uint16_t segment, fcml_int32_t offset)
Creates FarPointer instance for 16 bit segment and 32-bit offset.
Definition: fcml_common.hpp:3252
static const Register RIP()
Factory method for a register.
Definition: fcml_common.hpp:3126
static Operand reg(const Register ®)
Factory method which creates an register based operator for given register.
Definition: fcml_common.hpp:5065
bool isPE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5907
static const Register YMM6()
Factory method for a register.
Definition: fcml_common.hpp:2266
static const Register EDX()
Factory method for a register.
Definition: fcml_common.hpp:1916
static Operand offb(const Integer &offset)
Factory method which builds an offset based address operand with byte size operator.
Definition: fcml_common.hpp:4918
bool isAddr() const
Returns true if operand is an address operand.
Definition: fcml_common.hpp:4529
void reg(const Register ®)
Prepares operator for the given register.
Definition: fcml_common.hpp:4482
IB & effd(const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Adds an an effective address based operator for an index register, scaleFactor, displacement and doub...
Definition: fcml_common.hpp:7620
fcml_hints getHints() const
Gets instruction level hits associated with the instruction.
Definition: fcml_common.hpp:6342
static const Register R9W()
Factory method for a register.
Definition: fcml_common.hpp:2426
EffectiveAddress & setScaleFactor(fcml_uint8_t scaleFactor)
Sets a new scale factor for the effective address.
Definition: fcml_common.hpp:3826
static const Condition S()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5859
fcml_usize getAddressSizeAttribute() const
Gets address size attribute held by the entry point.
Definition: fcml_common.hpp:576
Describes segment register.
Definition: fcml_common.h:487
static Operand eff(const Register &base, const Register &index, fcml_uint8_t scaleFactor, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address based operator for a base register, index register, scale factor and optional size operator.
Definition: fcml_common.hpp:5366
IB & eff(const Register &base, fcml_usize sizeOperator=FCML_DS_UNDEF)
Adds an an effective address based operator for a base register and optional size operator...
Definition: fcml_common.hpp:7462
static Operand addrb(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector)
Factory method which creates address type operand for given effective address and byte size operator...
Definition: fcml_common.hpp:5022
static const Register CX()
Factory method for a register.
Definition: fcml_common.hpp:1836
IB & lock()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:6859
Register()
Creates an empty register instance.
Definition: fcml_common.hpp:1603
bool isZ() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5717
Address(const Integer &offset, fcml_usize sizeOperator=FCML_DS_UNDEF)
Creates an address instance with an offset and optional size operator set.
Definition: fcml_common.hpp:3879
static const InstructionPrefix REPNE()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:6871
static const Register ESP()
Factory method for a register.
Definition: fcml_common.hpp:2066
bool operator==(const fcml_uint16_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:824
IB & xacquire()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:6985
static const OperandHint OP_SIB_ENCODING()
Gets SIB encoding hint for the operand.
Definition: fcml_common.hpp:7081
Integer & setSigned(fcml_bool isSigned)
Definition: fcml_common.hpp:779
static const Register SS()
Factory method for a register.
Definition: fcml_common.hpp:2856
#define FCML_PREFIX_REPNE
REPNE prefix (0xF2)
Definition: fcml_common.h:50
Operand not used.
Definition: fcml_common.hpp:4255
static const Register DH()
Factory method for a register.
Definition: fcml_common.hpp:2196
fcml_usize operand_size_attribute
Default operand size attribute (See 'D' flag of segment descriptor.)
Definition: fcml_common.h:655
fcml_usize getOffsetSize() const
Gets offset size.
Definition: fcml_common.hpp:3264
Defines instruction's condition.
Definition: fcml_common.h:370
static const Condition PO()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5954
static Integer uint64(fcml_uint64_t value)
Factory method which creates an insatnce fo the Integer for given parameter.
Definition: fcml_common.hpp:1358
Effective address combined from address components like base register, index registers, factor, displacement etc...
Definition: fcml_common.h:451
bool isIndirectPointer() const
Returns true if indirect pointer hint is set.
Definition: fcml_common.hpp:6572
bool isG() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6097
EffectiveAddress()
Creates an empry effective address.
Definition: fcml_common.hpp:3514
bool isDisRelativeAddress() const
Returns true if it's an displacement relative address.
Definition: fcml_common.hpp:4734
Direct far pointer.
Definition: fcml_common.hpp:4259
IB & effw(const Register &base, const Register &index, fcml_uint8_t scaleFactor)
Adds an an effective address based operator for a base register, index register, scale factor and wor...
Definition: fcml_common.hpp:7734
fcml_uint16_t segment
16-bit Code segment.
Definition: fcml_common.h:428
fcml_int16_t offset16
16-bit offset.
Definition: fcml_common.h:432
static const Register YMM7()
Factory method for a register.
Definition: fcml_common.hpp:2346
static Address effective(const Register &base, const Register &index, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address instance with the base register and index register...
Definition: fcml_common.hpp:3969
Segment register.
Definition: fcml_common.hpp:1590
IB & eff(const Register &base, const Register &index, fcml_usize sizeOperator=FCML_DS_UNDEF)
Adds an an effective address based operator for a base register, index register and optional size ope...
Definition: fcml_common.hpp:7646
static IB inst(const fcml_cstring &mnemonic)
Factory method that can be used to create instruction builder.
Definition: fcml_common.hpp:6730
fcml_en_register
Register type.
Definition: fcml_common.h:303
static const Register R9L()
Factory method for a register.
Definition: fcml_common.hpp:2416
Instruction & setOperandsCount(fcml_int operandsCount)
Sets number of operands available in the instruction.
Definition: fcml_common.hpp:6419
bool operator!=(const FarPointer &fp) const
Compares two far pointers.
Definition: fcml_common.hpp:3227
bool isNC() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5679
Operand & setRegister(const Register ®)
Sets a new register for the operand.
Definition: fcml_common.hpp:4688
Illegal state exception.
Definition: fcml_common.hpp:228
void setSegmentSelector(const Register &segmentSelector)
Sets segment register for the selector.
Definition: fcml_common.hpp:3490
static const Register DR0()
Factory method for a register.
Definition: fcml_common.hpp:3026
Two way conversion for common types.
Definition: fcml_common.hpp:7955
void setIP(fcml_ip ip)
Sets a new instruction pointer for the entry point.
Definition: fcml_common.hpp:626
void setOperandSizeAttribute(fcml_usize operandSizeAttribute)
Sets a new operand size attribute for the entry point.
Definition: fcml_common.hpp:606
fcml_st_integer immediate
Immediate value operand.
Definition: fcml_common.h:573
static Operand effd(const Integer &displacement)
Factory method which creates an effective address based operator for a displacement and double word s...
Definition: fcml_common.hpp:5119
static Operand effq(const Register &base)
Factory method which creates an effective address based operator for a base register and quadro word ...
Definition: fcml_common.hpp:5180
static Integer uint16(fcml_uint16_t value)
Factory method which creates an instance fo the Integer for given parameter.
Definition: fcml_common.hpp:1318
#define FCML_PREFIX_REPZ
REPZ prefix (0xF3)
Definition: fcml_common.h:58
void setX64Exp(bool x64Exp)
Sets x64exp flag, see manual.
Definition: fcml_common.hpp:1713
static const Register ES()
Factory method for a register.
Definition: fcml_common.hpp:2836
static const Register DL()
Factory method for a register.
Definition: fcml_common.hpp:1896
const EffectiveAddress & getEffectiveAddress() const
Gets reference to the constant effective address associated with the address.
Definition: fcml_common.hpp:4118
virtual ~Address()
Definition: fcml_common.hpp:3914
static const Condition GE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6030
static const Register YMM13()
Factory method for a register.
Definition: fcml_common.hpp:2706
static const Register YMM8()
Factory method for a register.
Definition: fcml_common.hpp:2406
6 Less than
Definition: fcml_common.h:362
fcml_ip getIP() const
Gets instruction pointer held by the entry point.
Definition: fcml_common.hpp:616
IB & nobranchHint()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7048
static const OperandHint MULTIMEDIA()
Creates operand level hint: MULTIMEDIA_INSTRUCTION.
Definition: fcml_common.hpp:453
static const Register CH()
Factory method for a register.
Definition: fcml_common.hpp:2116
fcml_bool x64_exp
In case of SPL,BPL,SIL,DIL GPR registers has to be set to true.
Definition: fcml_common.h:333
Control register.
Definition: fcml_common.h:315
Condition(ConditionType type, bool negation=false)
Creates a condition for given parameters.
Definition: fcml_common.hpp:5534
Segment register.
Definition: fcml_common.h:313
bool operator!=(const fcml_uint64_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:967
Describes segment register.
Definition: fcml_common.hpp:3355
Operand & setImmediate(const Integer &immediate)
Sets a new immediate value for the address.
Definition: fcml_common.hpp:4634
static const Register RBP()
Factory method for a register.
Definition: fcml_common.hpp:2156
SegmentSelector & getSegmentSelector()
Gets the segment selector associated with the address.
Definition: fcml_common.hpp:4192
fcml_uint8_t getScaleFactor() const
Gets a scale factor value associated with the effective address.
Definition: fcml_common.hpp:3815
virtual ~Register()
Definition: fcml_common.hpp:1640
static const Register RDX()
Factory method for a register.
Definition: fcml_common.hpp:1926
static const InstructionPrefix LOCK()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:6850
static const Register XMM2()
Factory method for a register.
Definition: fcml_common.hpp:1946
bool operator!=(const fcml_uint32_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:945
bool isB() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5584
bool isNL() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6002
IB & operator<<(const Operand &operand)
Adds an operand to the instruction being built.
Definition: fcml_common.hpp:7842
Address operand.
Definition: fcml_common.hpp:3847
x86 - 64 register representation.
Definition: fcml_common.hpp:1574
static const Register R12W()
Factory method for a register.
Definition: fcml_common.hpp:2606
fcml_st_segment_selector segment_selector
Segment register.
Definition: fcml_common.h:503
static EffectiveAddress addr(const Register &base, const Register &index)
Factory method which creates an effective address instance with the base register and index register...
Definition: fcml_common.hpp:3684
static const Register MM1()
Factory method for a register.
Definition: fcml_common.hpp:1866
IB & effq(const Register &base, const Register &index, fcml_uint8_t scaleFactor)
Adds an an effective address based operator for a base register, index register, scale factor and qua...
Definition: fcml_common.hpp:7760
static Operand addrq(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector)
Factory method which creates address type operand for given effective address and quadro word size op...
Definition: fcml_common.hpp:5055
IB & effq(const Register &base, const Register &index)
Adds an an effective address based operator for a base register, index register and quadro word size ...
Definition: fcml_common.hpp:7694
fcml_en_operand_type
Supported operand types.
Definition: fcml_common.h:513
const Address & getAddress() const
Gets reference to the constant address associated with the operand.
Definition: fcml_common.hpp:4549
void incrementIP(fcml_ip ip)
Increments the instruction pointer by given number of bytes.
Definition: fcml_common.hpp:656
bool isNegation() const
Returns true if condition is negated.
Definition: fcml_common.hpp:6164
bool isEffectiveAddress() const
Returns true if address holds effective address.
Definition: fcml_common.hpp:4075
bool operator==(const Register ®) const
Compares registers.
Definition: fcml_common.hpp:1725
static Address offset(const Integer &offset, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factor method which creates an address instance with an offset and optional size operator set...
Definition: fcml_common.hpp:4063
Relative address.
Definition: fcml_common.h:544
static const InstructionPrefix NO_BRANCH()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:7039
fcml_uint16_t fcml_hints
Type used for storing instruction and operand hint masks.
Definition: fcml_common.h:85
fcml_bool isSigned() const
Definition: fcml_common.hpp:774
#define FCML_PREFIX_REPE
REPE prefix (0xF3)
Definition: fcml_common.h:56
static Address effective(const Integer &displacement, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address instance with the displacement only.
Definition: fcml_common.hpp:3925
Wraps operand hint and exposes factory methods for instruction hints.
Definition: fcml_common.hpp:436
IB & effb(const Register &base, const Register &index)
Adds an an effective address based operator for a base register, index register and byte size operato...
Definition: fcml_common.hpp:7658
static Operand addrd(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector)
Factory method which creates address type operand for given effective address and double word size op...
Definition: fcml_common.hpp:5044
static const Condition A()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5840
static Operand eff(const Register &base, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address based operator for a base register and optional siz...
Definition: fcml_common.hpp:5140
Integer & operator-=(const Integer &arg)
Subtraction assignment.
Definition: fcml_common.hpp:1231
EffectiveAddress(const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Creates an effective address instance with the index register, scale factor and displacement.
Definition: fcml_common.hpp:3557
IB & effd(const Register &base, const Register &index)
Adds an an effective address based operator for a base register, index register and double word size ...
Definition: fcml_common.hpp:7682
fcml_usize size
Offset size 16,32 or 64 bits.
Definition: fcml_common.h:459
General purpose register.
Definition: fcml_common.h:307
5 Parity
Definition: fcml_common.h:360
fcml_en_operating_mode
Supported processor operating modes.
Definition: fcml_common.h:73
bool isSIBEncoding() const
Returns true if the SIB byte is used.
Definition: fcml_common.hpp:4775
Integer(fcml_int8_t value)
Definition: fcml_common.hpp:684
Common general purpose utility functions.
Integer & operator/=(const Integer &arg)
Division assignment.
Definition: fcml_common.hpp:1222
bool isReg() const
Returns true if operand is a register operand.
Definition: fcml_common.hpp:4519
static const Register AH()
Factory method for a register.
Definition: fcml_common.hpp:2036
static const InstructionPrefix REPZ()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:6955
ConditionType
See fcml_st_condition for more details.
Definition: fcml_common.hpp:5499
IB & branchHint()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7027
IB & addrw(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector)
Adds an address type operand for given effective address and byte size operator.
Definition: fcml_common.hpp:7340
Integer & setInt64(fcml_int64_t int64)
Definition: fcml_common.hpp:757
void undef()
Converts operand to the undefined one.
Definition: fcml_common.hpp:4378
static const Condition P()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5897
Instruction & setCondition(const Condition &condition)
Sets a new condition for the instruction.
Definition: fcml_common.hpp:6331
Wrapper for nullable value types.
Definition: fcml_common.hpp:120
fcml_hints getHints() const
Gets hits associated with the operand.
Definition: fcml_common.hpp:4699
static const Register DR7()
Factory method for a register.
Definition: fcml_common.hpp:3096
bool isImm() const
Returns true if operand is an immediate value operand.
Definition: fcml_common.hpp:4509
Hints instruction to use FAR pointer to address the memory.
Definition: fcml_common.h:596
bool operator==(const Condition &cond) const
Checks if two condition are equal.
Definition: fcml_common.hpp:6120
bool isDefaultReg() const
Returns true if a register stored in the segment selector is the default one in the context the segme...
Definition: fcml_common.hpp:3450
Instruction pointer register.
Definition: fcml_common.h:319
bool operator==(const Operand &op) const
Checks if two operands are equal or not.
Definition: fcml_common.hpp:4336
static const InstructionHint INDIRECT_PTR()
Creates a hint instance described by the name of the method.
Definition: fcml_common.hpp:6806
static Operand off(const Integer &offset, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which builds an address operand.
Definition: fcml_common.hpp:4908
bool isRep() const
Returns true if rep prefix is set.
Definition: fcml_common.hpp:6482
static const Register ST6()
Factory method for a register.
Definition: fcml_common.hpp:2956
fcml_usize getSize() const
Definition: fcml_common.hpp:785
IB & rep()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:6922
fcml_uint8_t reg
Register itself as a positive integer.
Definition: fcml_common.h:331
bool operator==(const SegmentSelector &segmentSelector) const
Checks if two segment selector are equal.
Definition: fcml_common.hpp:3389
enum fcml_en_address_form fcml_en_effective_address_form
Addressing form.
void addr(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector, fcml_usize sizeOperator=FCML_DS_UNDEF)
Prepares address operator for given parameters.
Definition: fcml_common.hpp:4471
static Address effective(const EffectiveAddress &effectiveAddress, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factor method which creates an address instance with an effective address and optional size operator ...
Definition: fcml_common.hpp:4051
bool isLongFormPointer() const
Returns true if long form pointer hint is set.
Definition: fcml_common.hpp:6563
bool isNS() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5869
static const OperandHint OP_ABSOLUTE_ADDRESSING()
Gets absolute hint for the operand.
Definition: fcml_common.hpp:7073
fcml_st_integer displacement
Displacement value.
Definition: fcml_common.h:481
#define FCML_TEXT(x)
Used to code literal strings.
Definition: fcml_types.h:61
Integer & operator+=(const Integer &arg)
Addition assignment.
Definition: fcml_common.hpp:1204
bool isLE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6040
const Register & getSegmentSelector() const
Gets constant segment register associated with the selector.
Definition: fcml_common.hpp:3470
static const Register R13D()
Factory method for a register.
Definition: fcml_common.hpp:2676
0 Overflow
Definition: fcml_common.h:350
Address & setSizeOperator(fcml_usize sizeOperator)
Sets a new size operator for the address.
Definition: fcml_common.hpp:4224
static const Condition NGE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5992
EffectiveAddress(const Register &base)
Creates an effective address instance with the base register only.
Definition: fcml_common.hpp:3533
static const Register IP()
Factory method for a register.
Definition: fcml_common.hpp:3106
static const Register YMM9()
Factory method for a register.
Definition: fcml_common.hpp:2466
IB & offb(const Integer &offset)
Adds an offset based address operand with byte size operator.
Definition: fcml_common.hpp:7203
Definitions of common structures used by FCML components.
static const Register DR3()
Factory method for a register.
Definition: fcml_common.hpp:3056
bool isNB() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5603
static const Register DI()
Factory method for a register.
Definition: fcml_common.hpp:2296
static Operand effw(const Register &base, const Register &index)
Factory method which creates an effective address based operator for a base register, index register and word size operator.
Definition: fcml_common.hpp:5331
Encode ModR/M with optional SIB byte if possible.
Definition: fcml_common.h:561
fcml_int8_t getInt8() const
Definition: fcml_common.hpp:763
static const Condition NZ()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5764
IB & effb(const Register &base, const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Adds an an effective address based operator for a base register, index register, scale factor and byt...
Definition: fcml_common.hpp:7789
static const Register EDI()
Factory method for a register.
Definition: fcml_common.hpp:2306
bool isXAcquire() const
Returns true if xacquire prefix is set.
Definition: fcml_common.hpp:6509
static const Condition NP()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5935
static const InstructionPrefix XRELEASE()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:6997
static const Register XMM9()
Factory method for a register.
Definition: fcml_common.hpp:2456
EntryPoint(OperatingMode opMode, fcml_ip ip=0, fcml_usize addressSizeAttribute=FCML_DS_UNDEF, fcml_usize operandSizeAttribute=FCML_DS_UNDEF)
Creates an entry point instance for given processor operating mode, instruction pointer and optionall...
Definition: fcml_common.hpp:531
IB & effq(const Integer &displacement)
Adds an an effective address based operator for a displacement and quadro byte size operator...
Definition: fcml_common.hpp:7450
bool operator!=(const Address &address) const
Checks if two addresses are equal or not.
Definition: fcml_common.hpp:4024
bool isE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5698
static SegmentSelector seg(const Register &segmentSelector, bool isDefaultReg)
Creates segment selector for the given register.
Definition: fcml_common.hpp:3437
static const Register R12()
Factory method for a register.
Definition: fcml_common.hpp:2626
FarPointer(fcml_uint16_t segment, fcml_int32_t offset32)
Creates an far pointer instance.
Definition: fcml_common.hpp:3181
Holds instruction pointer, processor operating mode and memory segment flags.
Definition: fcml_common.hpp:499
fcml_int16_t getOffset16() const
Gets the 16-bit offset.
Definition: fcml_common.hpp:3284
void setSegment(fcml_uint16_t segment)
Sets segment selector.
Definition: fcml_common.hpp:3334
static const InstructionPrefix REPZ()
Creates instruction prefix: REPZ.
Definition: fcml_common.hpp:339
static const OperandHint OP_MULTIMEDIA_HINT()
Gets multimedia hint for the operand.
Definition: fcml_common.hpp:7057
static const Register GS()
Factory method for a register.
Definition: fcml_common.hpp:2886
static Operand effq(const Register &base, const Integer &displacement)
Factory method which creates an effective address based operator for a base register, displacement and quadro word size operator.
Definition: fcml_common.hpp:5236
IB & effw(const Integer &displacement)
Adds an an effective address based operator for a displacement and word size operator.
Definition: fcml_common.hpp:7428
static Operand addr(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates address type operand for given segment selector, effective address and o...
Definition: fcml_common.hpp:5011
static Operand effd(const Register &base, const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Factory method which creates an effective address based operator for a base register, index register, scale factor and double word size operator.
Definition: fcml_common.hpp:5467
static const Condition NBE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5821
static Address effective(const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address instance with the index register, scale factor and displacement.
Definition: fcml_common.hpp:3958
static const Register DR1()
Factory method for a register.
Definition: fcml_common.hpp:3036
Default value set if memory addressing hasn't been configured.
Definition: fcml_common.hpp:3856
bool operator!=(const fcml_int8_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:912
OperatingMode getOpMode() const
Gets processor operating mode.
Definition: fcml_common.hpp:636
static const Register ST0()
Factory method for a register.
Definition: fcml_common.hpp:2896
void addr(const EffectiveAddress &effectiveAddress, fcml_usize sizeOperator=FCML_DS_UNDEF)
Prepares an address operand for given effective address and optional size operator.
Definition: fcml_common.hpp:4458
IB & off(const Integer &offset, fcml_usize sizeOperator=FCML_DS_UNDEF)
Adds an offset operand.
Definition: fcml_common.hpp:7191
bool operator==(const fcml_int64_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:879
bool operator==(const fcml_uint64_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:868
void setAddressSizeAttribute(fcml_usize addressSizeAttribute)
Sets a new address size attribute for the entry point.
Definition: fcml_common.hpp:586
Generic instruction model.
Definition: fcml_common.h:611
static const Register YMM4()
Factory method for a register.
Definition: fcml_common.hpp:2106
bool operator!=(const fcml_int32_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:956
fcml_int32_t offset32
32-bit offset.
Definition: fcml_common.h:434
static Operand eff(const Register &base, const Register &index, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address based operator for a base register, index register and optional size operator.
Definition: fcml_common.hpp:5309
Instruction()
Creates an empty instruction.
Definition: fcml_common.hpp:6214
Register & getBase()
Gets the base register associated with the effective address.
Definition: fcml_common.hpp:3729
IB & repnz()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:6901
Processor register.
Definition: fcml_common.hpp:4263
Instruction pointer register.
Definition: fcml_common.hpp:1596
bool isPseudoOpcode() const
Returns true if it's pseudo opcode operand.
Definition: fcml_common.hpp:4745
IB & effd(const Integer &displacement)
Adds an an effective address based operator for a displacement and double word size operator...
Definition: fcml_common.hpp:7439
void setType(RegisterType type)
Sets the register type.
Definition: fcml_common.hpp:1695
static const Condition Z()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5726
Integer & setSize(fcml_usize size)
Definition: fcml_common.hpp:790
static Operand offd(const Integer &offset)
Factory method which builds an offset based address operand with double word size operator...
Definition: fcml_common.hpp:4938
FPU register.
Definition: fcml_common.hpp:1588
IB & operandSIBEncodingHint()
Sets preferred encoding to SIB for the lastly added ModR/M operand.
Definition: fcml_common.hpp:7116
Operand builder.
Definition: fcml_common.hpp:4838
void add(const Operand &operand)
Adds a new operand to the instruction.
Definition: fcml_common.hpp:6244
IB & effd(const Register &base, const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Adds an an effective address based operator for a base register, index register, scale factor and dou...
Definition: fcml_common.hpp:7817
Address & getAddress()
Gets reference to the address associated with the operand.
Definition: fcml_common.hpp:4559
void addr(const Address &address)
Prepares address operand for given address.
Definition: fcml_common.hpp:4434
bool operator==(const Address &address) const
Checks if two addresses are equal or not.
Definition: fcml_common.hpp:4007
IB & effq(const Register &base)
Adds an an effective address based operator for a base register and quadro word size operator...
Definition: fcml_common.hpp:7506
IB & effw(const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Adds an an effective address based operator for an index register, scaleFactor, displacement and word...
Definition: fcml_common.hpp:7607
Describes far pointer.
Definition: fcml_common.hpp:3148
static Operand effq(const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Factory method which creates an effective address based operator for an index register, scaleFactor, displacement and quadro word size operator.
Definition: fcml_common.hpp:5297
static Operand far_ptr(fcml_uint16_t seg, fcml_int16_t addr)
Factory method which builds a far pointer operand.
Definition: fcml_common.hpp:4866
bool isRepe() const
Returns true if repe prefix is set.
Definition: fcml_common.hpp:6491
#define FCML_PREFIX_XACQUIRE
XACQUIRE prefix (0xF2)
Definition: fcml_common.h:60
static const Register ECX()
Factory method for a register.
Definition: fcml_common.hpp:1846
bool isNearPointer() const
Returns true if near pointer hint is set.
Definition: fcml_common.hpp:6554
Integer & setInt8(fcml_int8_t int8)
Definition: fcml_common.hpp:768
static const Register R11L()
Factory method for a register.
Definition: fcml_common.hpp:2536
bool isAbsoluteAddressing() const
Returns true if it's an absolute offset being set in the operand.
Definition: fcml_common.hpp:4755
Integer & setInt32(fcml_int32_t int32)
Definition: fcml_common.hpp:746
Definition: fcml_assembler.hpp:39
2 Equal
Definition: fcml_common.hpp:5505
Operand & operator[](fcml_int index)
Gets reference to the operand at given index.
Definition: fcml_common.hpp:6285
bool operator!=(const SegmentSelector &segmentSelector) const
Checks if two segment selector are not equal.
Definition: fcml_common.hpp:3400
fcml_bool is_default_reg
Set to true if given segment register is a default one in given context.
Definition: fcml_common.h:491
static Operand offw(const Integer &offset)
Factory method which builds an offset based address operand with word size operator.
Definition: fcml_common.hpp:4928
virtual bool hasNext()=0
Gets true if there is an another element in the iterator.
static const Register XMM1()
Factory method for a register.
Definition: fcml_common.hpp:1876
IB & eff(const Register &base, const Register &index, fcml_uint8_t scaleFactor, fcml_usize sizeOperator=FCML_DS_UNDEF)
Adds an an effective address based operator for a base register, index register, scale factor and opt...
Definition: fcml_common.hpp:7708
Offset should be encoded as relative address.
Definition: fcml_common.h:557
static const InstructionPrefix NOBRANCH_HINT()
Creates instruction prefix: NOBRANCH_HINT.
Definition: fcml_common.hpp:367
static Operand eff(const Register &base, const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address based operator for a base register, index register, scale factor and optional size operator.
Definition: fcml_common.hpp:5428
#define FCML_PREFIX_REPNZ
REPNZ prefix (0xF2)
Definition: fcml_common.h:52
IB & effd(const Register &base, const Register &index, fcml_uint8_t scaleFactor)
Adds an an effective address based operator for a base register, index register, scale factor and dou...
Definition: fcml_common.hpp:7747
bool isNE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5736
static const Register DS()
Factory method for a register.
Definition: fcml_common.hpp:2866
static Operand imm(const Integer &imm)
Factory method which builds an immediate operand.
Definition: fcml_common.hpp:4855
IB & directPtr()
Sets a hint described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:6836
#define FCML_OPERANDS_COUNT
Maximal number of the instruction operands.
Definition: fcml_common.h:35
Integer & getOffset()
Gets the offset associated with the address.
Definition: fcml_common.hpp:4160
Wraps instruction hint and exposes factory methods for instruction hints.
Definition: fcml_common.hpp:377
static Operand effd(const Register &base, const Register &index)
Factory method which creates an effective address based operator for a base register, index register and double word size operator.
Definition: fcml_common.hpp:5342
IB & addr(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector, fcml_usize sizeOperator=FCML_DS_UNDEF)
Adds an address type operand for given segment selector, effective address and optional size operator...
Definition: fcml_common.hpp:7314
Integer operator*(const Integer &src) const
Multiplication operator.
Definition: fcml_common.hpp:1262
bool operator!=(const EffectiveAddress &address) const
Checks whether two effective addresses are equal or not.
Definition: fcml_common.hpp:3633
This hint is used only by assembler in order to force it to generate three byte VEX/XOP prefix even i...
Definition: fcml_common.h:600
void clean()
Cleans the instruction by removing all operands from it.
Definition: fcml_common.hpp:6294
bool isOffset() const
Returns true if address holds an offset only.
Definition: fcml_common.hpp:4085
bool operator==(const fcml_int32_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:857
bool isNA() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5793
static Operand effb(const Register &base, const Register &index)
Factory method which creates an effective address based operator for a base register, index register and byte size operator.
Definition: fcml_common.hpp:5320
EffectiveAddress & setDisplacement(const Integer &displacement)
Sets a new displacement value for the effective address.
Definition: fcml_common.hpp:3772
bool isRelativeAddressing() const
Returns true is relative addressing is used.
Definition: fcml_common.hpp:4765
static const Register XMM3()
Factory method for a register.
Definition: fcml_common.hpp:2016
FarPointer & getFarPointer()
Gets a reference to the far pointer instance associated with the address.
Definition: fcml_common.hpp:4591
IB & indirectPtr()
Sets a hint described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:6815
bool isNLE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6078
3 Below or equal
Definition: fcml_common.hpp:5507
Offset should be encoded as absolute address.
Definition: fcml_common.h:553
static const Register XMM10()
Factory method for a register.
Definition: fcml_common.hpp:2516
static const Register BP()
Factory method for a register.
Definition: fcml_common.hpp:2136
static const Register AX()
Factory method for a register.
Definition: fcml_common.hpp:1766
bool isGE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6021
bool operator!=(const Register ®) const
Compares registers.
Definition: fcml_common.hpp:1735
static const Register R14W()
Factory method for a register.
Definition: fcml_common.hpp:2726
static const InstructionPrefix BRANCH_HINT()
Creates instruction prefix: BRANCH_HINT.
Definition: fcml_common.hpp:360
static Integer int32(fcml_int32_t value)
Factory method which creates an insatnce fo the Integer for given parameter.
Definition: fcml_common.hpp:1328
bool isA() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5831
static Operand reg(fcml_uint8_t reg, fcml_usize size, Register::RegisterType type=Register::REG_GPR, fcml_bool x64_exp=FCML_FALSE)
Factory method which creates an register based operator for given parameters.
Definition: fcml_common.hpp:5078
static const Register YMM0()
Factory method for a register.
Definition: fcml_common.hpp:1816
IB & repe()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:6943
Structure describes x86_64 register.
Definition: fcml_common.h:325
Base exception for all exceptions exposed by FCML library.
Definition: fcml_common.hpp:162
static const InstructionPrefix REPNZ()
Creates instruction prefix: REPNZ.
Definition: fcml_common.hpp:318
Instruction operand.
Definition: fcml_common.hpp:4247
static Operand effw(const Register &base, const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Factory method which creates an effective address based operator for a base register, index register, scale factor and word size operator.
Definition: fcml_common.hpp:5454
Hints instruction to use DIRECT memory addressing.
Definition: fcml_common.h:604
static FarPointer off16(fcml_uint16_t segment, fcml_int16_t offset)
Creates FarPointer instance for 16 bit segment and 16-bit offset.
Definition: fcml_common.hpp:3241
static const Register MM2()
Factory method for a register.
Definition: fcml_common.hpp:1936
void setOffset16(fcml_int16_t offset16)
Sets 16-bit offset.
Definition: fcml_common.hpp:3294
static const Register R14D()
Factory method for a register.
Definition: fcml_common.hpp:2736
static const Register MM4()
Factory method for a register.
Definition: fcml_common.hpp:2086
static const Register RBX()
Factory method for a register.
Definition: fcml_common.hpp:1996
7 Less than or equal to
Definition: fcml_common.hpp:5515
Instruction build() const
Builds an instruction instance for the current state of the builder.
Definition: fcml_common.hpp:6698
const SegmentSelector & getSegmentSelector() const
Gets the constant segment selector associated with the address.
Definition: fcml_common.hpp:4182
static Operand effb(const Register &base, const Integer &displacement)
Factory method which creates an effective address based operator for a base register, displacement and byte size operator.
Definition: fcml_common.hpp:5203
static EffectiveAddress addr(const Register &base, const Integer &displacement)
Factory method which creates an effective address instance with the base register and displacement...
Definition: fcml_common.hpp:3663
static const Register ST3()
Factory method for a register.
Definition: fcml_common.hpp:2926
bool isBranchHint() const
Returns true if branch_hint prefix is set.
Definition: fcml_common.hpp:6527
static Integer uint32(fcml_uint32_t value)
Factory method which creates an insatnce fo the Integer for given parameter.
Definition: fcml_common.hpp:1338
IB & operandRelativeHint()
Marks the lastly added address operand as a relative one.
Definition: fcml_common.hpp:7098
static const Condition L()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5973
3 Below or equal
Definition: fcml_common.h:356
IB & addrb(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector)
Adds an address type operand for given effective address and byte size operator.
Definition: fcml_common.hpp:7327
fcml_en_condition_type
Condition type.
Definition: fcml_common.h:348
IB & repz()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:6964
Represents integer value.
Definition: fcml_common.hpp:675
static const Register DR5()
Factory method for a register.
Definition: fcml_common.hpp:3076
static Operand effd(const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Factory method which creates an effective address based operator for an index register, scaleFactor, displacement and double word size operator.
Definition: fcml_common.hpp:5285
fcml_usize getSize() const
Gets the register size.
Definition: fcml_common.hpp:1668
static const OperandHint ABSOLUTE_ADDRESSING()
Creates operand level hint: ABSOLUTE_ADDRESSING.
Definition: fcml_common.hpp:474
fcml_prefixes getPrefixes() const
Gets prefixes associated with the instruction.
Definition: fcml_common.hpp:6430
static Operand effq(const Register &base, const Register &index, fcml_uint8_t scaleFactor)
Factory method which creates an effective address based operator for a base register, index register, scale factor and quadro word size operator.
Definition: fcml_common.hpp:5414
static Operand effb(const Register &base)
Factory method which creates an effective address based operator for a base register and byte size op...
Definition: fcml_common.hpp:5150
bool isBE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5774
static const Register YMM10()
Factory method for a register.
Definition: fcml_common.hpp:2526
static const InstructionHint DIRECT_PTR()
Creates a hint instance described by the name of the method.
Definition: fcml_common.hpp:6827
fcml_st_register reg
Register operand.
Definition: fcml_common.h:579
fcml_en_operating_mode op_mode
Processor operating mode 16/32/64-bit.
Definition: fcml_common.h:651
IB & longFormPtr()
Sets a hint described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:6794
static EffectiveAddress addr(const Integer &displacement)
Factory method which creates an effective address instance with the displacement only.
Definition: fcml_common.hpp:3644
static const Register XMM15()
Factory method for a register.
Definition: fcml_common.hpp:2816
Operand not used.
Definition: fcml_common.h:515
static fcml_string strDup(const fcml_string str)
Definition: fcml_common.hpp:74
static const Condition NAE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5631
static const InstructionHint INDIRECT_POINTER()
Creates instruction hint: INDIRECT_POINTER.
Definition: fcml_common.hpp:419
FPU register.
Definition: fcml_common.h:311
static const Register EIP()
Factory method for a register.
Definition: fcml_common.hpp:3116
static const OperandHint UNDEFIEND()
Creates operand level hint: UNDEFIEND.
Definition: fcml_common.hpp:446
static const Register R15()
Factory method for a register.
Definition: fcml_common.hpp:2806
Processor register.
Definition: fcml_common.h:523
4 Sign
Definition: fcml_common.hpp:5509
fcml_prefixes prefixes
Describes explicit instruction prefixes.
Definition: fcml_common.h:613
Integer(fcml_uint16_t value)
Definition: fcml_common.hpp:709
static const OperandHint RELATIVE_ADDRESSING()
Creates operand level hint: RELATIVE_ADDRESSING.
Definition: fcml_common.hpp:481
fcml_st_register base
GPR base register.
Definition: fcml_common.h:475
EffectiveAddress(const Register &base, const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Creates an effective address instance with the base register, index register, scale factor and displa...
Definition: fcml_common.hpp:3596
static const Condition C()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5669
static const Register XMM6()
Factory method for a register.
Definition: fcml_common.hpp:2256
Integer operator+(const Integer &src) const
Addition operator.
Definition: fcml_common.hpp:1240
bool isFarPointer() const
Returns true if far pointer hint is set.
Definition: fcml_common.hpp:6545
static const Register CR4()
Factory method for a register.
Definition: fcml_common.hpp:3006
bool operator==(const EntryPoint &ep) const
Checks if two entry points are equal.
Definition: fcml_common.hpp:550
static Operand eff(const Integer &displacement, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address based operator for a displacement and optional size...
Definition: fcml_common.hpp:5089
bool isO() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5546
IB & far_ptr(const FarPointer &pointer)
Adds a far pointer operand.
Definition: fcml_common.hpp:7166
static Integer int64(fcml_int64_t value)
Factory method which creates an insatnce fo the Integer for given parameter.
Definition: fcml_common.hpp:1348
void imm(const Integer &imm)
Sets given immediate value for the operand and makes it to be an immediate operand.
Definition: fcml_common.hpp:4388
FarPointer()
Creates an far pointer instance.
Definition: fcml_common.hpp:3156
IB & effq(const Register &base, const Integer &displacement)
Adds an an effective address based operator for a base register, displacement and quadro word size op...
Definition: fcml_common.hpp:7567
Effective address combined from address components like base register, index registers, factor, displacement etc...
Definition: fcml_common.hpp:3860
void op(const Operand &operand)
Sets a next operand for the instruction.
Definition: fcml_common.hpp:6716
FarPointer(fcml_uint16_t segment, fcml_int16_t offset16)
Creates an far pointer instance.
Definition: fcml_common.hpp:3169
static const Condition NL()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6011
fcml_usize address_size_attribute
Default address size attribute (See 'D' flag of segment descriptor.)
Definition: fcml_common.h:653
static const Register R9D()
Factory method for a register.
Definition: fcml_common.hpp:2436
Operand & setHints(fcml_hints hints)
Sets new operand level hits for the operand.
Definition: fcml_common.hpp:4710
IB & effb(const Register &base, const Register &index, fcml_uint8_t scaleFactor)
Adds an an effective address based operator for a base register, index register, scale factor and byt...
Definition: fcml_common.hpp:7721
fcml_usize getSizeOperator() const
Gets the size operator associated with the address.
Definition: fcml_common.hpp:4214
IB & addr(const EffectiveAddress &effectiveAddress, fcml_usize sizeOperator=FCML_DS_UNDEF)
Adds an address type operand for given effective address and optional size operator.
Definition: fcml_common.hpp:7252
EffectiveAddress(const Register &base, const Register &index)
Creates an effective address instance with the base register and index register.
Definition: fcml_common.hpp:3569
Exposes API responsible for environment specific operations, even if standard CPP library is used to ...
Definition: fcml_common.hpp:68
static Operand offq(const Integer &offset)
Factory method which builds an offset based address operand with quadro word size operator...
Definition: fcml_common.hpp:4948
Operand & setFarPointer(const FarPointer &farPointer)
Sets a new far pointer for the operand.
Definition: fcml_common.hpp:4602
static const InstructionPrefix BRANCH()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:7018
static Operand far_ptr(fcml_uint16_t seg, fcml_int32_t addr)
Factory method which builds a far pointer operand.
Definition: fcml_common.hpp:4877
static const Register YMM2()
Factory method for a register.
Definition: fcml_common.hpp:1956
Integer(fcml_uint32_t value)
Definition: fcml_common.hpp:714
static Operand addrb(const EffectiveAddress &effectiveAddress)
Factory method which creates address type operand for given effective address and byte size operator...
Definition: fcml_common.hpp:4969
fcml_int64_t fcml_ip
General instruction pointer holder.
Definition: fcml_common.h:95
static const Register CR0()
Factory method for a register.
Definition: fcml_common.hpp:2976
Debug register.
Definition: fcml_common.h:317
bool isMultimedia() const
Returns information if the operand is multimedia one or not.
Definition: fcml_common.hpp:4724
bool isNBE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5812
AddressForm
Addressing type, see fcml_en_address_form enumerator.
Definition: fcml_common.hpp:3854
fcml_uint16_t getSegment() const
Gets segment selector.
Definition: fcml_common.hpp:3324
IB & effb(const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Adds an an effective address based operator for an index register, scaleFactor, displacement and byte...
Definition: fcml_common.hpp:7594
static const Register DR6()
Factory method for a register.
Definition: fcml_common.hpp:3086
Protected/Compatibility mode when 'D' segment descriptor flag is set to 1.
Definition: fcml_common.h:77
Condition()
Creates an empty condition.
Definition: fcml_common.hpp:5522
bool operator==(const Integer &value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:890
static const Register MM7()
Factory method for a register.
Definition: fcml_common.hpp:2326
Immediate integer value.
Definition: fcml_common.h:517
bool isC() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5660
EffectiveAddress(const Register &base, const Integer &displacement)
Creates an effective address instance with the base register and displacement only.
Definition: fcml_common.hpp:3544
virtual ~Integer()
Definition: fcml_common.hpp:724
fcml_hints hints
Holds instruction level hints.
Definition: fcml_common.h:615
static const Condition NC()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5688
Absolute offset (address).
Definition: fcml_common.h:449
bool operator!=(const Condition &cond) const
Checks if two condition are equal.
Definition: fcml_common.hpp:6131
6 Less than
Definition: fcml_common.hpp:5513
bool isP() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5888
static const Register SIL()
Factory method for a register.
Definition: fcml_common.hpp:2206
static Operand addrw(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector)
Factory method which creates address type operand for given effective address and word size operator...
Definition: fcml_common.hpp:5033
static const Register RDI()
Factory method for a register.
Definition: fcml_common.hpp:2316
const Integer & getOffset() const
Gets the constant offset associated with the address.
Definition: fcml_common.hpp:4150
static const Register MM0()
Factory method for a register.
Definition: fcml_common.hpp:1796
bool getX64Exp() const
Gets true if it's a 8-bit general purpose register for REX aware instruction.
Definition: fcml_common.hpp:1704
bool operator!=(const fcml_int16_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:934
fcml_hints hints
Optional operand level hints.
Definition: fcml_common.h:571
void setDefaultReg(bool isDefaultReg)
Sets "default" flag for the segment selector.
Definition: fcml_common.hpp:3460
Integer & getDisplacement()
Gets the displacement associated with the effective address.
Definition: fcml_common.hpp:3761
static const Register ST5()
Factory method for a register.
Definition: fcml_common.hpp:2946
Integer operator-(const Integer &src) const
Subtraction operator.
Definition: fcml_common.hpp:1251
Integer(fcml_int64_t value)
Definition: fcml_common.hpp:699
SIMD operand.
Definition: fcml_common.h:539
fcml_int operands_count
Number of operands defined for instruction.
Definition: fcml_common.h:625
Integer()
Definition: fcml_common.hpp:679
#define FCML_PREFIX_XRELEASE
XRELEASE prefix (0xF3)
Definition: fcml_common.h:62
const Integer & getImmediate() const
Gets a reference to the constant immediate value associated with the operand.
Definition: fcml_common.hpp:4613
fcml_st_address address
Effective address or absolute offset.
Definition: fcml_common.h:577
fcml_int32_t getInt32() const
Definition: fcml_common.hpp:741
static Operand effb(const Register &base, const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Factory method which creates an effective address based operator for a base register, index register, scale factor and byte size operator.
Definition: fcml_common.hpp:5441
bool isFar() const
Returns true if operand is a far pointer operand.
Definition: fcml_common.hpp:4539
SegmentSelector()
Creates an empty segment selector instance.
Definition: fcml_common.hpp:3362
static const Condition LE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6049
static const Register BX()
Factory method for a register.
Definition: fcml_common.hpp:1976
static Address effective(const Register &base, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address instance with the base register only...
Definition: fcml_common.hpp:3935
static const InstructionHint NEAR_POINTER()
Creates instruction hint: NEAR_POINTER.
Definition: fcml_common.hpp:398
IB & imm(const Integer &imm)
Adds an immediate operand.
Definition: fcml_common.hpp:7128
static const InstructionPrefix XRELEASE()
Creates instruction prefix: XRELEASE.
Definition: fcml_common.hpp:353
static const OperandHint PSEUDO_OPCODE()
Creates operand level hint: PSEUDO_OPCODE.
Definition: fcml_common.hpp:467
static const Condition G()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6106
Condition & setNegation(bool isNegation)
Sets negation flag for the condition.
Definition: fcml_common.hpp:6174
const Register & getRegister() const
Returns a reference to the constant register associated with the operand.
Definition: fcml_common.hpp:4667
static const Register R13L()
Factory method for a register.
Definition: fcml_common.hpp:2656
Undefined.
Definition: fcml_common.h:534
Undefined register type.
Definition: fcml_common.h:305
static const InstructionHint FAR_PTR()
Creates a hint instance described by the name of the method.
Definition: fcml_common.hpp:6743
Operand(const Integer &imm, fcml_hints hints=FCML_OP_HINT_UNDEFIEND)
Creates an immediate value operand for given integer.
Definition: fcml_common.hpp:4282
static const Condition NG()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6068
fcml_st_effective_address effective_address
Memory address for FCML_AF_COMBINED form.
Definition: fcml_common.h:505
fcml_int16_t getInt16() const
Definition: fcml_common.hpp:730
Operand(const FarPointer &pointer, fcml_hints hints=FCML_OP_HINT_UNDEFIEND)
Creates a far pointer operand for given far pointer.
Definition: fcml_common.hpp:4295
Integer(fcml_uint64_t value)
Definition: fcml_common.hpp:719
OperatingMode
Supported operating modes.
Definition: fcml_common.hpp:506
SegmentSelector(const Register &segmentSelector, bool isDefaultReg=FCML_TRUE)
Creates a segment selector instance for given parameters.
Definition: fcml_common.hpp:3373
RegisterType getType() const
Gets the register type.
Definition: fcml_common.hpp:1686
bool isRepz() const
Returns true if repz prefix is set.
Definition: fcml_common.hpp:6500
static const Register YMM15()
Factory method for a register.
Definition: fcml_common.hpp:2826
bool operator==(const fcml_int16_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:835
General purpose register.
Definition: fcml_common.hpp:1584
static EffectiveAddress addr(const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Factory method which creates an effective address instance with the index register, scale factor and displacement.
Definition: fcml_common.hpp:3674
bool isNP() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5926
static const OperandHint SIB_ENCODING()
Creates operand level hint: SIB_ENCODING.
Definition: fcml_common.hpp:488
const Register & getBase() const
Gets the constant base register associated with the effective address.
Definition: fcml_common.hpp:3719
static Operand effw(const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Factory method which creates an effective address based operator for an index register, scaleFactor, displacement and word size operator.
Definition: fcml_common.hpp:5273
static const InstructionHint FAR_POINTER()
Creates instruction hint: FAR_POINTER.
Definition: fcml_common.hpp:405
IB(fcml_prefixes prefixes, const fcml_cstring &mnemonic, fcml_hints hints)
Creates an instruction builder for given prefixes, mnemonic and hints.
Definition: fcml_common.hpp:6676
bool isNAE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5622
static const Register XMM7()
Factory method for a register.
Definition: fcml_common.hpp:2336
static const Register BL()
Factory method for a register.
Definition: fcml_common.hpp:1966
fcml_uint8_t scale_factor
Scale factor 1,2,4 or 8.
Definition: fcml_common.h:479
IB & effw(const Register &base, const Register &index)
Adds an an effective address based operator for a base register, index register and word size operato...
Definition: fcml_common.hpp:7670
bool operator==(const fcml_uint8_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:802
static const Register XMM5()
Factory method for a register.
Definition: fcml_common.hpp:2176
static const Register CS()
Factory method for a register.
Definition: fcml_common.hpp:2846
void setReg(fcml_uint8_t reg)
Sets the register number.
Definition: fcml_common.hpp:1659
Address()
Creates an empty address.
Definition: fcml_common.hpp:3867
Integer & setInt16(fcml_int16_t int16)
Definition: fcml_common.hpp:735
Operand(const Register ®, fcml_hints hints=FCML_OP_HINT_UNDEFIEND)
Creates a new register operand for given register.
Definition: fcml_common.hpp:4321
bool isNGE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5983
fcml_st_far_pointer far_pointer
Far pointer operand.
Definition: fcml_common.h:575
A base iterator interface.
Definition: fcml_common.hpp:98
Operand(const Address &address, fcml_hints hints=FCML_OP_HINT_UNDEFIEND)
Creates an address operand for given address.
Definition: fcml_common.hpp:4308
static const Register AL()
Factory method for a register.
Definition: fcml_common.hpp:1756
IB & offd(const Integer &offset)
Adds an offset based address operand with double word size operator.
Definition: fcml_common.hpp:7227
static const Register SP()
Factory method for a register.
Definition: fcml_common.hpp:2056
IB & effw(const Register &base, const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Adds an an effective address based operator for a base register, index register, scale factor and wor...
Definition: fcml_common.hpp:7803
static const Register R15D()
Factory method for a register.
Definition: fcml_common.hpp:2796
Condition & setConditionType(ConditionType conditionType)
Sets condition type.
Definition: fcml_common.hpp:6153
bool isXRelease() const
Returns true if xrelease prefix is set.
Definition: fcml_common.hpp:6518
Default value set if memory addressing hasn't been configured.
Definition: fcml_common.h:447
0 Overflow
Definition: fcml_common.hpp:5501
static Operand effd(const Register &base, const Integer &displacement)
Factory method which creates an effective address based operator for a base register, displacement and double word size operator.
Definition: fcml_common.hpp:5225
bool operator!=(const Integer &value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:989
AddressForm getAddressForm() const
Gets an address form.
Definition: fcml_common.hpp:4095
Register(const fcml_st_register ®)
Creates a register instance for given register structure.
Definition: fcml_common.hpp:1615
Address(const EffectiveAddress &effectiveAddress, fcml_usize sizeOperator=FCML_DS_UNDEF)
Creates an address instance with an effective address and optional size operator set.
Definition: fcml_common.hpp:3892
#define FCML_PREFIX_NOBRANCH_HINT
nobranch hint (0x3E) (SSE2 extension)
Definition: fcml_common.h:66
static const Register XMM4()
Factory method for a register.
Definition: fcml_common.hpp:2096
void far_ptr(const FarPointer &pointer)
Prepares far pointer operand for given far pointer.
Definition: fcml_common.hpp:4423
fcml_int16_t off16
Place for 16-bit absolute offset.
Definition: fcml_common.h:463
const FarPointer & getFarPointer() const
Gets a reference to the constant far pointer instance associated with the address.
Definition: fcml_common.hpp:4581
Instruction condition.
Definition: fcml_common.hpp:5492
static const Condition AE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5650
EffectiveAddress & setBase(const Register &base)
Sets a new base register for the effective address.
Definition: fcml_common.hpp:3740
static const Register ST7()
Factory method for a register.
Definition: fcml_common.hpp:2966
IB(const fcml_cstring &mnemonic, fcml_hints hints)
Creates an instruction builder for given mnemonic and hints.
Definition: fcml_common.hpp:6661
virtual ~EffectiveAddress()
Definition: fcml_common.hpp:3606
Operand & setOperandType(OperandType operandType)
Sets a new operand type.
Definition: fcml_common.hpp:4656
EffectiveAddress & setIndex(const Register &index)
Sets a new index register for the effective address.
Definition: fcml_common.hpp:3804
Integer(fcml_int16_t value)
Definition: fcml_common.hpp:689
static const Register RCX()
Factory method for a register.
Definition: fcml_common.hpp:1856
static Operand effb(const Integer &displacement)
Factory method which creates an effective address based operator for a displacement and byte size ope...
Definition: fcml_common.hpp:5099
static const Register RSP()
Factory method for a register.
Definition: fcml_common.hpp:2076
static const Register ST4()
Factory method for a register.
Definition: fcml_common.hpp:2936
static const Register SPL()
Factory method for a register.
Definition: fcml_common.hpp:2046
SIMD (SSE, MMX) register.
Definition: fcml_common.hpp:1586
IB & far_ptr(fcml_uint16_t seg, fcml_int16_t addr)
Adds a far pointer operand.
Definition: fcml_common.hpp:7141
Immediate integer value.
Definition: fcml_common.hpp:4257
EffectiveAddress(const Integer &displacement)
Creates an effective address instance with the displacement only.
Definition: fcml_common.hpp:3523
static EffectiveAddress addr(const Register &base, const Register &index, fcml_uint8_t scaleFactor)
Factory method which creates an effective address instance with the base register, index register and scale factor.
Definition: fcml_common.hpp:3695
Hints instruction to use INDIRECT pointer to address the memory.
Definition: fcml_common.h:602
7 Less than or equal to
Definition: fcml_common.h:364
Operand & setAddress(const Address &address)
Sets a new address for the operand.
Definition: fcml_common.hpp:4570
ConditionType getConditionType() const
Gets a type of the condition.
Definition: fcml_common.hpp:6143
Address(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector, fcml_usize sizeOperator=FCML_DS_UNDEF)
Creates an address instance with an effective address, segment selector and optional size operator se...
Definition: fcml_common.hpp:3906
static const Register R10L()
Factory method for a register.
Definition: fcml_common.hpp:2476
bool isNG() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6059
static const Register XMM11()
Factory method for a register.
Definition: fcml_common.hpp:2576
static Operand eff(const Register &base, const Integer &displacement, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address based operator for a base register, displacement and optional size operator.
Definition: fcml_common.hpp:5192
static const Condition NS()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5878
static const Register R8()
Factory method for a register.
Definition: fcml_common.hpp:2386
SIMD (SSE, MMX) register.
Definition: fcml_common.h:309
fcml_en_instruction_hints
Instruction level hints.
Definition: fcml_common.h:592
Definition: fcml_types.h:257
IB & effb(const Register &base, const Integer &displacement)
Adds an an effective address based operator for a base register, displacement and byte size operator...
Definition: fcml_common.hpp:7531
static const Register R13W()
Factory method for a register.
Definition: fcml_common.hpp:2666
Debug register.
Definition: fcml_common.hpp:1594
Operand()
Creates an undefined operand.
Definition: fcml_common.hpp:4270
OperandType getOperandType() const
Gets operand type.
Definition: fcml_common.hpp:4645
static const Register EAX()
Factory method for a register.
Definition: fcml_common.hpp:1776
Integer(fcml_int32_t value)
Definition: fcml_common.hpp:694
static const Condition NA()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5802
IB & addrw(const EffectiveAddress &effectiveAddress)
Adds an address type operand for given effective address and word size operator.
Definition: fcml_common.hpp:7276
Direct far pointer.
Definition: fcml_common.h:519
bool operator==(const EffectiveAddress &address) const
Checks whether two effective addresses are equal or not.
Definition: fcml_common.hpp:3617
static Operand addr(const EffectiveAddress &effectiveAddress, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates address type operand for given effective address and optional size opera...
Definition: fcml_common.hpp:4959
bool isRepnz() const
Returns true if lock repnz is set.
Definition: fcml_common.hpp:6473
static const Register R11D()
Factory method for a register.
Definition: fcml_common.hpp:2556
void setSize(fcml_usize size)
Sets the register size.
Definition: fcml_common.hpp:1677
static const Register FS()
Factory method for a register.
Definition: fcml_common.hpp:2876
Condition & getCondition()
Gets a pointer to the condition associated with the instruction.
Definition: fcml_common.hpp:6320
Real-addressing mode, virtual 8086 mode.
Definition: fcml_common.h:75
IB & addr(const Address &address)
Adds an address operand.
Definition: fcml_common.hpp:7178
static const Register CR2()
Factory method for a register.
Definition: fcml_common.hpp:2986
IB & reg(const Register ®)
Adds an an register based operator for given register.
Definition: fcml_common.hpp:7378
IB & effb(const Integer &displacement)
Adds an an effective address based operator for a displacement and byte size operator.
Definition: fcml_common.hpp:7417
EffectiveAddress(const Register &base, const Register &index, fcml_uint8_t scaleFactor)
Creates an effective address instance with the base register, index register and scale factor set...
Definition: fcml_common.hpp:3582
Hints instruction to use NEAR pointer to address the memory.
Definition: fcml_common.h:598
SegmentSelector & operator=(const SegmentSelector ®)
Copies one segment selector to another.
Definition: fcml_common.hpp:3419
static Operand eff(const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address based operator for an index register, scaleFactor, displacement and optional size operator.
Definition: fcml_common.hpp:5249
Memory address.
Definition: fcml_common.hpp:4261
fcml_st_operand operands[FCML_OPERANDS_COUNT]
Fixed size array of instruction operands.
Definition: fcml_common.h:623
IB & offw(const Integer &offset)
Adds an offset based address operand with word size operator.
Definition: fcml_common.hpp:7215
static const InstructionPrefix REP()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:6913
void setOpMode(OperatingMode opMode)
Sets a new processor operating mode for the entry point.
Definition: fcml_common.hpp:646
Describes an instruction.
Definition: fcml_common.hpp:6207
IB & set(const InstructionHint &hint)
Adds an instruction level hint to the instruction being built.
Definition: fcml_common.hpp:7894
bool operator!=(const fcml_uint16_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:923
Instruction operand.
Definition: fcml_common.h:567
static const InstructionHint DIRECT_POINTER()
Creates instruction hint: DIRECT_POINTER.
Definition: fcml_common.hpp:426
fcml_usize offset_size
Size of the offset.
Definition: fcml_common.h:430
Wraps instruction prefix and prepares factory methods for the hints.
Definition: fcml_common.hpp:287
bool isNO() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5565
const Register & getIndex() const
Gets the constant index register associated with the effective address.
Definition: fcml_common.hpp:3783
IB & addrd(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector)
Adds an address type operand for given effective address and double word size operator.
Definition: fcml_common.hpp:7353
Instruction & setPrefixes(fcml_prefixes prefixes)
Sets a new set of prefixes for the instruction.
Definition: fcml_common.hpp:6441
static const Register R13()
Factory method for a register.
Definition: fcml_common.hpp:2686
static const Register R10W()
Factory method for a register.
Definition: fcml_common.hpp:2486
static const Register CL()
Factory method for a register.
Definition: fcml_common.hpp:1826
bool isRepne() const
Returns true if repne prefix is set.
Definition: fcml_common.hpp:6464
static Operand effq(const Register &base, const Register &index)
Factory method which creates an effective address based operator for a base register, index register and quadro word size operator.
Definition: fcml_common.hpp:5353
const Condition & getCondition() const
Gets a pointer to the constant condition associated with the instruction.
Definition: fcml_common.hpp:6310
static const Register R8W()
Factory method for a register.
Definition: fcml_common.hpp:2366
Register & getSegmentSelector()
Gets segment register associated with the selector.
Definition: fcml_common.hpp:3480
Integer & operator*=(const Integer &arg)
Multiplication assignment.
Definition: fcml_common.hpp:1213
1 Below
Definition: fcml_common.hpp:5503
static const Register BPL()
Factory method for a register.
Definition: fcml_common.hpp:2126
static const Condition NE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5745
static const OperandHint DISPLACEMENT_RELATIVE_ADDRESS()
Creates operand level hint: DISPLACEMENT_RELATIVE_ADDRESS.
Definition: fcml_common.hpp:460
#define FCML_PREFIX_BRANCH_HINT
branch hint (0x2E) (SSE2 extension)
Definition: fcml_common.h:64
static EffectiveAddress addr(const Register &base)
Factory method which creates an effective address instance with the base register only...
Definition: fcml_common.hpp:3653
static const Register BH()
Factory method for a register.
Definition: fcml_common.hpp:2276
Instruction & setMnemonic(const fcml_cstring &mnemonic)
Sets a new mnemonic for the instruction.
Definition: fcml_common.hpp:6397
Operation succeed.
Definition: fcml_errors.h:42
static const Register R8D()
Factory method for a register.
Definition: fcml_common.hpp:2376
fcml_st_register segment_selector
Used segment register.
Definition: fcml_common.h:489
bool operator==(const FarPointer &fp) const
Compares two far pointers.
Definition: fcml_common.hpp:3199
static const Register R8L()
Factory method for a register.
Definition: fcml_common.hpp:2356
fcml_bool is_signed
True if offset should be treated as signed value.
Definition: fcml_common.h:461
bool isConditional() const
Gets true if it's a conditional instruction.
Definition: fcml_common.hpp:6364
Address & setAddressForm(AddressForm addressForm)
Sets a new address form for the effective address.
Definition: fcml_common.hpp:4107
fcml_usize size
Register size in bits.
Definition: fcml_common.h:329
bool isAE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5641
static Address effective(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factor method which creates an instance of the address for an effective address, segment selector and...
Definition: fcml_common.hpp:4039
void setOffset32(fcml_int32_t offset32)
Sets 32-bit offset.
Definition: fcml_common.hpp:3314
Instruction & setHints(fcml_hints hints)
Sets new instruction hints.
Definition: fcml_common.hpp:6353
bool isL() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5964
fcml_bool is_conditional
True for conditional instructions.
Definition: fcml_common.h:619
No hints defined.
Definition: fcml_common.h:594
fcml_usize getOperandSizeAttribute() const
Gets operand size attribute held by the entry point.
Definition: fcml_common.hpp:596
bool isS() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5850
Bad arguments.
Definition: fcml_common.hpp:217
static Operand effq(const Register &base, const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Factory method which creates an effective address based operator for a base register, index register, scale factor and quardo word size operator.
Definition: fcml_common.hpp:5480
IB & effw(const Register &base, const Integer &displacement)
Adds an an effective address based operator for a base register, displacement and word size operator...
Definition: fcml_common.hpp:7543
Control register.
Definition: fcml_common.hpp:1592
static const InstructionPrefix REPE()
Creates instruction prefix: REPE.
Definition: fcml_common.hpp:332
static Operand effq(const Integer &displacement)
Factory method which creates an effective address based operator for a displacement and quadro byte s...
Definition: fcml_common.hpp:5129
static const Register EBX()
Factory method for a register.
Definition: fcml_common.hpp:1986
Representation of far pointer operand.
Definition: fcml_common.h:426
OperandType
See fcml_en_operand_type structure for more details.
Definition: fcml_common.hpp:4253
bool isNZ() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5755
void reg(fcml_uint8_t reg, fcml_usize size, Register::RegisterType type=Register::REG_GPR, fcml_bool x64_exp=FCML_FALSE)
Prepares an register operator for given register compounds.
Definition: fcml_common.hpp:4496
IB & xrelease()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7006
IB & addrd(const EffectiveAddress &effectiveAddress)
Adds an address type operand for given effective address and double word size operator.
Definition: fcml_common.hpp:7288
Effective address.
Definition: fcml_common.h:473
fcml_st_register index
GPR index register.
Definition: fcml_common.h:477
static const Register XMM8()
Factory method for a register.
Definition: fcml_common.hpp:2396
static const Condition E()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5707
static const Register R11()
Factory method for a register.
Definition: fcml_common.hpp:2566
static Operand effd(const Register &base)
Factory method which creates an effective address based operator for a base register and double word ...
Definition: fcml_common.hpp:5170
static Operand effw(const Integer &displacement)
Factory method which creates an effective address based operator for a displacement and word size ope...
Definition: fcml_common.hpp:5109
Describes address of an instruction code.
Definition: fcml_common.h:649
4 Sign
Definition: fcml_common.h:358
bool isPO() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:5945
IB & effd(const Register &base, const Integer &displacement)
Adds an an effective address based operator for a base register, displacement and double word size op...
Definition: fcml_common.hpp:7555
static Operand effb(const Register &base, const Register &index, fcml_uint8_t scaleFactor)
Factory method which creates an effective address based operator for a base register, index register, scale factor and byte size operator.
Definition: fcml_common.hpp:5378
static Address effective(const Register &base, const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address instance with the base register, index register, scale factor and displacement.
Definition: fcml_common.hpp:3994
Address & setEffectiveAddress(const EffectiveAddress &effectiveAddress)
Sets a new effective address for the address.
Definition: fcml_common.hpp:4139
void far_ptr(fcml_uint16_t seg, fcml_int32_t addr)
Prepares far pointer operand for given components.
Definition: fcml_common.hpp:4412
static const InstructionPrefix REPE()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:6934
static const Register YMM1()
Factory method for a register.
Definition: fcml_common.hpp:1886
static const InstructionPrefix REP()
Creates instruction prefix: REP.
Definition: fcml_common.hpp:325
IB & effd(const Register &base)
Adds an an effective address based operator for a base register and double word size operator...
Definition: fcml_common.hpp:7495
static const Register MM5()
Factory method for a register.
Definition: fcml_common.hpp:2166
static const Register XMM14()
Factory method for a register.
Definition: fcml_common.hpp:2756
static const Register R15W()
Factory method for a register.
Definition: fcml_common.hpp:2786
fcml_uint16_t fcml_prefixes
Type for explicit instruction prefixes bit mask.
Definition: fcml_common.h:90
EffectiveAddress & getEffectiveAddress()
Gets reference to the effective address associated with the address.
Definition: fcml_common.hpp:4128
Operation is not supported.
Definition: fcml_common.hpp:250
Memory address.
Definition: fcml_common.h:521
Generic memory addressing operator.
Definition: fcml_common.h:497
IB & reg(fcml_uint8_t reg, fcml_usize size, Register::RegisterType type=Register::REG_GPR, fcml_bool x64_exp=FCML_FALSE)
Adds an an register based operator for given parameters.
Definition: fcml_common.hpp:7393
static const Register MM3()
Factory method for a register.
Definition: fcml_common.hpp:2006
static const Register XMM13()
Factory method for a register.
Definition: fcml_common.hpp:2696
static const Condition NB()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5612
bool operator!=(const Operand &op) const
Checks if two operands are equal or not.
Definition: fcml_common.hpp:4368
void setOffsetSize(fcml_usize offsetSize)
Sets offset size.
Definition: fcml_common.hpp:3274
void far_ptr(fcml_uint16_t seg, fcml_int16_t addr)
Converts operand to the far pointer and sets the segment selector and offset for it.
Definition: fcml_common.hpp:4400
Global error handling related declarations.
static const Register XMM12()
Factory method for a register.
Definition: fcml_common.hpp:2636
static const Register ST2()
Factory method for a register.
Definition: fcml_common.hpp:2916
const Integer & getDisplacement() const
Gets the constant displacement associated with the effective address.
Definition: fcml_common.hpp:3751
static const Register YMM14()
Factory method for a register.
Definition: fcml_common.hpp:2766
fcml_int32_t getOffset32() const
Gets 32-bit offset.
Definition: fcml_common.hpp:3304
static const Register CR8()
Factory method for a register.
Definition: fcml_common.hpp:3016
Register & getRegister()
Returns a reference to the register associated with the operand.
Definition: fcml_common.hpp:4677
IB & repne()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:6880
#define FCML_PREFIX_REP
REP prefix (0xF3)
Definition: fcml_common.h:54
5 Parity
Definition: fcml_common.hpp:5511
bool isLock() const
Returns true if lock prefix is set.
Definition: fcml_common.hpp:6455
static const Register R15L()
Factory method for a register.
Definition: fcml_common.hpp:2776
bool operator!=(const EntryPoint &ep) const
Checks if two entry points are not equal.
Definition: fcml_common.hpp:564
void off(const Integer &offset, fcml_usize sizeOperator=FCML_DS_UNDEF)
Prepares address operand for given offset.
Definition: fcml_common.hpp:4446
static Operand effw(const Register &base, const Integer &displacement)
Factory method which creates an effective address based operator for a base register, displacement and word size operator.
Definition: fcml_common.hpp:5214
static const Register R12D()
Factory method for a register.
Definition: fcml_common.hpp:2616
static Operand addrw(const EffectiveAddress &effectiveAddress)
Factory method which creates address type operand for given effective address and word size operator...
Definition: fcml_common.hpp:4979
IB & addrq(const EffectiveAddress &effectiveAddress)
Adds an address type operand for given effective address and quadro word size operator.
Definition: fcml_common.hpp:7300
RegisterType
Register types.
Definition: fcml_common.hpp:1580
Integer(fcml_uint8_t value)
Definition: fcml_common.hpp:704
static const InstructionHint NEAR_PTR()
Creates a hint instance described by the name of the method.
Definition: fcml_common.hpp:6764
fcml_usize size_operator
Size of data accessed in memory.
Definition: fcml_common.h:499
Register(fcml_uint8_t reg, fcml_usize size, RegisterType type=REG_GPR, fcml_bool x64_exp=FCML_FALSE)
Creates a register instance for given parameters.
Definition: fcml_common.hpp:1630
Absolute offset.
Definition: fcml_common.h:457
IB & farPtr()
Sets a hint described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:6752
static Operand addrq(const EffectiveAddress &effectiveAddress)
Factory method which creates address type operand for given effective address and quadro word size op...
Definition: fcml_common.hpp:4999
static const Register YMM11()
Factory method for a register.
Definition: fcml_common.hpp:2586
bool operator!=(const fcml_uint8_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:901
static Integer int16(fcml_int16_t value)
Factory method which creates an instance fo the Integer for given parameter.
Definition: fcml_common.hpp:1308
static Operand effb(const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Factory method which creates an effective address based operator for an index register, scaleFactor, displacement and byte size operator.
Definition: fcml_common.hpp:5261
static const Register RAX()
Factory method for a register.
Definition: fcml_common.hpp:1786
fcml_en_register type
Register type.
Definition: fcml_common.h:327
static const Register DR4()
Factory method for a register.
Definition: fcml_common.hpp:3066
static const Register R14L()
Factory method for a register.
Definition: fcml_common.hpp:2716
fcml_st_condition condition
Describes condition used by assembled/disassembled conditional instruction.
Definition: fcml_common.h:621
static const InstructionPrefix XACQUIRE()
Creates instruction prefix: XACQUIRE.
Definition: fcml_common.hpp:346
static const Register DX()
Factory method for a register.
Definition: fcml_common.hpp:1906
Component can not be initialized correctly.
Definition: fcml_common.hpp:206
static const InstructionHint NO_HINTS()
Creates instruction hint: NO_HINTS.
Definition: fcml_common.hpp:391
IB & effq(const Register &base, const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Adds an an effective address based operator for a base register, index register, scale factor and qua...
Definition: fcml_common.hpp:7831
static const Register UNDEF()
Factory method for an undefined register.
Definition: fcml_common.hpp:1746
Integer & getImmediate()
Gets a reference to the immediate value associated with the operand.
Definition: fcml_common.hpp:4623
fcml_int64_t getInt64() const
Definition: fcml_common.hpp:752
bool isDirectPointer() const
Returns true if direct pointer hint is set.
Definition: fcml_common.hpp:6581
static const Register R10()
Factory method for a register.
Definition: fcml_common.hpp:2506
static const InstructionPrefix LOCK()
Creates instruction prefix: LOCK.
Definition: fcml_common.hpp:304
static Operand effd(const Register &base, const Register &index, fcml_uint8_t scaleFactor)
Factory method which creates an effective address based operator for a base register, index register, scale factor and double word size operator.
Definition: fcml_common.hpp:5402
static const Register EBP()
Factory method for a register.
Definition: fcml_common.hpp:2146
IB & offq(const Integer &offset)
Adds an offset based address operand with quadro word size operator.
Definition: fcml_common.hpp:7239
IB(fcml_prefixes prefixes, const fcml_cstring &mnemonic)
Creates builder for the given mnemonic and prefixes.
Definition: fcml_common.hpp:6647
static const Register R12L()
Factory method for a register.
Definition: fcml_common.hpp:2596
IB & eff(const Register &base, const Integer &displacement, fcml_usize sizeOperator=FCML_DS_UNDEF)
Adds an an effective address based operator for a base register, displacement and optional size opera...
Definition: fcml_common.hpp:7519
static const Register XMM0()
Factory method for a register.
Definition: fcml_common.hpp:1806
fcml_uint16_t fcml_ceh_error
All error codes should be held in variables of this type.
Definition: fcml_errors.h:139
static Operand addrd(const EffectiveAddress &effectiveAddress)
Factory method which creates address type operand for given effective address and double word size op...
Definition: fcml_common.hpp:4989
static const InstructionPrefix XACQUIRE()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:6976
static const Register RSI()
Factory method for a register.
Definition: fcml_common.hpp:2236
static Operand far_ptr(const FarPointer &pointer)
Factory method which builds a far pointer operand.
Definition: fcml_common.hpp:4887
static const Register YMM3()
Factory method for a register.
Definition: fcml_common.hpp:2026
static const InstructionPrefix REPNZ()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:6892
static const Register ST1()
Factory method for a register.
Definition: fcml_common.hpp:2906
static EffectiveAddress addr(const Register &base, const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Factory method which creates an effective address instance with the base register, index register, scale factor and displacement.
Definition: fcml_common.hpp:3707
IB & effb(const Register &base)
Adds an an effective address based operator for a base register and byte size operator.
Definition: fcml_common.hpp:7473
static Operand addr(const Address &address)
Factory method which builds an address operand.
Definition: fcml_common.hpp:4897
fcml_int getOperandsCount() const
Gets number of operands associated with the instruction.
Definition: fcml_common.hpp:6408
static const Register CR3()
Factory method for a register.
Definition: fcml_common.hpp:2996
fcml_en_operand_type type
Operand type.
Definition: fcml_common.h:569
static const Condition BE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5783
static const Register R10D()
Factory method for a register.
Definition: fcml_common.hpp:2496
static const Register YMM5()
Factory method for a register.
Definition: fcml_common.hpp:2186
static const Condition NLE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6087
Describes effective address.
Definition: fcml_common.hpp:3507
static Integer uint8(fcml_uint8_t value)
Factory method which creates an instance fo the Integer for given parameter.
Definition: fcml_common.hpp:1298
Instruction & setConditional(bool isConditional)
Sets conditional flag for the instruction.
Definition: fcml_common.hpp:6375
static const Register ESI()
Factory method for a register.
Definition: fcml_common.hpp:2226
const fcml_cstring & getMnemonic() const
Gets the mnemonic associated with the instruction.
Definition: fcml_common.hpp:6386
const Operand & operator[](fcml_int index) const
Gets reference to the constant operand at given index.
Definition: fcml_common.hpp:6273
fcml_int32_t off32
Place for 32-bit absolute offset.
Definition: fcml_common.h:465
IB & eff(const Register &base, const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement, fcml_usize sizeOperator=FCML_DS_UNDEF)
Adds an an effective address based operator for a base register, index register, scale factor and opt...
Definition: fcml_common.hpp:7775
static Integer int8(fcml_int8_t value)
Factory method which creates an instance fo the Integer for given parameter.
Definition: fcml_common.hpp:1288
static const Register R11W()
Factory method for a register.
Definition: fcml_common.hpp:2546
static Operand undef()
Factory method which builds an empty operand.
Definition: fcml_common.hpp:4846
static Address effective(const Register &base, const Register &index, fcml_uint8_t scaleFactor, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address instance with the base register, index register and scale factor.
Definition: fcml_common.hpp:3981
fcml_en_operand_hints
Operand hints.
Definition: fcml_common.h:530
IB & operandAbsoluteHint()
Marks the lastly added address operand as a absolute one.
Definition: fcml_common.hpp:7107
IB & addrb(const EffectiveAddress &effectiveAddress)
Adds an address type operand for given effective address and byte size operator.
Definition: fcml_common.hpp:7264
2 Equal
Definition: fcml_common.h:354
Object which shouldn't be copied can inherit from this class.
Definition: fcml_common.hpp:263
IB & nearPtr()
Sets a hint described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:6773
fcml_uint8_t getReg() const
Gets the register number.
Definition: fcml_common.hpp:1650
static const Condition B()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5593
IB(const fcml_cstring &mnemonic)
Creates builder for the given mnemonic.
Definition: fcml_common.hpp:6633
static const Register SI()
Factory method for a register.
Definition: fcml_common.hpp:2216
static const OperandHint OP_RELATIVE_ADDRESSING()
Gets relative address hint for the operand.
Definition: fcml_common.hpp:7065
IB & addrq(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector)
Adds an address type operand for given effective address and quadro word size operator.
Definition: fcml_common.hpp:7366
fcml_en_effective_address_form address_form
Memory addressing format: absolute offset/effective address.
Definition: fcml_common.h:501
IB & set(const OperandHint &hint)
Adds an operand level hint to the instruction being built.
Definition: fcml_common.hpp:7905
IB & set(const InstructionPrefix &prefix)
Adds a prefix to the instruction being built.
Definition: fcml_common.hpp:7883
static const Register MM6()
Factory method for a register.
Definition: fcml_common.hpp:2246
Address & setOffset(const Integer &offset)
Sets a new offset for the address.
Definition: fcml_common.hpp:4171
1 Below
Definition: fcml_common.h:352
Register & getIndex()
Gets the index register associated with the effective address.
Definition: fcml_common.hpp:3793
static const InstructionPrefix REPNE()
Creates instruction prefix: REPNE.
Definition: fcml_common.hpp:311
static Address effective(const Register &base, const Integer &displacement, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which creates an effective address instance with the base register and displacement...
Definition: fcml_common.hpp:3946
fcml_st_offset offset
Memory address for FCML_AF_OFFSET form.
Definition: fcml_common.h:507
static const InstructionHint LONG_FORM_PTR()
Creates a hint instance described by the name of the method.
Definition: fcml_common.hpp:6785
void setOperand(const Operand &operand, fcml_int index)
Sets a new oeprand for the instruction at given index.
Definition: fcml_common.hpp:6259
Illegal argument exception.
Definition: fcml_common.hpp:239
static const Register YMM12()
Factory method for a register.
Definition: fcml_common.hpp:2646
static const Condition PE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5916
static const Condition O()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5555
Pseudo opcode.
Definition: fcml_common.h:549
64-bit mode.
Definition: fcml_common.h:79
static const Condition NO()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:5574
Undefined register type.
Definition: fcml_common.hpp:1582
bool operator!=(const fcml_int64_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:978
Absolute offset (address).
Definition: fcml_common.hpp:3858
IB & effq(const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement)
Adds an an effective address based operator for an index register, scaleFactor, displacement and quad...
Definition: fcml_common.hpp:7633
static Operand effw(const Register &base)
Factory method which creates an effective address based operator for a base register and word size op...
Definition: fcml_common.hpp:5160
Integer operator/(const Integer &src) const
Division operator.
Definition: fcml_common.hpp:1273
virtual T next()=0
Gets a next element from the iterator.
IB & operandMultimediaHint()
Marks the lastly added operand as a multimedia one.
Definition: fcml_common.hpp:7089
fcml_int64_t off64
Place for 64-bit absolute offset.
Definition: fcml_common.h:467
static const InstructionHint LONG_FORM_POINTER()
Creates instruction hint: LONG_FORM_POINTER.
Definition: fcml_common.hpp:412
Address & setSegmentSelector(const SegmentSelector &segmentSelector)
Sets a new segment selector for the address.
Definition: fcml_common.hpp:4203
bool operator==(const fcml_int8_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:813
static const Register DR2()
Factory method for a register.
Definition: fcml_common.hpp:3046
static const Register R9()
Factory method for a register.
Definition: fcml_common.hpp:2446
IB & eff(const Register &index, fcml_uint8_t scaleFactor, const Integer &displacement, fcml_usize sizeOperator=FCML_DS_UNDEF)
Adds an an effective address based operator for an index register, scaleFactor, displacement and opti...
Definition: fcml_common.hpp:7581
Instruction(const fcml_cstring &mnemonic)
Creates an empty instruction for given mnemonic.
Definition: fcml_common.hpp:6227