在汇编宏中创建循环 - IAR ARM

Creating a loop within an assembly macro - IAR ARM

我正在尝试在 IAR Arm 汇编宏中创建一个循环,但无法弄清楚如何制作本地标签,如果多次调用该宏,我会从汇编程序中收到重复标签错误。我的代码如下:

myMacro MACRO
     MOV R1, #0
label:  enter code here
     do some stuff here
     ADD R1, R1, #1         
     CMP R1, #10
     BLE label
     ENDM

解决如下:

myMacro MACRO
         LOCAL label
         MOV R1, #0
    label:  enter code here
         do some stuff here
         ADD R1, R1, #1         
         CMP R1, #10
         BLE label
         ENDM