#emulator #intel #chip #microprocessor #8080 #projects #harness

nightly no-std lemurs-8080

An emulator for the Intel 8080 microprocessor

8 releases

0.5.2 Jan 9, 2024
0.5.1 Oct 9, 2023
0.4.8 Oct 2, 2023
0.4.7 Sep 29, 2023
0.3.0 Sep 17, 2023

#936 in Rust patterns

UPL-1.0 license

105KB
2.5K SLoC

Lemurs 8080

This package provides an emulator for the Intel 8080 microprocessor. It models only the chip itself and can be supported with any value that supports the published Harness trait.

The package supports compiling without the "std" feature to remove dependencies on the std crate. This will require supplying a replacement panic handler and allocator.

You can use the scripts below to build a static library that can be used in C++ projects, which will produce a folder called lemurs_8080_cpp in the current directory containing a header file and both debug and release versions of the library:

bash (Linux/Mac OS X/ other POSIX)

#!/bin/bash
mkdir lemurs_8080_cpp; cd lemurs_8080_cpp; L8080=$(pwd); mkdir debug release
cargo new --vcs none build_8080_cpp
(cd build_8080_cpp; cargo add lemurs-8080; cargo vendor)
(
	cd build_8080_cpp/vendor/lemurs-8080; cp -R include "$L8080";
	cargo +nightly -Z unstable-options build --no-default-features --features "cpp $1" \
		--out-dir "${L8080}/debug"
	cargo +nightly -Z unstable-options build --no-default-features --features "cpp $1" \
		--out-dir "${L8080}/release" --release
)
rm -r build_8080_cpp

PowerShell (Windows)

mkdir 'lemurs_8080_cpp'
Set-Location .\lemurs_8080_cpp
Push-Location
'debug','release' | ForEach-Object {mkdir ".\$_"}
cargo new --vcs none build_8080_cpp
Set-Location build_8080_cpp
cargo add lemurs-8080
cargo vendor
Set-Location vendor\lemurs-8080
Copy-Item -Path .\include -Destination (Get-Location -Stack) -Recurse

cargo +nightly -Z unstable-options build --no-default-features --features "cpp" --out-dir "$(Get-Location -Stack)\debug"
cargo +nightly -Z unstable-options build --no-default-features --features "cpp" --out-dir "$(Get-Location -Stack)\release" --release

Pop-Location
Remove-Item -Recurse -Path build_8080_cpp

Lemurs is intended to be a collection of chip emulation packages. Currently only the i8080 is supported.

Dependencies

~1.3–1.7MB
~41K SLoC