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

C51: About "bit" and interrupt

2 questions:

1) See http://www.keil.com/support/man/docs/c51/c51_le_bit.htm I don't understand the meaning of the following description. "Functions that disable interrupts (#pragma disable) and functions that are declared using an explicit register bank (using n) cannot return a bit value. The Cx51 Compiler generates an error message for functions of this type that attempt to return a bit type."

Can someone provide more explanagtion and example for my reference ? Thanks!

2) For interrupt, see http://www.keil.com/support/man/docs/c51/c51_le_interruptfuncs.htm "Interrupt function declarations may not include a return value. They must be declared as void (see the above examples). The compiler emits an error message if any attempt is made to define a return value for the interrupt function. The implicit int return value, however, is ignored by the compiler."

Why interrupt function(interrupt service routine, ISR) can not have return value?
Should declare as void ?

Can someone tell me why ? Thanks!