zilog_z80
This is a Z80 emulator.
Example for a small loop:
use CPU;
let mut c = CPUnew;
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; // LD A,0x0F
c.bus.write_byte;
c.bus.write_byte; // DEC A
c.bus.write_byte; // JP NZ,0x0102
c.bus.write_word;
c.bus.write_byte; // RET
loop
For IO and MMIO examples see my demonstration TRS-80 emulator.
License: MIT