ARM Technical Support Knowledge Articles

LOCAL LABELS DON'T WORK IN MACROS

Applies to: A51 Macro Assembler

Answer

Information in this article applies to:


SYMPTOMS

I 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 (SB1SBSMARTPADKEIL.V08RS232.A51, LINE 393): SYNTAX ERROR

What can I do for this?

CAUSE

The 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.

RESOLUTION

Change 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 INFORMATION

Refer to the A51/AX51 User's Guide, Chapter 5, Assembler Macros, Labels for more information about the LOCAL directive.

SEE ALSO

Article last edited on: 2004-05-10 15:32:05

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential