This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Parameter passing from C to assembler in RealView

Hi,

I am new to ARM.

I have an assembler function (declared in assembler RealView) that is invoked in a C file by the C language convention.

How can I pass arguments from this function invokation in C to the assembler. Do I have to use any registers for it? Or can I simply reserve a memory area? -> This is possible for 8051 but how looks it for the ARM architecture using RealView?

Thanks in advance!

Parents
  • Yes, of course it is possible: the whole point of assembler is that you can generate the precise sequence of instructions that you require - and that includes generating a sequence of instructions that is compatible with any compiler's calling convention.

    The difficulty here is finding what calling convention the RealView compiler uses!

    I've noted here before that the RealView documentaion seems to be particularly poor in terms of being able to actually find information like this!

    :-(

    The C51 manuals provide it in a clearly-titled chapter, "interfacing 'C' to assembler"
    As it is such a common requirement - especially in embedded systems - the RealView documentation really ought to have an equally easy-to-find section.

    Anyhow, I think ARM themselves define a standard calling convention; the ABI (ARM Binay Interface?) - so it's probably worth searching on the ARM site for that...

Reply
  • Yes, of course it is possible: the whole point of assembler is that you can generate the precise sequence of instructions that you require - and that includes generating a sequence of instructions that is compatible with any compiler's calling convention.

    The difficulty here is finding what calling convention the RealView compiler uses!

    I've noted here before that the RealView documentaion seems to be particularly poor in terms of being able to actually find information like this!

    :-(

    The C51 manuals provide it in a clearly-titled chapter, "interfacing 'C' to assembler"
    As it is such a common requirement - especially in embedded systems - the RealView documentation really ought to have an equally easy-to-find section.

    Anyhow, I think ARM themselves define a standard calling convention; the ABI (ARM Binay Interface?) - so it's probably worth searching on the ARM site for that...

Children