| Crates.io | i8051 |
| lib.rs | i8051 |
| version | 0.13.0 |
| created_at | 2025-09-20 13:04:44.44524+00 |
| updated_at | 2025-12-27 20:13:29.240446+00 |
| description | An emulator for the i8051 (MCS-51) microcontroller. |
| homepage | |
| repository | https://github.com/mmastrac/i8051 |
| max_upload_size | |
| id | 1847715 |
| size | 97,731 |
This crate provides a fast, unsafe-free emulator for the i8051
microcontroller.
The 8051 (a.k.a. the MCS-51) is a 8-bit microcontroller that was very common in the 1980s and 1990s, and is still used in many modern devices.
There are a number of different variants of the 8051, and this crate supports a CPU like the original 8051, but with a zero-flag extension.
use i8051::Cpu;
let mut cpu = Cpu::new();
let mut ram = RAM::new();
let mut code = ROM::new(fs::read(&args.rom_file).unwrap());
let mut ports = Ports { ram: [0; 128] };
loop {
if !cpu.step(&mut ram, &mut code, &mut ports) {
break;
}
}
The i8051-debug-tui crate provides
a terminal UI debugger for the i8051 emulator.

The instruction set is from the standard MCS-51.