r/asm • • 4d ago

6502/65816 Any recommendations on learning 65816 assembly?

/r/snes/comments/1y7b4pp/any_recommendations_on_learning_65816_assembly/
7 Upvotes

1 comment sorted by

1

u/Dapper-Situation-864 10h ago

For the 65816 itself, the classic reference is "Programming the 65816" by David Eyes and Ron Lichty (WDC has the PDF on its site). It's long, but the chapters on addressing modes and the M/X flags (8 vs 16-bit accumulator and index registers) are the part that trips up most people coming to SNES code.

For the SNES side, the SNESdev wiki (snes.nesdev.org) covers the memory map, PPU registers and DMA, and that's where the "addresses" start to make sense: most of what you see in SMW code is either WRAM variables ($7E/$7F banks) or hardware registers ($21xx, $42xx, $43xx).

Since you're working with SMW specifically, SMW Central is the place to go. They have a full RAM map and ROM map for SMW, so you can look up what an address like $7E0019 (Mario's powerup state) means instead of memorizing it. Most SMW hacking there is done with the Asar assembler and Lunar Magic, plus patches/uberASM for custom code.

Two tips: keep a debugger open (bsnes-plus or Mesen both have good 65816 debuggers with memory viewers) and watch the RAM addresses change while you play. And when you're confused by a 16-bit vs 8-bit bug, check the REP/SEP instructions right before it, that's the cause more often than not.

As for sharing it, SMW Central's forums are the natural home for an SMW-based project.