Forums

BootLoader, Interrupt tables and C

Started by Jordi Costa October 15, 2004
Hi all,

I'm trying to write some BootLoader code in C following AN2153 guidelines.

Interrupt tables looks like these (showing only RTI interrupt) : __interrupt void JRTI (void);

const tIsrFunc _vect[] @0xFF80 = { // Interrupt table
....................
JRTI ,
....................
BootLoader
};

const tIsrFunc _vect2[] @0xEF80 = { // Secondary interrupt table
....................
Timer_Interrupt,
....................
}; and jumps to secondary interrupt table are written in the form:

void JRTI (void) {asm jmp [RTI - BOOT_BLK_SIZE, pcr]; }

that generate code like:

....
F15E JMP [0xFE8E, PC]
F162 RTS
....

It seems to work, but is it correct ?
Any ideas to improve the code ?

Regards,

Jordi Costa