A software emulation of the MOS Technology 6502 processor, a historically significant 8-bit microprocessor that powered iconic systems like the Apple II, Commodore 64, Atari 2600, and Nintendo Entertainment System (NES).
This project is documented across multiple files for better organization:
- Architecture - System architecture and component interaction
- CPU - CPU implementation, registers, and flags
- Memory - Memory organization and special regions
- Opcodes - Instruction set and addressing modes
- Demo Programs - Example programs and execution
- Testing - Testing framework and utilities
- C++17 compatible compiler
- CMake 3.10 or higher
- Make
- Clone the repository:
git clone https://github.com/your-username/6502_cpu_emulator.git
cd 6502_cpu_emulator- Build the project:
make setup
make build- Run the emulator:
make runmake testThe emulator currently implements:
- Basic CPU structure with registers (A, X, Y, PC, SP)
- Status flags (C, Z, I, D, B, V, N)
- Memory access with a 64KB address space
- Instruction implementations:
- Load/Store operations (LDA, LDX, LDY, STA, STX, STY)
- Subroutine handling (JSR, RTS)
- Stack operations (PHA, PHP, PLA, PLP, TXS, TSX)
- Jump instructions (JMP absolute, JMP indirect)
- No Operation (NOP)
The project uses CMake for building and testing:
make setup- Configure the build systemmake build- Build the emulatormake run- Run the emulatormake test- Run the test suitemake debug- Debug the emulator with GDB
This project is open source and available under the MIT License.
Contributions are welcome! Please check the Contributing Guide for details on how to get started.