# `rts`

[M68K Documentation](https://asm-editor.specy.app/documentation/m68k.md) › [Instructions](https://asm-editor.specy.app/documentation/m68k/instruction.md)

Web page: https://asm-editor.specy.app/documentation/m68k/instruction/rts

**Return from subroutine**

Category: Control flow

Returns from a subroutine by popping the return address from the stack and jumping to it.

Used in: [bsr, rts, link and unlk](https://asm-editor.specy.app/learn/courses/m68k/think-in-assembly/bsr-rts-link-and-unlk.md) (M68K assembly), [A subroutine with its arguments in registers](https://asm-editor.specy.app/learn/courses/m68k/examples/subroutine-with-register-arguments.md) (M68K assembly), [Stack arguments and a stack frame](https://asm-editor.specy.app/learn/courses/m68k/examples/subroutine-with-stack-arguments.md) (M68K assembly), [Recursion: factorial and Fibonacci](https://asm-editor.specy.app/learn/courses/m68k/examples/factorial-and-fibonacci.md) (M68K assembly), [Print a number in any base without help](https://asm-editor.specy.app/learn/courses/m68k/examples/number-to-string.md) (M68K assembly), [Drawing shapes on the screen](https://asm-editor.specy.app/learn/courses/m68k/examples/drawing-on-the-screen.md) (M68K assembly), [The snake game](https://asm-editor.specy.app/learn/courses/m68k/examples/snake.md) (M68K assembly), [Flappy ASM](https://asm-editor.specy.app/learn/courses/m68k/examples/flappy-asm.md) (M68K assembly), [Play a WAV and a MIDI file](https://asm-editor.specy.app/learn/courses/m68k/examples/play-sound-files.md) (M68K assembly), [Chiptune](https://asm-editor.specy.app/learn/courses/m68k/examples/chiptune.md) (M68K assembly)

## Flags

| Flag | Effect |
| --- | --- |
| X | not changed |
| N | not changed |
| Z | not changed |
| V | not changed |
| C | not changed |

## Forms

- `rts`

## Example

```m68k
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:
```
