EmbDev.net

Forum: ARM programming with GCC/GNU tools Inline assembly


von Kumar K. (keir)


Rate this post
useful
not useful
Hi all
I have to inline some arm instructions with c code.Can any one tell me
how to pass the parameters from c code to assembly and take the output.I
have a loop in the assembly code and the results are to be stored back
to an array in the c code.
Can any one suggest me any documents regarding this or any methods to do
it.
Regards
keir

von Stefan (Guest)


Rate this post
useful
not useful

von Stefan (Guest)


Rate this post
useful
not useful

von Kumar K. (keir)


Rate this post
useful
not useful
Stefan wrote:
> Assembler Instruction Set for ARM
>
> http://www.heyrick.co.uk/assembler/qfinder.html
> http://www.arm.com/pdfs/QRC0001H_rvct_v2.1_arm.pdf
> http://www.arm.com/pdfs/QRC0007_VFP.pdf
> ...

hi all,
Thanks for the details
I have heard that assembly "*.s" file can be embedded in the c source
file and the assembly routine can be called fromm the c source.Can u
please send me the details of how to do that ie passing the parameters
to assembly code and getting the outputs.
kk

von Stefan (Guest)


Rate this post
useful
not useful
> I have heard that assembly "*.s" file can be embedded in the c source
> file and the assembly routine can be called fromm the c source.

Ask whoever told you this. I think this is not possible.

You can create pure assembler source files (*.s files)
You can create assembler source files that require CPP processing (*.S
files).
You can create c source files with inline assembler statements (see
above and more ARM specific:
http://www.ethernut.de/en/documents/arm-inline-asm.html).

Each of them may compile to an object file. The linker forms a binary
executable from these object files. So a mixture of object files from
*.s, *.S and *.c is possible.

More infos about stack layout and calling conventions:
http://www.cs.umbc.edu/~chang/cs313.s02/stack.shtml

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.