logo
pub struct RegisterInfo { /* private fields */ }
Expand description

Register information

Implementations

Gets the register

Examples
use iced_x86::*;
let info = Register::EAX.info();
assert_eq!(info.register(), Register::EAX);

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);

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);

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);

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);

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

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.