Skip to content
/ i8080 Public

An Intel 8080 Emulation Library in Rust

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

dkim/i8080

Repository files navigation

i8080

build status docs

i8080 is an Intel 8080 emulation library in Rust.

Features

  • Supports all the 8080 instructions.
  • Passes rigorous 8080 CPU tests (TST8080.COM, 8080PRE.COM, 8080EXM.COM, and CPUTEST.COM).

Requirements

Rust

This program targets the latest stable version of Rust 1.47.0 or later.

Usage

Add this to your Cargo.toml:

[dependencies]
i8080 = { git = "https://github.com/dkim/i8080", tag = "1.0.2" }

Example

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(())
}

License

Licensed under either of

at your option.

Contribution

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.