i8080 is an Intel 8080 emulation library in Rust.
- Supports all the 8080 instructions.
- Passes rigorous 8080 CPU tests (TST8080.COM, 8080PRE.COM, 8080EXM.COM, and CPUTEST.COM).
This program targets the latest stable version of Rust 1.47.0 or later.
Add this to your Cargo.toml
:
[dependencies]
i8080 = { git = "https://github.com/dkim/i8080", tag = "1.0.2" }
This example shows how to load and execute a ROM file, printing each instruction and the number of states that it took.
use std::process;
use i8080::Intel8080;
fn main() {
if let Err(err) = example() {
eprintln!("Error: {}", err);
process::exit(1);
}
}
fn example() -> Result<(), Box<dyn std::error::Error>> {
let mut i8080 = Intel8080::new(&["rom_file"], 0)?;
while let Ok((instruction, states)) = i8080.fetch_execute_instruction() {
println!("{:?} ({} states)", instruction, states);
}
Ok(())
}
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.