Keil™, An ARM® Company

Technical Support

A51: MACROS ARE NOT EXPANDED

Information in this article applies to:

  • C51 All Versions

SYMPTOMS

I am using the 8051 A51 assembler version 5.10, and have just tried assembling a file with the following lines as a test:

REPT 3
  NOP
ENDM

Upon examining the list file, the repeated lines seem to have been ignored by the assembler.

CAUSE

The GEN assembler directive must be used to include the MACRO expansions in the listing file.

The GENONLY assembler directive must be used to include the first level MACRO expansion.

If neither of these directives is used, MACRO expansions are not listed in the listing file.

RESOLUTION

Add the GEN directive to your A51 command line to include the macro expansion in your listing file. If you don't include that directive, the macro expansions are performed but they are not printed in the list file. For example:

A51 mycode.a51 GEN

SEE ALSO

Last Reviewed: Tuesday, November 23, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure