pub trait Memory {
// Required methods
fn read(&mut self, addr: u16) -> u8;
fn write(&mut self, addr: u16, val: u8);
// Provided methods
fn read_word(&mut self, addr: u16) -> u16 { ... }
fn write_word(&mut self, addr: u16, val: u16) { ... }
}Expand description
Memory trait for the 6809 CPU.
Implement this trait to provide the CPU with access to memory and I/O.
The 6809 has a 16-bit address bus (64KB address space) and an 8-bit data bus.
Re-implementations of word read/write methods must use big-endian byte order
(high byte at addr, low byte at addr + 1).
Required Methods§
Provided Methods§
Sourcefn read_word(&mut self, addr: u16) -> u16
fn read_word(&mut self, addr: u16) -> u16
Read a big-endian 16-bit word (high byte at addr, low byte at addr + 1).
Sourcefn write_word(&mut self, addr: u16, val: u16)
fn write_word(&mut self, addr: u16, val: u16)
Write a big-endian 16-bit word (high byte at addr, low byte at addr + 1).