JSR Instruction



JSR (Jump to SubRoutine) works as JMP except that before the jump is made, the address to the instruction after JSR is pushed to the stack, so you can return with the instruction RTS.

ADDRESS METHODS: (An), x(An), x(An,xr.s), x.w, x.l, x(PC), x(PC,xr.s)

DATA LENGTH: N/A

FLAGS: Unaffected

SYNTAX: JSR <ea>

EXAMPLE CODE:

    JSR    subroutine    jumps to the subroutine, use RTS to return to the next instruction