Skip to contentSkip to conversation

question on assembly on SH4 (linux portage)

DISCUSSION Frederic Marmond 1 participant 2 messages Dec 8, 2003 – Dec 11, 2003

lore
Share & tools
lore
#0 lore raw

Hi,
I'm working on a SH4 portage, and I have a problem in a function. Using a BSR, we seems to be limited to a 12bits jump. How may I call a far subroutine?

thanks for help...

Fred

#1 lore raw

Well, it seems nobody works on SH4 here? ;)
For information in the archives, opcodes for SH4/SH5 can be found here.
http://www.superh.com/documentation/documents.php?id=17

For self-answering (if anybody wants to switch from x86 to sh4 one day):
BSR and BSRF are for relative jumps, we can use JSR for absolute jumps.
Integration in a C/C++ prog is pretty easy, just have to know that a JSR needs a indirection (mov.l function_to_call_ptr,rx; jsr @rx) (instead of: bsr function_to_call)

After few hours working on SH4 assembly, it is not too complexe and powerfull enough to make it fun to code!

Fred

Quoted 10 lines · Frederic Marmond

Hi,
I'm working on a SH4 portage, and I have a problem in a function. Using a BSR, we seems to be limited to a 12bits jump. How may I call a far subroutine?

thanks for help...

Fred