This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Interrupt numbering

I have noticed that the Kiel compiler doesn't produce the correct interrupt vector if 8051 interrupt numbers are used. For example for external interrupt 0 (IE0), the interrupt number has to be 0, instead of 1 to produce a jump at location 1. Example:

void edge1 (void) interrupt 0{ /*produces correct code

while

void edge1 (void) interrupt 1{ /*produces wrong code

This is the case with all the interrupts I have used. My questions is what do you have to do to produce a reset vector? Reset is interrupt number 0 in 8051 numbering. Using -1 or 255 both produce a compile error.

Parents
  • Is it?

    Where did you see that defined?

    The so-called "bible" for the 8051 never considers reset as an interrupt.

    Neither does it use any concept of interrupt "numbers" - it speaks only of the vector addresses.

    The C51 interrupt numbers are a Keil invention as part of their interrupt keyword extension in C51 - you cannot put any other meaning on them other than defined in the Keil C51 manual!

Reply
  • Is it?

    Where did you see that defined?

    The so-called "bible" for the 8051 never considers reset as an interrupt.

    Neither does it use any concept of interrupt "numbers" - it speaks only of the vector addresses.

    The C51 interrupt numbers are a Keil invention as part of their interrupt keyword extension in C51 - you cannot put any other meaning on them other than defined in the Keil C51 manual!

Children