[−][src]Function z80emu::disasm::disasm_memory
pub fn disasm_memory<C: Cpu, F: FnMut(CpuDebug) -> Result<(), E>, E>(
pc: u16,
memory: &[u8],
debug: F
) -> Result<(), E>
Interprets a given memory
chunk as machine code instructions.
pc
- the address of the first byte of memory chunk given.memory
- a chunk of memory to disassemble.debug
- a function called for each interpreted instruction with a single argument: CpuDebug.
After each instruction the address is increased by the number of bytes occupied by this instruction until the end of memory is reached.
If debug
closure returns Err(E)
disassembling will stop and Err(E)
will be returned immediately.
NOTE: debug
is being invoked only for multi-byte instructions which entirely fit
in the provided memory.