Skip to content

dtg-lucifer/6502_emulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

6502 CPU Emulator

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).

6502 CPU

📑 Documentation

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

🚀 Quick Start

Prerequisites

  • C++17 compatible compiler
  • CMake 3.10 or higher
  • Make

Building the Project

  1. Clone the repository:
git clone https://github.com/your-username/6502_cpu_emulator.git
cd 6502_cpu_emulator
  1. Build the project:
make setup
make build
  1. Run the emulator:
make run

Running Tests

make test

📊 Project Status

The 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)

🔨 Development

The project uses CMake for building and testing:

  • make setup - Configure the build system
  • make build - Build the emulator
  • make run - Run the emulator
  • make test - Run the test suite
  • make debug - Debug the emulator with GDB

📝 License

This project is open source and available under the MIT License.

🤝 Contributing

Contributions are welcome! Please check the Contributing Guide for details on how to get started.

About

A simple 6502 cpu emulator built with c++

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages