Struct iced_x86::RegisterInfo
source · [−]pub struct RegisterInfo { /* private fields */ }
Expand description
Register
information
Implementations
sourceimpl RegisterInfo
impl RegisterInfo
sourcepub const fn register(&self) -> Register
pub const fn register(&self) -> Register
Gets the register
Examples
use iced_x86::*;
let info = Register::EAX.info();
assert_eq!(info.register(), Register::EAX);
sourcepub const fn base(&self) -> Register
pub const fn base(&self) -> Register
Gets the base register, eg. AL
, AX
, EAX
, RAX
, MM0
, XMM0
, YMM0
, ZMM0
, ES
Examples
use iced_x86::*;
let info = Register::GS.info();
assert_eq!(info.base(), Register::ES);
let info = Register::RDX.info();
assert_eq!(info.base(), Register::RAX);
let info = Register::XMM13.info();
assert_eq!(info.base(), Register::XMM0);
let info = Register::YMM13.info();
assert_eq!(info.base(), Register::YMM0);
let info = Register::ZMM13.info();
assert_eq!(info.base(), Register::ZMM0);
sourcepub const fn number(&self) -> usize
pub const fn number(&self) -> usize
The register number (index) relative to base()
, eg. 0-15, or 0-31, or if 8-bit GPR, 0-19
Examples
use iced_x86::*;
let info = Register::GS.info();
assert_eq!(info.number(), 5);
let info = Register::RDX.info();
assert_eq!(info.number(), 2);
let info = Register::XMM13.info();
assert_eq!(info.number(), 13);
let info = Register::YMM13.info();
assert_eq!(info.number(), 13);
let info = Register::ZMM13.info();
assert_eq!(info.number(), 13);
sourcepub const fn full_register(&self) -> Register
pub const fn full_register(&self) -> Register
The full register that this one is a part of, eg. CL
/CH
/CX
/ECX
/RCX
-> RCX
, XMM11
/YMM11
/ZMM11
-> ZMM11
Examples
use iced_x86::*;
let info = Register::GS.info();
assert_eq!(info.full_register(), Register::GS);
let info = Register::BH.info();
assert_eq!(info.full_register(), Register::RBX);
let info = Register::DX.info();
assert_eq!(info.full_register(), Register::RDX);
let info = Register::ESP.info();
assert_eq!(info.full_register(), Register::RSP);
let info = Register::RCX.info();
assert_eq!(info.full_register(), Register::RCX);
let info = Register::XMM3.info();
assert_eq!(info.full_register(), Register::ZMM3);
let info = Register::YMM3.info();
assert_eq!(info.full_register(), Register::ZMM3);
let info = Register::ZMM3.info();
assert_eq!(info.full_register(), Register::ZMM3);
sourcepub const fn full_register32(&self) -> Register
pub const fn full_register32(&self) -> Register
Gets the full register that this one is a part of, except if it’s a GPR in which case the 32-bit register is returned,
eg. CL
/CH
/CX
/ECX
/RCX
-> ECX
, XMM11
/YMM11
/ZMM11
-> ZMM11
Examples
use iced_x86::*;
let info = Register::GS.info();
assert_eq!(info.full_register32(), Register::GS);
let info = Register::BH.info();
assert_eq!(info.full_register32(), Register::EBX);
let info = Register::DX.info();
assert_eq!(info.full_register32(), Register::EDX);
let info = Register::ESP.info();
assert_eq!(info.full_register32(), Register::ESP);
let info = Register::RCX.info();
assert_eq!(info.full_register32(), Register::ECX);
let info = Register::XMM3.info();
assert_eq!(info.full_register32(), Register::ZMM3);
let info = Register::YMM3.info();
assert_eq!(info.full_register32(), Register::ZMM3);
let info = Register::ZMM3.info();
assert_eq!(info.full_register32(), Register::ZMM3);
sourcepub const fn size(&self) -> usize
pub const fn size(&self) -> usize
Size of the register in bytes
Examples
use iced_x86::*;
let info = Register::GS.info();
assert_eq!(info.size(), 2);
let info = Register::BH.info();
assert_eq!(info.size(), 1);
let info = Register::DX.info();
assert_eq!(info.size(), 2);
let info = Register::ESP.info();
assert_eq!(info.size(), 4);
let info = Register::RCX.info();
assert_eq!(info.size(), 8);
let info = Register::XMM3.info();
assert_eq!(info.size(), 16);
let info = Register::YMM3.info();
assert_eq!(info.size(), 32);
let info = Register::ZMM3.info();
assert_eq!(info.size(), 64);
Trait Implementations
sourceimpl Clone for RegisterInfo
impl Clone for RegisterInfo
sourcefn clone(&self) -> RegisterInfo
fn clone(&self) -> RegisterInfo
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for RegisterInfo
impl Debug for RegisterInfo
sourceimpl Hash for RegisterInfo
impl Hash for RegisterInfo
sourceimpl PartialEq<RegisterInfo> for RegisterInfo
impl PartialEq<RegisterInfo> for RegisterInfo
sourcefn eq(&self, other: &RegisterInfo) -> bool
fn eq(&self, other: &RegisterInfo) -> bool
impl Copy for RegisterInfo
impl Eq for RegisterInfo
impl StructuralEq for RegisterInfo
impl StructuralPartialEq for RegisterInfo
Auto Trait Implementations
impl RefUnwindSafe for RegisterInfo
impl Send for RegisterInfo
impl Sync for RegisterInfo
impl Unpin for RegisterInfo
impl UnwindSafe for RegisterInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more