As Paul R noted, gcc -nostartfiles helloworld.s
should do the trick.
With just calling as
you are building an object file you can use in other programs (like .o
files when building C code).
file
should tell you that a.out
is actually an executable
:
a.out: ELF 32-bit LSB executable, ARM, ....
If you want further advice, I wouldn't start with an assembly program from scratch. Instead, write the boilerplate code in C and use GCC's inline assembly features to drop to assembly whenever you wish. That way you can write whole functions in assembly, but still have C to back you up for things like printing results, etc.