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.

ASM > ARM VS THUM

#7092 - mlequim - Mon Jun 09, 2003 12:46 pm

Hi there, I heard that

"It is recommended that you use 32-bit ARM instructions in RAM and
16-bit THUMB instruction in ROM"

But i don't know how actually do to put code in ram or rom with gcc, and how to specify thats portion of code is compiled for arm or thum code.
(if you know ho to do it with armstd compiler i am also interrested)

I would like also to put ressources files in my bin with a label to access it, but how to do it with gcc compiler ? (the one provided on the site of dovoto's tutorial). with arm i avec example but for gcc i am lost.

thanks in advance,
Michel from bruxelles :O)

#7093 - Quirky - Mon Jun 09, 2003 1:44 pm

To compile C code to thumb, use the -mthumb option. If you have arm code that calls it or thuhmb calling arm code, you'll need to use -mthumb-interwork. i.e :

gcc -c -mthumb -mthumb-interwork blah.c -o blah.o

otherwise you'll get a load of "dangerous errors". If you are all thumbing it, it'd be:

gcc -c -mthumb blah.c -o blah.o

#7101 - MrMr[iCE] - Mon Jun 09, 2003 4:33 pm

Here's a good FAQ that explains much on how to specify where things go in ROM/RAM:

http://devrs.com/gba/files/gbadevfaqs.php#IntRamCode
_________________
Does the corpse have a familiar face?

#7102 - mlequim - Mon Jun 09, 2003 4:55 pm

thanks for the useful informations :O),
Michel