[−][src]Crate iz80
Z80 Emulator library that passess all ZEXALL tests
See cpuville.rs or the iz-cpm project for usage examples.
Example
To run ths example, execute: cargo run --bin simplest
use iz80::*; fn main() { // Prepare the device let mut machine = PlainMachine::new(); let mut cpu = Cpu::new(); cpu.set_trace(true); // Load program inline or from a file with: // let code = include_bytes!("XXXX.rom"); let code = [0x3c, 0xc3, 0x00, 0x00]; // INC A, JP $0000 let size = code.len(); for i in 0..size { machine.poke(0x0000 + i as u16, code[i]); } // Run emulation cpu.registers().set_pc(0x0000); loop { cpu.execute_instruction(&mut machine); // Examine Machine state to update the hosting device as needed. if cpu.registers().a() == 0x10 { // Let's stop break; } } }
Structs
Cpu | The Z80 cpu emulator. |
PlainMachine | A simple Machine implementation |
Registers | Z80 internal register values |
Enums
Flag | Z80 flags |
Reg8 | 8 bit registers |
Reg16 | 16 bit registers, composed from 8 bit registers |
Traits
Machine | Abstraction of the device hosting the Z80 CPU |