Motorola HC12 User Manual

Page of 328
User’s Manual
MCUez HC12 Assembler
222
Operating Procedures
MOTOROLA
Operating Procedures
In the previous portion of code, the instruction
LDAA
will be located at offset 0
from the section
codeSec
start address, and instruction
ADDA
will be located
at offset 3 from the
codeSec
 start address.
8
8                      codeSec:  SECTION
9
9                      entry:
10
10
000000 B6 xxxx LDAA cst1
; Load value in cst1
11
11
000003 BB xxxx ADDA cst2
; Add value in cst2
12
12
000006 7A xxxx STAA var
; Store in var
13
13
000009 20F5
BRA entry
To avoid problems during linking or executing an application, an assembly file
must:
Initialize the stack pointer using the instruction LDS
Publish the application entry point using
XDEF
11.3.2  Linking an Application Containing Relocatable Sections
Applications containing relocatable sections must be linked. The linker
parameter file must contain at least the:
Name of the absolute file
Name of the object file which should be linked
Specification of a memory area where the sections containing variables
must be allocated
Specification of a memory area where sections containing code or
constants must be allocated
Specification for the application entry point
Definition of the reset vector