Inline assembly

OP #1171327
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
OP #1171330
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
Guest #1171331
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

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.