Operating Procedures
Introduction
MCUez HC12 Assembler User’s Manual
MOTOROLA Operating Procedures 219
In the previous code, the instruction LDAA will be located at address $C00 and
instruction ADDA at address $C03, as shown in this code listing.
6 6 ORG $C00
7 7 entry:
8 8 a000C00 B6 0A00 LDAA cst1 ; Load value in cst1
9 9 a000C03 BB 0A01 ADDA cst2 ; Add value in cst2
10 10 a000C06 7A 0800 STAA var ; Store in var
11 11 a000C09 20F5 BRA entry
To avoid problems during linking or executing an application, an assembly file
should at least:
Initialize the stack pointer (using the instruction LDS).
Publish the application entry point using XDEF.
The programmer should ensure that the addresses specified in the source
file are valid addresses for the MCU being used.
11.2.3 Linking an Application Containing Absolute Sections
Applications containing only absolute sections must be linked.
A linker parameter file must contain at least:
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. For applications containing only absolute sections,
nothing will be allocated there.
Specification of a memory area where the sections containing code or
constants must be allocated. For applications containing only absolute
sections, nothing will be allocated.
Specification of the application entry point
Definition of the reset vector