6502, short for MOS Technology 6502 Microprocessor, was created by Chuck Peddle and his team in 1975. 6502 is an 8-bit microprocessor and assembly language used in early home computers, video game consoles, and embedded systems. Developers can access 6502 emulators, assemblers, and documentation through resources like 6502 Instruction Set Reference or Online 6502 Emulator, which provide cross-platform support for learning, experimentation, and retro computing.

6502 exists to provide a simple, low-cost CPU with powerful instruction capabilities for its time. Its design philosophy emphasizes minimal hardware, straightforward instruction sets, and efficient memory usage. By providing an accessible and fast microprocessor, 6502 solved the problem of building affordable home computers and gaming consoles while enabling hobbyists and engineers to experiment with assembly-level programming.

6502: Registers and Memory

6502 provides a small set of registers including the accumulator (A), index registers (X, Y), stack pointer (SP), program counter (PC), and processor status (P), along with a 16-bit address space.

LDA #$10      ; Load immediate value 0x10 into accumulator A
STA $0200      ; Store A into memory address 0x0200
INX            ; Increment X register

Registers enable fast, temporary data storage, and the limited memory model forces efficient programming. This structure is similar to other assembly environments like Assembly and DCPU-16.

6502: Instructions and Operations

6502 supports arithmetic, logical, branching, and bit manipulation instructions.

ADC #$05       ; Add 0x05 to accumulator with carry
CMP $0200      ; Compare accumulator with memory at 0x0200
BEQ label      ; Branch if equal

Instructions enable computation, comparison, and control flow. Its simplicity makes it ideal for educational exercises and retro programming, similar to Assembly and DCPU-16.

6502: Stack and Subroutines

6502 provides a stack located on page 1 (0x0100–0x01FF) for temporary storage and subroutine calls.

PHA            ; Push accumulator onto stack
PLA            ; Pull accumulator from stack
JSR $0300      ; Jump to subroutine at 0x0300
RTS            ; Return from subroutine

Stack operations allow modular code and nested function-like behavior. This mechanism is comparable to call stacks in modern CPUs and assembly environments.

6502: Input/Output and Hardware

6502 interacts with peripherals through memory-mapped I/O, allowing programmers to control devices and read inputs.

LDA $C000     ; Read input from joystick mapped at 0xC000
STA $D020     ; Write value to screen color register

Memory-mapped I/O demonstrates how software communicates directly with hardware, similar to principles in DCPU-16 and Assembly.

6502 remains relevant in retro computing, hobbyist projects, and educational environments. Its minimal instruction set, straightforward architecture, and historical significance make it foundational for understanding microprocessor design alongside DCPU-16, Assembly, and C++.