Keil Logo

Directives that can be omitted in pass 2 of the assembler

1.4 Directives that can be omitted in pass 2 of the assembler

Most directives must appear in both passes of the assembly process. You can omit some directives from the second pass over the source code by the assembler, but doing this is strongly discouraged.

Directives that can be omitted from pass 2 are:
  • GBLA, GBLL, GBLS.
  • LCLA, LCLL, LCLS.
  • SETA, SETL, SETS.
  • RN, RLIST.
  • CN, CP.
  • SN, DN.
  • EQU.
  • MAP, FIELD.
  • GET, INCLUDE.
  • IF, ELSE, ELIF, ENDIF.
  • WHILE, WEND.
  • ASSERT.
  • ATTR.
  • COMMON.
  • EXPORTAS.
  • IMPORT.
  • EXTERN.
  • KEEP.
  • MACRO, MEND, MEXIT.
  • REQUIRE8.
  • PRESERVE8.

Note

Macros that appear only in pass 1 and not in pass 2 must contain only these directives.

ASSERT directive appears in pass 1 only

The code in the following example assembles without error although the ASSERT directive does not appear in pass 2:
    AREA ||.text||,CODE 
x   EQU 42
    IF :LNOT: :DEF: sym
        ASSERT x == 42
    ENDIF
sym EQU 1
    END

Use of ELSE and ELIF directives

Directives that appear in pass 2 but do not appear in pass 1 cause an assembly error. However, this does not cause an assembly error when using the ELSE and ELIF directives if their matching IF directive appears in pass 1. The following example assembles without error because the IF directive appears in pass 1:
    AREA ||.text||,CODE 
x   EQU 42
    IF :DEF: sym
    ELSE
        ASSERT x == 42
    ENDIF
sym EQU 1
    END
Non-ConfidentialPDF file icon PDF versionARM DUI0379H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  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.