27 #ifndef FCML_COMMON_HPP_ 28 #define FCML_COMMON_HPP_ 46 #define FCML_TO_CPP_BOOL( x ) ( (x) ? true : false ) 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 ) {
108 virtual bool hasNext() = 0;
113 virtual T next() = 0;
123 Nullable(
const T& value,
bool is_not_null =
true ) :
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;
161 return _value == nullable._value &&
162 _is_not_null == nullable._is_not_null;
173 return !(nullable == *
this);
190 this->_error = error;
194 this->_error = error;
197 this->_msg = cpy._msg;
198 this->_error = cpy._error;
203 if ( &exc !=
this ) {
204 this->_msg = exc._msg;
205 this->_error = exc._error;
210 const fcml_cstring getMsg()
const {
217 void*
operator new(
size_t size ) {
218 return ::operator
new( size );
321 instructionPrefix._prefix = prefix;
322 return instructionPrefix;
543 _addressSizeAttribute(FCML_DS_32),
544 _operandSizeAttribute(FCML_DS_32),
558 _addressSizeAttribute(addressSizeAttribute),
559 _operandSizeAttribute(operandSizeAttribute),
576 return _opMode == ep._opMode &&
578 _operandSizeAttribute == ep._operandSizeAttribute &&
579 _addressSizeAttribute == ep._addressSizeAttribute;
590 return !(ep == *
this);
602 return _addressSizeAttribute;
612 _addressSizeAttribute = addressSizeAttribute;
622 return _operandSizeAttribute;
632 _operandSizeAttribute = operandSizeAttribute;
689 fcml_usize _addressSizeAttribute;
691 fcml_usize _operandSizeAttribute;
705 _size( FCML_DS_64 ), _isSigned( FCML_FALSE ), _vint8( 0 ), _vint16( 0 ), _vint32( 0 ), _vint64( 0 ) {
710 _size( FCML_DS_8 ), _isSigned( FCML_TRUE ), _vint8( value ), _vint16( 0 ), _vint32( 0 ), _vint64( 0 ) {
715 _size( FCML_DS_16 ), _isSigned( FCML_TRUE ), _vint8( 0 ), _vint16( value ), _vint32( 0 ), _vint64( 0 ) {
720 _size( FCML_DS_32 ), _isSigned( FCML_TRUE ), _vint8( 0 ), _vint16( 0 ), _vint32( value ), _vint64( 0 ) {
725 _size( FCML_DS_64 ), _isSigned( FCML_TRUE ), _vint8( 0 ), _vint16( 0 ), _vint32( 0 ), _vint64( value ) {
730 _size( FCML_DS_8 ), _isSigned( FCML_FALSE ), _vint8( static_cast<fcml_uint8_t>( value ) ), _vint16( 0 ), _vint32( 0 ), _vint64( 0 ) {
735 _size( FCML_DS_16 ), _isSigned( FCML_FALSE ), _vint8( 0 ), _vint16( static_cast<fcml_uint16_t>( value ) ), _vint32( 0 ), _vint64( 0 ) {
740 _size( FCML_DS_32 ), _isSigned( FCML_FALSE ), _vint8( 0 ), _vint16( 0 ), _vint32( static_cast<fcml_uint32_t>( value ) ), _vint64( 0 ) {
745 _size( FCML_DS_64 ), _isSigned( FCML_FALSE ), _vint8( 0 ), _vint16( 0 ), _vint32( 0 ), _vint64( static_cast<fcml_uint64_t>( value ) ) {
805 _isSigned = isSigned;
828 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 );
839 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 );
850 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 );
861 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 );
872 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 );
883 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 );
894 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 );
905 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 );
916 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 );
927 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 );
938 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 );
949 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 );
960 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 );
971 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 );
982 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 );
993 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 );
1004 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 );
1015 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 );
1023 operator fcml_int8_t()
const {
1027 result =
static_cast<fcml_int8_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1030 result =
static_cast<fcml_int8_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1033 result =
static_cast<fcml_int8_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1036 result =
static_cast<fcml_int8_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1048 operator fcml_uint8_t()
const {
1049 fcml_uint8_t result;
1052 result =
static_cast<fcml_uint8_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1055 result =
static_cast<fcml_uint8_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1058 result =
static_cast<fcml_uint8_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1061 result =
static_cast<fcml_uint8_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1074 operator fcml_int16_t()
const {
1075 fcml_int16_t result;
1078 result =
static_cast<fcml_int16_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1081 result =
static_cast<fcml_int16_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1084 result =
static_cast<fcml_int16_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1087 result =
static_cast<fcml_int16_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1100 operator fcml_uint16_t()
const {
1101 fcml_uint16_t result;
1104 result =
static_cast<fcml_uint16_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1107 result =
static_cast<fcml_uint16_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1110 result =
static_cast<fcml_uint16_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1113 result =
static_cast<fcml_uint16_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1126 operator fcml_int32_t()
const {
1127 fcml_int32_t result;
1130 result =
static_cast<fcml_int32_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1133 result =
static_cast<fcml_int32_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1136 result =
static_cast<fcml_int32_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1139 result =
static_cast<fcml_int32_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1152 operator fcml_uint32_t()
const {
1153 fcml_uint32_t result;
1156 result =
static_cast<fcml_uint32_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1159 result =
static_cast<fcml_uint32_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1162 result =
static_cast<fcml_uint32_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1165 result =
static_cast<fcml_uint32_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1178 operator fcml_int64_t()
const {
1179 fcml_int64_t result;
1182 result =
static_cast<fcml_int64_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1185 result =
static_cast<fcml_int64_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1188 result =
static_cast<fcml_int64_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1191 result =
static_cast<fcml_int64_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1204 operator fcml_uint64_t()
const {
1205 fcml_uint64_t result;
1208 result =
static_cast<fcml_uint64_t
>( _isSigned ? _vint8 : (fcml_uint8_t)_vint8 );
1211 result =
static_cast<fcml_uint64_t
>( _isSigned ? _vint16 : (fcml_uint16_t)_vint16 );
1214 result =
static_cast<fcml_uint64_t
>( _isSigned ? _vint32 : (fcml_uint32_t)_vint32 );
1217 result =
static_cast<fcml_uint64_t
>( _isSigned ? _vint64 : (fcml_uint64_t)_vint64 );
1257 minus( *
this, arg );
1266 const Integer &thisRef = *
this;
1268 plus( result, src );
1277 const Integer &thisRef = *
this;
1279 minus( result, src );
1288 const Integer &thisRef = *
this;
1299 const Integer &thisRef = *
this;
1394 callMathExpression( &doMinus, &doUMinus, result, src );
1402 callMathExpression( &doMul, &doUMul, result, src );
1410 callMathExpression( &doDiv, &doUDiv, result, src );
1418 callMathExpression( &doPlus, &doUPlus, result, src );
1427 static fcml_int64_t doPlus( fcml_int64_t thisValue, fcml_int64_t thatValue ) {
1428 return thisValue + thatValue;
1435 static fcml_int64_t doMinus( fcml_int64_t thisValue, fcml_int64_t thatValue ) {
1436 return thisValue - thatValue;
1443 static fcml_int64_t doMul( fcml_int64_t thisValue, fcml_int64_t thatValue ) {
1444 return thisValue * thatValue;
1451 static fcml_int64_t doDiv( fcml_int64_t thisValue, fcml_int64_t thatValue ) {
1452 return thisValue / thatValue;
1459 static fcml_uint64_t doUPlus( fcml_uint64_t thisValue, fcml_uint64_t thatValue ) {
1460 return thisValue + thatValue;
1467 static fcml_uint64_t doUMinus( fcml_uint64_t thisValue, fcml_uint64_t thatValue ) {
1468 return thisValue - thatValue;
1475 static fcml_uint64_t doUMul( fcml_uint64_t thisValue, fcml_uint64_t thatValue ) {
1476 return thisValue * thatValue;
1483 static fcml_uint64_t doUDiv( fcml_uint64_t thisValue, fcml_uint64_t thatValue ) {
1484 return thisValue / thatValue;
1491 void callMathExpression( fcml_int64_t (*signedExpressionFn)( fcml_int64_t thisValue, fcml_int64_t thatValue ),
1492 fcml_uint64_t (*unsignedExpressionFn)( fcml_uint64_t thisValue, fcml_uint64_t thatValue ),
1497 fcml_int64_t thisValue;
1498 fcml_int64_t thatValue;
1501 switch( src._size ) {
1503 thatValue = src._isSigned ? src._vint8 :
static_cast<fcml_uint8_t
>( src._vint8 );
1506 thatValue = src._isSigned ? src._vint16 :
static_cast<fcml_uint16_t
>( src._vint16 );
1509 thatValue = src._isSigned ? src._vint32 :
static_cast<fcml_uint32_t
>( src._vint32 );
1512 thatValue = src._isSigned ? src._vint64 :
static_cast<fcml_uint64_t
>( src._vint64 );
1517 switch( result._size ) {
1519 thisValue = result._isSigned ? result._vint8 :
static_cast<fcml_uint8_t
>(result._vint8 );
1520 thisValue = (*signedExpressionFn)( thisValue, thatValue );
1521 result._vint8 =
static_cast<fcml_int8_t
>( thisValue );
1524 thisValue = result._isSigned ? result._vint16 :
static_cast<fcml_uint16_t
>( result._vint16 );
1525 thisValue = (*signedExpressionFn)( thisValue, thatValue );
1526 result._vint16 =
static_cast<fcml_int16_t
>( thisValue );
1529 thisValue = result._isSigned ? result._vint32 :
static_cast<fcml_uint32_t
>( result._vint32 );
1530 thisValue = (*signedExpressionFn)( thisValue, thatValue );
1531 result._vint32 =
static_cast<fcml_int32_t
>( thisValue );
1534 thisValue = result._isSigned ? result._vint64 :
static_cast<fcml_uint64_t
>( result._vint64 );
1535 thisValue = (*signedExpressionFn)( thisValue, thatValue );
1536 result._vint64 = thisValue;
1542 fcml_uint64_t thisValue;
1543 fcml_uint64_t thatValue;
1546 switch( src._size ) {
1548 thatValue = src._isSigned ? src._vint8 :
static_cast<fcml_uint8_t
>( src._vint8 );
1551 thatValue = src._isSigned ? src._vint16 :
static_cast<fcml_uint16_t
>( src._vint16 );
1554 thatValue = src._isSigned ? src._vint32 :
static_cast<fcml_uint32_t
>( src._vint32 );
1557 thatValue = src._isSigned ? src._vint64 :
static_cast<fcml_uint64_t
>( src._vint64 );
1562 switch( result._size ) {
1564 thisValue = result._isSigned ? result._vint8 :
static_cast<fcml_uint8_t
>( result._vint8 );
1565 thisValue = (*unsignedExpressionFn)( thisValue, thatValue );
1566 result._vint8 =
static_cast<fcml_int8_t
>( thisValue );
1569 thisValue = result._isSigned ? result._vint16 :
static_cast<fcml_uint16_t
>( result._vint16 );
1570 thisValue = (*unsignedExpressionFn)( thisValue, thatValue );
1571 result._vint16 =
static_cast<fcml_int16_t
>( thisValue );
1574 thisValue = result._isSigned ? result._vint32 :
static_cast<fcml_uint32_t
>( result._vint32 );
1575 thisValue = (*unsignedExpressionFn)( thisValue, thatValue );
1576 result._vint32 =
static_cast<fcml_int32_t
>( thisValue );
1579 thisValue = result._isSigned ? result._vint64 :
static_cast<fcml_uint64_t
>( result._vint64 );
1580 thisValue = (*unsignedExpressionFn)( thisValue, thatValue );
1581 result._vint64 = thisValue;
1590 fcml_bool _isSigned;
1592 fcml_int16_t _vint16;
1593 fcml_int32_t _vint32;
1594 fcml_int64_t _vint64;
1636 _type(REG_UNDEFINED),
1639 _x64_exp(FCML_FALSE) {
1651 _x64_exp(reg.x64_exp? true : false) {
1666 _x64_exp(x64_exp?true:false) {
1758 return _reg == reg._reg && _type == reg._type && _size == reg._size && _x64_exp == reg._x64_exp;
1768 return !( reg == *this );
3925 _offset_size(FCML_DS_16),
3926 _offset16(offset16),
3937 _offset_size(FCML_DS_32),
3939 _offset32(offset32) {
3954 fcml_int32_t thisOffset;
3955 switch( _offset_size ) {
3957 thisOffset = _offset32;
3960 thisOffset = _offset16;
3963 fcml_int32_t thatOffset;
3964 switch( fp._offset_size ) {
3966 thatOffset = fp._offset32;
3969 thatOffset = fp._offset16;
3972 return thisOffset == thatOffset;
3982 return !(fp == *
this);
4019 return _offset_size;
4029 _offset_size = offsetSize;
4049 _offset16 = offset16;
4069 _offset32 = offset32;
4095 fcml_uint16_t _segment;
4097 fcml_usize _offset_size;
4099 fcml_int16_t _offset16;
4101 fcml_int32_t _offset32;
4118 _isDefaultReg(false) {
4128 _segmentSelector(segmentSelector),
4129 _isDefaultReg(isDefaultReg) {
4145 return segmentSelector._segmentSelector == _segmentSelector;
4155 return !(*
this == segmentSelector);
4164 return _segmentSelector;
4174 if( ® !=
this ) {
4175 _isDefaultReg = reg._isDefaultReg;
4176 _segmentSelector = reg._segmentSelector;
4205 return _isDefaultReg;
4215 _isDefaultReg = isDefaultReg;
4225 return _segmentSelector;
4235 return _segmentSelector;
4245 _segmentSelector = segmentSelector;
4279 _displacement(displacement) {
4301 _displacement(displacement) {
4313 _scaleFactor(scaleFactor),
4314 _displacement(displacement) {
4339 _scaleFactor(scaleFactor) {
4353 _scaleFactor(scaleFactor),
4354 _displacement(displacement) {
4372 if( &address ==
this ) {
4375 return _base == address._base &&
4376 _index == address._index &&
4377 _scaleFactor == address._scaleFactor &&
4378 _displacement == address._displacement;
4388 return !(address == *
this);
4506 return _displacement;
4516 return _displacement;
4527 _displacement = displacement;
4570 return _scaleFactor;
4581 _scaleFactor = scaleFactor;
4591 fcml_uint8_t _scaleFactor;
4622 _size_operator( FCML_DS_UNDEF ),
4623 _address_form( AF_UNDEFINED ) {
4634 _size_operator( sizeOperator ),
4635 _address_form( AF_OFFSET ),
4647 _size_operator( sizeOperator ),
4648 _address_form( AF_COMBINED ),
4649 _effective_address( effectiveAddress ) {
4661 _size_operator( sizeOperator ),
4662 _address_form( AF_COMBINED ),
4663 _segment_selector( segmentSelector ),
4664 _effective_address( effectiveAddress ) {
4713 return effective(
EffectiveAddress( index, scaleFactor, displacement ), sizeOperator );
4736 return effective(
EffectiveAddress( base, index, scaleFactor ), sizeOperator );
4749 return effective(
EffectiveAddress( base, index, scaleFactor, displacement ), sizeOperator );
4762 if( &address ==
this ) {
4765 return _size_operator == address._size_operator &&
4766 _address_form == address._address_form &&
4767 _segment_selector == address._segment_selector &&
4768 _effective_address == address._effective_address &&
4769 _offset == address._offset;
4779 return !(address == *this );
4794 return Address( effectiveAddress, segmentSelector, sizeOperator );
4806 return Address( effectiveAddress, sizeOperator );
4818 return Address( offset, sizeOperator );
4830 return _address_form == AF_COMBINED;
4840 return _address_form == AF_OFFSET;
4850 return _address_form;
4862 _address_form = addressForm;
4873 return _effective_address;
4883 return _effective_address;
4894 _effective_address = effectiveAddress;
4926 this->_offset = offset;
4937 return _segment_selector;
4947 return _segment_selector;
4958 _segment_selector = segmentSelector;
4969 return _size_operator;
4979 _size_operator = sizeOperator;
4986 fcml_usize _size_operator;
5053 _operandMaskReg = opmaskReg;
5106 return _operandMaskReg;
5116 return _operandMaskReg;
5148 if(&decorators ==
this) {
5151 return _z == decorators._z &&
5152 _bcast == decorators._bcast &&
5153 _operandMaskReg == decorators._operandMaskReg &&
5154 _er == decorators._er &&
5155 _sae == decorators._sae;
5165 return !(decorators == *
this);
5211 _operandType( OT_NONE ) {
5223 _operandType(OT_IMMEDIATE ),
5236 _operandType( OT_FAR_POINTER ),
5237 _farPointer( pointer ) {
5249 _operandType( OT_ADDRESS ),
5250 _address( address ) {
5262 _operandType( OT_REGISTER ),
5280 switch( _operandType ) {
5282 equal = _address == op._address;
5284 case OT_FAR_POINTER:
5285 equal = _farPointer == op._farPointer;
5288 equal = _immediate == op._immediate;
5291 equal = _register == op._register;
5300 return equal && op._hints == _hints && op._decorators == _decorators;
5311 return !(op == *
this);
5321 _operandType = OT_NONE;
5331 _operandType = OT_IMMEDIATE;
5342 void far_ptr( fcml_uint16_t seg, fcml_int16_t addr ) {
5343 _operandType = OT_FAR_POINTER;
5354 void far_ptr( fcml_uint16_t seg, fcml_int32_t addr ) {
5355 _operandType = OT_FAR_POINTER;
5366 _operandType = OT_FAR_POINTER;
5367 _farPointer = pointer;
5377 _operandType = OT_ADDRESS;
5388 void off(
const Integer &offset, fcml_usize sizeOperator = FCML_DS_UNDEF ) {
5389 _operandType = OT_ADDRESS;
5390 _address =
Address( offset, sizeOperator );
5401 _operandType = OT_ADDRESS;
5402 _address =
Address( effectiveAddress, sizeOperator );
5414 _operandType = OT_ADDRESS;
5415 _address =
Address( effectiveAddress, segmentSelector, sizeOperator );
5425 _operandType = OT_REGISTER;
5439 _operandType = OT_REGISTER;
5440 _register =
Register( reg, size, type, x64_exp );
5452 return _operandType == OT_IMMEDIATE;
5462 return _operandType == OT_REGISTER;
5472 return _operandType == OT_ADDRESS;
5482 return _operandType == OT_FAR_POINTER;
5545 _farPointer = farPointer;
5577 _immediate = immediate;
5588 return _operandType;
5599 _operandType = operandType;
5631 this->_register = reg;
5685 _decorators = decorators;
5990 return Operand(
Address( effectiveAddress, segmentSelector, sizeOperator ) );
6001 return Operand(
Address( effectiveAddress, segmentSelector, FCML_DS_8 ) );
6012 return Operand(
Address( effectiveAddress, segmentSelector, FCML_DS_16 ) );
6023 return Operand(
Address( effectiveAddress, segmentSelector, FCML_DS_32 ) );
6034 return Operand(
Address( effectiveAddress, segmentSelector, FCML_DS_64 ) );
6227 static Operand eff(
const Register &index, fcml_uint8_t scaleFactor,
const Integer &displacement, fcml_usize sizeOperator = FCML_DS_UNDEF ) {
6228 return addr(
EffectiveAddress( index, scaleFactor, displacement ), sizeOperator );
6240 return addr(
EffectiveAddress( index, scaleFactor, displacement ), FCML_DS_8 );
6252 return addr(
EffectiveAddress( index, scaleFactor, displacement ), FCML_DS_16 );
6264 return addr(
EffectiveAddress( index, scaleFactor, displacement ), FCML_DS_32 );
6276 return addr(
EffectiveAddress( index, scaleFactor, displacement ), FCML_DS_64 );
6407 return addr(
EffectiveAddress( base, index, scaleFactor, displacement ), sizeOperator );
6420 return addr(
EffectiveAddress( base, index, scaleFactor, displacement ), FCML_DS_8 );
6433 return addr(
EffectiveAddress( base, index, scaleFactor, displacement ), FCML_DS_16 );
6446 return addr(
EffectiveAddress( base, index, scaleFactor, displacement ), FCML_DS_32 );
6459 return addr(
EffectiveAddress( base, index, scaleFactor, displacement ), FCML_DS_64 );
6501 _conditionType(CONDITION_O),
6502 _isNegation(false) {
6513 _conditionType( type ),
6514 _isNegation( negation ) {
6525 return check( CONDITION_O );
6534 const Condition condition( CONDITION_O );
6544 return check( CONDITION_O,
true );
6553 const Condition condition( CONDITION_O );
6563 return check( CONDITION_B );
6572 const Condition condition( CONDITION_B );
6582 return check( CONDITION_B,
true );
6591 const Condition condition( CONDITION_B,
true );
6601 return check( CONDITION_B );
6610 const Condition condition( CONDITION_B );
6620 return check( CONDITION_B,
true );
6629 const Condition condition( CONDITION_B,
true );
6639 return check( CONDITION_B );
6648 const Condition condition( CONDITION_B );
6658 return check( CONDITION_B,
true );
6667 const Condition condition( CONDITION_B,
true );
6677 return check( CONDITION_E );
6686 const Condition condition( CONDITION_E );
6696 return check( CONDITION_E );
6705 const Condition condition( CONDITION_E );
6715 return check( CONDITION_E,
true );
6724 const Condition condition( CONDITION_E,
true );
6734 return check( CONDITION_E,
true );
6743 const Condition condition( CONDITION_E,
true );
6753 return check( CONDITION_BE );
6762 const Condition condition( CONDITION_BE );
6772 return check( CONDITION_BE );
6781 const Condition condition( CONDITION_BE );
6791 return check( CONDITION_BE,
true );
6800 const Condition condition( CONDITION_BE,
true );
6810 return check( CONDITION_BE,
true );
6819 const Condition condition( CONDITION_BE,
true );
6829 return check( CONDITION_S );
6838 const Condition condition( CONDITION_S );
6848 return check( CONDITION_S,
true );
6857 const Condition condition( CONDITION_S,
true );
6867 return check( CONDITION_P );
6876 const Condition condition( CONDITION_P );
6886 return check( CONDITION_P );
6895 const Condition condition( CONDITION_P );
6905 return check( CONDITION_P,
true );
6914 const Condition condition( CONDITION_P,
true );
6924 return check( CONDITION_P,
true );
6933 const Condition condition( CONDITION_P,
true );
6943 return check( CONDITION_L );
6952 const Condition condition( CONDITION_L );
6962 return check( CONDITION_L );
6971 const Condition condition( CONDITION_L );
6981 return check( CONDITION_L,
true );
6990 const Condition condition( CONDITION_L,
true );
7000 return check( CONDITION_L,
true );
7009 const Condition condition( CONDITION_L,
true );
7019 return check( CONDITION_LE );
7028 const Condition condition( CONDITION_LE );
7038 return check( CONDITION_LE );
7047 const Condition condition( CONDITION_LE );
7057 return check( CONDITION_LE,
true );
7066 const Condition condition( CONDITION_LE,
true );
7076 return check( CONDITION_LE,
true );
7085 const Condition condition( CONDITION_LE,
true );
7099 return cond._conditionType == _conditionType && cond._isNegation == _isNegation;
7110 return !(*
this == cond);
7122 return _conditionType;
7132 _conditionType = conditionType;
7153 _isNegation = isNegation;
7167 bool check(
ConditionType type,
bool negation =
false )
const {
7168 return _conditionType == type && _isNegation == negation;
7195 _isConditional(false),
7208 _mnemonic(mnemonic),
7209 _isConditional(false),
7226 _operands[_operandsCount++] = operand;
7241 _operands[index] = operand;
7252 checkArrayAccess(index);
7253 return _operands[index];
7264 checkArrayAccess(index);
7265 return _operands[index];
7310 _condition = condition;
7343 return _isConditional;
7354 _isConditional = isConditional;
7376 _mnemonic = mnemonic;
7387 return _operandsCount;
7398 _operandsCount = operandsCount;
7420 _prefixes = prefixes;
7570 void checkArrayAccess( fcml_int index)
const {
7583 fcml_cstring _mnemonic;
7585 bool _isConditional;
7591 fcml_int _operandsCount;
7611 IB(
const fcml_cstring &mnemonic ) :
7614 _mnemonic(mnemonic),
7627 _prefixes(prefixes),
7628 _mnemonic(mnemonic),
7642 _mnemonic(mnemonic),
7656 _prefixes(prefixes),
7657 _mnemonic(mnemonic),
7698 _operands[_operandsCount++] = operand;
7708 static IB inst(
const fcml_cstring &mnemonic ) {
7709 return IB(mnemonic);
8068 set( OP_MULTIMEDIA_HINT() );
8077 set( OP_MULTIMEDIA_HINT() );
8086 set( OP_MULTIMEDIA_HINT() );
8095 set( OP_MULTIMEDIA_HINT() );
8108 _operands[_operandsCount++].imm(imm);
8121 _operands[_operandsCount++].far_ptr(seg, addr);
8134 _operands[_operandsCount++].far_ptr(seg, addr);
8146 _operands[_operandsCount++].far_ptr( pointer );
8158 _operands[_operandsCount++].addr(address);
8169 IB&
off(
const Integer &offset, fcml_usize sizeOperator = FCML_DS_UNDEF ) {
8171 _operands[_operandsCount++].off( offset, sizeOperator );
8183 _operands[_operandsCount++].off( offset, FCML_DS_8 );
8195 _operands[_operandsCount++].off( offset, FCML_DS_16 );
8207 _operands[_operandsCount++].off( offset, FCML_DS_32 );
8219 _operands[_operandsCount++].off( offset, FCML_DS_64 );
8232 _operands[_operandsCount++].addr( effectiveAddress, sizeOperator );
8244 _operands[_operandsCount++].addr( effectiveAddress, FCML_DS_8 );
8256 _operands[_operandsCount++].addr( effectiveAddress, FCML_DS_16 );
8268 _operands[_operandsCount++].addr( effectiveAddress, FCML_DS_32 );
8280 _operands[_operandsCount++].addr( effectiveAddress, FCML_DS_64 );
8294 _operands[_operandsCount++].addr( effectiveAddress, segmentSelector, sizeOperator );
8307 _operands[_operandsCount++].addr( effectiveAddress, segmentSelector, FCML_DS_8 );
8320 _operands[_operandsCount++].addr( effectiveAddress, segmentSelector, FCML_DS_8 );
8333 _operands[_operandsCount++].addr( effectiveAddress, segmentSelector, FCML_DS_8 );
8346 _operands[_operandsCount++].addr( effectiveAddress, segmentSelector, FCML_DS_8 );
8358 _operands[_operandsCount++].reg( reg );
8373 _operands[_operandsCount++].reg(
Register( reg, size, type, x64_exp ) );
8384 IB&
eff(
const Integer &displacement, fcml_usize sizeOperator = FCML_DS_UNDEF ) {
8559 IB&
eff(
const Register &index, fcml_uint8_t scaleFactor,
const Integer &displacement, fcml_usize sizeOperator = FCML_DS_UNDEF ) {
8686 IB&
eff(
const Register &base,
const Register &index, fcml_uint8_t scaleFactor, fcml_usize sizeOperator = FCML_DS_UNDEF ) {
8862 _prefixes |= prefix._prefix;
8873 _hints |= hint._hint;
8884 if( _operandsCount == 0 ) {
8887 _operands[_operandsCount-1].setHints( _operands[_operandsCount-1].getHints() | hint._hint );
8900 return _operands[_operandsCount++];
8908 void sanityCheck()
const {
8921 fcml_cstring _mnemonic;
8923 fcml_int _operandsCount;
8987 dest.
setType( static_cast<Register::RegisterType>( src.
type ) );
9075 bcast.setNotNull(FCML_TO_CPP_BOOL(src.
bcast.is_not_null));
9076 bcast.setValue(src.
bcast.value);
9079 er.setNotNull(FCML_TO_CPP_BOOL(src.
er.is_not_null));
9080 er.setValue(static_cast<Decorators::EmbeededRoundingControl>(src.
er.value));
9090 dest.
er.is_not_null = src.
getEr().isNotNull();
9091 dest.
er.value =
static_cast<fcml_uint8_t
>(src.
getEr().getValue());
9098 dest.
setConditionType( static_cast<Condition::ConditionType>( src.condition_type ) );
9099 dest.
setNegation( src.is_negation ?
true :
false );
9114 convert( src.
operands[i], dest[i] );
9127 convert( src[i], dest.
operands[i] );
9134 Env::strFree( instruction.
mnemonic );
9142 #endif //FCML_COMMON_HPP_ fcml_char * mnemonic
Dialect-dependent instruction mnemonic.
Definition: fcml_common.h:791
IB & effw(const Register &base)
Adds an an effective address based operator for a base register and word size operator.
Definition: fcml_common.hpp:8462
EntryPoint()
Creates an empty entry point instance.
Definition: fcml_common.hpp:541
fcml_hints getHints() const
Gets instruction level hits associated with the instruction.
Definition: fcml_common.hpp:7320
static const Register ZMM15()
Factory method for a register.
Definition: fcml_common.hpp:3020
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:8384
An instruction builder.
Definition: fcml_common.hpp:7602
bool isRepnz() const
Returns true if lock repnz is set.
Definition: fcml_common.hpp:7451
bool isOffset() const
Returns true if address holds an offset only.
Definition: fcml_common.hpp:4839
fcml_ip ip
Instruction pointer EIP/RIP.
Definition: fcml_common.h:833
#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:6368
static const Register R14()
Factory method for a register.
Definition: fcml_common.hpp:2920
IB & far_ptr(fcml_uint16_t seg, fcml_int32_t addr)
Adds a far pointer operand.
Definition: fcml_common.hpp:8132
static const Register DIL()
Factory method for a register.
Definition: fcml_common.hpp:2390
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:4006
bool isNoBranchHint() const
Returns true if no_branch_hint prefix is set.
Definition: fcml_common.hpp:7514
const Nullable< EmbeededRoundingControl > & getEr() const
Gets AVX-512 {er} decorator.
Definition: fcml_common.hpp:5125
bool isNS() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6847
static const Register RIP()
Factory method for a register.
Definition: fcml_common.hpp:3800
static Operand reg(const Register ®)
Factory method which creates an register based operator for given register.
Definition: fcml_common.hpp:6043
static const Register YMM6()
Factory method for a register.
Definition: fcml_common.hpp:2359
static const Register EDX()
Factory method for a register.
Definition: fcml_common.hpp:1968
static Operand offb(const Integer &offset)
Factory method which builds an offset based address operand with byte size operator.
Definition: fcml_common.hpp:5896
void reg(const Register ®)
Prepares operator for the given register.
Definition: fcml_common.hpp:5424
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:8598
const EffectiveAddress & getEffectiveAddress() const
Gets reference to the constant effective address associated with the address.
Definition: fcml_common.hpp:4872
bool isNP() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6904
bool isRelativeAddressing() const
Returns true is relative addressing is used.
Definition: fcml_common.hpp:5739
static const Register R9W()
Factory method for a register.
Definition: fcml_common.hpp:2550
EffectiveAddress & setScaleFactor(fcml_uint8_t scaleFactor)
Sets a new scale factor for the effective address.
Definition: fcml_common.hpp:4580
static const Condition S()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6837
Describes segment register.
Definition: fcml_common.h:619
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:6344
Integer operator/(const Integer &src) const
Division operator.
Definition: fcml_common.hpp:1298
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:8440
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:6000
static const Register CX()
Factory method for a register.
Definition: fcml_common.hpp:1878
bool isRep() const
Returns true if rep prefix is set.
Definition: fcml_common.hpp:7460
IB & lock()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7837
Register()
Creates an empty register instance.
Definition: fcml_common.hpp:1635
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:4633
static const InstructionPrefix REPNE()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:7849
static const Register ESP()
Factory method for a register.
Definition: fcml_common.hpp:2138
IB & xacquire()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7963
static const OperandHint OP_SIB_ENCODING()
Gets SIB encoding hint for the operand.
Definition: fcml_common.hpp:8059
Integer & setSigned(fcml_bool isSigned)
Definition: fcml_common.hpp:804
fcml_uint8_t getReg() const
Gets the register number.
Definition: fcml_common.hpp:1682
static const Register SS()
Factory method for a register.
Definition: fcml_common.hpp:3530
#define FCML_PREFIX_REPNE
REPNE prefix (0xF2)
Definition: fcml_common.h:50
static const Register DH()
Factory method for a register.
Definition: fcml_common.hpp:2289
fcml_usize operand_size_attribute
Default operand size attribute (See 'D' flag of segment descriptor.)
Definition: fcml_common.h:830
Defines instruction's condition.
Definition: fcml_common.h:495
static const Condition PO()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6932
static Integer uint64(fcml_uint64_t value)
Factory method which creates an insatnce fo the Integer for given parameter.
Definition: fcml_common.hpp:1383
Effective address combined from address components like base register, index registers, factor, displacement etc...
Definition: fcml_common.h:583
EffectiveAddress()
Creates an empry effective address.
Definition: fcml_common.hpp:4268
static const Register ZMM9()
Factory method for a register.
Definition: fcml_common.hpp:2600
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:8712
static const Register XMM30()
Factory method for a register.
Definition: fcml_common.hpp:3450
fcml_uint16_t segment
16-bit Code segment.
Definition: fcml_common.h:558
fcml_int16_t offset16
16-bit offset.
Definition: fcml_common.h:562
static const Register YMM7()
Factory method for a register.
Definition: fcml_common.hpp:2450
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:4723
const Decorators & getDecorators() const
Gets constant decorators associated with the operand.
Definition: fcml_common.hpp:5663
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:8624
static IB inst(const fcml_cstring &mnemonic)
Factory method that can be used to create instruction builder.
Definition: fcml_common.hpp:7708
bool operator==(const SegmentSelector &segmentSelector) const
Checks if two segment selector are equal.
Definition: fcml_common.hpp:4143
fcml_en_register
Register type.
Definition: fcml_common.h:426
static const Register R9L()
Factory method for a register.
Definition: fcml_common.hpp:2540
Instruction & setOperandsCount(fcml_int operandsCount)
Sets number of operands available in the instruction.
Definition: fcml_common.hpp:7397
Operand & setRegister(const Register ®)
Sets a new register for the operand.
Definition: fcml_common.hpp:5630
Illegal state exception.
Definition: fcml_common.hpp:253
static const Register ZMM12()
Factory method for a register.
Definition: fcml_common.hpp:2810
void setSegmentSelector(const Register &segmentSelector)
Sets segment register for the selector.
Definition: fcml_common.hpp:4244
static const Register DR0()
Factory method for a register.
Definition: fcml_common.hpp:3700
Two way conversion for common types.
Definition: fcml_common.hpp:8933
void setIP(fcml_ip ip)
Sets a new instruction pointer for the entry point.
Definition: fcml_common.hpp:651
Container for operand decorators.
Definition: fcml_common.h:657
void setOperandSizeAttribute(fcml_usize operandSizeAttribute)
Sets a new operand size attribute for the entry point.
Definition: fcml_common.hpp:631
fcml_st_integer immediate
Immediate value operand.
Definition: fcml_common.h:741
bool isO() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6524
bool operator==(const EntryPoint &ep) const
Checks if two entry points are equal.
Definition: fcml_common.hpp:575
static const Register YMM30()
Factory method for a register.
Definition: fcml_common.hpp:3460
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:6097
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:6158
const Register & getRegister() const
Returns a reference to the constant register associated with the operand.
Definition: fcml_common.hpp:5609
static Integer uint16(fcml_uint16_t value)
Factory method which creates an instance fo the Integer for given parameter.
Definition: fcml_common.hpp:1343
const Nullable< fcml_uint8_t > & getBcast() const
Gets AVX-512 {bcast} decorator.
Definition: fcml_common.hpp:5095
#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:1745
bool operator!=(const fcml_int16_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:959
static const Register ES()
Factory method for a register.
Definition: fcml_common.hpp:3510
static const Register DL()
Factory method for a register.
Definition: fcml_common.hpp:1948
static const Register YMM19()
Factory method for a register.
Definition: fcml_common.hpp:3130
virtual ~Address()
Definition: fcml_common.hpp:4668
static const Condition GE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:7008
fcml_st_operand_decorators decorators
Operand decorators.
Definition: fcml_common.h:749
static const Register YMM13()
Factory method for a register.
Definition: fcml_common.hpp:2870
static const Register YMM8()
Factory method for a register.
Definition: fcml_common.hpp:2520
6 Less than
Definition: fcml_common.h:487
IB & nobranchHint()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:8026
static const Register YMM31()
Factory method for a register.
Definition: fcml_common.hpp:3490
static const OperandHint MULTIMEDIA()
Creates operand level hint: MULTIMEDIA_INSTRUCTION.
Definition: fcml_common.hpp:478
bool isSIBEncoding() const
Returns true if the SIB byte is used.
Definition: fcml_common.hpp:5749
static const Register CH()
Factory method for a register.
Definition: fcml_common.hpp:2199
fcml_bool x64_exp
In case of SPL,BPL,SIL,DIL GPR registers has to be set to true.
Definition: fcml_common.h:458
Control register.
Definition: fcml_common.h:438
Condition(ConditionType type, bool negation=false)
Creates a condition for given parameters.
Definition: fcml_common.hpp:6512
Segment register.
Definition: fcml_common.h:436
bool operator==(const Address &address) const
Checks if two addresses are equal or not.
Definition: fcml_common.hpp:4761
Operand mask register.
Definition: fcml_common.h:444
Describes segment register.
Definition: fcml_common.hpp:4109
bool isBranchHint() const
Returns true if branch_hint prefix is set.
Definition: fcml_common.hpp:7505
Operand & setImmediate(const Integer &immediate)
Sets a new immediate value for the address.
Definition: fcml_common.hpp:5576
static const Register RBP()
Factory method for a register.
Definition: fcml_common.hpp:2239
SegmentSelector & getSegmentSelector()
Gets the segment selector associated with the address.
Definition: fcml_common.hpp:4946
fcml_bool isZ() const
Gets AVX-512 {z} operator.
Definition: fcml_common.hpp:5085
virtual ~Register()
Definition: fcml_common.hpp:1672
static const Register RDX()
Factory method for a register.
Definition: fcml_common.hpp:1978
static const InstructionPrefix LOCK()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:7828
static const Register XMM2()
Factory method for a register.
Definition: fcml_common.hpp:1998
const Integer & getImmediate() const
Gets a reference to the constant immediate value associated with the operand.
Definition: fcml_common.hpp:5555
static const Register ZMM22()
Factory method for a register.
Definition: fcml_common.hpp:3230
std::basic_string< fcml_char > fcml_cstring
By using this type definition here, it will be definitely much easier to support UNICODE in future re...
Definition: fcml_common.hpp:53
RegisterType getType() const
Gets the register type.
Definition: fcml_common.hpp:1718
Address operand.
Definition: fcml_common.hpp:4601
bool isNB() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6581
fcml_st_register operand_mask_reg
The 64-bit k registers are: k0 through k7.
Definition: fcml_common.h:663
x86 - 64 register representation.
Definition: fcml_common.hpp:1601
bool operator==(const EffectiveAddress &address) const
Checks whether two effective addresses are equal or not.
Definition: fcml_common.hpp:4371
static const Register R12W()
Factory method for a register.
Definition: fcml_common.hpp:2760
static const Register XMM26()
Factory method for a register.
Definition: fcml_common.hpp:3330
fcml_st_segment_selector segment_selector
Segment register.
Definition: fcml_common.h:639
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:4438
static const Register MM1()
Factory method for a register.
Definition: fcml_common.hpp:1908
static const Register ZMM25()
Factory method for a register.
Definition: fcml_common.hpp:3320
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:8738
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:6033
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:8672
fcml_bool isSigned() const
Definition: fcml_common.hpp:799
fcml_en_operand_type
Supported operand types.
Definition: fcml_common.h:673
static const Register XMM17()
Factory method for a register.
Definition: fcml_common.hpp:3060
void incrementIP(fcml_ip ip)
Increments the instruction pointer by given number of bytes.
Definition: fcml_common.hpp:681
bool operator!=(const Condition &cond) const
Checks if two condition are equal.
Definition: fcml_common.hpp:7109
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:4817
Relative address.
Definition: fcml_common.h:710
static const InstructionPrefix NO_BRANCH()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:8017
fcml_uint16_t fcml_hints
Type used for storing instruction and operand hint masks.
Definition: fcml_common.h:86
#define FCML_PREFIX_REPE
REPE prefix (0xF3)
Definition: fcml_common.h:56
const Condition & getCondition() const
Gets a pointer to the constant condition associated with the instruction.
Definition: fcml_common.hpp:7288
static const Register XMM28()
Factory method for a register.
Definition: fcml_common.hpp:3390
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:4679
Wraps operand hint and exposes factory methods for instruction hints.
Definition: fcml_common.hpp:461
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:8636
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:6022
static const Condition A()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6818
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:6118
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:4311
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:8660
fcml_usize size
Offset size 16,32 or 64 bits.
Definition: fcml_common.h:591
fcml_usize getSizeOperator() const
Gets the size operator associated with the address.
Definition: fcml_common.hpp:4968
bool isNG() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:7037
General purpose register.
Definition: fcml_common.h:430
5 Parity
Definition: fcml_common.h:485
bool isRepz() const
Returns true if repz prefix is set.
Definition: fcml_common.hpp:7478
fcml_en_operating_mode
Supported processor operating modes.
Definition: fcml_common.h:73
Integer(fcml_int8_t value)
Definition: fcml_common.hpp:709
Common general purpose utility functions.
static const Register AH()
Factory method for a register.
Definition: fcml_common.hpp:2108
static const Register YMM18()
Factory method for a register.
Definition: fcml_common.hpp:3100
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:4204
static const Register YMM27()
Factory method for a register.
Definition: fcml_common.hpp:3370
static const InstructionPrefix REPZ()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:7933
ConditionType
See fcml_st_condition for more details.
Definition: fcml_common.hpp:6477
IB & branchHint()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:8005
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:8318
bool isMultimedia() const
Returns information if the operand is multimedia one or not.
Definition: fcml_common.hpp:5698
Integer & setInt64(fcml_int64_t int64)
Definition: fcml_common.hpp:782
void undef()
Converts operand to the undefined one.
Definition: fcml_common.hpp:5320
static const Condition P()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6875
Instruction & setCondition(const Condition &condition)
Sets a new condition for the instruction.
Definition: fcml_common.hpp:7309
Wrapper for nullable value types.
Definition: fcml_common.hpp:120
static const Register DR7()
Factory method for a register.
Definition: fcml_common.hpp:3770
bool operator==(const fcml_int32_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:882
static const Register XMM23()
Factory method for a register.
Definition: fcml_common.hpp:3240
Hints instruction to use FAR pointer to address the memory.
Definition: fcml_common.h:766
bool isPE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6885
Instruction pointer register.
Definition: fcml_common.h:442
bool isXRelease() const
Returns true if xrelease prefix is set.
Definition: fcml_common.hpp:7496
static const InstructionHint INDIRECT_PTR()
Creates a hint instance described by the name of the method.
Definition: fcml_common.hpp:7784
static Operand off(const Integer &offset, fcml_usize sizeOperator=FCML_DS_UNDEF)
Factory method which builds an address operand.
Definition: fcml_common.hpp:5886
static const Register ZMM29()
Factory method for a register.
Definition: fcml_common.hpp:3440
static const Register ST6()
Factory method for a register.
Definition: fcml_common.hpp:3630
IB & rep()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7900
fcml_uint8_t reg
Register itself as a positive integer.
Definition: fcml_common.h:456
enum fcml_en_address_form fcml_en_effective_address_form
Memory addressing using ModR/M field.
void addr(const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector, fcml_usize sizeOperator=FCML_DS_UNDEF)
Prepares address operator for given parameters.
Definition: fcml_common.hpp:5413
bool isNA() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6771
static const Register XMM31()
Factory method for a register.
Definition: fcml_common.hpp:3480
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:4805
static const OperandHint OP_ABSOLUTE_ADDRESSING()
Gets absolute hint for the operand.
Definition: fcml_common.hpp:8051
fcml_st_integer displacement
Displacement value.
Definition: fcml_common.h:613
#define FCML_TEXT(x)
Used to code literal strings.
Definition: fcml_types.h:61
Decorators & setBcast(const Nullable< fcml_uint8_t > &bcast)
Sets a new AVX-512 {bcast} decorator.
Definition: fcml_common.hpp:5041
static const Register YMM29()
Factory method for a register.
Definition: fcml_common.hpp:3430
static const Register ZMM11()
Factory method for a register.
Definition: fcml_common.hpp:2740
bool operator!=(const EffectiveAddress &address) const
Checks whether two effective addresses are equal or not.
Definition: fcml_common.hpp:4387
static const Register R13D()
Factory method for a register.
Definition: fcml_common.hpp:2840
static const Register ZMM7()
Factory method for a register.
Definition: fcml_common.hpp:2460
0 Overflow
Definition: fcml_common.h:475
Address & setSizeOperator(fcml_usize sizeOperator)
Sets a new size operator for the address.
Definition: fcml_common.hpp:4978
static const Condition NGE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6970
EffectiveAddress(const Register &base)
Creates an effective address instance with the base register only.
Definition: fcml_common.hpp:4287
static const Register IP()
Factory method for a register.
Definition: fcml_common.hpp:3780
static const Register YMM9()
Factory method for a register.
Definition: fcml_common.hpp:2590
IB & offb(const Integer &offset)
Adds an offset based address operand with byte size operator.
Definition: fcml_common.hpp:8181
Definitions of common structures used by FCML components.
static const Register DR3()
Factory method for a register.
Definition: fcml_common.hpp:3730
fcml_int32_t getInt32() const
Definition: fcml_common.hpp:766
bool operator==(const Integer &value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:915
static const Register DI()
Factory method for a register.
Definition: fcml_common.hpp:2400
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:6309
Encode ModR/M with optional SIB byte if possible.
Definition: fcml_common.h:729
bool operator!=(const Register ®) const
Compares registers.
Definition: fcml_common.hpp:1767
static const Condition NZ()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6742
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:8767
bool isNL() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6980
static const Register EDI()
Factory method for a register.
Definition: fcml_common.hpp:2410
static const Condition NP()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6913
static const InstructionPrefix XRELEASE()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:7975
static const Register XMM9()
Factory method for a register.
Definition: fcml_common.hpp:2580
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:556
IB & effq(const Integer &displacement)
Adds an an effective address based operator for a displacement and quadro byte size operator...
Definition: fcml_common.hpp:8428
static SegmentSelector seg(const Register &segmentSelector, bool isDefaultReg)
Creates segment selector for the given register.
Definition: fcml_common.hpp:4191
static const Register R12()
Factory method for a register.
Definition: fcml_common.hpp:2780
FarPointer(fcml_uint16_t segment, fcml_int32_t offset32)
Creates an far pointer instance.
Definition: fcml_common.hpp:3935
Holds instruction pointer, processor operating mode and memory segment flags.
Definition: fcml_common.hpp:524
void setSegment(fcml_uint16_t segment)
Sets segment selector.
Definition: fcml_common.hpp:4088
static const InstructionPrefix REPZ()
Creates instruction prefix: REPZ.
Definition: fcml_common.hpp:364
static const OperandHint OP_MULTIMEDIA_HINT()
Gets multimedia hint for the operand.
Definition: fcml_common.hpp:8035
static const Register GS()
Factory method for a register.
Definition: fcml_common.hpp:3560
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:6214
fcml_int16_t getOffset16() const
Gets the 16-bit offset.
Definition: fcml_common.hpp:4038
IB & effw(const Integer &displacement)
Adds an an effective address based operator for a displacement and word size operator.
Definition: fcml_common.hpp:8406
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:5989
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:6445
static const Condition NBE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6799
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:4712
static const Register DR1()
Factory method for a register.
Definition: fcml_common.hpp:3710
const Address & getAddress() const
Gets reference to the constant address associated with the operand.
Definition: fcml_common.hpp:5491
static const Register ST0()
Factory method for a register.
Definition: fcml_common.hpp:3570
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:5400
IB & off(const Integer &offset, fcml_usize sizeOperator=FCML_DS_UNDEF)
Adds an offset operand.
Definition: fcml_common.hpp:8169
void setAddressSizeAttribute(fcml_usize addressSizeAttribute)
Sets a new address size attribute for the entry point.
Definition: fcml_common.hpp:611
Generic instruction model.
Definition: fcml_common.h:783
static const Register YMM4()
Factory method for a register.
Definition: fcml_common.hpp:2178
fcml_int32_t offset32
32-bit offset.
Definition: fcml_common.h:564
bool operator==(const fcml_uint8_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:827
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:6287
Instruction()
Creates an empty instruction.
Definition: fcml_common.hpp:7192
Register & getBase()
Gets the base register associated with the effective address.
Definition: fcml_common.hpp:4483
IB & repnz()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7879
IB & effd(const Integer &displacement)
Adds an an effective address based operator for a displacement and double word size operator...
Definition: fcml_common.hpp:8417
void setType(RegisterType type)
Sets the register type.
Definition: fcml_common.hpp:1727
static const Condition Z()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6704
Integer & setSize(fcml_usize size)
Definition: fcml_common.hpp:815
static Operand offd(const Integer &offset)
Factory method which builds an offset based address operand with double word size operator...
Definition: fcml_common.hpp:5916
IB & operandSIBEncodingHint()
Sets preferred encoding to SIB for the lastly added ModR/M operand.
Definition: fcml_common.hpp:8094
Operand builder.
Definition: fcml_common.hpp:5816
void add(const Operand &operand)
Adds a new operand to the instruction.
Definition: fcml_common.hpp:7222
bool isPseudoOpcode() const
Returns true if it's pseudo opcode operand.
Definition: fcml_common.hpp:5719
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:8795
Address & getAddress()
Gets reference to the address associated with the operand.
Definition: fcml_common.hpp:5501
void addr(const Address &address)
Prepares address operand for given address.
Definition: fcml_common.hpp:5376
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:8484
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:8585
bool isConditional() const
Gets true if it's a conditional instruction.
Definition: fcml_common.hpp:7342
Describes far pointer.
Definition: fcml_common.hpp:3902
bool isNegation() const
Returns true if condition is negated.
Definition: fcml_common.hpp:7142
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:6275
static Operand far_ptr(fcml_uint16_t seg, fcml_int16_t addr)
Factory method which builds a far pointer operand.
Definition: fcml_common.hpp:5844
#define FCML_PREFIX_XACQUIRE
XACQUIRE prefix (0xF2)
Definition: fcml_common.h:60
static const Register YMM20()
Factory method for a register.
Definition: fcml_common.hpp:3160
static const Register ECX()
Factory method for a register.
Definition: fcml_common.hpp:1888
Integer & setInt8(fcml_int8_t int8)
Definition: fcml_common.hpp:793
fcml_int64_t getInt64() const
Definition: fcml_common.hpp:777
static const Register R11L()
Factory method for a register.
Definition: fcml_common.hpp:2680
static const Register ZMM28()
Factory method for a register.
Definition: fcml_common.hpp:3410
Integer & setInt32(fcml_int32_t int32)
Definition: fcml_common.hpp:771
static const Register K2()
Factory method for a register.
Definition: fcml_common.hpp:3830
Definition: fcml_assembler.hpp:39
Operand & operator[](fcml_int index)
Gets reference to the operand at given index.
Definition: fcml_common.hpp:7263
fcml_bool is_default_reg
Set to true if given segment register is a default one in given context.
Definition: fcml_common.h:625
const Register & getOpmaskReg() const
Gets constant AVX-512 opmask register for {k} decorator.
Definition: fcml_common.hpp:5105
Integer operator+(const Integer &src) const
Addition operator.
Definition: fcml_common.hpp:1265
static Operand offw(const Integer &offset)
Factory method which builds an offset based address operand with word size operator.
Definition: fcml_common.hpp:5906
static const Register XMM1()
Factory method for a register.
Definition: fcml_common.hpp:1918
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:8686
Offset should be encoded as relative address.
Definition: fcml_common.h:725
static const InstructionPrefix NOBRANCH_HINT()
Creates instruction prefix: NOBRANCH_HINT.
Definition: fcml_common.hpp:392
Decorators & setOpmaskReg(const Register &opmaskReg)
Sets AVX-512 opmask register for {k} decorator.
Definition: fcml_common.hpp:5052
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:6406
#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:8725
static const Register YMM21()
Factory method for a register.
Definition: fcml_common.hpp:3190
static const Register DS()
Factory method for a register.
Definition: fcml_common.hpp:3540
static Operand imm(const Integer &imm)
Factory method which builds an immediate operand.
Definition: fcml_common.hpp:5833
IB & directPtr()
Sets a hint described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7814
#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:4914
Wraps instruction hint and exposes factory methods for instruction hints.
Definition: fcml_common.hpp:402
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:6320
bool getX64Exp() const
Gets true if it's a 8-bit general purpose register for REX aware instruction.
Definition: fcml_common.hpp:1736
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:8292
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:771
void clean()
Cleans the instruction by removing all operands from it.
Definition: fcml_common.hpp:7272
bool isBE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6752
const Integer & getOffset() const
Gets the constant offset associated with the address.
Definition: fcml_common.hpp:4904
OperandType getOperandType() const
Gets operand type.
Definition: fcml_common.hpp:5587
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:6298
EffectiveAddress & setDisplacement(const Integer &displacement)
Sets a new displacement value for the effective address.
Definition: fcml_common.hpp:4526
static const Register XMM3()
Factory method for a register.
Definition: fcml_common.hpp:2078
FarPointer & getFarPointer()
Gets a reference to the far pointer instance associated with the address.
Definition: fcml_common.hpp:5533
IB & indirectPtr()
Sets a hint described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7793
bool operator==(const FarPointer &fp) const
Compares two far pointers.
Definition: fcml_common.hpp:3953
fcml_uint16_t getSegment() const
Gets segment selector.
Definition: fcml_common.hpp:4078
Offset should be encoded as absolute address.
Definition: fcml_common.h:721
static const Register XMM10()
Factory method for a register.
Definition: fcml_common.hpp:2650
static const Register BP()
Factory method for a register.
Definition: fcml_common.hpp:2219
static const Register AX()
Factory method for a register.
Definition: fcml_common.hpp:1798
bool isNZ() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6733
static const Register R14W()
Factory method for a register.
Definition: fcml_common.hpp:2900
static const InstructionPrefix BRANCH_HINT()
Creates instruction prefix: BRANCH_HINT.
Definition: fcml_common.hpp:385
static Integer int32(fcml_int32_t value)
Factory method which creates an insatnce fo the Integer for given parameter.
Definition: fcml_common.hpp:1353
static const Register XMM27()
Factory method for a register.
Definition: fcml_common.hpp:3360
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:6056
static const Register YMM0()
Factory method for a register.
Definition: fcml_common.hpp:1848
Integer operator-(const Integer &src) const
Subtraction operator.
Definition: fcml_common.hpp:1276
IB & repe()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7921
Structure describes x86_64 register.
Definition: fcml_common.h:450
Base exception for all exceptions exposed by FCML library.
Definition: fcml_common.hpp:187
static const InstructionPrefix REPNZ()
Creates instruction prefix: REPNZ.
Definition: fcml_common.hpp:343
Instruction operand.
Definition: fcml_common.hpp:5184
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:6432
Hints instruction to use DIRECT memory addressing.
Definition: fcml_common.h:775
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:3995
static const Register MM2()
Factory method for a register.
Definition: fcml_common.hpp:1988
void setOffset16(fcml_int16_t offset16)
Sets 16-bit offset.
Definition: fcml_common.hpp:4048
static const Register R14D()
Factory method for a register.
Definition: fcml_common.hpp:2910
static const Register MM4()
Factory method for a register.
Definition: fcml_common.hpp:2158
fcml_bool sae
Indicates support for SAE (Suppress All Exceptions).
Definition: fcml_common.h:667
static const Register RBX()
Factory method for a register.
Definition: fcml_common.hpp:2058
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:6181
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:4417
static const Register ST3()
Factory method for a register.
Definition: fcml_common.hpp:3600
bool operator!=(const Address &address) const
Checks if two addresses are equal or not.
Definition: fcml_common.hpp:4778
fcml_usize getAddressSizeAttribute() const
Gets address size attribute held by the entry point.
Definition: fcml_common.hpp:601
bool isNE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6714
static Integer uint32(fcml_uint32_t value)
Factory method which creates an insatnce fo the Integer for given parameter.
Definition: fcml_common.hpp:1363
IB & operandRelativeHint()
Marks the lastly added address operand as a relative one.
Definition: fcml_common.hpp:8076
bool operator==(const Operand &op) const
Checks if two operands are equal or not.
Definition: fcml_common.hpp:5275
static const Condition L()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6951
3 Below or equal
Definition: fcml_common.h:481
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:8305
fcml_en_condition_type
Condition type.
Definition: fcml_common.h:473
IB & repz()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7942
Represents integer value.
Definition: fcml_common.hpp:700
static const Register K1()
Factory method for a register.
Definition: fcml_common.hpp:3820
static const Register DR5()
Factory method for a register.
Definition: fcml_common.hpp:3750
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:6263
static const OperandHint ABSOLUTE_ADDRESSING()
Creates operand level hint: ABSOLUTE_ADDRESSING.
Definition: fcml_common.hpp:499
bool isRepne() const
Returns true if repne prefix is set.
Definition: fcml_common.hpp:7442
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:6392
bool operator==(const fcml_int16_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:860
bool operator!=(const FarPointer &fp) const
Compares two far pointers.
Definition: fcml_common.hpp:3981
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:6128
Decorators & getDecorators()
Gets decorators associated with the operand.
Definition: fcml_common.hpp:5673
static const Register YMM10()
Factory method for a register.
Definition: fcml_common.hpp:2660
static const InstructionHint DIRECT_PTR()
Creates a hint instance described by the name of the method.
Definition: fcml_common.hpp:7805
fcml_st_register reg
Register operand.
Definition: fcml_common.h:747
static const Register XMM24()
Factory method for a register.
Definition: fcml_common.hpp:3270
fcml_en_operating_mode op_mode
Processor operating mode 16/32/64-bit.
Definition: fcml_common.h:826
IB & longFormPtr()
Sets a hint described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7772
fcml_usize getSize() const
Gets the register size.
Definition: fcml_common.hpp:1700
static EffectiveAddress addr(const Integer &displacement)
Factory method which creates an effective address instance with the displacement only.
Definition: fcml_common.hpp:4398
static const Register ZMM14()
Factory method for a register.
Definition: fcml_common.hpp:2950
static const Register XMM15()
Factory method for a register.
Definition: fcml_common.hpp:3000
Operand not used.
Definition: fcml_common.h:675
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:6609
static const InstructionHint INDIRECT_POINTER()
Creates instruction hint: INDIRECT_POINTER.
Definition: fcml_common.hpp:444
FPU register.
Definition: fcml_common.h:434
static const Register EIP()
Factory method for a register.
Definition: fcml_common.hpp:3790
bool operator==(const Decorators &decorators) const
Checks if two decorators containers are equal or not.
Definition: fcml_common.hpp:5147
static const OperandHint UNDEFIEND()
Creates operand level hint: UNDEFIEND.
Definition: fcml_common.hpp:471
static const Register R15()
Factory method for a register.
Definition: fcml_common.hpp:2990
fcml_int8_t getInt8() const
Definition: fcml_common.hpp:788
Processor register.
Definition: fcml_common.h:683
fcml_prefixes prefixes
Describes explicit instruction prefixes.
Definition: fcml_common.h:786
Integer(fcml_uint16_t value)
Definition: fcml_common.hpp:734
static const OperandHint RELATIVE_ADDRESSING()
Creates operand level hint: RELATIVE_ADDRESSING.
Definition: fcml_common.hpp:506
fcml_st_register base
GPR base register.
Definition: fcml_common.h:607
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:4350
static const Condition C()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6647
static const Register XMM6()
Factory method for a register.
Definition: fcml_common.hpp:2349
fcml_prefixes getPrefixes() const
Gets prefixes associated with the instruction.
Definition: fcml_common.hpp:7408
static const Register CR4()
Factory method for a register.
Definition: fcml_common.hpp:3680
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:6067
IB & far_ptr(const FarPointer &pointer)
Adds a far pointer operand.
Definition: fcml_common.hpp:8144
static Integer int64(fcml_int64_t value)
Factory method which creates an insatnce fo the Integer for given parameter.
Definition: fcml_common.hpp:1373
void imm(const Integer &imm)
Sets given immediate value for the operand and makes it to be an immediate operand.
Definition: fcml_common.hpp:5330
FarPointer()
Creates an far pointer instance.
Definition: fcml_common.hpp:3910
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:8545
void op(const Operand &operand)
Sets a next operand for the instruction.
Definition: fcml_common.hpp:7694
bool operator==(const fcml_uint32_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:871
FarPointer(fcml_uint16_t segment, fcml_int16_t offset16)
Creates an far pointer instance.
Definition: fcml_common.hpp:3923
const Integer & getDisplacement() const
Gets the constant displacement associated with the effective address.
Definition: fcml_common.hpp:4505
static const Condition NL()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6989
fcml_usize address_size_attribute
Default address size attribute (See 'D' flag of segment descriptor.)
Definition: fcml_common.h:828
static const Register R9D()
Factory method for a register.
Definition: fcml_common.hpp:2560
Operand & setHints(fcml_hints hints)
Sets new operand level hits for the operand.
Definition: fcml_common.hpp:5652
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:8699
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:8230
fcml_bool isSae() const
Gets AVX-512 {sae} decorator.
Definition: fcml_common.hpp:5135
EffectiveAddress(const Register &base, const Register &index)
Creates an effective address instance with the base register and index register.
Definition: fcml_common.hpp:4323
bool isDirectPointer() const
Returns true if direct pointer hint is set.
Definition: fcml_common.hpp:7559
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:5926
Operand & setFarPointer(const FarPointer &farPointer)
Sets a new far pointer for the operand.
Definition: fcml_common.hpp:5544
static const Register XMM16()
Factory method for a register.
Definition: fcml_common.hpp:3030
static const InstructionPrefix BRANCH()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:7996
static Operand far_ptr(fcml_uint16_t seg, fcml_int32_t addr)
Factory method which builds a far pointer operand.
Definition: fcml_common.hpp:5855
static const Register YMM2()
Factory method for a register.
Definition: fcml_common.hpp:2008
Integer(fcml_uint32_t value)
Definition: fcml_common.hpp:739
bool isS() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6828
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:5947
fcml_int64_t fcml_ip
General instruction pointer holder.
Definition: fcml_common.h:96
bool operator==(const fcml_uint16_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:849
static const Register CR0()
Factory method for a register.
Definition: fcml_common.hpp:3650
Debug register.
Definition: fcml_common.h:440
AddressForm
Addressing type, see fcml_en_address_form enumerator.
Definition: fcml_common.hpp:4608
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:8572
static const Register DR6()
Factory method for a register.
Definition: fcml_common.hpp:3760
Protected/Compatibility mode when 'D' segment descriptor flag is set to 1.
Definition: fcml_common.h:78
Condition()
Creates an empty condition.
Definition: fcml_common.hpp:6500
static const Register MM7()
Factory method for a register.
Definition: fcml_common.hpp:2430
bool operator!=(const fcml_uint16_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:948
Immediate integer value.
Definition: fcml_common.h:677
bool isZ() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6695
EffectiveAddress(const Register &base, const Integer &displacement)
Creates an effective address instance with the base register and displacement only.
Definition: fcml_common.hpp:4298
virtual ~Integer()
Definition: fcml_common.hpp:749
fcml_hints hints
Holds instruction level hints.
Definition: fcml_common.h:788
static const Condition NC()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6666
Absolute offset (address).
Definition: fcml_common.h:580
fcml_ip getIP() const
Gets instruction pointer held by the entry point.
Definition: fcml_common.hpp:641
static const Register SIL()
Factory method for a register.
Definition: fcml_common.hpp:2299
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:6011
static const Register RDI()
Factory method for a register.
Definition: fcml_common.hpp:2420
const Operand & operator[](fcml_int index) const
Gets reference to the constant operand at given index.
Definition: fcml_common.hpp:7251
static const Register MM0()
Factory method for a register.
Definition: fcml_common.hpp:1828
fcml_hints hints
Optional operand level hints.
Definition: fcml_common.h:739
void setDefaultReg(bool isDefaultReg)
Sets "default" flag for the segment selector.
Definition: fcml_common.hpp:4214
Integer & getDisplacement()
Gets the displacement associated with the effective address.
Definition: fcml_common.hpp:4515
bool operator!=(const Nullable &nullable) const
Checks if two nullable values are not equal.
Definition: fcml_common.hpp:172
static const Register ST5()
Factory method for a register.
Definition: fcml_common.hpp:3620
bool isB() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6562
bool isEffectiveAddress() const
Returns true if address holds effective address.
Definition: fcml_common.hpp:4829
bool operator!=(const EntryPoint &ep) const
Checks if two entry points are not equal.
Definition: fcml_common.hpp:589
Integer(fcml_int64_t value)
Definition: fcml_common.hpp:724
SIMD operand.
Definition: fcml_common.h:705
static const Register YMM16()
Factory method for a register.
Definition: fcml_common.hpp:3040
fcml_int operands_count
Number of operands defined for instruction.
Definition: fcml_common.h:800
Integer()
Definition: fcml_common.hpp:704
#define FCML_PREFIX_XRELEASE
XRELEASE prefix (0xF3)
Definition: fcml_common.h:62
fcml_st_address address
Effective address or absolute offset.
Definition: fcml_common.h:745
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:6419
SegmentSelector()
Creates an empty segment selector instance.
Definition: fcml_common.hpp:4116
static const Condition LE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:7027
static const Register BX()
Factory method for a register.
Definition: fcml_common.hpp:2038
static const Register ZMM26()
Factory method for a register.
Definition: fcml_common.hpp:3350
fcml_int32_t getOffset32() const
Gets 32-bit offset.
Definition: fcml_common.hpp:4058
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:4689
const FarPointer & getFarPointer() const
Gets a reference to the constant far pointer instance associated with the address.
Definition: fcml_common.hpp:5523
OperatingMode getOpMode() const
Gets processor operating mode.
Definition: fcml_common.hpp:661
static const InstructionHint NEAR_POINTER()
Creates instruction hint: NEAR_POINTER.
Definition: fcml_common.hpp:423
IB & imm(const Integer &imm)
Adds an immediate operand.
Definition: fcml_common.hpp:8106
bool isL() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6942
static const InstructionPrefix XRELEASE()
Creates instruction prefix: XRELEASE.
Definition: fcml_common.hpp:378
bool isFarPointer() const
Returns true if far pointer hint is set.
Definition: fcml_common.hpp:7523
static const OperandHint PSEUDO_OPCODE()
Creates operand level hint: PSEUDO_OPCODE.
Definition: fcml_common.hpp:492
static const Condition G()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:7084
Condition & setNegation(bool isNegation)
Sets negation flag for the condition.
Definition: fcml_common.hpp:7152
fcml_bool z
Zeroing masking.
Definition: fcml_common.h:661
static const Register R13L()
Factory method for a register.
Definition: fcml_common.hpp:2820
Undefined.
Definition: fcml_common.h:699
bool operator!=(const Decorators &decorators) const
Checks if two decorators are equal or not.
Definition: fcml_common.hpp:5164
Undefined register type.
Definition: fcml_common.h:428
bool operator==(const Nullable &nullable) const
Checks if two nullable values are equal.
Definition: fcml_common.hpp:160
bool isNAE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6600
static const InstructionHint FAR_PTR()
Creates a hint instance described by the name of the method.
Definition: fcml_common.hpp:7721
Operand(const Integer &imm, fcml_hints hints=FCML_OP_HINT_UNDEFIEND)
Creates an immediate value operand for given integer.
Definition: fcml_common.hpp:5221
static const Condition NG()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:7046
fcml_st_effective_address effective_address
Memory address for FCML_AF_COMBINED form.
Definition: fcml_common.h:641
Operand(const FarPointer &pointer, fcml_hints hints=FCML_OP_HINT_UNDEFIEND)
Creates a far pointer operand for given far pointer.
Definition: fcml_common.hpp:5234
static const Register XMM22()
Factory method for a register.
Definition: fcml_common.hpp:3210
Integer(fcml_uint64_t value)
Definition: fcml_common.hpp:744
OperatingMode
Supported operating modes.
Definition: fcml_common.hpp:531
SegmentSelector(const Register &segmentSelector, bool isDefaultReg=FCML_TRUE)
Creates a segment selector instance for given parameters.
Definition: fcml_common.hpp:4127
bool operator==(const fcml_int8_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:838
static const Register YMM15()
Factory method for a register.
Definition: fcml_common.hpp:3010
static const Register ZMM6()
Factory method for a register.
Definition: fcml_common.hpp:2369
General purpose register.
Definition: fcml_common.hpp:1612
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:4428
static const OperandHint SIB_ENCODING()
Creates operand level hint: SIB_ENCODING.
Definition: fcml_common.hpp:513
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:6251
static const InstructionHint FAR_POINTER()
Creates instruction hint: FAR_POINTER.
Definition: fcml_common.hpp:430
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:7654
static const Register XMM7()
Factory method for a register.
Definition: fcml_common.hpp:2440
static const Register K3()
Factory method for a register.
Definition: fcml_common.hpp:3840
static const Register BL()
Factory method for a register.
Definition: fcml_common.hpp:2028
fcml_uint8_t scale_factor
Scale factor 1,2,4 or 8.
Definition: fcml_common.h:611
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:8648
Holds operand decorators.
Definition: fcml_common.hpp:5001
bool isLongFormPointer() const
Returns true if long form pointer hint is set.
Definition: fcml_common.hpp:7541
static const Register XMM5()
Factory method for a register.
Definition: fcml_common.hpp:2259
static const Register CS()
Factory method for a register.
Definition: fcml_common.hpp:3520
void setReg(fcml_uint8_t reg)
Sets the register number.
Definition: fcml_common.hpp:1691
Address()
Creates an empty address.
Definition: fcml_common.hpp:4621
Integer & setInt16(fcml_int16_t int16)
Definition: fcml_common.hpp:760
Operand(const Register ®, fcml_hints hints=FCML_OP_HINT_UNDEFIEND)
Creates a new register operand for given register.
Definition: fcml_common.hpp:5260
fcml_st_far_pointer far_pointer
Far pointer operand.
Definition: fcml_common.h:743
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:5247
static const Register AL()
Factory method for a register.
Definition: fcml_common.hpp:1788
IB & offd(const Integer &offset)
Adds an offset based address operand with double word size operator.
Definition: fcml_common.hpp:8205
static const Register SP()
Factory method for a register.
Definition: fcml_common.hpp:2128
static const Register ZMM18()
Factory method for a register.
Definition: fcml_common.hpp:3110
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:8781
static const Register YMM24()
Factory method for a register.
Definition: fcml_common.hpp:3280
static const Register R15D()
Factory method for a register.
Definition: fcml_common.hpp:2980
bool isNearPointer() const
Returns true if near pointer hint is set.
Definition: fcml_common.hpp:7532
Condition & setConditionType(ConditionType conditionType)
Sets condition type.
Definition: fcml_common.hpp:7131
static const Register YMM25()
Factory method for a register.
Definition: fcml_common.hpp:3310
Default value set if memory addressing hasn't been configured.
Definition: fcml_common.h:578
Decorators & setEr(const Nullable< EmbeededRoundingControl > &er)
Sets AVX-512 {er} decorator.
Definition: fcml_common.hpp:5063
EmbeededRoundingControl
Rounding mode.
Definition: fcml_common.hpp:5007
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:6203
bool isG() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:7075
Register(const fcml_st_register ®)
Creates a register instance for given register structure.
Definition: fcml_common.hpp:1647
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:4646
static const Register ZMM4()
Factory method for a register.
Definition: fcml_common.hpp:2188
static const Register XMM25()
Factory method for a register.
Definition: fcml_common.hpp:3300
#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:2168
void far_ptr(const FarPointer &pointer)
Prepares far pointer operand for given far pointer.
Definition: fcml_common.hpp:5365
bool operator!=(const fcml_uint8_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:926
fcml_int16_t off16
Place for 16-bit absolute offset.
Definition: fcml_common.h:595
static const Register YMM28()
Factory method for a register.
Definition: fcml_common.hpp:3400
Instruction condition.
Definition: fcml_common.hpp:6470
static const Condition AE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6628
EffectiveAddress & setBase(const Register &base)
Sets a new base register for the effective address.
Definition: fcml_common.hpp:4494
static const Register ST7()
Factory method for a register.
Definition: fcml_common.hpp:3640
IB(const fcml_cstring &mnemonic, fcml_hints hints)
Creates an instruction builder for given mnemonic and hints.
Definition: fcml_common.hpp:7639
virtual ~EffectiveAddress()
Definition: fcml_common.hpp:4360
Register & getOpmaskReg()
Gets AVX-512 opmask register for {k} decorator.
Definition: fcml_common.hpp:5115
Operand & setOperandType(OperandType operandType)
Sets a new operand type.
Definition: fcml_common.hpp:5598
Decorators()
Creates an empty operand decorators container.
Definition: fcml_common.hpp:5018
AddressForm getAddressForm() const
Gets an address form.
Definition: fcml_common.hpp:4849
bool operator!=(const fcml_int64_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:1003
ConditionType getConditionType() const
Gets a type of the condition.
Definition: fcml_common.hpp:7121
EffectiveAddress & setIndex(const Register &index)
Sets a new index register for the effective address.
Definition: fcml_common.hpp:4558
bool operator!=(const fcml_uint64_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:992
Integer(fcml_int16_t value)
Definition: fcml_common.hpp:714
static const Register RCX()
Factory method for a register.
Definition: fcml_common.hpp:1898
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:6077
static const Register RSP()
Factory method for a register.
Definition: fcml_common.hpp:2148
bool isLE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:7018
static const Register ST4()
Factory method for a register.
Definition: fcml_common.hpp:3610
static const Register SPL()
Factory method for a register.
Definition: fcml_common.hpp:2118
IB & far_ptr(fcml_uint16_t seg, fcml_int16_t addr)
Adds a far pointer operand.
Definition: fcml_common.hpp:8119
EffectiveAddress(const Integer &displacement)
Creates an effective address instance with the displacement only.
Definition: fcml_common.hpp:4277
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:4449
Hints instruction to use INDIRECT pointer to address the memory.
Definition: fcml_common.h:773
bool isNLE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:7056
7 Less than or equal to
Definition: fcml_common.h:489
Operand & setAddress(const Address &address)
Sets a new address for the operand.
Definition: fcml_common.hpp:5512
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:4660
static const Register R10L()
Factory method for a register.
Definition: fcml_common.hpp:2610
static const Register ZMM5()
Factory method for a register.
Definition: fcml_common.hpp:2279
static const Register XMM11()
Factory method for a register.
Definition: fcml_common.hpp:2720
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:6170
static const Condition NS()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6856
static const Register R8()
Factory method for a register.
Definition: fcml_common.hpp:2500
SIMD (SSE, MMX) register.
Definition: fcml_common.h:432
bool isNGE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6961
bool operator!=(const fcml_uint32_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:970
fcml_en_instruction_hints
Instruction level hints.
Definition: fcml_common.h:762
Definition: fcml_types.h:257
static const Register K5()
Factory method for a register.
Definition: fcml_common.hpp:3860
static const Register YMM23()
Factory method for a register.
Definition: fcml_common.hpp:3250
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:8509
bool isPO() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6923
static const Register ZMM31()
Factory method for a register.
Definition: fcml_common.hpp:3500
static const Register R13W()
Factory method for a register.
Definition: fcml_common.hpp:2830
Operand()
Creates an undefined operand.
Definition: fcml_common.hpp:5209
static const Register EAX()
Factory method for a register.
Definition: fcml_common.hpp:1808
static const Register K6()
Factory method for a register.
Definition: fcml_common.hpp:3870
static const Register K0()
Factory method for a register.
Definition: fcml_common.hpp:3810
Integer(fcml_int32_t value)
Definition: fcml_common.hpp:719
static const Condition NA()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6780
Instruction build() const
Builds an instruction instance for the current state of the builder.
Definition: fcml_common.hpp:7676
IB & addrw(const EffectiveAddress &effectiveAddress)
Adds an address type operand for given effective address and word size operator.
Definition: fcml_common.hpp:8254
Direct far pointer.
Definition: fcml_common.h:679
const Register & getIndex() const
Gets the constant index register associated with the effective address.
Definition: fcml_common.hpp:4537
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:5937
static const Register R11D()
Factory method for a register.
Definition: fcml_common.hpp:2700
void setSize(fcml_usize size)
Sets the register size.
Definition: fcml_common.hpp:1709
static const Register FS()
Factory method for a register.
Definition: fcml_common.hpp:3550
Condition & getCondition()
Gets a pointer to the condition associated with the instruction.
Definition: fcml_common.hpp:7298
Real-addressing mode, virtual 8086 mode.
Definition: fcml_common.h:75
IB & addr(const Address &address)
Adds an address operand.
Definition: fcml_common.hpp:8156
bool isNC() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6657
static const Register CR2()
Factory method for a register.
Definition: fcml_common.hpp:3660
IB & reg(const Register ®)
Adds an an register based operator for given register.
Definition: fcml_common.hpp:8356
static const Register YMM22()
Factory method for a register.
Definition: fcml_common.hpp:3220
bool operator==(const fcml_int64_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:904
IB & effb(const Integer &displacement)
Adds an an effective address based operator for a displacement and byte size operator.
Definition: fcml_common.hpp:8395
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:4336
Hints instruction to use NEAR pointer to address the memory.
Definition: fcml_common.h:768
SegmentSelector & operator=(const SegmentSelector ®)
Copies one segment selector to another.
Definition: fcml_common.hpp:4173
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:6227
Not an operand in a strict sense, only a container for attributes.
Definition: fcml_common.h:688
fcml_int getOperandsCount() const
Gets number of operands associated with the instruction.
Definition: fcml_common.hpp:7386
fcml_st_operand operands[FCML_OPERANDS_COUNT]
Fixed size array of instruction operands.
Definition: fcml_common.h:798
IB & offw(const Integer &offset)
Adds an offset based address operand with word size operator.
Definition: fcml_common.hpp:8193
bool isLock() const
Returns true if lock prefix is set.
Definition: fcml_common.hpp:7433
bool isIndirectPointer() const
Returns true if indirect pointer hint is set.
Definition: fcml_common.hpp:7550
fcml_int16_t getInt16() const
Definition: fcml_common.hpp:755
static const InstructionPrefix REP()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:7891
void setOpMode(OperatingMode opMode)
Sets a new processor operating mode for the entry point.
Definition: fcml_common.hpp:671
bool isReg() const
Returns true if operand is a register operand.
Definition: fcml_common.hpp:5461
Describes an instruction.
Definition: fcml_common.hpp:7185
bool operator!=(const Integer &value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:1014
Instruction operand.
Definition: fcml_common.h:735
static const InstructionHint DIRECT_POINTER()
Creates instruction hint: DIRECT_POINTER.
Definition: fcml_common.hpp:451
fcml_usize offset_size
Size of the offset.
Definition: fcml_common.h:560
Wraps instruction prefix and prepares factory methods for the hints.
Definition: fcml_common.hpp:312
static const Register XMM21()
Factory method for a register.
Definition: fcml_common.hpp:3180
static const Register ZMM27()
Factory method for a register.
Definition: fcml_common.hpp:3380
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:8331
bool isRepe() const
Returns true if repe prefix is set.
Definition: fcml_common.hpp:7469
Instruction & setPrefixes(fcml_prefixes prefixes)
Sets a new set of prefixes for the instruction.
Definition: fcml_common.hpp:7419
static const Register R13()
Factory method for a register.
Definition: fcml_common.hpp:2850
static const Register R10W()
Factory method for a register.
Definition: fcml_common.hpp:2620
bool isImm() const
Returns true if operand is an immediate value operand.
Definition: fcml_common.hpp:5451
bool isE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6676
static const Register CL()
Factory method for a register.
Definition: fcml_common.hpp:1868
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:6331
static const Register R8W()
Factory method for a register.
Definition: fcml_common.hpp:2480
Register & getSegmentSelector()
Gets segment register associated with the selector.
Definition: fcml_common.hpp:4234
static const Register BPL()
Factory method for a register.
Definition: fcml_common.hpp:2209
static const Condition NE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6723
static const OperandHint DISPLACEMENT_RELATIVE_ADDRESS()
Creates operand level hint: DISPLACEMENT_RELATIVE_ADDRESS.
Definition: fcml_common.hpp:485
#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:4407
static const Register BH()
Factory method for a register.
Definition: fcml_common.hpp:2380
Instruction & setMnemonic(const fcml_cstring &mnemonic)
Sets a new mnemonic for the instruction.
Definition: fcml_common.hpp:7375
bool isDisRelativeAddress() const
Returns true if it's an displacement relative address.
Definition: fcml_common.hpp:5708
Operation succeed.
Definition: fcml_errors.h:42
static const Register R8D()
Factory method for a register.
Definition: fcml_common.hpp:2490
fcml_st_register segment_selector
Used segment register.
Definition: fcml_common.h:621
static const Register R8L()
Factory method for a register.
Definition: fcml_common.hpp:2470
std::basic_ostringstream< fcml_char > fcml_costream
String output stream.
Definition: fcml_common.hpp:59
fcml_bool is_signed
True if offset should be treated as signed value.
Definition: fcml_common.h:593
Address & setAddressForm(AddressForm addressForm)
Sets a new address form for the effective address.
Definition: fcml_common.hpp:4861
fcml_usize size
Register size in bits.
Definition: fcml_common.h:454
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:4793
void setOffset32(fcml_int32_t offset32)
Sets 32-bit offset.
Definition: fcml_common.hpp:4068
static const Register YMM26()
Factory method for a register.
Definition: fcml_common.hpp:3340
fcml_uint8_t getScaleFactor() const
Gets a scale factor value associated with the effective address.
Definition: fcml_common.hpp:4569
static const Register ZMM3()
Factory method for a register.
Definition: fcml_common.hpp:2098
Instruction & setHints(fcml_hints hints)
Sets new instruction hints.
Definition: fcml_common.hpp:7331
fcml_bool is_conditional
True for conditional instructions.
Definition: fcml_common.h:793
No hints defined.
Definition: fcml_common.h:764
Bad arguments.
Definition: fcml_common.hpp:242
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:6458
bool operator==(const Register ®) const
Compares registers.
Definition: fcml_common.hpp:1757
static const Register ZMM20()
Factory method for a register.
Definition: fcml_common.hpp:3170
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:8521
const Register & getBase() const
Gets the constant base register associated with the effective address.
Definition: fcml_common.hpp:4473
static const InstructionPrefix REPE()
Creates instruction prefix: REPE.
Definition: fcml_common.hpp:357
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:6107
static const Register EBX()
Factory method for a register.
Definition: fcml_common.hpp:2048
bool operator!=(const SegmentSelector &segmentSelector) const
Checks if two segment selector are not equal.
Definition: fcml_common.hpp:4154
const SegmentSelector & getSegmentSelector() const
Gets the constant segment selector associated with the address.
Definition: fcml_common.hpp:4936
Decorators & setSae(const fcml_bool sae)
Sets AVX-512 {sae} decorator.
Definition: fcml_common.hpp:5074
Representation of far pointer operand.
Definition: fcml_common.h:556
OperandType
See fcml_en_operand_type structure for more details.
Definition: fcml_common.hpp:5190
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:5438
static const Register XMM19()
Factory method for a register.
Definition: fcml_common.hpp:3120
IB & xrelease()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7984
IB & addrd(const EffectiveAddress &effectiveAddress)
Adds an address type operand for given effective address and double word size operator.
Definition: fcml_common.hpp:8266
Effective address.
Definition: fcml_common.h:605
fcml_st_register index
GPR index register.
Definition: fcml_common.h:609
static const Register XMM8()
Factory method for a register.
Definition: fcml_common.hpp:2510
static const Condition E()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6685
static const Register ZMM30()
Factory method for a register.
Definition: fcml_common.hpp:3470
static const Register R11()
Factory method for a register.
Definition: fcml_common.hpp:2710
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:6148
bool isA() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6809
fcml_usize getOperandSizeAttribute() const
Gets operand size attribute held by the entry point.
Definition: fcml_common.hpp:621
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:6087
static const Register YMM17()
Factory method for a register.
Definition: fcml_common.hpp:3070
Describes address of an instruction code.
Definition: fcml_common.h:824
4 Sign
Definition: fcml_common.h:483
const Register & getSegmentSelector() const
Gets constant segment register associated with the selector.
Definition: fcml_common.hpp:4224
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:8533
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:6356
bool isNO() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6543
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:4748
Operand & setDecorators(const Decorators &decorators)
Sets new operand decorators for the operand.
Definition: fcml_common.hpp:5684
Address & setEffectiveAddress(const EffectiveAddress &effectiveAddress)
Sets a new effective address for the address.
Definition: fcml_common.hpp:4893
void far_ptr(fcml_uint16_t seg, fcml_int32_t addr)
Prepares far pointer operand for given components.
Definition: fcml_common.hpp:5354
static const InstructionPrefix REPE()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:7912
static const Register YMM1()
Factory method for a register.
Definition: fcml_common.hpp:1928
static const InstructionPrefix REP()
Creates instruction prefix: REP.
Definition: fcml_common.hpp:350
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:8473
static const Register MM5()
Factory method for a register.
Definition: fcml_common.hpp:2249
static const Register XMM14()
Factory method for a register.
Definition: fcml_common.hpp:2930
static const Register R15W()
Factory method for a register.
Definition: fcml_common.hpp:2970
fcml_uint16_t fcml_prefixes
Type for explicit instruction prefixes bit mask.
Definition: fcml_common.h:91
EffectiveAddress & getEffectiveAddress()
Gets reference to the effective address associated with the address.
Definition: fcml_common.hpp:4882
fcml_usize getOffsetSize() const
Gets offset size.
Definition: fcml_common.hpp:4018
Operation is not supported.
Definition: fcml_common.hpp:275
Memory address.
Definition: fcml_common.h:681
Generic memory addressing operator.
Definition: fcml_common.h:631
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:8371
static const Register ZMM23()
Factory method for a register.
Definition: fcml_common.hpp:3260
static const Register ZMM1()
Factory method for a register.
Definition: fcml_common.hpp:1938
static const Register MM3()
Factory method for a register.
Definition: fcml_common.hpp:2068
static const Register ZMM0()
Factory method for a register.
Definition: fcml_common.hpp:1858
bool isAbsoluteAddressing() const
Returns true if it's an absolute offset being set in the operand.
Definition: fcml_common.hpp:5729
static const Register ZMM10()
Factory method for a register.
Definition: fcml_common.hpp:2670
static const Register XMM13()
Factory method for a register.
Definition: fcml_common.hpp:2860
static const Condition NB()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6590
void setOffsetSize(fcml_usize offsetSize)
Sets offset size.
Definition: fcml_common.hpp:4028
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:5342
Global error handling related declarations.
static const Register XMM12()
Factory method for a register.
Definition: fcml_common.hpp:2790
static const Register ZMM8()
Factory method for a register.
Definition: fcml_common.hpp:2530
static const Register ST2()
Factory method for a register.
Definition: fcml_common.hpp:3590
static const Register YMM14()
Factory method for a register.
Definition: fcml_common.hpp:2940
static const Register ZMM24()
Factory method for a register.
Definition: fcml_common.hpp:3290
bool operator!=(const fcml_int32_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:981
static const Register CR8()
Factory method for a register.
Definition: fcml_common.hpp:3690
Register & getRegister()
Returns a reference to the register associated with the operand.
Definition: fcml_common.hpp:5619
IB & repne()
Sets a prefix described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7858
#define FCML_PREFIX_REP
REP prefix (0xF3)
Definition: fcml_common.h:54
static const Register R15L()
Factory method for a register.
Definition: fcml_common.hpp:2960
void off(const Integer &offset, fcml_usize sizeOperator=FCML_DS_UNDEF)
Prepares address operand for given offset.
Definition: fcml_common.hpp:5388
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:6192
static const Register K7()
Factory method for a register.
Definition: fcml_common.hpp:3880
static const Register R12D()
Factory method for a register.
Definition: fcml_common.hpp:2770
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:5957
IB & addrq(const EffectiveAddress &effectiveAddress)
Adds an address type operand for given effective address and quadro word size operator.
Definition: fcml_common.hpp:8278
RegisterType
Register types.
Definition: fcml_common.hpp:1608
Integer(fcml_uint8_t value)
Definition: fcml_common.hpp:729
static const InstructionHint NEAR_PTR()
Creates a hint instance described by the name of the method.
Definition: fcml_common.hpp:7742
fcml_usize size_operator
Size of data accessed in memory.
Definition: fcml_common.h:633
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:1662
fcml_nuint8_t bcast
Broadcasting: 2, 4, 8, 16, 32, 64.
Definition: fcml_common.h:659
Absolute offset.
Definition: fcml_common.h:589
IB & farPtr()
Sets a hint described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7730
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:5977
static const Register YMM11()
Factory method for a register.
Definition: fcml_common.hpp:2730
static Integer int16(fcml_int16_t value)
Factory method which creates an instance fo the Integer for given parameter.
Definition: fcml_common.hpp:1333
fcml_nuint8_t er
Embedded rounding control.
Definition: fcml_common.h:665
bool isGE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6999
Integer operator*(const Integer &src) const
Multiplication operator.
Definition: fcml_common.hpp:1287
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:6239
bool operator!=(const Operand &op) const
Checks if two operands are equal or not.
Definition: fcml_common.hpp:5310
static const Register RAX()
Factory method for a register.
Definition: fcml_common.hpp:1818
fcml_en_register type
Register type.
Definition: fcml_common.h:452
static const Register DR4()
Factory method for a register.
Definition: fcml_common.hpp:3740
static const Register ZMM16()
Factory method for a register.
Definition: fcml_common.hpp:3050
static const Register R14L()
Factory method for a register.
Definition: fcml_common.hpp:2890
fcml_st_condition condition
Describes condition used by assembled/disassembled conditional instruction.
Definition: fcml_common.h:796
static const InstructionPrefix XACQUIRE()
Creates instruction prefix: XACQUIRE.
Definition: fcml_common.hpp:371
static const Register DX()
Factory method for a register.
Definition: fcml_common.hpp:1958
Component can not be initialized correctly.
Definition: fcml_common.hpp:231
static const InstructionHint NO_HINTS()
Creates instruction hint: NO_HINTS.
Definition: fcml_common.hpp:416
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:8809
static const Register UNDEF()
Factory method for an undefined register.
Definition: fcml_common.hpp:1778
bool operator!=(const fcml_int8_t value) const
Checks if the integer is not equal to the passed value.
Definition: fcml_common.hpp:937
static const Register ZMM21()
Factory method for a register.
Definition: fcml_common.hpp:3200
Integer & getImmediate()
Gets a reference to the immediate value associated with the operand.
Definition: fcml_common.hpp:5565
static const Register R10()
Factory method for a register.
Definition: fcml_common.hpp:2640
static const InstructionPrefix LOCK()
Creates instruction prefix: LOCK.
Definition: fcml_common.hpp:329
static const Register ZMM13()
Factory method for a register.
Definition: fcml_common.hpp:2880
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:6380
static const Register EBP()
Factory method for a register.
Definition: fcml_common.hpp:2229
IB & offq(const Integer &offset)
Adds an offset based address operand with quadro word size operator.
Definition: fcml_common.hpp:8217
IB(fcml_prefixes prefixes, const fcml_cstring &mnemonic)
Creates builder for the given mnemonic and prefixes.
Definition: fcml_common.hpp:7625
static const Register R12L()
Factory method for a register.
Definition: fcml_common.hpp:2750
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:8497
const fcml_cstring & getMnemonic() const
Gets the mnemonic associated with the instruction.
Definition: fcml_common.hpp:7364
static const Register XMM0()
Factory method for a register.
Definition: fcml_common.hpp:1838
fcml_uint16_t fcml_ceh_error
All error codes should be held in variables of this type.
Definition: fcml_errors.h:156
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:5967
static const InstructionPrefix XACQUIRE()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:7954
static const Register RSI()
Factory method for a register.
Definition: fcml_common.hpp:2329
static Operand far_ptr(const FarPointer &pointer)
Factory method which builds a far pointer operand.
Definition: fcml_common.hpp:5865
static const Register YMM3()
Factory method for a register.
Definition: fcml_common.hpp:2088
static const InstructionPrefix REPNZ()
Creates a prefix instance described by the name of the method.
Definition: fcml_common.hpp:7870
static const Register ST1()
Factory method for a register.
Definition: fcml_common.hpp:3580
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:4461
IB & effb(const Register &base)
Adds an an effective address based operator for a base register and byte size operator.
Definition: fcml_common.hpp:8451
static Operand addr(const Address &address)
Factory method which builds an address operand.
Definition: fcml_common.hpp:5875
static const Register CR3()
Factory method for a register.
Definition: fcml_common.hpp:3670
fcml_en_operand_type type
Operand type.
Definition: fcml_common.h:737
static const Register ZMM17()
Factory method for a register.
Definition: fcml_common.hpp:3080
static const Condition BE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6761
static const Register R10D()
Factory method for a register.
Definition: fcml_common.hpp:2630
static const Register YMM5()
Factory method for a register.
Definition: fcml_common.hpp:2269
static const Condition NLE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:7065
static const Register ZMM19()
Factory method for a register.
Definition: fcml_common.hpp:3140
Describes effective address.
Definition: fcml_common.hpp:4261
static Integer uint8(fcml_uint8_t value)
Factory method which creates an instance fo the Integer for given parameter.
Definition: fcml_common.hpp:1323
Instruction & setConditional(bool isConditional)
Sets conditional flag for the instruction.
Definition: fcml_common.hpp:7353
static const Register ESI()
Factory method for a register.
Definition: fcml_common.hpp:2319
fcml_int32_t off32
Place for 32-bit absolute offset.
Definition: fcml_common.h:597
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:8753
static Integer int8(fcml_int8_t value)
Factory method which creates an instance fo the Integer for given parameter.
Definition: fcml_common.hpp:1313
bool operator==(const Condition &cond) const
Checks if two condition are equal.
Definition: fcml_common.hpp:7098
static const Register R11W()
Factory method for a register.
Definition: fcml_common.hpp:2690
static Operand undef()
Factory method which builds an empty operand.
Definition: fcml_common.hpp:5824
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:4735
bool isC() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6638
fcml_en_operand_hints
Operand hints.
Definition: fcml_common.h:695
IB & operandAbsoluteHint()
Marks the lastly added address operand as a absolute one.
Definition: fcml_common.hpp:8085
IB & addrb(const EffectiveAddress &effectiveAddress)
Adds an address type operand for given effective address and byte size operator.
Definition: fcml_common.hpp:8242
fcml_usize getSize() const
Definition: fcml_common.hpp:810
2 Equal
Definition: fcml_common.h:479
Object which shouldn't be copied can inherit from this class.
Definition: fcml_common.hpp:288
IB & nearPtr()
Sets a hint described by the name of the method for the instruction being built.
Definition: fcml_common.hpp:7751
bool isXAcquire() const
Returns true if xacquire prefix is set.
Definition: fcml_common.hpp:7487
static const Condition B()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6571
IB(const fcml_cstring &mnemonic)
Creates builder for the given mnemonic.
Definition: fcml_common.hpp:7611
static const Register SI()
Factory method for a register.
Definition: fcml_common.hpp:2309
static const OperandHint OP_RELATIVE_ADDRESSING()
Gets relative address hint for the operand.
Definition: fcml_common.hpp:8043
bool isP() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6866
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:8344
fcml_en_effective_address_form address_form
Memory addressing format: absolute offset/effective address.
Definition: fcml_common.h:637
static const Register MM6()
Factory method for a register.
Definition: fcml_common.hpp:2339
Address & setOffset(const Integer &offset)
Sets a new offset for the address.
Definition: fcml_common.hpp:4925
static const Register ZMM2()
Factory method for a register.
Definition: fcml_common.hpp:2018
1 Below
Definition: fcml_common.h:477
Register & getIndex()
Gets the index register associated with the effective address.
Definition: fcml_common.hpp:4547
bool isAE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6619
static const InstructionPrefix REPNE()
Creates instruction prefix: REPNE.
Definition: fcml_common.hpp:336
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:4700
fcml_st_offset offset
Memory address for FCML_AF_OFFSET form.
Definition: fcml_common.h:643
static const Register XMM29()
Factory method for a register.
Definition: fcml_common.hpp:3420
static const InstructionHint LONG_FORM_PTR()
Creates a hint instance described by the name of the method.
Definition: fcml_common.hpp:7763
void setOperand(const Operand &operand, fcml_int index)
Sets a new oeprand for the instruction at given index.
Definition: fcml_common.hpp:7237
bool isAddr() const
Returns true if operand is an address operand.
Definition: fcml_common.hpp:5471
Illegal argument exception.
Definition: fcml_common.hpp:264
static const Register YMM12()
Factory method for a register.
Definition: fcml_common.hpp:2800
static const Condition PE()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6894
static const Condition O()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6533
Pseudo opcode.
Definition: fcml_common.h:717
64-bit mode.
Definition: fcml_common.h:80
static const Condition NO()
Factory method which creates a condition of a given type.
Definition: fcml_common.hpp:6552
static const Register K4()
Factory method for a register.
Definition: fcml_common.hpp:3850
Undefined register type.
Definition: fcml_common.hpp:1610
bool operator==(const fcml_uint64_t value) const
Checks if the integer is equal to the passed value.
Definition: fcml_common.hpp:893
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:8611
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:6138
IB & operandMultimediaHint()
Marks the lastly added operand as a multimedia one.
Definition: fcml_common.hpp:8067
bool isNBE() const
Gets true the condition is of a given type.
Definition: fcml_common.hpp:6790
fcml_int64_t off64
Place for 64-bit absolute offset.
Definition: fcml_common.h:599
static const InstructionHint LONG_FORM_POINTER()
Creates instruction hint: LONG_FORM_POINTER.
Definition: fcml_common.hpp:437
Decorators & setZ(fcml_bool z)
Sets a new AVX-512 {z} decorator.
Definition: fcml_common.hpp:5029
Address & setSegmentSelector(const SegmentSelector &segmentSelector)
Sets a new segment selector for the address.
Definition: fcml_common.hpp:4957
static const Register DR2()
Factory method for a register.
Definition: fcml_common.hpp:3720
static const Register R9()
Factory method for a register.
Definition: fcml_common.hpp:2570
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:8559
fcml_hints getHints() const
Gets hits associated with the operand.
Definition: fcml_common.hpp:5641
Instruction(const fcml_cstring &mnemonic)
Creates an empty instruction for given mnemonic.
Definition: fcml_common.hpp:7205
static const Register XMM20()
Factory method for a register.
Definition: fcml_common.hpp:3150
bool isFar() const
Returns true if operand is a far pointer operand.
Definition: fcml_common.hpp:5481
static const Register XMM18()
Factory method for a register.
Definition: fcml_common.hpp:3090