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
BND1,
BND2,
BND3,
CR0,
CR1,
CR2,
CR3,
CR4,
CR5,
CR6,
CR7,
CR8,
CR9,
CR10,
CR11,
CR12,
CR13,
CR14,
CR15,
DR0,
DR1,
DR2,
DR3,
DR4,
DR5,
DR6,
DR7,
DR8,
DR9,
DR10,
DR11,
DR12,
DR13,
DR14,
DR15,
ST0,
ST1,
ST2,
ST3,
ST4,
ST5,
ST6,
ST7,
MM0,
MM1,
MM2,
MM3,
MM4,
MM5,
MM6,
MM7,
TR0,
TR1,
TR2,
TR3,
TR4,
TR5,
TR6,
TR7,
TMM0,
TMM1,
TMM2,
TMM3,
TMM4,
TMM5,
TMM6,
TMM7,
DontUse0,
DontUseFA,
DontUseFB,
DontUseFC,
DontUseFD,
DontUseFE,
DontUseFF,
}
Expand description
A register
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
None
AL
CL
DL
BL
AH
CH
DH
BH
SPL
BPL
SIL
DIL
R8L
R9L
R10L
R11L
R12L
R13L
R14L
R15L
AX
CX
DX
BX
SP
BP
SI
DI
R8W
R9W
R10W
R11W
R12W
R13W
R14W
R15W
EAX
ECX
EDX
EBX
ESP
EBP
ESI
EDI
R8D
R9D
R10D
R11D
R12D
R13D
R14D
R15D
RAX
RCX
RDX
RBX
RSP
RBP
RSI
RDI
R8
R9
R10
R11
R12
R13
R14
R15
EIP
RIP
ES
CS
SS
DS
FS
GS
XMM0
XMM1
XMM2
XMM3
XMM4
XMM5
XMM6
XMM7
XMM8
XMM9
XMM10
XMM11
XMM12
XMM13
XMM14
XMM15
XMM16
XMM17
XMM18
XMM19
XMM20
XMM21
XMM22
XMM23
XMM24
XMM25
XMM26
XMM27
XMM28
XMM29
XMM30
XMM31
YMM0
YMM1
YMM2
YMM3
YMM4
YMM5
YMM6
YMM7
YMM8
YMM9
YMM10
YMM11
YMM12
YMM13
YMM14
YMM15
YMM16
YMM17
YMM18
YMM19
YMM20
YMM21
YMM22
YMM23
YMM24
YMM25
YMM26
YMM27
YMM28
YMM29
YMM30
YMM31
ZMM0
ZMM1
ZMM2
ZMM3
ZMM4
ZMM5
ZMM6
ZMM7
ZMM8
ZMM9
ZMM10
ZMM11
ZMM12
ZMM13
ZMM14
ZMM15
ZMM16
ZMM17
ZMM18
ZMM19
ZMM20
ZMM21
ZMM22
ZMM23
ZMM24
ZMM25
ZMM26
ZMM27
ZMM28
ZMM29
ZMM30
ZMM31
K0
K1
K2
K3
K4
K5
K6
K7
BND0
BND1
BND2
BND3
CR0
CR1
CR2
CR3
CR4
CR5
CR6
CR7
CR8
CR9
CR10
CR11
CR12
CR13
CR14
CR15
DR0
DR1
DR2
DR3
DR4
DR5
DR6
DR7
DR8
DR9
DR10
DR11
DR12
DR13
DR14
DR15
ST0
ST1
ST2
ST3
ST4
ST5
ST6
ST7
MM0
MM1
MM2
MM3
MM4
MM5
MM6
MM7
TR0
TR1
TR2
TR3
TR4
TR5
TR6
TR7
TMM0
TMM1
TMM2
TMM3
TMM4
TMM5
TMM6
TMM7
DontUse0
Don’t use it!
DontUseFA
Don’t use it!
DontUseFB
Don’t use it!
DontUseFC
Don’t use it!
DontUseFD
Don’t use it!
DontUseFE
Don’t use it!
DontUseFF
Don’t use it!
Implementations
sourceimpl Register
impl Register
sourcepub fn info(self) -> &'static RegisterInfo
pub fn info(self) -> &'static RegisterInfo
Gets register info
Examples
use iced_x86::*;
let info = Register::EAX.info();
assert_eq!(info.size(), 4);
sourcepub fn base(self) -> Self
pub fn base(self) -> Self
Gets the base register, eg. AL
, AX
, EAX
, RAX
, MM0
, XMM0
, YMM0
, ZMM0
, ES
Examples
use iced_x86::*;
assert_eq!(Register::GS.base(), Register::ES);
assert_eq!(Register::SIL.base(), Register::AL);
assert_eq!(Register::SP.base(), Register::AX);
assert_eq!(Register::R13D.base(), Register::EAX);
assert_eq!(Register::RBP.base(), Register::RAX);
assert_eq!(Register::MM6.base(), Register::MM0);
assert_eq!(Register::XMM28.base(), Register::XMM0);
assert_eq!(Register::YMM12.base(), Register::YMM0);
assert_eq!(Register::ZMM31.base(), Register::ZMM0);
assert_eq!(Register::K3.base(), Register::K0);
assert_eq!(Register::BND1.base(), Register::BND0);
assert_eq!(Register::ST7.base(), Register::ST0);
assert_eq!(Register::CR8.base(), Register::CR0);
assert_eq!(Register::DR6.base(), Register::DR0);
assert_eq!(Register::TR3.base(), Register::TR0);
assert_eq!(Register::RIP.base(), Register::EIP);
sourcepub fn number(self) -> usize
pub 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::*;
assert_eq!(Register::GS.number(), 5);
assert_eq!(Register::SIL.number(), 10);
assert_eq!(Register::SP.number(), 4);
assert_eq!(Register::R13D.number(), 13);
assert_eq!(Register::RBP.number(), 5);
assert_eq!(Register::MM6.number(), 6);
assert_eq!(Register::XMM28.number(), 28);
assert_eq!(Register::YMM12.number(), 12);
assert_eq!(Register::ZMM31.number(), 31);
assert_eq!(Register::K3.number(), 3);
assert_eq!(Register::BND1.number(), 1);
assert_eq!(Register::ST7.number(), 7);
assert_eq!(Register::CR8.number(), 8);
assert_eq!(Register::DR6.number(), 6);
assert_eq!(Register::TR3.number(), 3);
assert_eq!(Register::RIP.number(), 1);
sourcepub fn full_register(self) -> Self
pub fn full_register(self) -> Self
Gets 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::*;
assert_eq!(Register::GS.full_register(), Register::GS);
assert_eq!(Register::SIL.full_register(), Register::RSI);
assert_eq!(Register::SP.full_register(), Register::RSP);
assert_eq!(Register::R13D.full_register(), Register::R13);
assert_eq!(Register::RBP.full_register(), Register::RBP);
assert_eq!(Register::MM6.full_register(), Register::MM6);
assert_eq!(Register::XMM10.full_register(), Register::ZMM10);
assert_eq!(Register::YMM10.full_register(), Register::ZMM10);
assert_eq!(Register::ZMM10.full_register(), Register::ZMM10);
assert_eq!(Register::K3.full_register(), Register::K3);
assert_eq!(Register::BND1.full_register(), Register::BND1);
assert_eq!(Register::ST7.full_register(), Register::ST7);
assert_eq!(Register::CR8.full_register(), Register::CR8);
assert_eq!(Register::DR6.full_register(), Register::DR6);
assert_eq!(Register::TR3.full_register(), Register::TR3);
assert_eq!(Register::RIP.full_register(), Register::RIP);
sourcepub fn full_register32(self) -> Self
pub fn full_register32(self) -> Self
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::*;
assert_eq!(Register::GS.full_register32(), Register::GS);
assert_eq!(Register::SIL.full_register32(), Register::ESI);
assert_eq!(Register::SP.full_register32(), Register::ESP);
assert_eq!(Register::R13D.full_register32(), Register::R13D);
assert_eq!(Register::RBP.full_register32(), Register::EBP);
assert_eq!(Register::MM6.full_register32(), Register::MM6);
assert_eq!(Register::XMM10.full_register32(), Register::ZMM10);
assert_eq!(Register::YMM10.full_register32(), Register::ZMM10);
assert_eq!(Register::ZMM10.full_register32(), Register::ZMM10);
assert_eq!(Register::K3.full_register32(), Register::K3);
assert_eq!(Register::BND1.full_register32(), Register::BND1);
assert_eq!(Register::ST7.full_register32(), Register::ST7);
assert_eq!(Register::CR8.full_register32(), Register::CR8);
assert_eq!(Register::DR6.full_register32(), Register::DR6);
assert_eq!(Register::TR3.full_register32(), Register::TR3);
assert_eq!(Register::RIP.full_register32(), Register::RIP);
sourcepub fn size(self) -> usize
pub fn size(self) -> usize
Gets the size of the register in bytes
Examples
use iced_x86::*;
assert_eq!(Register::GS.size(), 2);
assert_eq!(Register::SIL.size(), 1);
assert_eq!(Register::SP.size(), 2);
assert_eq!(Register::R13D.size(), 4);
assert_eq!(Register::RBP.size(), 8);
assert_eq!(Register::MM6.size(), 8);
assert_eq!(Register::XMM10.size(), 16);
assert_eq!(Register::YMM10.size(), 32);
assert_eq!(Register::ZMM10.size(), 64);
assert_eq!(Register::K3.size(), 8);
assert_eq!(Register::BND1.size(), 16);
assert_eq!(Register::ST7.size(), 10);
assert_eq!(Register::CR8.size(), 8);
assert_eq!(Register::DR6.size(), 8);
assert_eq!(Register::TR3.size(), 4);
assert_eq!(Register::RIP.size(), 8);
sourceimpl Register
impl Register
sourcepub fn is_segment_register(self) -> bool
pub fn is_segment_register(self) -> bool
Checks if it’s a segment register (ES
, CS
, SS
, DS
, FS
, GS
)
Examples
use iced_x86::*;
assert!(Register::GS.is_segment_register());
assert!(!Register::RCX.is_segment_register());
sourcepub fn is_gpr(self) -> bool
pub fn is_gpr(self) -> bool
Checks if it’s a general purpose register (AL
-R15L
, AX
-R15W
, EAX
-R15D
, RAX
-R15
)
Examples
use iced_x86::*;
assert!(!Register::GS.is_gpr());
assert!(Register::CH.is_gpr());
assert!(Register::DX.is_gpr());
assert!(Register::R13D.is_gpr());
assert!(Register::RSP.is_gpr());
assert!(!Register::XMM0.is_gpr());
sourcepub fn is_gpr8(self) -> bool
pub fn is_gpr8(self) -> bool
Checks if it’s an 8-bit general purpose register (AL
-R15L
)
Examples
use iced_x86::*;
assert!(!Register::GS.is_gpr8());
assert!(Register::CH.is_gpr8());
assert!(!Register::DX.is_gpr8());
assert!(!Register::R13D.is_gpr8());
assert!(!Register::RSP.is_gpr8());
assert!(!Register::XMM0.is_gpr8());
sourcepub fn is_gpr16(self) -> bool
pub fn is_gpr16(self) -> bool
Checks if it’s a 16-bit general purpose register (AX
-R15W
)
Examples
use iced_x86::*;
assert!(!Register::GS.is_gpr16());
assert!(!Register::CH.is_gpr16());
assert!(Register::DX.is_gpr16());
assert!(!Register::R13D.is_gpr16());
assert!(!Register::RSP.is_gpr16());
assert!(!Register::XMM0.is_gpr16());
sourcepub fn is_gpr32(self) -> bool
pub fn is_gpr32(self) -> bool
Checks if it’s a 32-bit general purpose register (EAX
-R15D
)
Examples
use iced_x86::*;
assert!(!Register::GS.is_gpr32());
assert!(!Register::CH.is_gpr32());
assert!(!Register::DX.is_gpr32());
assert!(Register::R13D.is_gpr32());
assert!(!Register::RSP.is_gpr32());
assert!(!Register::XMM0.is_gpr32());
sourcepub fn is_gpr64(self) -> bool
pub fn is_gpr64(self) -> bool
Checks if it’s a 64-bit general purpose register (RAX
-R15
)
Examples
use iced_x86::*;
assert!(!Register::GS.is_gpr64());
assert!(!Register::CH.is_gpr64());
assert!(!Register::DX.is_gpr64());
assert!(!Register::R13D.is_gpr64());
assert!(Register::RSP.is_gpr64());
assert!(!Register::XMM0.is_gpr64());
sourcepub fn is_xmm(self) -> bool
pub fn is_xmm(self) -> bool
Checks if it’s a 128-bit vector register (XMM0
-XMM31
)
Examples
use iced_x86::*;
assert!(!Register::R13D.is_xmm());
assert!(!Register::RSP.is_xmm());
assert!(Register::XMM0.is_xmm());
assert!(!Register::YMM0.is_xmm());
assert!(!Register::ZMM0.is_xmm());
sourcepub fn is_ymm(self) -> bool
pub fn is_ymm(self) -> bool
Checks if it’s a 256-bit vector register (YMM0
-YMM31
)
Examples
use iced_x86::*;
assert!(!Register::R13D.is_ymm());
assert!(!Register::RSP.is_ymm());
assert!(!Register::XMM0.is_ymm());
assert!(Register::YMM0.is_ymm());
assert!(!Register::ZMM0.is_ymm());
sourcepub fn is_zmm(self) -> bool
pub fn is_zmm(self) -> bool
Checks if it’s a 512-bit vector register (ZMM0
-ZMM31
)
Examples
use iced_x86::*;
assert!(!Register::R13D.is_zmm());
assert!(!Register::RSP.is_zmm());
assert!(!Register::XMM0.is_zmm());
assert!(!Register::YMM0.is_zmm());
assert!(Register::ZMM0.is_zmm());
sourcepub fn is_vector_register(self) -> bool
pub fn is_vector_register(self) -> bool
Checks if it’s an XMM
, YMM
or ZMM
register
Examples
use iced_x86::*;
assert!(!Register::R13D.is_vector_register());
assert!(!Register::RSP.is_vector_register());
assert!(Register::XMM0.is_vector_register());
assert!(Register::YMM0.is_vector_register());
assert!(Register::ZMM0.is_vector_register());
sourcepub fn is_ip(self) -> bool
pub fn is_ip(self) -> bool
Checks if it’s EIP
/RIP
Examples
use iced_x86::*;
assert!(Register::EIP.is_ip());
assert!(Register::RIP.is_ip());
sourcepub fn is_k(self) -> bool
pub fn is_k(self) -> bool
Checks if it’s an opmask register (K0
-K7
)
Examples
use iced_x86::*;
assert!(!Register::R13D.is_k());
assert!(Register::K3.is_k());
sourcepub fn is_cr(self) -> bool
pub fn is_cr(self) -> bool
Checks if it’s a control register (CR0
-CR15
)
Examples
use iced_x86::*;
assert!(!Register::R13D.is_cr());
assert!(Register::CR3.is_cr());
sourcepub fn is_dr(self) -> bool
pub fn is_dr(self) -> bool
Checks if it’s a debug register (DR0
-DR15
)
Examples
use iced_x86::*;
assert!(!Register::R13D.is_dr());
assert!(Register::DR3.is_dr());
sourcepub fn is_tr(self) -> bool
pub fn is_tr(self) -> bool
Checks if it’s a test register (TR0
-TR7
)
Examples
use iced_x86::*;
assert!(!Register::R13D.is_tr());
assert!(Register::TR3.is_tr());
sourcepub fn is_st(self) -> bool
pub fn is_st(self) -> bool
Checks if it’s an FPU stack register (ST0
-ST7
)
Examples
use iced_x86::*;
assert!(!Register::R13D.is_st());
assert!(Register::ST3.is_st());
sourcepub fn is_bnd(self) -> bool
pub fn is_bnd(self) -> bool
Checks if it’s a bound register (BND0
-BND3
)
Examples
use iced_x86::*;
assert!(!Register::R13D.is_bnd());
assert!(Register::BND3.is_bnd());
sourceimpl Register
impl Register
sourcepub fn values(
) -> impl Iterator<Item = Register> + DoubleEndedIterator + ExactSizeIterator + FusedIterator
pub fn values(
) -> impl Iterator<Item = Register> + DoubleEndedIterator + ExactSizeIterator + FusedIterator
Iterates over all Register
enum values
Trait Implementations
sourceimpl AddAssign<i32> for Register
impl AddAssign<i32> for Register
sourcefn add_assign(&mut self, rhs: i32)
fn add_assign(&mut self, rhs: i32)
+=
operation. Read moresourceimpl AddAssign<u32> for Register
impl AddAssign<u32> for Register
sourcefn add_assign(&mut self, rhs: u32)
fn add_assign(&mut self, rhs: u32)
+=
operation. Read moresourceimpl<'de> Deserialize<'de> for Register
impl<'de> Deserialize<'de> for Register
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
sourceimpl From<AsmRegister16> for Register
impl From<AsmRegister16> for Register
sourcefn from(reg: AsmRegister16) -> Self
fn from(reg: AsmRegister16) -> Self
sourceimpl From<AsmRegister32> for Register
impl From<AsmRegister32> for Register
sourcefn from(reg: AsmRegister32) -> Self
fn from(reg: AsmRegister32) -> Self
sourceimpl From<AsmRegister64> for Register
impl From<AsmRegister64> for Register
sourcefn from(reg: AsmRegister64) -> Self
fn from(reg: AsmRegister64) -> Self
sourceimpl From<AsmRegister8> for Register
impl From<AsmRegister8> for Register
sourcefn from(reg: AsmRegister8) -> Self
fn from(reg: AsmRegister8) -> Self
sourceimpl From<AsmRegisterBnd> for Register
impl From<AsmRegisterBnd> for Register
sourcefn from(reg: AsmRegisterBnd) -> Self
fn from(reg: AsmRegisterBnd) -> Self
sourceimpl From<AsmRegisterCr> for Register
impl From<AsmRegisterCr> for Register
sourcefn from(reg: AsmRegisterCr) -> Self
fn from(reg: AsmRegisterCr) -> Self
sourceimpl From<AsmRegisterDr> for Register
impl From<AsmRegisterDr> for Register
sourcefn from(reg: AsmRegisterDr) -> Self
fn from(reg: AsmRegisterDr) -> Self
sourceimpl From<AsmRegisterK> for Register
impl From<AsmRegisterK> for Register
sourcefn from(reg: AsmRegisterK) -> Self
fn from(reg: AsmRegisterK) -> Self
sourceimpl From<AsmRegisterMm> for Register
impl From<AsmRegisterMm> for Register
sourcefn from(reg: AsmRegisterMm) -> Self
fn from(reg: AsmRegisterMm) -> Self
sourceimpl From<AsmRegisterSegment> for Register
impl From<AsmRegisterSegment> for Register
sourcefn from(reg: AsmRegisterSegment) -> Self
fn from(reg: AsmRegisterSegment) -> Self
sourceimpl From<AsmRegisterSt> for Register
impl From<AsmRegisterSt> for Register
sourcefn from(reg: AsmRegisterSt) -> Self
fn from(reg: AsmRegisterSt) -> Self
sourceimpl From<AsmRegisterTmm> for Register
impl From<AsmRegisterTmm> for Register
sourcefn from(reg: AsmRegisterTmm) -> Self
fn from(reg: AsmRegisterTmm) -> Self
sourceimpl From<AsmRegisterTr> for Register
impl From<AsmRegisterTr> for Register
sourcefn from(reg: AsmRegisterTr) -> Self
fn from(reg: AsmRegisterTr) -> Self
sourceimpl From<AsmRegisterXmm> for Register
impl From<AsmRegisterXmm> for Register
sourcefn from(reg: AsmRegisterXmm) -> Self
fn from(reg: AsmRegisterXmm) -> Self
sourceimpl From<AsmRegisterYmm> for Register
impl From<AsmRegisterYmm> for Register
sourcefn from(reg: AsmRegisterYmm) -> Self
fn from(reg: AsmRegisterYmm) -> Self
sourceimpl From<AsmRegisterZmm> for Register
impl From<AsmRegisterZmm> for Register
sourcefn from(reg: AsmRegisterZmm) -> Self
fn from(reg: AsmRegisterZmm) -> Self
sourceimpl Ord for Register
impl Ord for Register
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl PartialOrd<Register> for Register
impl PartialOrd<Register> for Register
sourcefn partial_cmp(&self, other: &Register) -> Option<Ordering>
fn partial_cmp(&self, other: &Register) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl SubAssign<i32> for Register
impl SubAssign<i32> for Register
sourcefn sub_assign(&mut self, rhs: i32)
fn sub_assign(&mut self, rhs: i32)
-=
operation. Read moresourceimpl SubAssign<u32> for Register
impl SubAssign<u32> for Register
sourcefn sub_assign(&mut self, rhs: u32)
fn sub_assign(&mut self, rhs: u32)
-=
operation. Read more