Page 1 of 1

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

Posted: Thu Mar 22, 2018 12:49 pm
by Zabiah Jones
I just know how to do basic stuff with registers and need to know this stuff.

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

Posted: Thu Mar 22, 2018 1:49 pm
by bitbank
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

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

Posted: Thu Mar 22, 2018 4:48 pm
by jahboater
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.