Home /Modules/cpu/SPECIFICATION.md

SPECIFICATION.md

lib/cpu/6502/SPECIFICATION.md · 115 line(s) · markdown

6502 Specification

1. Identity

Model: MOS Technology 6502 Family: MOS 6500 series Architecture class: 8-bit microprocessor Addressing: 16-bit external address bus Base profile: original NMOS 6502

The 6502 exposes a compact programmer model while using internal latches, buses and control logic to sequence each instruction.

2. Programmer-visible state

RegisterWidthPurpose
A8accumulator
X8index register
Y8index register
S8stack pointer
PC16program counter
P8processor status representation

The hardware status representation has seven meaningful flags: N, V, B, D, I, Z and C. Bit 5 is treated specially rather than as an ordinary writable flag.

3. Address and data path

4. Clock

The original 6502 uses a two-phase clocking scheme. External systems commonly describe the phases as phi1 and phi2.

SLeeLa records:

Clock frequency must not be confused with instruction latency. A single instruction may consume multiple bus cycles.

5. Execution model

The 6502 does not use a modern out-of-order or superscalar pipeline. Instruction work is sequenced through control logic and repeated bus operations.

The SLeeLa model therefore represents:

  1. instruction fetch;
  2. opcode decode;
  3. operand/address acquisition;
  4. ALU/register operation;
  5. memory read/write;
  6. prefetch/next-cycle transition.

6. Cache

Base 6502:

Every memory access is modeled against the external memory/bus interface.

7. DMA

The base CPU has no integrated DMA controller. DMA in a 6502 system is an external-system function.

SLeeLa therefore leaves SLDMAController uninstantiated for the base profile while permitting a system-level DMA component to couple to the CPU bus.

8. Interrupts

The architectural model includes:

The interrupt controller model records request, recognition, vector fetch and entry timing without inventing undocumented internal transistor behavior.

9. MMU/TLB

The original 6502 has no MMU or TLB. Address translation is therefore:

CPU address -> external system address

Any banking, mapping or protection belongs to a surrounding system or a later 6500-family derivative.

10. Evidence labels

This profile uses those labels to keep architectural modeling separate from speculation.

Sources