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

A bug in C51?

Hi,
I encountered the following phenomena during my work:
I dont know if its supposed to be this way but I'm sure it made me a lot of trouble.
I had a working program and I built a bootloader for it.The interrupts were inside the bootloader (never mind the details..) but what's important is that it was made out of one C file. The interrupt handlers were written before the interrupt function themselves since there was no prototype function.
What happened is that everything went crazy and the interrupts didn't work right...THE PROBLEM was that the compiler didn't add the save\restore PSW assembly code in the interrupt function for some reason.
Any explanations or a is it a bug?

Parents
  • Ok, there is no simple sample - the simpliest one is your project - just look into generated HEX files. I don't understand what is so unclear in text.

    Espessially if you are using banked from 0x8000 to 0xFFFF (which implies that the common area is from 0x0000 to 0x4FFF).. Each HEX file will also have the code bank code from 0x8000 to 0xFFF."

    and If you use separate EPROMs for the common and bank areas, first pick one of the HEX files (it doesn't matter which one) and program the COMMON EPROM using the data from 0x0000 to the end of the common area. with the ISR in the COMMON or the banked?"

    looked at the map and i hope it will be clear?

Reply
  • Ok, there is no simple sample - the simpliest one is your project - just look into generated HEX files. I don't understand what is so unclear in text.

    Espessially if you are using banked from 0x8000 to 0xFFFF (which implies that the common area is from 0x0000 to 0x4FFF).. Each HEX file will also have the code bank code from 0x8000 to 0xFFF."

    and If you use separate EPROMs for the common and bank areas, first pick one of the HEX files (it doesn't matter which one) and program the COMMON EPROM using the data from 0x0000 to the end of the common area. with the ISR in the COMMON or the banked?"

    looked at the map and i hope it will be clear?

Children