Struct z80emu::RegisterPair
source · pub struct RegisterPair(/* private fields */);
Expand description
A struct that represents a register pair, that can be treated as a single 16-bit register or a separate 8-bit (MSB/LSB) registers.
Implementations§
source§impl RegisterPair
impl RegisterPair
pub fn ptr8hi(&mut self) -> *mut u8
pub fn ptr8lo(&mut self) -> *mut u8
pub fn get16(self) -> u16
pub fn set16(&mut self, val: u16)
pub fn get8hi(self) -> u8
pub fn get8lo(self) -> u8
pub fn set8hi(&mut self, val: u8)
pub fn set8lo(&mut self, val: u8)
sourcepub fn get(self) -> (u8, u8)
pub fn get(self) -> (u8, u8)
Returns values of this pair of registers as a tuple of (MSB, LSB)
.
pub fn set(&mut self, hi: u8, lo: u8)
pub fn inc16(&mut self)
pub fn add16(&mut self, val: u16)
pub fn dec16(&mut self)
sourcepub fn dec16_is_zero(&mut self) -> bool
pub fn dec16_is_zero(&mut self) -> bool
Subtracts 1 from the 16-bit register and returns true if the result is 0.
sourcepub fn op16<F: FnOnce(u16) -> (u8, u8)>(&mut self, op: F)
pub fn op16<F: FnOnce(u16) -> (u8, u8)>(&mut self, op: F)
Applies op to the 16-bit register value and modifies it in place.
Trait Implementations§
source§impl Clone for RegisterPair
impl Clone for RegisterPair
source§fn clone(&self) -> RegisterPair
fn clone(&self) -> RegisterPair
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 RegisterPair
impl Debug for RegisterPair
source§impl Default for RegisterPair
impl Default for RegisterPair
source§fn default() -> RegisterPair
fn default() -> RegisterPair
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for RegisterPair
impl<'de> Deserialize<'de> for RegisterPair
source§fn 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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<i16> for RegisterPair
impl From<i16> for RegisterPair
source§impl From<u16> for RegisterPair
impl From<u16> for RegisterPair
source§impl Hash for RegisterPair
impl Hash for RegisterPair
source§impl PartialEq for RegisterPair
impl PartialEq for RegisterPair
source§fn eq(&self, other: &RegisterPair) -> bool
fn eq(&self, other: &RegisterPair) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for RegisterPair
impl Serialize for RegisterPair
impl Copy for RegisterPair
impl Eq for RegisterPair
impl StructuralPartialEq for RegisterPair
Auto Trait Implementations§
impl RefUnwindSafe for RegisterPair
impl Send for RegisterPair
impl Sync for RegisterPair
impl Unpin for RegisterPair
impl UnwindSafe for RegisterPair
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