You copied the Doc URL to your clipboard.

Expression rules in scatter files

Expressions follow the C-Precedence rules.

Expressions are made up of the following:

  • Decimal or hexadecimal numbers.

  • Arithmetic operators: +, -, /, *, ~, OR, and AND

    The OR and AND operators map to the C operators | and & respectively.

  • Logical operators: LOR, LAND, and !

    The LOR and LAND operators map to the C operators || and && respectively.

  • Relational operators: <, <=, >, >=, and ==

    Zero is returned when the expression evaluates to false and nonzero is returned when true.

  • Conditional operator: Expression ? Expression1 : Expression2

    This matches the C conditional operator. If Expression evaluates to nonzero then Expression1 is evaluated otherwise Expression2 is evaluated.


    When using a conditional operator in a +offset context on an execution region or load region description, the final expression is considered relative only if both Expression1 and Expression2, are considered relative. For example:

    er1 0x8000
    er2 ((ImageLimit(er1) < 0x9000) ? +0 : +0x1000)    ; er2 has a relative address
    er3 ((ImageLimit(er2) < 0x10000) ? 0x0 : +0)       ; er3 has an absolute address
  • Functions that return numbers.

All operators match their C counterparts in meaning and precedence.

Expressions are not case-sensitive and you can use parentheses for clarity.