Struct rs6502::Cpu
[−]
[src]
pub struct Cpu { pub memory: MemoryBus, pub registers: Registers, pub flags: StatusFlags, pub stack: Stack, }
A representation of a 6502 microprocessor
Fields
memory: MemoryBus
registers: Registers
flags: StatusFlags
stack: Stack
Methods
impl Cpu
[src]
fn new() -> Cpu
Returns a default instance of a Cpu
fn load<T>(&mut self, code: &[u8], addr: T) -> Result<(), CpuError> where
T: Into<Option<u16>>,
T: Into<Option<u16>>,
Loads code into the Cpu main memory at an optional offset. If no offset is provided, the Cpu will, by default, load the code into main memory at 0xC000
fn step_n(&mut self, n: u32) -> Result<u64, CpuError>
Runs N instructions of code through the Cpu
fn reset(&mut self)
fn step(&mut self) -> CpuStepResult
Runs a single instruction of code through the Cpu
fn nmi(&mut self)
Execute the Non-Maskable Interrupt handler. This ignores the interrupt flag and forces execution to the NMI
fn irq(&mut self)
Execute the Interrupt ReQuest handler if we currently are accepting maskable interrupts. Ignore it otherwise.