Symbols identify memory locations in program or data sections in an assembly module. A symbol has two attributes:
Symbols can be defined with an absolute or relocatable value, depending on the section in which the labeled memory location is found. If the memory location is located within a relocatable section (defined with the SECTION - Declare Relocatable Section assembler directive), the label has a relocatable value relative to the section start address.
Symbols can be defined relocatable in the label field of an instruction or data definition source line.
The following listing shows an example of a user-defined relocatable SECTION.
Sec: SECTION label1: DC.B 2 ; label1 is assigned offset 0 within Sec. label2: DC.B 5 ; label2 is assigned offset 2 within Sec. label3: DC.B 1 ; label3 is assigned offset 7 within Sec.
It is also possible to define a label with either an absolute or a previously defined relocatable value, using the SET - Set Symbol Value or EQU - Equate symbol value assembler directives.
Symbols with absolute values must be defined with constant expressions.
Sec: SECTION label1: DC.B 2 ; label1 is assigned offset 0 within Sec. label2: EQU 5 ; label2 is assigned value 5. label3: EQU label1 ; label3 is assigned the address of label1.