Keil Logo

Comparison Functions

The MPL comparison functions compare two string arguments and return a value based on the comparison. If the function evaluates to TRUE, the function returns a value of 1. If the function evaluates to FALSE, the function returns a value of 0. The arguments to these functions may contain macro calls (which are expanded before the comparison occurs).

Function Description
%EOS (arg1, arg2) The EOS function compares arg1 and arg2 and returns a value of TRUE if they are identical.
%NES (arg1, arg2) The NES function compares arg1 and arg2 and returns a value of TRUE if they are different.
%LTS (arg1, arg2) The LTS function compares arg1 and arg2 and returns a value of TRUE if arg1 is less than arg2.
%LES (arg1, arg2) The LES function compares arg1 and arg2 and returns a value of TRUE if arg1 is less than or equal arg2.
%GTS (arg1, arg2) The GTS function compares arg1 and arg2 and returns a value of TRUE if arg1 is greater than arg2.
%GES (arg1, arg2) The GES function compares arg1 and arg2 and returns a value of TRUE if arg1 is greater than or equal arg2.

Examples


%EQS (A166, A166)

The above comparison is FALSE (0). The space after the comma is part of the second argument.


%LTS (A166,a166)

The above comparison is TRUE (1). The lowercase characters have a higher ASCII value than the uppercase characters.


%GTS (10,16)

The above comparison is FALSE (0). These macros compare strings—not numerical values. ASCII character 6 is greater than ASCII character 1.


%GES (a166,a166 )

The above comparison is FALSE (0). The space at the end of the second argument makes the second argument greater than the first.


%*DEFINE (VAR1) (A166)
%*DEFINE (VAR2) (%VAR1)

%EQS (%VAR1,%VAR2)

The above comparison is TRUE (1). The EQS Macro arguments expand to %EQS(A166,A166).

  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.