Local labels

Local labels are a subclass of label. A local label is a number in the range 0-99, optionally followed by a name. Unlike other labels, a local label can be defined many times and the same number can be used for more than one local label in an area.

Local labels do not appear in the object file. This means that, for example, a debugger cannot set a breakpoint directly on a local label, like it can for labels kept using the KEEP directive.

A local label can be used in place of symbol in source lines in an assembly language module:

A local label is generally used where you might use a PC-relative label.

Local labels are typically used for loops and conditional code within a routine, or for small subroutines that are only used locally. They are particularly useful when you are generating labels in macros.

The scope of local labels is limited by the AREA directive. Use the ROUT directive to limit the scope of local labels more tightly. A reference to a local label refers to a matching label within the same scope. If there is no matching label within the scope in either direction, the assembler generates an error message and the assembly fails.

You can use the same number for more than one local label even within the same scope. By default, the assembler links a local label reference to:

Use the optional parameters to modify this search pattern if required.

Show/hideSee also

Copyright © 2010-2011 ARM. All rights reserved.ARM DUI 0473C
Non-ConfidentialID080411