Skip to main content

Memory

Trait Memory 

Source
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§

Source

fn read(&mut self, addr: u16) -> u8

Read a byte from the given address.

Source

fn write(&mut self, addr: u16, val: u8)

Write a byte to the given address.

Provided Methods§

Source

fn read_word(&mut self, addr: u16) -> u16

Read a big-endian 16-bit word (high byte at addr, low byte at addr + 1).

Source

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).

Implementors§