Struct iz80::Registers

source ·
pub struct Registers { /* private fields */ }
Expand description

Z80 internal register values

Implementations§

source§

impl Registers

source

pub fn a(&self) -> u8

Returns the value of the A register

source

pub fn set_a(&mut self, value: u8)

Sets the A register

source

pub fn get8(&self, reg: Reg8) -> u8

Returns the value of an 8 bit register

source

pub fn set8(&mut self, reg: Reg8, value: u8)

Sets the value of an 8 bit register

source

pub fn get16(&self, rr: Reg16) -> u16

Returns the value of a 16 bit register

source

pub fn set16(&mut self, rr: Reg16, value: u16)

Sets the value of a 16 bit register. Changes the value of the two underlying 8 bit registers.

source

pub fn get_flag(&self, flag: Flag) -> bool

Returns the value of a flag

source

pub fn set_flag(&mut self, flag: Flag)

Sets a flag. Sets the value to true

source

pub fn clear_flag(&mut self, flag: Flag)

Clears a flag. Sets the value to false

source

pub fn put_flag(&mut self, flag: Flag, value: bool)

Sets the value of a flag

source

pub fn pc(&self) -> u16

Returns the program counter

source

pub fn set_pc(&mut self, value: u16)

Changes the program counter

Trait Implementations§

source§

impl Debug for Registers

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.