← ClaudeAtlas

6502-assemblylisted

Write, read, debug, and optimize 6502 assembly language code. Use this skill whenever the user asks about 6502 assembly, MOS 6502, 6510, 65C02, or 65C816 programming, or is working on projects for the NES, SNES, Commodore 64, Apple II, Atari 2600/8-bit, VIC-20, BBC Micro, or any other 6502-based platform. Also trigger when the user mentions opcodes, addressing modes, zero page, stack operations, or assembly language concepts in the context of 8-bit/retro computing. Covers instruction set, addressing modes, common algorithms (16-bit math, multiplication, division), memory layout, optimization, and platform-specific patterns. Even if the user just says "assembly" in a retro computing context, use this skill.
Yuki001/nes-skills · ★ 0 · Code & Development · score 62
Install: claude install-skill Yuki001/nes-skills
# 6502 Assembly Language Complete reference for programming the MOS 6502 and its derivatives. Covers the instruction set, addressing modes, common algorithms, optimization techniques, and platform-specific considerations. ## Architecture Overview The 6502 is an 8-bit processor with a 16-bit address bus (64KB addressable memory). ### Registers | Register | Width | Purpose | |----------|-------|---------| | **A** (Accumulator) | 8-bit | Primary arithmetic/logic register | | **X** (Index X) | 8-bit | Index register, counter, transfers | | **Y** (Index Y) | 8-bit | Index register, counter, transfers | | **SP** (Stack Pointer) | 8-bit | Points into page $01 ($0100–$01FF) | | **PC** (Program Counter) | 16-bit | Address of next instruction | | **P** (Processor Status) | 8-bit | Flag register: `NV-BDIZC` | ### Status Flags (P register): `NV-BDIZC` | Bit | Flag | Name | Set when | |-----|------|------|----------| | 7 | **N** | Negative | Result bit 7 is set | | 6 | **V** | Overflow | Signed arithmetic overflow | | 5 | - | (Unused) | Always 1 | | 4 | **B** | Break | BRK instruction (on stack only) | | 3 | **D** | Decimal | BCD mode enabled (SED/CLD) | | 2 | **I** | Interrupt Disable | IRQ disabled (SEI/CLI) | | 1 | **Z** | Zero | Result is zero | | 0 | **C** | Carry | Unsigned overflow / borrow inverse | ### Memory Map (General) | Range | Purpose | |-------|---------| | `$0000–$00FF` | **Zero Page** — fast access, used as pseudo-registers | | `$0100–$01FF` | **Stack** — grows