Struct intel_8080_emu::proc_state::Proc8080 [−][src]
pub struct Proc8080<Bus: DataBus> { /* fields omitted */ }
Structure containing the processor state (flags, registers and memory) and logic.
Methods
impl<Bus: DataBus> Proc8080<Bus>
[src]
impl<Bus: DataBus> Proc8080<Bus>
pub fn new(mem: Box<[u8]>, data_bus: Bus) -> Proc8080<Bus>
[src]
pub fn new(mem: Box<[u8]>, data_bus: Bus) -> Proc8080<Bus>
Builds a new Proc8080
with the given memory mem
and DataBus
.
The memory contains both the ROM and RAM of the processor. Usually it is called with a boxed array of size 0xffff (adressable space for the intel 8080) which contains the ROM at the beginning of the memory. The processor starts with the program counter equal to 0.
The data_bus
contains callbacks called when running a IN
or OUT
opcode.
pub fn flags(&self) -> &Flags
[src]
pub fn flags(&self) -> &Flags
Borrows the procesor flags immutably.
pub fn registers(&self) -> &Registers
[src]
pub fn registers(&self) -> &Registers
Borrows the procesor registers immutably.
pub fn emulate(&mut self)
[src]
pub fn emulate(&mut self)
Reads the next opcode in memory and changes state accordingly.
This methods run one step
of the processor simulation. It reads the next opcode according
to the program counter
pub fn memory(&self) -> &[u8]
[src]
pub fn memory(&self) -> &[u8]
Borrows the memory immutably.
pub fn interrupt(&mut self, rst_value: u8)
[src]
pub fn interrupt(&mut self, rst_value: u8)
Make the processor run a RST
instruction.
There are 8 possible RST
instruction for the 8080 (RST 0
to 7
). The specific
instruction is chosen via rst_value
.
An interrupt restart a processor which was in stopped state after running a HLT opcode.
Panics
If rst_value
is greater than 7;
pub fn cycles(&self) -> u64
[src]
pub fn cycles(&self) -> u64
Cycles elapsed since the cpu was created