0
這裏是我的宏:無法將標籤傳遞給ARM宏?
; Good old DJNZ meets ARM!
MACRO
DJNZ $register, $target
SUBS $register, $register, #1
BNE $target
MEND
我的用法:
DELAY PROC
PUSH {R2, LR} ; Push the changed registers & link register
WAIT_OUTER LDR R2, =40000 ; Length of inner loop
WAIT_INNER DJNZ R2, WAIT_INNER
DJNZ R0, WAIT_OUTER
POP {R2, PC} ; Pop & return
ENDP
我得到這個錯誤:
== Compiling main.asm to main.o == "main.asm", line 167 (column 9): Error: A1516E: Bad symbol 'WAIT_INNER', not defined or external at line 167 in macro DJNZ in 'macros.s' 167 000000d0 BNE WAIT_INNER ^ 1 Error, 0 Warnings make: *** [main.o] Error 1
想法有什麼不對?根據手冊,將標籤傳遞給宏應該可行。