#[repr(transparent)]pub struct Flags(u32);
Expand description
The RFLAGS register.
Tuple Fields§
§0: u32
Implementations§
source§impl Flags
impl Flags
const CARRY_BITS: usize = 1usize
const CARRY_OFFSET: usize = 0usize
sourcepub const fn with_carry(self, value: bool) -> Self
pub const fn with_carry(self, value: bool) -> Self
Set by hardware if last arithmetic operation generated a carry out of the most-significant bit of the result.
Bits: 0..1
sourcepub const fn carry(&self) -> bool
pub const fn carry(&self) -> bool
Set by hardware if last arithmetic operation generated a carry out of the most-significant bit of the result.
Bits: 0..1
sourcepub fn set_carry(&mut self, value: bool)
pub fn set_carry(&mut self, value: bool)
Set by hardware if last arithmetic operation generated a carry out of the most-significant bit of the result.
Bits: 0..1
const PARITY_BITS: usize = 1usize
const PARITY_OFFSET: usize = 2usize
sourcepub const fn with_parity(self, value: bool) -> Self
pub const fn with_parity(self, value: bool) -> Self
Set by hardware if last result has an even number of 1 bits (only for some operations).
Bits: 2..3
sourcepub const fn parity(&self) -> bool
pub const fn parity(&self) -> bool
Set by hardware if last result has an even number of 1 bits (only for some operations).
Bits: 2..3
sourcepub fn set_parity(&mut self, value: bool)
pub fn set_parity(&mut self, value: bool)
Set by hardware if last result has an even number of 1 bits (only for some operations).
Bits: 2..3
const AUXILIARY_CARRY_BITS: usize = 1usize
const AUXILIARY_CARRY_OFFSET: usize = 4usize
sourcepub const fn with_auxiliary_carry(self, value: bool) -> Self
pub const fn with_auxiliary_carry(self, value: bool) -> Self
Set by hardware if last arithmetic operation generated a carry ouf of bit 3 of the result.
Bits: 4..5
sourcepub const fn auxiliary_carry(&self) -> bool
pub const fn auxiliary_carry(&self) -> bool
Set by hardware if last arithmetic operation generated a carry ouf of bit 3 of the result.
Bits: 4..5
sourcepub fn set_auxiliary_carry(&mut self, value: bool)
pub fn set_auxiliary_carry(&mut self, value: bool)
Set by hardware if last arithmetic operation generated a carry ouf of bit 3 of the result.
Bits: 4..5
const ZERO_BITS: usize = 1usize
const ZERO_OFFSET: usize = 6usize
sourcepub const fn with_zero(self, value: bool) -> Self
pub const fn with_zero(self, value: bool) -> Self
Set by hardware if last arithmetic operation resulted in a zero value.
Bits: 6..7
sourcepub const fn zero(&self) -> bool
pub const fn zero(&self) -> bool
Set by hardware if last arithmetic operation resulted in a zero value.
Bits: 6..7
sourcepub fn set_zero(&mut self, value: bool)
pub fn set_zero(&mut self, value: bool)
Set by hardware if last arithmetic operation resulted in a zero value.
Bits: 6..7
const SIGN_BITS: usize = 1usize
const SIGN_OFFSET: usize = 7usize
sourcepub const fn with_sign(self, value: bool) -> Self
pub const fn with_sign(self, value: bool) -> Self
Set by hardware if last arithmetic operation resulted in a negative value.
Bits: 7..8
sourcepub const fn sign(&self) -> bool
pub const fn sign(&self) -> bool
Set by hardware if last arithmetic operation resulted in a negative value.
Bits: 7..8
sourcepub fn set_sign(&mut self, value: bool)
pub fn set_sign(&mut self, value: bool)
Set by hardware if last arithmetic operation resulted in a negative value.
Bits: 7..8
const TRAP_BITS: usize = 1usize
const TRAP_OFFSET: usize = 8usize
sourcepub const fn with_trap(self, value: bool) -> Self
pub const fn with_trap(self, value: bool) -> Self
Enable single-step mode for debugging.
Bits: 8..9
const INTERRUPT_BITS: usize = 1usize
const INTERRUPT_OFFSET: usize = 9usize
sourcepub const fn with_interrupt(self, value: bool) -> Self
pub const fn with_interrupt(self, value: bool) -> Self
Enable interrupts.
Bits: 9..10
sourcepub fn set_interrupt(&mut self, value: bool)
pub fn set_interrupt(&mut self, value: bool)
Enable interrupts.
Bits: 9..10
const DIRECTION_BITS: usize = 1usize
const DIRECTION_OFFSET: usize = 10usize
sourcepub const fn with_direction(self, value: bool) -> Self
pub const fn with_direction(self, value: bool) -> Self
Determines the order in which strings are processed.
Bits: 10..11
sourcepub const fn direction(&self) -> bool
pub const fn direction(&self) -> bool
Determines the order in which strings are processed.
Bits: 10..11
sourcepub fn set_direction(&mut self, value: bool)
pub fn set_direction(&mut self, value: bool)
Determines the order in which strings are processed.
Bits: 10..11
const OVERFLOW_BITS: usize = 1usize
const OVERFLOW_OFFSET: usize = 11usize
sourcepub const fn with_overflow(self, value: bool) -> Self
pub const fn with_overflow(self, value: bool) -> Self
Set by hardware to indicate that the sign bit of the result of the last signed integer operation differs from the source operands.
Bits: 11..12
sourcepub const fn overflow(&self) -> bool
pub const fn overflow(&self) -> bool
Set by hardware to indicate that the sign bit of the result of the last signed integer operation differs from the source operands.
Bits: 11..12
sourcepub fn set_overflow(&mut self, value: bool)
pub fn set_overflow(&mut self, value: bool)
Set by hardware to indicate that the sign bit of the result of the last signed integer operation differs from the source operands.
Bits: 11..12
const IOPL_LOW_BITS: usize = 1usize
const IOPL_LOW_OFFSET: usize = 12usize
sourcepub const fn with_iopl_low(self, value: bool) -> Self
pub const fn with_iopl_low(self, value: bool) -> Self
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 12..13
sourcepub const fn iopl_low(&self) -> bool
pub const fn iopl_low(&self) -> bool
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 12..13
sourcepub fn set_iopl_low(&mut self, value: bool)
pub fn set_iopl_low(&mut self, value: bool)
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 12..13
const IOPL_HIGH_BITS: usize = 1usize
const IOPL_HIGH_OFFSET: usize = 13usize
sourcepub const fn with_iopl_high(self, value: bool) -> Self
pub const fn with_iopl_high(self, value: bool) -> Self
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 13..14
sourcepub const fn iopl_high(&self) -> bool
pub const fn iopl_high(&self) -> bool
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 13..14
sourcepub fn set_iopl_high(&mut self, value: bool)
pub fn set_iopl_high(&mut self, value: bool)
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 13..14
const NESTED_TASK_BITS: usize = 1usize
const NESTED_TASK_OFFSET: usize = 14usize
sourcepub const fn with_nested_task(self, value: bool) -> Self
pub const fn with_nested_task(self, value: bool) -> Self
Used by iret
in hardware task switch mode to determine if current task is nested.
Bits: 14..15
sourcepub const fn nested_task(&self) -> bool
pub const fn nested_task(&self) -> bool
Used by iret
in hardware task switch mode to determine if current task is nested.
Bits: 14..15
sourcepub fn set_nested_task(&mut self, value: bool)
pub fn set_nested_task(&mut self, value: bool)
Used by iret
in hardware task switch mode to determine if current task is nested.
Bits: 14..15
const RESUME_BITS: usize = 1usize
const RESUME_OFFSET: usize = 16usize
sourcepub const fn with_resume(self, value: bool) -> Self
pub const fn with_resume(self, value: bool) -> Self
Temporarily disables debug exceptions so that an instruction can be restarted after a debug exception without immediately causing another debug exception.
Bits: 16..17
sourcepub const fn resume(&self) -> bool
pub const fn resume(&self) -> bool
Temporarily disables debug exceptions so that an instruction can be restarted after a debug exception without immediately causing another debug exception.
Bits: 16..17
sourcepub fn set_resume(&mut self, value: bool)
pub fn set_resume(&mut self, value: bool)
Temporarily disables debug exceptions so that an instruction can be restarted after a debug exception without immediately causing another debug exception.
Bits: 16..17
const VIRTUAL_8086_MODE_BITS: usize = 1usize
const VIRTUAL_8086_MODE_OFFSET: usize = 17usize
sourcepub const fn with_virtual_8086_mode(self, value: bool) -> Self
pub const fn with_virtual_8086_mode(self, value: bool) -> Self
Enable the virtual-8086 mode.
Bits: 17..18
sourcepub const fn virtual_8086_mode(&self) -> bool
pub const fn virtual_8086_mode(&self) -> bool
Enable the virtual-8086 mode.
Bits: 17..18
sourcepub fn set_virtual_8086_mode(&mut self, value: bool)
pub fn set_virtual_8086_mode(&mut self, value: bool)
Enable the virtual-8086 mode.
Bits: 17..18
const ALIGNMENT_CHECK_BITS: usize = 1usize
const ALIGNMENT_CHECK_OFFSET: usize = 18usize
sourcepub const fn with_alignment_check(self, value: bool) -> Self
pub const fn with_alignment_check(self, value: bool) -> Self
Enable automatic alignment checking if CR0.AM is set. Only works if CPL is 3.
Bits: 18..19
sourcepub const fn alignment_check(&self) -> bool
pub const fn alignment_check(&self) -> bool
Enable automatic alignment checking if CR0.AM is set. Only works if CPL is 3.
Bits: 18..19
sourcepub fn set_alignment_check(&mut self, value: bool)
pub fn set_alignment_check(&mut self, value: bool)
Enable automatic alignment checking if CR0.AM is set. Only works if CPL is 3.
Bits: 18..19
const VIRTUAL_INTERRUPT_BITS: usize = 1usize
const VIRTUAL_INTERRUPT_OFFSET: usize = 19usize
sourcepub const fn with_virtual_interrupt(self, value: bool) -> Self
pub const fn with_virtual_interrupt(self, value: bool) -> Self
Virtual interrupt flag.
Bits: 19..20
sourcepub const fn virtual_interrupt(&self) -> bool
pub const fn virtual_interrupt(&self) -> bool
Virtual interrupt flag.
Bits: 19..20
sourcepub fn set_virtual_interrupt(&mut self, value: bool)
pub fn set_virtual_interrupt(&mut self, value: bool)
Virtual interrupt flag.
Bits: 19..20
const VIRTUAL_INTERRUPT_PENDING_BITS: usize = 1usize
const VIRTUAL_INTERRUPT_PENDING_OFFSET: usize = 20usize
sourcepub const fn with_virtual_interrupt_pending(self, value: bool) -> Self
pub const fn with_virtual_interrupt_pending(self, value: bool) -> Self
Virtual interrupt pending.
Bits: 20..21
sourcepub const fn virtual_interrupt_pending(&self) -> bool
pub const fn virtual_interrupt_pending(&self) -> bool
Virtual interrupt pending.
Bits: 20..21
sourcepub fn set_virtual_interrupt_pending(&mut self, value: bool)
pub fn set_virtual_interrupt_pending(&mut self, value: bool)
Virtual interrupt pending.
Bits: 20..21