hi KDN,
please refer attached tn101 for how to implement interrupt for 8/16bit MCU.
Vector number can be found in datasheet vector locations table of MC9S12XHZ512 reference manual.
Count from bottom of the table for the “vector number”. the reset vector is vector number 0 (located at address 0), vector number 1 is located just after the vector 0 (at address 0x2) and so on.
ie Reset = 0 (address is $FFFE), Clock monitor reset = 1, COP watchdog reset = 2 , ...... You can see “Vector Priority” in this table. When the two interrupt occurs, the system will accept the higher priority interrupt.
I also attached a interrupt demo code, it's not for your chip but method is the same for all 16bit MCU.
I think it is simple and readable. Hope it can help you.
Best Regards,
Zhang Jun
=====================================================
this answer is for you. if it helps, please click on "Correct Answer " button. Thanks!
======================================================