You copied the Doc URL to your clipboard.

ScatterAssert function and load address related functions

The ScatterAssert function allows you to perform more complex size checks than those permitted by the max_size attribute.

The ScatterAssert(expression) function can be used at the top level, or within a load region. It is evaluated after the link has completed and gives an error message if expression evaluates to false.

The load address related functions can only be used within the ScatterAssert function. They map to the three linker defined symbol values:

Table 8-3 Load address related functions

Function Linker defined symbol value

The parameter region_name can be either a load or an execution region name. Forward references are not permitted. The region_name can only refer to load or execution regions that have already been defined.

The following example shows how to use the ScatterAssert function to write more complex size checks than those permitted by the max_size attribute of the region:

LR1 0x8000
    ER0 +0
    ER1 +0
    ER2 +0
    ScatterAssert((LoadLength(ER1) + LoadLength(ER2)) < 0x1000)
                                         ; LoadLength is compressed size
    ScatterAssert((ImageLength(ER1) + ImageLength(ER2)) < 0x2000)
                                         ; ImageLength is uncompressed size
ScatterAssert(ImageLength(LR1) < 0x3000) 
                                         ; Check uncompressed size of load region LR1