rts
Return from subroutine
Returns from a subroutine by popping the return address from the stack and jumping to it.
Used in
- bsr, rts, link and unlkM68K assembly
- A subroutine with its arguments in registersM68K assembly
- Stack arguments and a stack frameM68K assembly
- Recursion: factorial and FibonacciM68K assembly
- Print a number in any base without helpM68K assembly
- Drawing shapes on the screenM68K assembly
- The snake gameM68K assembly
- Flappy ASMM68K assembly
- Play a WAV and a MIDI fileM68K assembly
- ChiptuneM68K assembly
XNZVC –––––
- Changes no flag
Forms
rts
move.l #10, d0
bsr add_two
move.l d0, d1 ; d1 = 12
bsr add_two
move.l d0, d2 ; d2 = 14
bra END
add_two:
addq.l #2, d0
rts ; pops return address and jumps back
END: