Operating Procedures
Initializing the Vector Table
MCUez HC12 Assembler User’s Manual
MOTOROLA Operating Procedures 227
NOTE:
Each constant in the section
VectorTable is defined as a word (2-byte
constant) because the entries in the HC12 vector table are 16 bits wide. In the
previous example, the constant
XIRQIntis initialized with the address of the
label
XIRQFunc. The constant
COPResetIntis initialized with the address
of the label
DummyFuncbecause this interrupt is not in use. All labels specified
as initialization values must be defined, published (using XDEF), or imported
(using XREF) before the vector table section.
The section should now be placed at the expected address. This is performed in
the linker parameter file.
Example:
LINK test.abs
NAMES test.o END
SEGMENTS
MY_ROM = READ_ONLY 0x0800 TO 0x08FF;
MY_RAM = READ_WRITE 0x0A00 TO 0x0BFF;
/* Define the memory range for the vector table */
Vector = READ_ONLY 0xFFF2 TO 0xFFFF;
END
PLACEMENT
DEFAULT_RAM INTO MY_RAM;
DEFAULT_ROM INTO MY_ROM;
/* Place the section ‘VectorTable’ at the appropriated
address */
VectorTable INTO Vector;
END
INIT ResetFunc
ENTRIES
*
END