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 > GCC ASM Directives please...

#15565 - MumblyJoe - Sun Jan 25, 2004 2:48 am

I'm just getting into ARM ASM, and I love it, but the gcc assembler has me a bit lost. I used to use TASM a fair bit so I'm not 100% sure what I am doing.

If anyone could post an example that quickly shows the basics, like how to seperate the different sections of memory and different text and code areas etc...


Before anyone says it, I dont like that Goldroad assembler much and the gbaguy tutorials are good but a little lacking in some departments.
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!

#15566 - MumblyJoe - Sun Jan 25, 2004 2:53 am

One other thing, even when i can get gcc to compile something REALLY simple, some things like:

ldr r2,[r1]+4!

that work in goldroad dont work, hows gcc do these?
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!

#15569 - poslundc - Sun Jan 25, 2004 3:24 am

The correct assembly statement in gcc/gas would be:

ldr r2, [r1], #4

The Arm Instruction Set Quick Refernece from Arm's website has the correct syntax for the gnu assembler.

There's a great quick reference to the GAS Arm directives at http://re-eject.gbadev.org/.

Dan.