Keil Logo

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: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.