Struct Instruction
pub struct Instruction { /* private fields */ }Expand description
This structure represents a x86/x86-64 instruction
Implementations§
§impl Instruction
impl Instruction
pub fn operands(&self) -> Operands<'_> ⓘ
pub fn operands(&self) -> Operands<'_> ⓘ
Return an iterator over the x86::Operands operands
pub fn has_lock_prefix(&self) -> bool
pub fn has_lock_prefix(&self) -> bool
True if this instruction has a LOCK prefix
pub fn is_lockable(&self) -> bool
pub fn is_lockable(&self) -> bool
True if the LOCK prefix is architecturally valid on this instruction
pub fn lock(&self) -> Option<Instruction>
pub fn lock(&self) -> Option<Instruction>
Re-encoded copy of this instruction with a LOCK prefix added.
If the instruction already has a LOCK prefix, it returns a plain copy.
pub fn unlock(&self) -> Option<Instruction>
pub fn unlock(&self) -> Option<Instruction>
Re-encoded copy of this instruction with the LOCK prefix removed.
If the instruction does not have a LOCK prefix, it returns a plain
copy or None if the LOCK semantic can’t be removed.
Trait Implementations§
§impl Display for Instruction
impl Display for Instruction
§impl Instruction for Instruction
impl Instruction for Instruction
§fn to_string_no_address(&self) -> String
fn to_string_no_address(&self) -> String
Same as the
Display representation (i.e.
ToString::to_string) but without the address as prefix§fn is_terminator(&self) -> bool
fn is_terminator(&self) -> bool
True if the instruction marks the end of a basic block
§fn is_syscall(&self) -> bool
fn is_syscall(&self) -> bool
True if the instruction is a syscall
§fn is_memory_access(&self) -> bool
fn is_memory_access(&self) -> bool
True if the instruction performs a memory access
§fn is_move_reg(&self) -> bool
fn is_move_reg(&self) -> bool
True if the instruction is a register to register move.
§fn is_barrier(&self) -> bool
fn is_barrier(&self) -> bool
True if the instruction prevents executing the instruction
that immediatly follows the current. This includes return
or unconditional branch instructions
§fn is_indirect_branch(&self) -> bool
fn is_indirect_branch(&self) -> bool
True if the instruction is and indirect branch. Read more
§fn is_conditional_branch(&self) -> bool
fn is_conditional_branch(&self) -> bool
True if the instruction is conditionally jumping to the next
instruction or an instruction into some other basic block.
§fn is_unconditional_branch(&self) -> bool
fn is_unconditional_branch(&self) -> bool
True if the instruction is jumping (unconditionally) to some other
basic block.
§fn is_compare(&self) -> bool
fn is_compare(&self) -> bool
True if the instruction is a comparison
§fn is_move_immediate(&self) -> bool
fn is_move_immediate(&self) -> bool
True if the instruction is moving an immediate
§fn is_bitcast(&self) -> bool
fn is_bitcast(&self) -> bool
True if the instruction is doing a bitcast
§fn memory_access(&self) -> MemoryAccess
fn memory_access(&self) -> MemoryAccess
Memory access flags
§fn branch_target(&self) -> Result<u64, Error>
fn branch_target(&self) -> Result<u64, Error>
Given a
Instruction::is_branch instruction, try to evaluate the address of the
destination.Auto Trait Implementations§
impl Freeze for Instruction
impl RefUnwindSafe for Instruction
impl !Send for Instruction
impl !Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more