gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > How can i jump to 0x08800000 with thumb mode

#120011 - kenghot - Wed Feb 28, 2007 8:50 am

Hi all,

i try to put my function in to commercial GBA rom at blank area (end of file) so i need to jump to offset 0x08800000 and i use gold road.
this work for arm
Code:

        mov r0,($88<<24)
        b r0


but i need to use thumb mode. How can i do
Thanks,

#120019 - chishm - Wed Feb 28, 2007 11:52 am

Code:
mov r0, #0x88
lsl r0, #20
bx r0

This is the syntax used by GNU ASM. I don't know the Goldroad ASM syntax.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#120029 - kenghot - Wed Feb 28, 2007 1:08 pm

chishm wrote:
Code:
mov r0, #0x88
lsl r0, #20
bx r0

This is the syntax used by GNU ASM. I don't know the Goldroad ASM syntax.


Thanks, chishm
i try with your code but still have error
Code:

error : line 2 : syntax error
   lsl r0,  20
error : line 2 : only regs 0-7 available in thumb mode
   lsl r0,  20

assembled with 2 errors

#120030 - keldon - Wed Feb 28, 2007 1:14 pm

Check with the people at goldroad!!! Note aswell that he said that was the GNU asm syntax, and THUMB cannot access register 20!!!

#120032 - Cearn - Wed Feb 28, 2007 1:39 pm

Thumb shifts need a source register too:
Code:

mov     r0, #88
lsl     r0, r0, #20
bx      r0

#120034 - chishm - Wed Feb 28, 2007 1:52 pm

Cearn wrote:
Thumb shifts need a source register too:
Code:

mov     r0, #88
lsl     r0, r0, #20
bx      r0

The GNU assembler will expand "lsl r0, #20" into "lsl r0, r0, #20". Also, you used the decimal constant 88 and not 0x88 in your code.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#120063 - poslundc - Wed Feb 28, 2007 6:47 pm

Hacking of commercial ROMs is a prohibited topic in these forums. Please take your question elsewhere.

Thanks,

Dan.