Struct iced_x86::UsedMemory
source · pub struct UsedMemory { /* private fields */ }
Expand description
A memory location used by an instruction
Implementations§
source§impl UsedMemory
impl UsedMemory
sourcepub const fn new(
segment: Register,
base: Register,
index: Register,
scale: u32,
displacement: u64,
memory_size: MemorySize,
access: OpAccess
) -> Self
pub const fn new( segment: Register, base: Register, index: Register, scale: u32, displacement: u64, memory_size: MemorySize, access: OpAccess ) -> Self
Creates a new instance
Arguments
segment
: Effective segment register orRegister::None
if the segment register is ignoredbase
: Base registerindex
: Index registerscale
: 1, 2, 4 or 8displacement
: Displacementmemory_size
: Memory sizeaccess
: Access
sourcepub fn new2(
segment: Register,
base: Register,
index: Register,
scale: u32,
displacement: u64,
memory_size: MemorySize,
access: OpAccess,
address_size: CodeSize,
vsib_size: u32
) -> Self
pub fn new2( segment: Register, base: Register, index: Register, scale: u32, displacement: u64, memory_size: MemorySize, access: OpAccess, address_size: CodeSize, vsib_size: u32 ) -> Self
Creates a new instance
Arguments
segment
: Effective segment register orRegister::None
if the segment register is ignoredbase
: Base registerindex
: Index registerscale
: 1, 2, 4 or 8displacement
: Displacementmemory_size
: Memory sizeaccess
: Accessaddress_size
: Address sizevsib_size
: VSIB size (0
,4
or8
)
sourcepub const fn segment(&self) -> Register
pub const fn segment(&self) -> Register
Effective segment register or Register::None
if the segment register is ignored
sourcepub const fn base(&self) -> Register
pub const fn base(&self) -> Register
Base register or Register::None
if none
sourcepub const fn index(&self) -> Register
pub const fn index(&self) -> Register
Index register or Register::None
if none
sourcepub const fn displacement(&self) -> u64
pub const fn displacement(&self) -> u64
Displacement
sourcepub const fn memory_size(&self) -> MemorySize
pub const fn memory_size(&self) -> MemorySize
Size of location
sourcepub const fn address_size(&self) -> CodeSize
pub const fn address_size(&self) -> CodeSize
Address size
sourcepub fn virtual_address<F>(
&self,
element_index: usize,
get_register_value: F
) -> Option<u64>
pub fn virtual_address<F>( &self, element_index: usize, get_register_value: F ) -> Option<u64>
Gets the virtual address of a used memory location, or None
if register resolution fails.
Arguments
get_register_value
: Function that returns the value of a register or the base address of a segment register, orNone
on failure.
Call-back function args
- Arg 1:
register
: Register. If it’s a segment register, the call-back should return the segment’s base address, not the segment’s register value. - Arg 2:
element_index
: Only used if it’s a vsib memory operand. This is the element index of the vector index register. - Arg 3:
element_size
: Only used if it’s a vsib memory operand. Size in bytes of elements in vector index register (4 or 8).
Trait Implementations§
source§impl Clone for UsedMemory
impl Clone for UsedMemory
source§fn clone(&self) -> UsedMemory
fn clone(&self) -> UsedMemory
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for UsedMemory
impl Debug for UsedMemory
source§impl Default for UsedMemory
impl Default for UsedMemory
source§fn default() -> UsedMemory
fn default() -> UsedMemory
Returns the “default value” for a type. Read more
source§impl Hash for UsedMemory
impl Hash for UsedMemory
source§impl PartialEq for UsedMemory
impl PartialEq for UsedMemory
source§fn eq(&self, other: &UsedMemory) -> bool
fn eq(&self, other: &UsedMemory) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for UsedMemory
impl Eq for UsedMemory
impl StructuralEq for UsedMemory
impl StructuralPartialEq for UsedMemory
Auto Trait Implementations§
impl RefUnwindSafe for UsedMemory
impl Send for UsedMemory
impl Sync for UsedMemory
impl Unpin for UsedMemory
impl UnwindSafe for UsedMemory
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