Hacking/Background knowledge/Computer architecture/6502 assembly

From Wikibooks, open books for an open world
Jump to navigation Jump to search

6502 assembly contains a grand total of 151 valid opcodes; we can ignore the 105 undefined opcodes that some sources reference. Because of this small set, 6502 assembly language allows us to quickly conjure hypothetical machines based on non-existent hardware, define memory mappings for this hardware, and then proceed to define simple programs for the hardware.

This page of the Hacking Wikibook takes advantage of this to submerge the reader deeper into the guts of a bare CPU; although other CPUs have different instruction sets, the core function of operating flags, registers, memory, and the stack remain the same. More advanced CPUs utilize protected memory; but even then, the function of delivering and handling a signal matches closely with the function of delivering and handling an interrupt.

Further reading[edit | edit source]