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

Inline Assembly coding

Parents
  • Note: This was originally posted on 22nd July 2011 at http://forums.arm.com


    Hi,

    I'm trying to store the value of integer b into the address pointed to by c.
    Could you please check the Macro definition of STORE_REG and tell me if its correct?

    Thanks a lot...


    I don't know anything at inline assembly but


    are you sure you need the & into your macro ?
    and I think the both value must be specified as source.

    try

    #define STORE_REG(src, dest) asm("str %[source], [%[result]]" : : [result] "r"(dest), [source] "r"(src))


    while c is a pointeur you need to use it's value and not it's address.
    that's without any warranty !!
Reply
  • Note: This was originally posted on 22nd July 2011 at http://forums.arm.com


    Hi,

    I'm trying to store the value of integer b into the address pointed to by c.
    Could you please check the Macro definition of STORE_REG and tell me if its correct?

    Thanks a lot...


    I don't know anything at inline assembly but


    are you sure you need the & into your macro ?
    and I think the both value must be specified as source.

    try

    #define STORE_REG(src, dest) asm("str %[source], [%[result]]" : : [result] "r"(dest), [source] "r"(src))


    while c is a pointeur you need to use it's value and not it's address.
    that's without any warranty !!
Children
No data