The 6502 processor is an 8-bit processor developed by MOS Technology in 1975. It is a von neumann computer with a single 8-bit data bus and an address bus of 16-bits. The 16-bit address space of the processor allows it to address up to 64kB of effective memory.
The original NMOS version of the 6502 has 151 legal opcodes.
Out of the total number of possible opcodes, ilegal opcodes have been found to be sometimes useful.
The ISA included in this page will cover the legal opcodes. Ilegal opcodes may be added in the future as an extension to this page.
The instructions can be categorized according to the type of operation they perform. We can distinguish between the following categories:
Logical and bit manipulation operations. Operations such as AND, OR, XOR, etc.
Arithmetic operations. Operations such as ADD, SUBSTRACT, INCREMENT, etc.
Data shifting instructions. Shift values in registers. Can be either logical, arithmetic or rotation instructions.
Program control flow operations. Control the flow of the program. They allow to set/modify the value of the program counter.
Memory transfer operations. Transfers memory between different parts of the system (Mainly processor and main memory).
Absolute. The operand is located at a given absolute address (16-bit addressing-space).
Absolute, X-Indexed. The operand is located at the absolute address + the X index value.
Absolute, Y-Indexed. The operand is located at the absolute address + the Y index value.
Immediate. The operand is encoded with the instruction.
Implied. The operand is implicit in the context of the instruction (not provided by the user).
Indirect. The address field in the instruction contains the memory location where the effective address of the operand is present.
X-indexed, indirect. The value at the address field in the instruction plus the X register points to the memory location where the effective address of the operand is present.
Indirect, Y-indexed. The operand is the same as in an indirect access, except the obtained value is added with the Y register.
Relative. The operand is the PC + a signed offset (used for branching).
Zeropage. The operand is a zeropage address (single byte).
Zeropage X-indexed. The operand is a zeropage address incremented by X.
Zeropage Y-indexed. The operand is a zeropage address incremented by Y.