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 11th August 2011 at http://forums.arm.com

    Hi

    The general format for ARM inline assembly is,
    asm(code : output operand list : input operand list : clobber list);

    In the example given by you, output operand list and clobber list are present. "cc" in the clobber list mentions that the instruction will modify condition code flags.

    You may go through the below link for more info,

    http://www.ethernut.de/en/documents/arm-inline-asm.html
    - Divya


    Hi,
    I am also a newbie of asm. Can any one help to explain below GCC function codes, what are the meaning of the :"cc"?
    Thanks in advance!
    -----------------------------------

    static inline unsigned int read_cpuid(void)
    {
    unsigned int val;

    /* Main ID register (MIDR) */
    asm("mrc        p15, 0, %0, c0, c0, 0"
           : "=r" (val)
           :
       : "cc"); //What's this means?

    return val;
    }
    --------------------------------
Reply
  • Note: This was originally posted on 11th August 2011 at http://forums.arm.com

    Hi

    The general format for ARM inline assembly is,
    asm(code : output operand list : input operand list : clobber list);

    In the example given by you, output operand list and clobber list are present. "cc" in the clobber list mentions that the instruction will modify condition code flags.

    You may go through the below link for more info,

    http://www.ethernut.de/en/documents/arm-inline-asm.html
    - Divya


    Hi,
    I am also a newbie of asm. Can any one help to explain below GCC function codes, what are the meaning of the :"cc"?
    Thanks in advance!
    -----------------------------------

    static inline unsigned int read_cpuid(void)
    {
    unsigned int val;

    /* Main ID register (MIDR) */
    asm("mrc        p15, 0, %0, c0, c0, 0"
           : "=r" (val)
           :
       : "cc"); //What's this means?

    return val;
    }
    --------------------------------
Children
No data