Struct iced_x86::ConstantOffsets
source · pub struct ConstantOffsets { /* private fields */ }
Expand description
Contains the offsets of the displacement and immediate. Call Decoder::get_constant_offsets()
or
Encoder::get_constant_offsets()
to get the offsets of the constants after the instruction has been
decoded/encoded.
Implementations§
source§impl ConstantOffsets
impl ConstantOffsets
sourcepub const fn displacement_offset(&self) -> usize
pub const fn displacement_offset(&self) -> usize
The offset of the displacement, if any
sourcepub const fn displacement_size(&self) -> usize
pub const fn displacement_size(&self) -> usize
Size in bytes of the displacement, or 0 if there’s no displacement
sourcepub const fn immediate_offset(&self) -> usize
pub const fn immediate_offset(&self) -> usize
The offset of the first immediate, if any.
This field can be invalid even if the operand has an immediate if it’s an immediate that isn’t part
of the instruction stream, eg. SHL AL,1
.
sourcepub const fn immediate_size(&self) -> usize
pub const fn immediate_size(&self) -> usize
Size in bytes of the first immediate, or 0 if there’s no immediate
sourcepub const fn immediate_offset2(&self) -> usize
pub const fn immediate_offset2(&self) -> usize
The offset of the second immediate, if any.
sourcepub const fn immediate_size2(&self) -> usize
pub const fn immediate_size2(&self) -> usize
Size in bytes of the second immediate, or 0 if there’s no second immediate
sourcepub const fn has_displacement(&self) -> bool
pub const fn has_displacement(&self) -> bool
true
if displacement_offset()
and displacement_size()
are valid
sourcepub const fn has_immediate(&self) -> bool
pub const fn has_immediate(&self) -> bool
true
if immediate_offset()
and immediate_size()
are valid
sourcepub const fn has_immediate2(&self) -> bool
pub const fn has_immediate2(&self) -> bool
true
if immediate_offset2()
and immediate_size2()
are valid
Trait Implementations§
source§impl Clone for ConstantOffsets
impl Clone for ConstantOffsets
source§fn clone(&self) -> ConstantOffsets
fn clone(&self) -> ConstantOffsets
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ConstantOffsets
impl Debug for ConstantOffsets
source§impl Default for ConstantOffsets
impl Default for ConstantOffsets
source§fn default() -> ConstantOffsets
fn default() -> ConstantOffsets
source§impl Hash for ConstantOffsets
impl Hash for ConstantOffsets
source§impl PartialEq for ConstantOffsets
impl PartialEq for ConstantOffsets
source§fn eq(&self, other: &ConstantOffsets) -> bool
fn eq(&self, other: &ConstantOffsets) -> bool
self
and other
values to be equal, and is used
by ==
.