Keil Logo

Bracket Function

The Bracket MPL function prevents macro processing of specified text. The syntax for the bracket function is:


The bracket function disables all macro processing of the balanced-text contained within the parentheses. However, the Escape function, Comment function, and parameter substitution are still recognized.

The length of the balanced-text is not limited. Therefore, the bracket function may prove easier to use than the escape function. For example:

ASM%(166)      Evaluates to     ASM166
%(1,2,3,4,5)   Evaluates to     1,2,3,4,5

Source Text

%LABEL:   DW     %LIST

%DW (%(120, 121, 122, 123, -1), TABLE)

Output Text

TABLE: DW 120, 121, 122, 123, -1


  • The DW macro defined in the above example adds word definitions to the source file. It uses two parameters: one for the word expression list and one for the label name. Without the bracket function, it is impossible to pass more than one expression into the list since the first comma would be interpreted as the delimiter separating the actual parameters. The bracket function used in the macro call prevents the expression list (120, 121, 122, 123, -1) from being evaluated as separate parameters.
  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.