asmjit::Imm Class Reference

Immediate operand.

Immediate operand is usually part of instruction itself. It's inlined after or before the instruction opcode. Immediates can be only signed or unsigned integers.

To create an immediate operand use asmjit::imm() helper, which can be used with any type, not just the default 64-bit int.

Member Functions

Construction & Destruction
Overloaded Operators
Accessors
Utilities
- Public Member Functions inherited from asmjit::Operand
- Public Member Functions inherited from asmjit::Operand_

Additional Inherited Members

- Public Attributes inherited from asmjit::Operand_
- Public Types inherited from asmjit::Operand_
- Static Public Member Functions inherited from asmjit::Operand_

Constructor & Destructor Documentation

Imm::Imm()constexprconstexprnoexcept[1/3]

Creates a new immediate value (initial value is 0).

Imm::Imm(const Imm& other)constexprconstexprnoexcept[2/3]

Creates a new immediate value from other.

Imm::Imm(int64_t val)constexprexplicitconstexprnoexcept[3/3]

Creates a new signed immediate value, assigning the value to val.

Member Function Documentation

Imm& Imm::operator=(const Imm& other)noexcept

Assigns the value of the other operand to this immediate.

int64_t Imm::value() constconstexprconstexprnoexcept

Returns the immediate value as int64_t, which is the internal format Imm uses.

bool Imm::isInt8() constconstexprconstexprnoexcept

Tests whether the immediate can be casted to 8-bit signed integer.

bool Imm::isUInt8() constconstexprconstexprnoexcept

Tests whether the immediate can be casted to 8-bit unsigned integer.

bool Imm::isInt16() constconstexprconstexprnoexcept

Tests whether the immediate can be casted to 16-bit signed integer.

bool Imm::isUInt16() constconstexprconstexprnoexcept

Tests whether the immediate can be casted to 16-bit unsigned integer.

bool Imm::isInt32() constconstexprconstexprnoexcept

Tests whether the immediate can be casted to 32-bit signed integer.

bool Imm::isUInt32() constconstexprconstexprnoexcept

Tests whether the immediate can be casted to 32-bit unsigned integer.

template<typename T>
T Imm::valueAs() constconstexprconstexprnoexcept

Returns the immediate value casted to T.

The value is masked before it's casted to T so the returned value is simply the representation of T considering the original value's lowest bits.

int32_t Imm::int32Lo() constconstexprconstexprnoexcept

Returns low 32-bit signed integer.

int32_t Imm::int32Hi() constconstexprconstexprnoexcept

Returns high 32-bit signed integer.

uint32_t Imm::uint32Lo() constconstexprconstexprnoexcept

Returns low 32-bit signed integer.

uint32_t Imm::uint32Hi() constconstexprconstexprnoexcept

Returns high 32-bit signed integer.

template<typename T>
void Imm::setValue(const T& val)noexcept

Sets immediate value to val, the value is casted to a signed 64-bit integer.

Imm Imm::clone() constconstexprconstexprnoexcept

Clones the immediate operand.