Motorola HC12 User Manual

Page of 328
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
XIRQInt
is initialized with the address of the
label
XIRQFunc
. The constant
COPResetInt
is initialized with the address
of the label
DummyFunc
because 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