#[repr(u8)]pub enum DataRegister {
Show 16 variants
V0 = 0,
V1 = 1,
V2 = 2,
V3 = 3,
V4 = 4,
V5 = 5,
V6 = 6,
V7 = 7,
V8 = 8,
V9 = 9,
VA = 10,
VB = 11,
VC = 12,
VD = 13,
VE = 14,
VF = 15,
}Expand description
Data register of the CHIP-8 processor.
Variants§
V0 = 0
Used as the offset in [Instruction::JumpOffset].
V1 = 1
V2 = 2
V3 = 3
V4 = 4
V5 = 5
V6 = 6
V7 = 7
V8 = 8
V9 = 9
VA = 10
VB = 11
VC = 12
VD = 13
VE = 14
VF = 15
Used for carry/borrow flags and set to the shifted-out bit after bit shifts.
See [Instruction::AddAssign], [Instruction::SubAssign],
[Instruction::RevSubAssign], [Instruction::ShrAssign]
and [Instruction::ShlAssign].
Implementations§
Source§impl DataRegister
impl DataRegister
Sourcepub unsafe fn from_unchecked(number: u8) -> Self
pub unsafe fn from_unchecked(number: u8) -> Self
Transmutes number: u8 into a DataRegister.
§Safety
numbermust represent a valid discriminant ofDataRegister
Trait Implementations§
Source§impl Clone for DataRegister
impl Clone for DataRegister
Source§fn clone(&self) -> DataRegister
fn clone(&self) -> DataRegister
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DataRegister
impl Debug for DataRegister
Source§impl From<DataRegister> for u8
impl From<DataRegister> for u8
Source§fn from(enum_value: DataRegister) -> Self
fn from(enum_value: DataRegister) -> Self
Converts to this type from the input type.
Source§impl Ord for DataRegister
impl Ord for DataRegister
Source§fn cmp(&self, other: &DataRegister) -> Ordering
fn cmp(&self, other: &DataRegister) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for DataRegister
impl PartialEq for DataRegister
Source§impl PartialOrd for DataRegister
impl PartialOrd for DataRegister
Source§impl Step for DataRegister
impl Step for DataRegister
Source§fn steps_between(start: &Self, end: &Self) -> Option<usize>
fn steps_between(start: &Self, end: &Self) -> Option<usize>
🔬This is a nightly-only experimental API. (
step_trait)Source§fn forward_checked(start: Self, count: usize) -> Option<Self>
fn forward_checked(start: Self, count: usize) -> Option<Self>
🔬This is a nightly-only experimental API. (
step_trait)Source§fn backward_checked(start: Self, count: usize) -> Option<Self>
fn backward_checked(start: Self, count: usize) -> Option<Self>
🔬This is a nightly-only experimental API. (
step_trait)Source§fn forward(start: Self, count: usize) -> Self
fn forward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)Source§unsafe fn forward_unchecked(start: Self, count: usize) -> Self
unsafe fn forward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)Source§fn backward(start: Self, count: usize) -> Self
fn backward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)Source§unsafe fn backward_unchecked(start: Self, count: usize) -> Self
unsafe fn backward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)Source§impl TryFrom<u8> for DataRegister
impl TryFrom<u8> for DataRegister
Source§type Error = TryFromPrimitiveError<DataRegister>
type Error = TryFromPrimitiveError<DataRegister>
The type returned in the event of a conversion error.
Source§impl TryFromPrimitive for DataRegister
impl TryFromPrimitive for DataRegister
impl Copy for DataRegister
impl Eq for DataRegister
impl StructuralPartialEq for DataRegister
Auto Trait Implementations§
impl Freeze for DataRegister
impl RefUnwindSafe for DataRegister
impl Send for DataRegister
impl Sync for DataRegister
impl Unpin for DataRegister
impl UnwindSafe for DataRegister
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