Zabiah Jones
Posts: 1
Joined: Thu Mar 22, 2018 12:46 pm

How can I compile arm assembly? how can i make a file and access it.

Thu Mar 22, 2018 12:49 pm

I just know how to do basic stuff with registers and need to know this stuff.

User avatar
bitbank
Posts: 252
Joined: Sat Nov 07, 2015 8:01 am
Location: Sarasota, Florida
Contact: Website

Re: How can I compile arm assembly? how can i make a file and access it.

Thu Mar 22, 2018 1:49 pm

Zabiah Jones wrote:
Thu Mar 22, 2018 12:49 pm
I just know how to do basic stuff with registers and need to know this stuff.
Take a look at my gcc_perf project. I compare the speed of compiled C versus SIMD intrinsics versus hand coded assembly language (ARM). You can see how to compile/link it from my example:

https://github.com/bitbank2/gcc_perf
The fastest code is none at all :)

jahboater
Posts: 4607
Joined: Wed Feb 04, 2015 6:38 pm

Re: How can I compile arm assembly? how can i make a file and access it.

Thu Mar 22, 2018 4:48 pm

Zabiah Jones wrote:
Thu Mar 22, 2018 12:49 pm
I just know how to do basic stuff with registers and need to know this stuff.
You may use the "as" assembler, or the C compiler "gcc" can do it for you.
See "man as" or "man gcc" for more info.
If you use "as", you will have to call the linker "ld" afterwards.

easiest is to use gcc:

gcc myprog.s -o myprog

then

./myprog

will run it.

You "make a file" with a text editor assuming you are referring to source files.
On the Pi you have "nano" (simple) or "vi" (harder but very powerful).

You can run the program using the debugger "gdb" (use "layout reg" ) and single step though with "si".

All these tools mentioned are included within Raspbian so you don't need to install anything.

Return to “Advanced users”