pub struct RexPrefix { /* private fields */ }
Expand description
Construct and emit the REX prefix byte.
For more details, see section 2.2.1, “REX Prefixes” in Intel’s reference manual.
Implementations§
Source§impl RexPrefix
impl RexPrefix
Sourcepub const fn one_op(enc: u8, w_bit: bool, uses_8bit: bool) -> Self
pub const fn one_op(enc: u8, w_bit: bool, uses_8bit: bool) -> Self
Construct the RexPrefix
for a unary instruction.
Used with a single register operand:
x
andr
are unused.b
extends thereg
register, allowing access to r8-r15, or the top bit of the opcode digit.
Sourcepub const fn two_op(
enc_reg: u8,
enc_rm: u8,
w_bit: bool,
uses_8bit: bool,
) -> Self
pub const fn two_op( enc_reg: u8, enc_rm: u8, w_bit: bool, uses_8bit: bool, ) -> Self
Construct the RexPrefix
for a binary instruction.
Used without a SIB byte or for register-to-register addressing:
r
extends thereg
operand, allowing access to r8-r15.x
is unused.b
extends ther/m
operand, allowing access to r8-r15.
Sourcepub const fn with_digit(
digit: u8,
enc_reg: u8,
w_bit: bool,
uses_8bit: bool,
) -> Self
pub const fn with_digit( digit: u8, enc_reg: u8, w_bit: bool, uses_8bit: bool, ) -> Self
Construct the RexPrefix
for an instruction using an opcode digit.
:
r
extends the opcode digit.x
is unused.b
extends thereg
operand, allowing access to r8-r15.
Sourcepub const fn three_op(
enc_reg: u8,
enc_index: u8,
enc_base: u8,
w_bit: bool,
uses_8bit: bool,
) -> Self
pub const fn three_op( enc_reg: u8, enc_index: u8, enc_base: u8, w_bit: bool, uses_8bit: bool, ) -> Self
Construct the RexPrefix
for a ternary instruction, typically using a
memory address.
Used with a SIB byte:
r
extends thereg
operand, allowing access to r8-r15.x
extends the index register, allowing access to r8-r15.b
extends the base register, allowing access to r8-r15.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RexPrefix
impl RefUnwindSafe for RexPrefix
impl Send for RexPrefix
impl Sync for RexPrefix
impl Unpin for RexPrefix
impl UnwindSafe for RexPrefix
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