Keil™, An ARM® Company

Technical Support

A51: CONDITIONAL ASSEMBLY CODE


Information in this article applies to:

  • C51 All Versions

QUESTION

Is it possible to do conditional assembly with the A51 assembler? If so, why won't statements like the following work?

IF USE_SIMULATION == ENABLED

ANSWER

To create conditional assembly programs, you must use the $IF and $ENDIF directives in your assembly program with symbols you define with $SET or $RESET or symbols you define on the command line. IF does not work with those types of defined symbols. The following code:

$IF (USE_SIMULATION = ENABLED)
        nop
        nop
        nop
$ENDIF

should work as expected.

SEE ALSO

Last Reviewed: Monday, June 07, 2004


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