# `bsr`

[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/bsr

**Branch to subroutine**

Category: Control flow

Pushes the return address onto the stack and branches to the specified address.

Sizes .b .s .w .l

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), [Convert a number to a string in any base](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

- `bsr label`

## Operands

- [`label`](https://asm-editor.specy.app/documentation/m68k/addressing-mode/effective-address.md): A branch target, written as a label or address. The assembler calculates the relative displacement.

## Description

The size sets the branch’s reach: about 128 bytes in either direction for `.s` (or `.b`), and 32 KB for `.w`. With no size, the assembler chooses `.s` for a known target when the short encoding can reach it. On the 68020, it chooses `.l` for a known target beyond `.w` reach. All other cases use `.w`, including forward references. On the 68020, `.l` reaches anywhere in memory. See [long branches](https://asm-editor.specy.app/documentation/m68k/addressing-mode/long-branches.md). On the 68000 and 68010, `.l` is treated as `.w`, as in EASy68K.

## Example

```m68k
move.l #10, d0
bsr add_two
move.l d0, d1 ; d1 = 12
bra END

add_two:
    addq.l #2, d0
    rts

END:
```
