Dear all, I have met a problem when using macro in my project. Here it is my case: In file "A.h":
DelayX9Cyc macro n local loop1, loop2 if (n) <> 0 mov temp, #n ;;[3] loop1: djnz temp, loop2 ;;[3]/[4] REPT 3 NOP ;;[1] ENDM sjmp loop1 ;;[3] loop2: nop ;;[1] nop ;;[1] endif endm
#include "A.h" ... ... F_OSC EQU 13560000 _Delay MACRO DelayX9Cyc %(F_OSC) ENDM ... ... _Delay ; <---Undefined Symbol
DelayX9Cyc %(F_OSC)
DelayX9Cyc %(13560000)
actually the problem is the definition of the variable 'temp'. Please use the assembler directive GEN (uVision - Project - Options - Listing - Assembler Listing - Macros: All expansions) and check the *.LST file to find problems like this. Reinhard