Skip to content

alexander-akhmetov/mos6502

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MOS 6502 CPU emulator

Simple emulator of the MOS 6502 CPU. I used it to build an Apple-1 emulator.

Usage

let mut cpu = mos6502::cpu::CPU::new();

let program = "LDA #$c0
TAX
INX
ADC #$c4";

// you can skip this step,
// if you load an assembled machine code
let bytes = mos6502::asm::assemble(&program);

cpu.load(&bytes, 0x800);

cpu.run();

Tests

Run tests:

cargo test

Functional tests

You can download functional tests from this repository. Put the 6502_functional_test.bin file to the root of the repository and then run:

wget "https://github.com/Klaus2m5/6502_65C02_functional_tests/blob/master/bin_files/6502_functional_test.bin?raw=true" -O 6502_functional_test.bin

make functional-tests

Resources