EmbDev.net

Forum: ARM programming with GCC/GNU tools Inline assembly


Author: Kumar Kk (keir)
Posted on:

Rate this post
0 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

Author: Stefan (Guest)
Posted on:

Rate this post
0 useful
not useful

Author: Stefan (Guest)
Posted on:

Rate this post
0 useful
not useful

Author: Kumar Kk (keir)
Posted on:

Rate this post
0 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

Author: Stefan (Guest)
Posted on:

Rate this post
0 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

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.