MOS 6502 Assembly

The 6502 was the microchip present in many computing systems of the 80ies, like the Atari ST, Commodore 64 and the NES, among others. Hence, it’s an interesting assembly to look at.

MOS 6502AD 4585 top

Some notes on 6502

  • 3 registers: A, X and Y. These can hold values using the mnemonic opcode STA (Store Accumulator), STX and STY
  • 16 bit address space (ffff) that can be used to wrote to the hardware, such as memory or I/O devices. The writing is done through LDA, LDX, and LDY, which take the current top value in the register and write it to the address given.
  • Most of the other opcodes1 deal with mutating, transferring or comparing these values.
  • There are also 8 flags that can be set, or are done so automatically after a process, that keep track of certain states of the chip or a calculation.

https://en.wikipedia.org/wiki/MOS_Technology_6502#/media/File:BreakNES_MOS_6502.jpg

Footnotes

  1. 6502.org: Tutorials and Aids ↩