State

Struct State 

Source
pub struct State { /* private fields */ }
Expand description

This struct stores the internal registers and flags of the 8080 CPU.

Implementations§

Source§

impl State

Source

pub fn flags(&self) -> u8

This method exposes the flag bits of the 8080 in the same format as the PSW pseudo-register, mz0a0p1c, where

  • m is the sign flag;
  • z is the zero flag;
  • a is the auxilliary carry flag;
  • p is the even-parity flag;
  • c is the carry flag.
Source

pub fn is_stopped(&self) -> bool

Whether or not the processor is in a stopped state (not executing operations from the PC). The processor will return to an active state if it receives an interrupt.

Note that if interrupts are disabled when the processor is halted, the processor will remain stopped until it is reset from outside.

Source

pub fn is_interrupt_ready(&self) -> bool

Whether the processor is accepting interrupts; this is disabled automatically when an interrupt is received, to allow the interrupt to finish processing without being further disrupted. It is also set by the EI operation and reset by the DI operation.

Source§

impl State

Source

pub fn new() -> Self

Creates a fresh state with the processor in an active state and all registers reset.

Trait Implementations§

Source§

impl Index<Double> for State

Source§

type Output = Wrapping<u16>

The returned type after indexing.
Source§

fn index(&self, index: Double) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<Internal> for State

Source§

type Output = Wrapping<u16>

The returned type after indexing.
Source§

fn index(&self, index: Internal) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<Register> for State

Source§

type Output = Wrapping<u8>

The returned type after indexing.
Source§

fn index(&self, index: Register) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<Double> for State

Source§

fn index_mut(&mut self, index: Double) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<Internal> for State

Source§

fn index_mut(&mut self, index: Internal) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<Register> for State

Source§

fn index_mut(&mut self, index: Register) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl Freeze for State

§

impl RefUnwindSafe for State

§

impl Send for State

§

impl Sync for State

§

impl Unpin for State

§

impl UnwindSafe for State

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>,

Source§

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>,

Source§

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.