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 > Getting started with ARM

#20401 - Happy_Dude - Mon May 10, 2004 2:57 pm

Hi,
I'm looking for a tutorial or some help on ARM assembly under linux.
I'v tried compiling some source using devkitadv's "as" but I have no idea how to
compose the comand line arguments. I'd like to be able to assemble a working program
before I really start coding.
Any help would be appreciated

#20403 - poslundc - Mon May 10, 2004 3:01 pm

Just call GCC on your input files. If the file's extension is .s it will run it through the assembler. If it is .S it will run it through the C/C++ pre-processor first so you can do things like C-style comments, pre-processor instructions, etc.

Dan.

#20502 - sasq - Wed May 12, 2004 8:31 am

It's not as simple as that - you need to link correctly to an ELF and then convert to a binary image. With a correctly setup devkitadvance this shouldn't be too hard though.
Personally I'd recommend the offical Arm STD for assembler programming since as (or gas) syntax is strange and was mainly intended for generated code (from C).

#20515 - Lupin - Wed May 12, 2004 12:12 pm

Goldroad assembler is nice too if you plan to use pure asm for your project.

The best tutorial i know is:
http://k2pts.home.comcast.net/gbaguy/gbaasm.htm
_________________
Team Pokeme
My blog and PM ASM tutorials

#20518 - sasq - Wed May 12, 2004 12:45 pm

goldroad would have been nice if
- It supported linking
- It wasn't so damn buggy (for instance, some opcodes, like STRH rx,[rx],#c compiles incorrectly).

#20523 - poslundc - Wed May 12, 2004 2:25 pm

sasq wrote:
It's not as simple as that - you need to link correctly to an ELF and then convert to a binary image. With a correctly setup devkitadvance this shouldn't be too hard though.


These steps are no different from linking a C program, though, which is why I didn't bother with them.

Quote:
Personally I'd recommend the offical Arm STD for assembler programming since as (or gas) syntax is strange and was mainly intended for generated code (from C).


I have never had any problems whatsoever with GAS syntax. People use it for assembly programming all the time.

Dan.

#20565 - Happy_Dude - Thu May 13, 2004 4:14 am

sasq wrote:
Personally I'd recommend the offical Arm STD for assembler programming since as (or gas) syntax is strange and was mainly intended for generated code (from C).

That sounds like it would cost money. (and the trial version only lets you compile up to 4k )


I'v checked all the source code here and it looks like very few people are using gas.
Are there some demos out there someone could point me to?
(you just know I'll find somthing the second I hit submit :D )

#20587 - isildur - Thu May 13, 2004 2:21 pm

Go check Dooby's examples:
http://bits.bris.ac.uk/dooby/gba/index.html