Instruction

From NES Hacker Wiki
Revision as of 15:06, 21 April 2014 by TheAlmightyGuru (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In 6502 assembly, an instruction is a single command to be executed by the processor. Instructions always include an opcode, and usually contain an operand.

Examples

In the example below, STA is the opcode, $10 is the operand, and the two combined is the instruction.

0001:85 10     STA $10      ; Stores the accumulator into memory location $10.

This example with RTS only has an opcode, but no operand. Even still, it is an instruction.

0001:4D        RTS          ; Return to calling subroutine.