Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


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
  • Well, there you go!

    I still say that the Reset is not really an interrupt.

    I beleive that the Philips 80C51_FAM_*.pdf docs are just copies of the intel originals, and they clearly show Reset as distinct from the interrupt vectors:

    www.semiconductors.philips.com/.../80C51_FAM_ARCH_1.pdf - Figure 3.

    Unfortunately, the intel original is no longer available at developer.intel.com/.../272383.htm

    "In the brief Keil manual section on interrupts there are no long jumps in the assembly listing"

    That's because it's just the disassembly of the function - not the vector table!

    As it says on that page, "...shows you what the code generated to enter and exit the interrupt function looks like" - it does not claim to show the vector table.

    "clarifying what I said earlier"

    Not at all!

    "The Keil C compiler for 8051 doesn't provide a way of installing a reset vector."

    Because it isn't meaningful to the Keil C51 compiler!

    The Keil C51 compiler relies upon its main() being called from the startup code - see: http://www.keil.com/support/man/docs/c51/c51_ap_startup.htm

Reply
  • Well, there you go!

    I still say that the Reset is not really an interrupt.

    I beleive that the Philips 80C51_FAM_*.pdf docs are just copies of the intel originals, and they clearly show Reset as distinct from the interrupt vectors:

    www.semiconductors.philips.com/.../80C51_FAM_ARCH_1.pdf - Figure 3.

    Unfortunately, the intel original is no longer available at developer.intel.com/.../272383.htm

    "In the brief Keil manual section on interrupts there are no long jumps in the assembly listing"

    That's because it's just the disassembly of the function - not the vector table!

    As it says on that page, "...shows you what the code generated to enter and exit the interrupt function looks like" - it does not claim to show the vector table.

    "clarifying what I said earlier"

    Not at all!

    "The Keil C compiler for 8051 doesn't provide a way of installing a reset vector."

    Because it isn't meaningful to the Keil C51 compiler!

    The Keil C51 compiler relies upon its main() being called from the startup code - see: http://www.keil.com/support/man/docs/c51/c51_ap_startup.htm

Children