zilog_z80

Crates.iozilog_z80
lib.rszilog_z80
version0.16.0
sourcesrc
created_at2022-09-30 19:28:44.386599
updated_at2024-05-25 15:12:09.623346
descriptionZilog Z80 Emulator.
homepage
repositoryhttps://github.com/nicolasbauw/ZilogZ80
max_upload_size
id677486
size363,659
Nicolas BAUW (nicolasbauw)

documentation

README

zilog_z80

Current Crates.io Version Current docs Version Downloads badge

This is a Z80 emulator.

Example for a small loop:

use zilog_z80::cpu::CPU;
let mut c = CPU::new(0xFFFF);
c.reg.pc = 0x0100;                  // sets pc to 0x0100
// Here we create a small machine code program for demo purpose.
// Usually you will rather load an assembled code in memory with the load_bin function.
c.bus.write_byte(0x0100, 0x3e);     // LD A,0x0F
c.bus.write_byte(0x0101, 0x0F);
c.bus.write_byte(0x0102, 0x3d);     // DEC A
c.bus.write_byte(0x0103, 0xc2);     // JP NZ,0x0102
c.bus.write_word(0x0104, 0x0102);
c.bus.write_byte(0x0106, 0xc9);     // RET
loop {
    c.execute();
    if c.reg.pc == 0x0000 { break }
}

For IO and MMIO examples see my demonstration TRS-80 emulator.

License: MIT

Commit count: 421

cargo fmt