How to write a sample program "Hello world" using arm assembly language for gnu as(gas) to compile?

Sep 03, 2004 2 Replies

Hi,



I have an arm board, which is runnig Linux. My question is would anyone tell me how to write a "Hello, World" program using ARM assembly language, compiled by gnu as(gas) on Linux? Thanks.



Personally, I would have thought that the easiest way would be to write it in C first and then compile it using the "-S" option. This option tells gcc to compile, but not assemble. You may also need a -m switch to tell gcc to produce ARM assembly.

Pete

8622F69077800592BF9E05CE Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit

Keichii -

First build yourself a gcc cross-compile for Arm. There's help here.

Create a C program to do what you want.

Cross-compile to assembly, using the "-S" option, eg. "arm-unknown-linux-gnu-gcc -S hello.c"

- Glen

Keichii wrote:

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required