Forum Discussion

bsp_user's avatar
bsp_user
Icon for Occasional Contributor rankOccasional Contributor
3 years ago
Solved

arria v ds-5 arm compiler inline assembly

Hi, I try to read the cntfreq register in arria V evaluation board , ds-5 arm compiler 5. I use the following line: __asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val))); compilation f...
  • Jeet14's avatar
    3 years ago

    Hi,


    compiler v7 can have the single line syntax like below-


    __asm("[;]");

    __asm{[;]}


    for reading CNTFREQ, assign global variable with volatile.

    And try to run again,


    volatile unsigned int freq=0;


    void printReg()

    {

    __asm

    {

    mrc p15, 0, freq, c14, c0, 0

    }

    printf("freq=0x%X", freq);

    }


    let me know if you have any query on this.


    Regards

    Jeetesh