| |||||
Technical Support Support Resources
Product Information | A51: LOCAL LABELS DON'T WORK IN MACROSInformation in this article applies to:
SYMPTOMSI have defined the following MACRO in my assembly file: INC_BUF_POINTER MACRO X,Y,Z,W ; LOCAL IBP1 ; INC DPTR ; MOV A,DPL CJNE A,#LOW(X),IBP1 . . . ENDM When I assemble this in my program, I get the following error message:
=1 1488 INC_BUF_POINTER COM_BUF_END,COM_BUF_START,COM_BUF_HEAD_H,COM_BUF_HEAD_L
=1 1489+1 ;
=1 1490+1 LOCAL IBP1
*** _________________________________^
*** ERROR #9 IN 1490 (\SB1\SB\SMARTPAD\KEIL.V08\RS232.A51, LINE 393): SYNTAX ERROR
What can I do for this? CAUSEThe LOCAL directive must be specified immediately after the MACRO definition. If it is not, the text LOCAL will be included in the macro expansion. Since LOCAL is not a recognized keyword (by the assembler), the error results. RESOLUTIONChange your macro definition to read as follows: INC_BUF_POINTER MACRO X,Y,Z,W LOCAL IBP1 . . . ENDM When you re-assemble your program, the error will go away. MORE INFORMATIONRefer to the A51/AX51 User's Guide, Chapter 5, Assembler Macros, Labels for more information about the LOCAL directive. SEE ALSOLast Reviewed: Monday, May 10, 2004 | ||||
| |||||