Discussion:
m68k assembly question: jsr vs. bsr
(too old to reply)
John Paul Adrian Glaubitz
2023-02-01 22:20:01 UTC
Permalink
Hi!
https://github.com/llvm/llvm-project/issues/60354#issuecomment-1412018845
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Geert Uytterhoeven
2023-02-02 07:50:01 UTC
Permalink
Hi Adrian,

On Wed, Feb 1, 2023 at 11:17 PM John Paul Adrian Glaubitz
https://github.com/llvm/llvm-project/issues/60354#issuecomment-1412018845
"jsr" is an absolute jump to a subroutine.
"bsr" is a relative jump (8-bit, 16-bit, or 32-bit signed offset) to a
subroutine,
i.e. typically for calling a nearby function.

There's also "jbsr", which is an assembler macro that picks the most
appropriate: bsr does not need relocation, but bsr.l is 68020+ only.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ***@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Andreas Schwab
2023-02-02 19:20:01 UTC
Permalink
Post by Geert Uytterhoeven
Hi Adrian,
On Wed, Feb 1, 2023 at 11:17 PM John Paul Adrian Glaubitz
https://github.com/llvm/llvm-project/issues/60354#issuecomment-1412018845
"jsr" is an absolute jump to a subroutine.
"bsr" is a relative jump (8-bit, 16-bit, or 32-bit signed offset) to a
subroutine,
i.e. typically for calling a nearby function.
jsr/jmp also take pcrel, but bsr/bra with 8-bit disp is shorter.
--
Andreas Schwab, ***@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
Loading...