Sections
Section Types
MCUez HC12 Assembler User’s Manual
MOTOROLA Sections 109
6.3.3 Data Sections
A section containing variables (variable defined using the DS directive) is
considered to be a data section. Data sections are always allocated in the target
processor RAM area.
Empty sections that do not contain any code or data declarations are also
considered to be data sections.
6.4 Section TypesFirst, in an application, a programmer must decide which type of code to use:
• Absolute
• Relocatable
The assembler allows mixing of absolute and relocatable sections in a single
application and also in a single source file. The main difference between
absolute and relocatable sections is the way symbol addresses are determined.
6.4.1 Absolute Sections
The starting address of an absolute section is known at assembly time. An
absolute section is defined by the directive ORG. The operand specified in the
ORG directive determines the start address, as shown in Figure 6-1.
XDEF entry
ORG $A00 ; Absolute constant data section.
cst1: DC.B $A6
cst2: DC.B $BC
... ORG $800 ; Absolute data section.
var: DS.B 1
ORG $C00 ; Absolute code section.
entry: LDAA cst1 ; Load value in cst1
ADDA cst2 ; Add value in cst2
STAA var ; Store in var
BRA entry
Figure 6-1. Absolute Section Programming Example