A 3-letter opcode for the 6502 processor. Means literally 'Jump to Subroutine'. This instruction causes the processor to jump to a specified location in memory and continue working from there. Only when a RTS instruction is encountered does the processor return to its previous location in memory (the address is kept on the stack).

Back to the 6502 opcodes metanode

1. Jet Set Radio, called Jet Grind Radio in the US. See also Jet Set Radio Future.

2. A 6502 instruction that pushes the program counter and jumps to a new instruction stream. It can be parsed as "Jump to SubRoutine" or "Jump and Save Return."

  • Function: PC - 1 => Stack; N => PC
  • Updates flags: none
  • Opcode numbers:
    abs   JSR $5597 (6 cycles)
    

Note that because JSR pushes the address minus 1, you must account for this when retrieving the arguments from calls of the form

  ...
  jsr prodos_entry
  .dcb write
  .dcw write_args
  ...
Super Mario Brothers uses this technique for its switch statements; ProDOS uses it for syscalls.

Similar: JMP | BRK | RTS
See also: 6502 instructions | 6502 addressing modes

Log in or register to write something here or to contact authors.