fcml  1.2.2
Public Types | Public Member Functions | List of all members
fcml::Operand Class Reference

Instruction operand. More...

#include <fcml_common.hpp>

Public Types

enum  OperandType {
  OT_NONE = FCML_OT_NONE,
  OT_IMMEDIATE = FCML_OT_IMMEDIATE,
  OT_FAR_POINTER = FCML_OT_FAR_POINTER,
  OT_ADDRESS = FCML_OT_ADDRESS,
  OT_REGISTER = FCML_OT_REGISTER,
  OT_VIRTUAL = FCML_OT_VIRTUAL
}
 See fcml_en_operand_type structure for more details. More...
 

Public Member Functions

 Operand ()
 Creates an undefined operand. More...
 
 Operand (const Integer &imm, fcml_hints hints=FCML_OP_HINT_UNDEFIEND)
 Creates an immediate value operand for given integer. More...
 
 Operand (const FarPointer &pointer, fcml_hints hints=FCML_OP_HINT_UNDEFIEND)
 Creates a far pointer operand for given far pointer. More...
 
 Operand (const Address &address, fcml_hints hints=FCML_OP_HINT_UNDEFIEND)
 Creates an address operand for given address. More...
 
 Operand (const Register &reg, fcml_hints hints=FCML_OP_HINT_UNDEFIEND)
 Creates a new register operand for given register. More...
 
bool operator== (const Operand &op) const
 Checks if two operands are equal or not. More...
 
bool operator!= (const Operand &op) const
 Checks if two operands are equal or not. More...
 
void undef ()
 Converts operand to the undefined one. More...
 
void imm (const Integer &imm)
 Sets given immediate value for the operand and makes it to be an immediate operand. More...
 
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. More...
 
void far_ptr (fcml_uint16_t seg, fcml_int32_t addr)
 Prepares far pointer operand for given components. More...
 
void far_ptr (const FarPointer &pointer)
 Prepares far pointer operand for given far pointer. More...
 
void addr (const Address &address)
 Prepares address operand for given address. More...
 
void off (const Integer &offset, fcml_usize sizeOperator=FCML_DS_UNDEF)
 Prepares address operand for given offset. More...
 
void addr (const EffectiveAddress &effectiveAddress, fcml_usize sizeOperator=FCML_DS_UNDEF)
 Prepares an address operand for given effective address and optional size operator. More...
 
void addr (const EffectiveAddress &effectiveAddress, const SegmentSelector &segmentSelector, fcml_usize sizeOperator=FCML_DS_UNDEF)
 Prepares address operator for given parameters. More...
 
void reg (const Register &reg)
 Prepares operator for the given register. More...
 
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. More...
 
bool isImm () const
 Returns true if operand is an immediate value operand. More...
 
bool isReg () const
 Returns true if operand is a register operand. More...
 
bool isAddr () const
 Returns true if operand is an address operand. More...
 
bool isFar () const
 Returns true if operand is a far pointer operand. More...
 
const AddressgetAddress () const
 Gets reference to the constant address associated with the operand. More...
 
AddressgetAddress ()
 Gets reference to the address associated with the operand. More...
 
OperandsetAddress (const Address &address)
 Sets a new address for the operand. More...
 
const FarPointergetFarPointer () const
 Gets a reference to the constant far pointer instance associated with the address. More...
 
FarPointergetFarPointer ()
 Gets a reference to the far pointer instance associated with the address. More...
 
OperandsetFarPointer (const FarPointer &farPointer)
 Sets a new far pointer for the operand. More...
 
const IntegergetImmediate () const
 Gets a reference to the constant immediate value associated with the operand. More...
 
IntegergetImmediate ()
 Gets a reference to the immediate value associated with the operand. More...
 
OperandsetImmediate (const Integer &immediate)
 Sets a new immediate value for the address. More...
 
OperandType getOperandType () const
 Gets operand type. More...
 
OperandsetOperandType (OperandType operandType)
 Sets a new operand type. More...
 
const RegistergetRegister () const
 Returns a reference to the constant register associated with the operand. More...
 
RegistergetRegister ()
 Returns a reference to the register associated with the operand. More...
 
OperandsetRegister (const Register &reg)
 Sets a new register for the operand. More...
 
fcml_hints getHints () const
 Gets hits associated with the operand. More...
 
OperandsetHints (fcml_hints hints)
 Sets new operand level hits for the operand. More...
 
const DecoratorsgetDecorators () const
 Gets constant decorators associated with the operand. More...
 
DecoratorsgetDecorators ()
 Gets decorators associated with the operand. More...
 
OperandsetDecorators (const Decorators &decorators)
 Sets new operand decorators for the operand. More...
 
bool isMultimedia () const
 Returns information if the operand is multimedia one or not. More...
 
bool isDisRelativeAddress () const
 Returns true if it's an displacement relative address. More...
 
bool isPseudoOpcode () const
 Returns true if it's pseudo opcode operand. More...
 
bool isAbsoluteAddressing () const
 Returns true if it's an absolute offset being set in the operand. More...
 
bool isRelativeAddressing () const
 Returns true is relative addressing is used. More...
 
bool isSIBEncoding () const
 Returns true if the SIB byte is used. More...
 
 operator const Integer & () const
 A casting operator. More...
 
 operator const FarPointer & () const
 A casting operator. More...
 
 operator const Address & () const
 A casting operator. More...
 
 operator const Register & () const
 A casting operator. More...
 

Detailed Description

Instruction operand.

Since
1.1.0

Member Enumeration Documentation

◆ OperandType

See fcml_en_operand_type structure for more details.

Since
1.1.0
Enumerator
OT_NONE 

Operand not used.

OT_IMMEDIATE 

Immediate integer value.

OT_FAR_POINTER 

Direct far pointer.

OT_ADDRESS 

Memory address.

OT_REGISTER 

Processor register.

OT_VIRTUAL 

Virtual operand.

Constructor & Destructor Documentation

◆ Operand() [1/5]

fcml::Operand::Operand ( )
inline

Creates an undefined operand.

Since
1.1.0

◆ Operand() [2/5]

fcml::Operand::Operand ( const Integer imm,
fcml_hints  hints = FCML_OP_HINT_UNDEFIEND 
)
inline

Creates an immediate value operand for given integer.

Parameters
immThe immediate value as integer.
hintsOptional operand level hints.
Since
1.1.0

◆ Operand() [3/5]

fcml::Operand::Operand ( const FarPointer pointer,
fcml_hints  hints = FCML_OP_HINT_UNDEFIEND 
)
inline

Creates a far pointer operand for given far pointer.

Parameters
pointerThe far pointer for the operand.
hintsOptional operand level hints.
Since
1.1.0

◆ Operand() [4/5]

fcml::Operand::Operand ( const Address address,
fcml_hints  hints = FCML_OP_HINT_UNDEFIEND 
)
inline

Creates an address operand for given address.

Parameters
addressThe address for the created operand.
hintsOptional operand level hints.
Since
1.1.0

◆ Operand() [5/5]

fcml::Operand::Operand ( const Register reg,
fcml_hints  hints = FCML_OP_HINT_UNDEFIEND 
)
inline

Creates a new register operand for given register.

Parameters
regThe register for the new operand being created.
hintsOptional operand level hints.
Since
1.1.0

Member Function Documentation

◆ addr() [1/3]

void fcml::Operand::addr ( const Address address)
inline

Prepares address operand for given address.

Parameters
addressThe address to be set for the operand.
Since
1.1.0

◆ addr() [2/3]

void fcml::Operand::addr ( const EffectiveAddress effectiveAddress,
fcml_usize  sizeOperator = FCML_DS_UNDEF 
)
inline

Prepares an address operand for given effective address and optional size operator.

Parameters
effectiveAddressThe effective address.
sizeOperatorThe size operator.
Since
1.1.0

◆ addr() [3/3]

void fcml::Operand::addr ( const EffectiveAddress effectiveAddress,
const SegmentSelector segmentSelector,
fcml_usize  sizeOperator = FCML_DS_UNDEF 
)
inline

Prepares address operator for given parameters.

Parameters
effectiveAddressThe effective address.
segmentSelectorThe segment selector.
sizeOperatorThe size operator.
Since
1.1.0

◆ far_ptr() [1/3]

void fcml::Operand::far_ptr ( fcml_uint16_t  seg,
fcml_int16_t  addr 
)
inline

Converts operand to the far pointer and sets the segment selector and offset for it.

Parameters
segThe segment selector.
addrOffset.
Since
1.1.0

◆ far_ptr() [2/3]

void fcml::Operand::far_ptr ( fcml_uint16_t  seg,
fcml_int32_t  addr 
)
inline

Prepares far pointer operand for given components.

Parameters
segThe segment selector.
addrThe offset.
Since
1.1.0

◆ far_ptr() [3/3]

void fcml::Operand::far_ptr ( const FarPointer pointer)
inline

Prepares far pointer operand for given far pointer.

Parameters
pointerFar pointer to be set for the operand.
Since
1.1.0

◆ getAddress() [1/2]

const Address& fcml::Operand::getAddress ( ) const
inline

Gets reference to the constant address associated with the operand.

Returns
The reference to the address.
Since
1.1.0

◆ getAddress() [2/2]

Address& fcml::Operand::getAddress ( )
inline

Gets reference to the address associated with the operand.

Returns
The reference to the address.
Since
1.1.0

◆ getDecorators() [1/2]

const Decorators& fcml::Operand::getDecorators ( ) const
inline

Gets constant decorators associated with the operand.

Returns
The decorators associated with the operand.
Since
1.2.0

◆ getDecorators() [2/2]

Decorators& fcml::Operand::getDecorators ( )
inline

Gets decorators associated with the operand.

Returns
The decorators associated with the operand.
Since
1.2.0

◆ getFarPointer() [1/2]

const FarPointer& fcml::Operand::getFarPointer ( ) const
inline

Gets a reference to the constant far pointer instance associated with the address.

Returns
The far pointer instance associated with the address.
Since
1.1.0

◆ getFarPointer() [2/2]

FarPointer& fcml::Operand::getFarPointer ( )
inline

Gets a reference to the far pointer instance associated with the address.

Returns
The far pointer instance associated with the address.
Since
1.1.0

◆ getHints()

fcml_hints fcml::Operand::getHints ( ) const
inline

Gets hits associated with the operand.

Returns
The hits associated with the operand.
Since
1.1.0

◆ getImmediate() [1/2]

const Integer& fcml::Operand::getImmediate ( ) const
inline

Gets a reference to the constant immediate value associated with the operand.

Returns
The immediate value.
Since
1.1.0

◆ getImmediate() [2/2]

Integer& fcml::Operand::getImmediate ( )
inline

Gets a reference to the immediate value associated with the operand.

Returns
The immediate value.
Since
1.1.0

◆ getOperandType()

OperandType fcml::Operand::getOperandType ( ) const
inline

Gets operand type.

Returns
The operand type.
Since
1.1.0

◆ getRegister() [1/2]

const Register& fcml::Operand::getRegister ( ) const
inline

Returns a reference to the constant register associated with the operand.

Returns
The reference to the register associated with the operand.
Since
1.1.0

◆ getRegister() [2/2]

Register& fcml::Operand::getRegister ( )
inline

Returns a reference to the register associated with the operand.

Returns
The reference to the register associated with the operand.
Since
1.1.0

◆ imm()

void fcml::Operand::imm ( const Integer imm)
inline

Sets given immediate value for the operand and makes it to be an immediate operand.

Parameters
immThe immediate value.
Since
1.1.0

◆ isAbsoluteAddressing()

bool fcml::Operand::isAbsoluteAddressing ( ) const
inline

Returns true if it's an absolute offset being set in the operand.

Returns
True in case of absolute addressing being used.
Since
1.1.0

◆ isAddr()

bool fcml::Operand::isAddr ( ) const
inline

Returns true if operand is an address operand.

Returns
True if operand is an address operand.
Since
1.1.0

◆ isDisRelativeAddress()

bool fcml::Operand::isDisRelativeAddress ( ) const
inline

Returns true if it's an displacement relative address.

Returns
True if it's an displacement relative address.
Since
1.1.0

◆ isFar()

bool fcml::Operand::isFar ( ) const
inline

Returns true if operand is a far pointer operand.

Returns
True if operand is a far pointer operand.
Since
1.1.0

◆ isImm()

bool fcml::Operand::isImm ( ) const
inline

Returns true if operand is an immediate value operand.

Returns
True if operand is an immediate value operand.
Since
1.1.0

◆ isMultimedia()

bool fcml::Operand::isMultimedia ( ) const
inline

Returns information if the operand is multimedia one or not.

For more details about the multimedia operand head over to the manual pages.

Returns
true if it's a multimedia operand.
Since
1.1.0

◆ isPseudoOpcode()

bool fcml::Operand::isPseudoOpcode ( ) const
inline

Returns true if it's pseudo opcode operand.

More information about pseudo opcodes in the manual.

Returns
True if it's pseudo opcode operand.
Since
1.1.0

◆ isReg()

bool fcml::Operand::isReg ( ) const
inline

Returns true if operand is a register operand.

Returns
True if operand is a register operand.
Since
1.1.0

◆ isRelativeAddressing()

bool fcml::Operand::isRelativeAddressing ( ) const
inline

Returns true is relative addressing is used.

Returns
True in case of relative addressing.
Since
1.1.0

◆ isSIBEncoding()

bool fcml::Operand::isSIBEncoding ( ) const
inline

Returns true if the SIB byte is used.

Returns
True if the SIB byte is used.
Since
1.1.0

◆ off()

void fcml::Operand::off ( const Integer offset,
fcml_usize  sizeOperator = FCML_DS_UNDEF 
)
inline

Prepares address operand for given offset.

Parameters
offsetThe offset to be set for the operand.
sizeOperatorThe size operator to be set for the address.
Since
1.1.0

◆ operator const Address &()

fcml::Operand::operator const Address & ( ) const
inline

A casting operator.

Since
1.1.0

◆ operator const FarPointer &()

fcml::Operand::operator const FarPointer & ( ) const
inline

A casting operator.

Since
1.1.0

◆ operator const Integer &()

fcml::Operand::operator const Integer & ( ) const
inline

A casting operator.

Since
1.1.0

◆ operator const Register &()

fcml::Operand::operator const Register & ( ) const
inline

A casting operator.

Since
1.1.0

◆ operator!=()

bool fcml::Operand::operator!= ( const Operand op) const
inline

Checks if two operands are equal or not.

Parameters
opThe operand to be compared with the current one.
Returns
True if the operands are NOT equal.
Since
1.1.0

◆ operator==()

bool fcml::Operand::operator== ( const Operand op) const
inline

Checks if two operands are equal or not.

Parameters
opThe operand to be compared with the current one.
Returns
True if the operands are equal.
Since
1.1.0

◆ reg() [1/2]

void fcml::Operand::reg ( const Register reg)
inline

Prepares operator for the given register.

Parameters
regThe register for the operator.
Since
1.1.0

◆ reg() [2/2]

void fcml::Operand::reg ( fcml_uint8_t  reg,
fcml_usize  size,
Register::RegisterType  type = Register::REG_GPR,
fcml_bool  x64_exp = FCML_FALSE 
)
inline

Prepares an register operator for given register compounds.

Parameters
regA register number.
sizeA register size.
typeA register type.
x64_expAn optional marker for the SPL, BPL, SIL etc. registers. See manual for more information.
Since
1.1.0

◆ setAddress()

Operand& fcml::Operand::setAddress ( const Address address)
inline

Sets a new address for the operand.

Parameters
addressThe new address.
Returns
The operand itself.
Since
1.1.0

◆ setDecorators()

Operand& fcml::Operand::setDecorators ( const Decorators decorators)
inline

Sets new operand decorators for the operand.

Parameters
decoratorsThe new decorators to be set.
Returns
The operand itself.
Since
1.2.0

◆ setFarPointer()

Operand& fcml::Operand::setFarPointer ( const FarPointer farPointer)
inline

Sets a new far pointer for the operand.

Parameters
farPointerThe new far pointer instance.
Returns
The operand itself.
Since
1.1.0

◆ setHints()

Operand& fcml::Operand::setHints ( fcml_hints  hints)
inline

Sets new operand level hits for the operand.

Parameters
hintsThe new hits to be set.
Returns
The operand itself.
Since
1.1.0

◆ setImmediate()

Operand& fcml::Operand::setImmediate ( const Integer immediate)
inline

Sets a new immediate value for the address.

Parameters
immediateThe new immediate value.
Returns
The operand itself.
Since
1.1.0

◆ setOperandType()

Operand& fcml::Operand::setOperandType ( OperandType  operandType)
inline

Sets a new operand type.

Parameters
operandTypeThe new operand type.
Returns
The operand itself.
Since
1.1.0

◆ setRegister()

Operand& fcml::Operand::setRegister ( const Register reg)
inline

Sets a new register for the operand.

Parameters
regThe new register.
Returns
The operand itself.
Since
1.1.0

◆ undef()

void fcml::Operand::undef ( )
inline

Converts operand to the undefined one.

Since
1.1.0

The documentation for this class was generated from the following file: