This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Undefined Symbol when using Macro

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

In file "B.asm"
#include "A.h"
...
...
F_OSC EQU 13560000

_Delay MACRO
     DelayX9Cyc %(F_OSC)
     ENDM
...
...
   _Delay     ; <---Undefined Symbol

After compilation, there is an error occured as specified in above source code. However, if i replace the following code:
DelayX9Cyc %(F_OSC)
by
DelayX9Cyc %(13560000)
it works.

I just what to ask why this error will occured and how to fix it?

C.H.