JSR
From SnesLab
| Basic Info | |||||||
|---|---|---|---|---|---|---|---|
| Addressing Mode | Opcode | Length | Speed | ||||
| Absolute | 20 | 3 bytes | 6 cycles | ||||
| Absolute Indexed Indirect | FC | 3 bytes | 8 cycles | ||||
| Absolute Long | 22 | 4 bytes | 8 cycles | ||||
| Flags Affected | ||||||||
|---|---|---|---|---|---|---|---|---|
| N | V | M | X | D | I | Z | C | |
| . | . | . | . | . | . | . | . | |
JSR (Jump to Subroutine) is a 65x instruction that transfers control to a subroutine.
No flags are affected.
Syntax
JSR addr JSR (addr, X) JSR long
Execution Sequence
- The return address is pushed onto the stack (the current program counter value, which is the address of the last byte of this instruction)
- Control is transferred to the target location
See Also
External Links
- Eyes & Lichty, page 461 on JSR
- Labiak, page 148 on JSR
- 8.1 on MCS6500 Manual, page 106 on JSR
- Carr, page 262 on JSR
- Leventhal, page 3-70 on JSR
- Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#JSR