asmjit::OpRWInfo Struct Reference

Read/Write information related to a single operand, used by InstRWInfo.

Public Members

Public Types

Member Functions

Reset
Operand Flags
Memory Flags
Physical Register ID
Reg/Mem Information
Read & Write Masks

Member Enumeration Documentation

OpRWInfo::Flags : uint32_tenum

Flags describe how the operand is accessed and some additional information.

ConstantDescription
kRead 

Operand is read.

kWrite 

Operand is written.

kRW 

Operand is both read and written.

kRegMem 

Register operand can be replaced by a memory operand.

kZExt 

The extendByteMask() represents a zero extension.

kRegPhysId 

Register operand must use physId().

kMemPhysId 

Base register of a memory operand must use physId().

kMemFake 

This memory operand is only used to encode registers and doesn't access memory.

X86 Specific
------------

Instructions that use such feature include BNDLDX, BNDSTX, and LEA. 
kMemBaseRead 

Base register of the memory operand will be read.

kMemBaseWrite 

Base register of the memory operand will be written.

kMemBaseRW 

Base register of the memory operand will be read & written.

kMemIndexRead 

Index register of the memory operand will be read.

kMemIndexWrite 

Index register of the memory operand will be written.

kMemIndexRW 

Index register of the memory operand will be read & written.

kMemBasePreModify 

Base register of the memory operand will be modified before the operation.

kMemBasePostModify 

Base register of the memory operand will be modified after the operation.

Member Function Documentation

void OpRWInfo::reset()noexcept[1/2]

Resets this operand information to all zeros.

void OpRWInfo::reset(uint32_t opFlags, uint32_t regSize, uint32_t physId = BaseReg::kIdBad)noexcept[2/2]

Resets this operand info (resets all members) and set common information to the given opFlags, regSize, and possibly physId.

uint32_t OpRWInfo::opFlags() constnoexcept

Returns operand flags, see Flags.

bool OpRWInfo::hasOpFlag(uint32_t flag) constnoexcept

Tests whether operand flags contain the given flag.

void OpRWInfo::addOpFlags(uint32_t flags)noexcept

Adds the given flags to operand flags.

void OpRWInfo::clearOpFlags(uint32_t flags)noexcept

Removes the given flags from operand flags.

bool OpRWInfo::isRead() constnoexcept

Tests whether this operand is read from.

bool OpRWInfo::isWrite() constnoexcept

Tests whether this operand is written to.

bool OpRWInfo::isReadWrite() constnoexcept

Tests whether this operand is both read and write.

bool OpRWInfo::isReadOnly() constnoexcept

Tests whether this operand is read only.

bool OpRWInfo::isWriteOnly() constnoexcept

Tests whether this operand is write only.

bool OpRWInfo::isRm() constnoexcept

Tests whether this operand is Reg/Mem.

Reg/Mem operands can use either register or memory.

bool OpRWInfo::isZExt() constnoexcept

Tests whether the operand will be zero extended.

bool OpRWInfo::isMemFake() constnoexcept

Tests whether this is a fake memory operand, which is only used, because of encoding.

Fake memory operands do not access any memory, they are only used to encode registers.

bool OpRWInfo::isMemBaseUsed() constnoexcept

Tests whether the instruction's memory BASE register is used.

bool OpRWInfo::isMemBaseRead() constnoexcept

Tests whether the instruction reads from its BASE registers.

bool OpRWInfo::isMemBaseWrite() constnoexcept

Tests whether the instruction writes to its BASE registers.

bool OpRWInfo::isMemBaseReadWrite() constnoexcept

Tests whether the instruction reads and writes from/to its BASE registers.

bool OpRWInfo::isMemBaseReadOnly() constnoexcept

Tests whether the instruction only reads from its BASE registers.

bool OpRWInfo::isMemBaseWriteOnly() constnoexcept

Tests whether the instruction only writes to its BASE registers.

bool OpRWInfo::isMemBasePreModify() constnoexcept

Tests whether the instruction modifies the BASE register before it uses it to calculate the target address.

bool OpRWInfo::isMemBasePostModify() constnoexcept

Tests whether the instruction modifies the BASE register after it uses it to calculate the target address.

bool OpRWInfo::isMemIndexUsed() constnoexcept

Tests whether the instruction's memory INDEX register is used.

bool OpRWInfo::isMemIndexRead() constnoexcept

Tests whether the instruction reads the INDEX registers.

bool OpRWInfo::isMemIndexWrite() constnoexcept

Tests whether the instruction writes to its INDEX registers.

bool OpRWInfo::isMemIndexReadWrite() constnoexcept

Tests whether the instruction reads and writes from/to its INDEX registers.

bool OpRWInfo::isMemIndexReadOnly() constnoexcept

Tests whether the instruction only reads from its INDEX registers.

bool OpRWInfo::isMemIndexWriteOnly() constnoexcept

Tests whether the instruction only writes to its INDEX registers.

uint32_t OpRWInfo::physId() constnoexcept

Returns a physical id of the register that is fixed for this operand.

Returns BaseReg::kIdBad if any register can be used.

bool OpRWInfo::hasPhysId() constnoexcept

Tests whether physId() would return a valid physical register id.

void OpRWInfo::setPhysId(uint32_t physId)noexcept

Sets physical register id, which would be fixed for this operand.

uint32_t OpRWInfo::rmSize() constnoexcept

Returns Reg/Mem size of the operand.

void OpRWInfo::setRmSize(uint32_t rmSize)noexcept

Sets Reg/Mem size of the operand.

uint64_t OpRWInfo::readByteMask() constnoexcept

Returns read mask.

uint64_t OpRWInfo::writeByteMask() constnoexcept

Returns write mask.

uint64_t OpRWInfo::extendByteMask() constnoexcept

Returns extend mask.

void OpRWInfo::setReadByteMask(uint64_t mask)noexcept

Sets read mask.

void OpRWInfo::setWriteByteMask(uint64_t mask)noexcept

Sets write mask.

void OpRWInfo::setExtendByteMask(uint64_t mask)noexcept

Sets externd mask.

Member Data Documentation

uint32_t OpRWInfo::_opFlags

Read/Write flags, see OpRWInfo::Flags.

uint8_t OpRWInfo::_physId

Physical register index, if required.

uint8_t OpRWInfo::_rmSize

Size of a possible memory operand that can replace a register operand.

uint8_t OpRWInfo::_reserved[2]

Reserved for future use.

uint64_t OpRWInfo::_readByteMask

Read bit-mask where each bit represents one byte read from Reg/Mem.

uint64_t OpRWInfo::_writeByteMask

Write bit-mask where each bit represents one byte written to Reg/Mem.

uint64_t OpRWInfo::_extendByteMask

Zero/Sign extend bit-mask where each bit represents one byte written to Reg/Mem.