bsr

Branch to subroutine

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

Sizes .b .s .w .l

XNZVC –––––
  • Leaves every flag unchanged

Forms

  • bsr

Operands

label
A branch target, written as a label or address. The assembler calculates the relative displacement. More

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. On the 68000 and 68010, .l is treated as .w, as in EASy68K.

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

add_two:
    addq.l #2, d0
    rts

END: