This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Mixing C/ASM for CCS5.3 ARM Cortex-M4

Hi,

 How to get the address of a variable using ARM assembler?

;svar is defined in the main.c

The code below generate compiler error.

    .global svar

myfunc:  .asmfunc

      MOVW  R0,#svar

      MOVT   R0,#svar

       MOVW R0,#(svar & 0xFFFF)

       MOVT R0,#(svar >> 16)

       BX  LR

      ..endasmfunc