jsr

Affected Flags

X
N
Z
V
C
-
-
-
-
-

Operands

Op 1
(An)/d(An)/d(An,Xn)/Ea/<label>/d(PC)/d(PC,Xn)

Jumps to the specified address, like the "lea" instruction, when resolving the address, it does not read the memory, so "jsr 4(a0)" will jump to the value of "a0 + 4", the address is loaded and stores the return address in the stack

move.l #10, d0
jsr add_two ; pushes return address, jumps to subroutine
move.l d0, d1 ; d1 = 12 (returned from subroutine)

* --- JSR through address register ---
lea add_two, a0
jsr (a0)
move.l d0, d2 ; d2 = 14
bra END

add_two:
    addq.l #2, d0
    rts

END: